Jump to content
  • Advertisement
Sign in to follow this  
ManaStone

OpenGL What does What?

This topic is 5409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know different Graphics cards may do different things, but in general, what does the CPU do and what does the GPU do? For instance, when OpenGL and DirectX do their own matrix multiplication functions, does the GPU or CPU do that? I’m curious because I’m considering making my own matrix class, but if it is going to be much slower, then maybe I should stick with OpenGl’s matrix manipulation functions. Also, if your graphics card does not support shaders, then how well does the CPU handle them? Would it be too slow to make a shader that does vertex weights on animation?

Share this post


Link to post
Share on other sites
Advertisement
Chances are, you'll need your own matrix class anyway, regardless of whether it's slower than the GPU or not. You can't use GPU functions all the time, and it's not going to take too long to code the basic functionality of a matrix class if you have some good Internet references. I believe that matrix manipulation does happen on the GPU, but I'm not sure. Perhaps someone else will be.

If the graphics card doesn't support vertex/fragment programs, then running them on the CPU is akin to running a game in software mode: it's very slow. I enabled NV30 emulation on my GeForce3 to run a demo that used shaders, and the slowdown was incredible. I accidentally left it on when I started Doom 3 up and I couldn't play it. The framerate was about 5 fps, and that was just the menu.

Share this post


Link to post
Share on other sites
You can of course write CPU-based code to do the same thing as the vertex shader. It won't be as efficient but should be faster than emulation.

Fragment shaders, on the other hand, are nearly impossible to emulate at any speed. You'll have to find some equivalent to the actual functionality, for example, using vertex lighting instead of per-pixel bumpmapping.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!