Jump to content
  • Advertisement
Sign in to follow this  
putenuter

OpenGL How to "simulate" a GPU-Vertex-shader in CPU ?

This topic is 4758 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

Hi there ! I just have programmed a custom vertex shader for my OpenGL-based game. But now I want to make it run even on graphic cards which are not able to load custom vertex shaders. So I want to compute all necessary transformations on the CPU. My Problem is, that I have to transform ALL Vertices (or Polygons) in my scene by a 4x4-matrix, which has to be recomputed every frame. Does anybody know how to make this transformations in general and how to do them as Do I have to modify the modelview-matrix or the projection matrix ? I am currently quite desperate about this issue, I hope somebody knows a option how to "migrate" a vertex shader back to the CPU.

Share this post


Link to post
Share on other sites
Advertisement
Actually it is perfectly possible, don't know the inner works though, but I can be almost sure that it will be seriously charging on your game's frames per second, and the users will be forced to get a new card anyways.

But if you succeed and the speed is decent, please contact the guys that made 3D analyzer and see if they can implement the pixel shaders simulation on it.

Share this post


Link to post
Share on other sites
Case 1: You only have 1 transform matrix (computed each frame)
you should be able to just glMultMatrix() your transform with the ModelView matrix.

Case 2: You have several transform matrices (computed each frame)
same as above, but you are going to have to setup some
glPushMatrix() glPopMatrix() sections and batch your geometry to reduce the number of matrice switches.

Case 3: "one" matrix that depends on some variables that cause it to be different for each vertex.
This is going to be very slow. If this is what you have to deal with, I sugest you just change your design spec to indicate
that a Graphics Card with proper shading ability is present.

Share this post


Link to post
Share on other sites
If it's just a vertex shader (not a fragment shader) shouldn't the driver take over and do the vertex shader using the CPU for you?

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!