[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Slick Forums • View topic - Does Slick render with CPU or GPU?

Slick Forums

Discuss the Slick 2D Library
It is currently Thu Oct 21, 2021 11:18 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jul 17, 2012 1:47 pm 
Offline

Joined: Thu May 19, 2011 9:43 am
Posts: 50
We know that Slick is built upon LWJGL, which is built upon OpenGL.
After reading the , I saw that there are things in OpenGL that are not rendered with GPU. Right now, I don't know what aspects of OpenGL, hence Slick 2D, use software rendering and what are GPU accelerated.

I'm wondering about these things because I'd like to know how to calculate stuff on the GPU side, as I need to do many vector related calculations every frame. I've read that GPUs are extremely fast for vector calculations.


Top
 Profile  
 
PostPosted: Tue Jul 17, 2012 2:57 pm 
Offline
Regular

Joined: Sun Oct 30, 2011 4:47 pm
Posts: 184
Location: Mittweida, Saxony, Germany
OpenGL knows a software emulated mode and a hardware mode. LWJGL and slick will try to use the hardware accelerated mode (so GPU rendering) to perform all drawing operations as far as possible. In case the host system does not have the required driver support to perform hardware accelerated rendering on the GPU, it will fallback to the software mode and perform the drawing operations on the CPU. But the software mode is really badly slow.

Other operations, such as vector and matrix operations that can be done by the GPU extremly fast, are currently not supported by slick as far as I know. But LWJGL has support for OpenCL (computing language) that should be able to perform such operations on the GPU.

Nitram


Top
 Profile  
 
PostPosted: Tue Jul 17, 2012 3:51 pm 
Offline

Joined: Thu May 19, 2011 9:43 am
Posts: 50
So, I did a bit of googling, and I found that if I want to code on a PC with AMD card, I have to download their special SDK at
Same for NVIDIA - They have a special SDK as well.

When I create a program using my AMD card, will it still work on NVIDIA cards, or do I have to download their special SDK as well and reference it in my Eclipse project somehow? This whole OpenCL setup is quite confusing.

Also, I couldn't find any downloadable library from OpenCL's official website -


Top
 Profile  
 
PostPosted: Tue Jul 17, 2012 6:08 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
Slick's images, polygons, lines, circles, etc. are all rendered using the GPU unless the user has old/broken drivers or they have somehow disabled hardware acceleration (in which case they probably shouldn't expect any OpenGL games to work).

There are a variety of things in Slick, like polygon triangulation, transform/scaling/rotation, etc that are done on the CPU.

What kind of vector calculations are you doing that need to take advantage of the GPU? Even AAA titles generally don't need to take advantage of the GPU for math/physics -- PhysX has supported GPU physics for a while, yet the list of games using it is .

Generally speaking the CPU will be more than fast enough to handle all of the physics and math in your game -- if you are finding it a bottleneck, I'd wonder whether your algorithm is slow, rather than the processor. For a 2D game, especially, the CPU should be suitable.

Calculating physics on the GPU is not a small task -- OpenCL is pretty new and finding documentation/tutorials on using it may be challenging. It's also not very widely supported yet, and many of your users will be unable to play your game.

If you really need hardware accelerated calculations, you can use GLSL (shaders) to achieve this. Here's a brief intro on shaders in Slick:
http://slick.cokeandcode.com/wiki/doku.php?id=shaders

Chances are, whatever you're trying to do should be possible with plain old CPU calculations -- or GLSL if you have more specific performance needs.


Top
 Profile  
 
PostPosted: Tue Jul 17, 2012 9:40 pm 
Offline

Joined: Thu May 19, 2011 9:43 am
Posts: 50
I'm doing an outline(border) for a polygon shape, and I'm doing it by extruding the existing polygon edges.


I have to normalize the normal vectors in order to make uniform thickness for the outline.
Normalizing vector means calculating the unit vector, which requires the use of the square root, which is computationally very heavy. I have to use the square root dozens of times every frame so that I can update the polygon's outline. That's why I'd like to have an option to move those vector calculations to the GPU somehow.


Top
 Profile  
 
PostPosted: Wed Jul 18, 2012 12:16 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Wed Jul 18, 2012 8:23 am 
Offline

Joined: Thu May 19, 2011 9:43 am
Posts: 50


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group