PeapBoy Posted October 26, 2016 Author Share Posted October 26, 2016 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 26, 2016 Share Posted October 26, 2016 when not sampling sample1, the shader compiler will just remove it from the shader meaning that sample2 becomes the first and unique Pryme8 1 Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted October 27, 2016 Author Share Posted October 27, 2016 Aah, so there's actually kind of parsing at compilation time. Thank you. And keep up the great work man ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 27, 2016 Share Posted October 27, 2016 There is a big one actually in order to optimize shaders Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.