View Full Version : Pixel Shader, C++ or Java?

06-27-2006, 01:41 AM
Hi to everyone. It's been a long time since I've posted anything in these forums but my latest activities have brought me back to the kind of programming I love.

I would like to write a pixel shader that would perform some filtering operations on an image. Would there be any difference in speed if I use Java or C++? Since the operations would take place in the graphics card I suppose no, but I just want some more opinions.

06-27-2006, 02:19 AM
Really, there is no difference what programming language you use, the speed of graphics card won't be touched by that :-/ Java is sligtly slower then C++, it's true, but even Quake2 port to Java is almost as fast as original. Don't fall for legends like "C++ is the fastest"

Robert Osfield
06-27-2006, 02:36 AM
Its most likely that you performance bottleneck will be the fragment processor down on the GPU, and the CPU will be sitting idle waiting for the results, so its highly unlikely that your choice of language to interface with OpenGL will make any performance difference.

If you have a scene with 100's of thousands of seperate objects then you are much more likely to be CPU limited, in which case your language choice will be more critical, but even then there isn't a clear cut choice these days.