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

2017-01-03 Thread Alberto Luaces
"Rômulo Cerqueira" writes: > Hi Sebastian, > > I have used the last openscenegraph stable package in ubuntu (version > 3.2.3 - https://launchpad.net/ubuntu/+source/openscenegraph), and > there is no setDefine() method in osg::StateSet (only for 2.4 and > newer). There is a different way? > Hi

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

2017-01-03 Thread Rômulo Cerqueira
Hi, > > I can create a minimal example if you're stuck with this. > I will appreciate this, please. ... Thank you! Cheers, Rômulo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69845#69845

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

2017-01-03 Thread Sebastian Messerschmidt
Hi, yes there is: Simply assign one Program with shaders handling texturing and the non-texturing variant at the appropriate state-sets. Be sure to share the programs (don't create a new one per instance) to keep performance up. I can create a minimal example if you're stuck with this.

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

2017-01-03 Thread Christian Buchner
Pragmatic shader composition was added to the repository around Feb 13, 2015, and most likely into OSG 3.4 and newer only. A link to the relevant thread started by Robert Osfield is here: http://markmail.org/message/mjxjn4vujpvz3wfz#query:+page:1+mid:vogwv7uwhoefcln6+state:results 2017-01-03

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

2017-01-03 Thread Rômulo Cerqueira
Hi Sebastian, I have used the last openscenegraph stable package in ubuntu (version 3.2.3 - https://launchpad.net/ubuntu/+source/openscenegraph), and there is no setDefine() method in osg::StateSet (only for 2.4 and newer). There is a different way? Cheers, Rômulo -- Read

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

2016-12-29 Thread Sebastian Messerschmidt
Am 29.12.2016 um 17:07 schrieb Rômulo Cerqueira: Hi Christian, You could traverse the scene graph and check the state sets to see if they bind a texture to a texture unit. Then depending on these findings, choose the correct shader code. I appreciated it. Can you give me some example?

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

2016-12-29 Thread Rômulo Cerqueira
Hi Christian, > You could traverse the scene graph and check the state sets to see if they > bind a texture to a texture unit. > > Then depending on these findings, choose the correct shader code. I appreciated it. Can you give me some example? ... Thank you! Cheers, Rômulo

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

2016-12-29 Thread Christian Buchner
> I will receive the final scene with or without textures You could traverse the scene graph and check the state sets to see if they bind a texture to a texture unit. Then depending on these findings, choose the correct shader code. Christian ___

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

2016-12-28 Thread Rômulo Cerqueira
Hi Sebastian, > > There is no direct way. If you need shaders with and without texturing > you should bind different programs to the affected geometries. > I think my problem is a little bit different. I will receive the final scene with or without textures and process it properly. I

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

2016-12-27 Thread Sebastian Messerschmidt
Hi Rômulo, Hi, is there a way to check if a texture (as uniform sampler2D) is valid in fragment shader? There is no direct way. If you need shaders with and without texturing you should bind different programs to the affected geometries. Also OSG has the pragmatic-shadercomposition which