Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Pixel Shader, C++ or Java?

  1. #1
    Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    368

    Pixel Shader, C++ or Java?

    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.

  2. #2
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,979

    Re: Pixel Shader, C++ or Java?

    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"

  3. #3
    Intern Contributor
    Join Date
    Apr 2002
    Location
    Prestwick, Ayrshire, Scotland
    Posts
    97

    Re: Pixel Shader, C++ or Java?

    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.

    Robert.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •