• Advertisement
Sign in to follow this  

Vertex shaders, how does it work?

This topic is 4519 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, I know I shouldn't go into this, and anyway, my graphic card doesn't seem to support it, but I want to know how vertex shaders work. I heard they can only process 1 vertex at a time and doesn't care for the others, in fact doesn't know about the others. So How can this make sense? I've heard it is THE solution for damage simulation in a car racing simulation, but how can it simulate damages on a model when it doesn't know about the surrounding vertices positions? I don't want to get into all the details of the vertex shaders, I know it's a complex concept, but I want to know if what I heard about it is true and how it works for what I've heard. In fact, what is missing from what I've heard for everything to make sense? lol Thanks

Share this post


Link to post
Share on other sites
Advertisement
Wikipedia has an entry on pixel and vertex shaders which should be an adequate general-purpose backgrounder for you.

Vertex shaders can apply a deformation to a mesh (imagine for this example you have a car door made up of many polygons connected by vertices). You don't necessarily need to know the positions of the surrounding vertices to do this as the renderer knows about those -- all you care about is how that particular vertex is deformed (i.e. how deep it is indented from its normal position on the hood).

When you run the shader, you would do some kind of lookup on where the dents are (this information would be stored in your game engine somewhere and updated when a new dent is created due to a collision) and then, based on that information of how deeply a particular vertex is dented, apply it to the mesh using the shader.

Imagine an analogue to a heightmap in that regard.

Share this post


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

  • Advertisement