sending data to vertex shader
In my vertex shader I need the current x,z position of my player for many vertices. What would the best way to send the playerposition to the shader?
Hmm, but how to get the data for "vec2 uniform" onto the graphiccard?
I thought using something like glColor..() can work?
And yeah it's constant for all vertices, but changes with each frame.
I thought using something like glColor..() can work?
And yeah it's constant for all vertices, but changes with each frame.
GLhandleARB prgmShdr;...GLuint eyePos = glGetUniformLocationARB( prgmShdr, "eyePos" );...glUniform3fARB( eyePos, 0.0f, 0.0f, 0.0f );
if you have vec2 uniform eyePos in your shader. if its not called eyePos, change "eyePos" to the variable name.
What does the line
GLuint eyePos = glGetUniformLocationARB( prgmShdr, "eyePos" );
do exactly?
I have the coordinates in the main program as two floats. Could I pass them directly with this glUniform3fARB ? Hmm..., I dont understand you code... :-(
GLuint eyePos = glGetUniformLocationARB( prgmShdr, "eyePos" );
do exactly?
I have the coordinates in the main program as two floats. Could I pass them directly with this glUniform3fARB ? Hmm..., I dont understand you code... :-(
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement