Seperate shader Sampler Issues.

Started by
1 comment, last by BornToCode 10 years, 6 months ago

Yesterday i posted an topic regarding that problem and i said that i have found solution. Well the solution was half ass. the problem is that

Samplers depends on the Texture BindPoints. In that case whatever the texture id is for GL_ACTIVE_TEXTURE for texture n will be used for the applied samplers.

So if you have two samplers one in the vertex and another in the pixel shader. How can i go about assigning a different Texture for each sampler where the sampler uses the BindingPoint the Active Texture .Is what i am trying to do even possible. I know in DX11 you can use different texture for Vertex and pixel shader at the same time. So in an nutshell the problem is that if i assing texture 1 at GL_ACTIVE_TEXTURE0, then both samplers in my shader end's up using the same texture even though i am using seperate programs. So the solution i am trying to find, is that is there any GL texture function that works at the program level, where each samplers have their own binding points build in, instead of using the default GL_ACTIVE_TEXTURE0 to n

Advertisement
glActiveTexture( GL_TEXTURE0+n );
glBindTexture( GL_TEXTURE_2D, texture );
glActiveTexture( GL_TEXTURE0 );
glUniform1i( uniform, n );

You beat me to id. But i just though about it and notice that the implementation has a minimal support of 80 binds points which should be more than enough. So forget it i found a solution

This topic is closed to new replies.

Advertisement