"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 Rôm
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
_
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.
Cheer
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 14:
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 this
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?
Ba
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
> 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
___
osg-us
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 won't
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 all
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
11 matches
Mail list logo