[osg-users] Check if sampler2D is valid in fragment shader

Rômulo Cerqueira romulogcerqueira at gmail.com
Mon Dec 26 20:52:10 PST 2016


Hi,

is there a way to check if a texture (as uniform sampler2D) is valid in fragment shader?

This is my current code:


Code:

if (textureSize(myTexture, 0).x > 1) {
// do something with the texture
}
else {
// process without texture information
}



... 

Thank you in advance!

Cheers,
Rômulo

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69772#69772








More information about the osg-users mailing list