Jump to content
  • Advertisement
Sign in to follow this  
BornToCode

DX11 Seperate shader Sampler Issues.

This topic is 2106 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

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

Edited by BornToCode

Share this post


Link to post
Share on other sites
Advertisement
glActiveTexture( GL_TEXTURE0+n );
glBindTexture( GL_TEXTURE_2D, texture );
glActiveTexture( GL_TEXTURE0 );
glUniform1i( uniform, n );

Share this post


Link to post
Share on other sites

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

Edited by BornToCode

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!