Sign in to follow this  

shader Confusion

This topic is 4834 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 am pretty confused as to what shaders are. I know that a vertex shader changes things about a vertex and a pixel shader.... But i do not understand how they are added to a program. I read somewhere that they effect all verticies. But dosnt that mean that u can only use that one shader in ur program,and nothing else. help?

Share this post


Link to post
Share on other sites
Basically a vertex shader is a short program for which vertexes are passed, you can then alter these vertexes in the program and you output your altered version of them. Pixel shaders are the same apart from you're processing fragments (which is basically a potential pixel contaning data such as texture coordinates as well as a colour value).

When using shaders they are only applied when bound. E.g. you may have a pixel and vertex shader for drawing a bumpmapped surface, and a pixel and vertex shader for drawing a water surface. When you draw what you want to be bumpmapped you'd bind the shaders that do bumpmapping. When drawing your water surface you'd bind the shaders that do the effects for your water surface (e.g. reflection of the surrounding scene).

Share this post


Link to post
Share on other sites
You dont revert back to "normal drawing", you use shaders OR the Fixed Function Pipeline (FFP), you dont mix them as there is no need.

You can do anything in a shader that the FFP can do, and many things that the FFP can't do.

If all you want to do is apply a matrix transformation to view an object, like your "normal drawing", then that is done inside a shader that only does that.

Andy

Share this post


Link to post
Share on other sites

This topic is 4834 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this