Jump to content

[SOLVED] Wrong texture passed in uniform to my shader


PeapBoy
 Share

Recommended Posts

16 hours ago, Deltakosh said:

samplers are actually pretty dumb, they just work in order of declaration and they are statefull

so if you declare samp1, samp2 and samp3, it is up to you to set the right texture in slot 1, 2 and 3 :)

 

if you forgot something then the sampler will just read the currently bind texture

Hmm ok. I understand why I get sampler1 instead of sampler2. I set sampler1 in sample list and sampler2 in uniform list. So it's like I'm forgetting to set sampler2, right ? (In shaderMaterial, I don't make any difference between uniforms and samplers, and it works though)
So I read sampler1 instead of sampler2. Ok.

But, what is strange :
- When I sample sampler1 (without doing anything with the sample), I get sampler1 instead of sampler2 in output (it's the case explained above, ok).
- When I don't sample sampler1, I get sampler2, as I want !

So finally, sampler2 seems to be bound, isn't it ? How this useless sample can influence the bounding ?

I could live without the answer, but that's so frustrating to not understand this. :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...