Sign in to follow this  

Ways of passing information to a Shader

Recommended Posts

Hi, I have a shader that needs to know some additional information about a vertex than just its position. And I was wondering what other ways there are of passing information to a shader. Here's what I thought I was going to do: <Vertex Shader> if(gl_Vertex.w == 0.0) doSomething; else if(gl_Vertex.w == 1.0) doSomethingElse; else if(gl_Vertex.w == 2.0) doSomethingElse; But I found that that doesn't work. Because the w component actually does have meaning. (Which I didn't know). So what other ways are there of passing this information to my shader? Thanks a lot -Patrick

Share this post

Link to post
Share on other sites

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