<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Nick,<br>
<br>
</div>
<blockquote
cite="mid:CAO-+zikDX0a8BqPbcqBqDX+U0s8FkdTeBYjjOPFd5DhLOU79SA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>Hi Robert, all,<br>
<br>
</div>
I finally ported all my shaders to the this
new thing. I have a question. Probably
simple but will go anyway<br>
<br>
</div>
in my shader I have something like<br>
<br>
</div>
#define MYDEFINE<br>
</div>
.. do stuff here ...<br>
</div>
#endif<br>
<br>
</div>
at the root of the scene I have<br>
</div>
stateSet->setDefine("MYDEFINE");<br>
<br>
</div>
how can I fornid this define somewhere down the tree ?
Simple removing it is not helping (as expected I guess).<br>
</div>
</div>
</div>
</div>
</blockquote>
Do you mean "unsetting"?<br>
Then simply do setDefines("MYDEFINE", osg::StateAttribute::OFF)
where you like it to have it disabled.<br>
The rules for the overriding / protecting apply to this as well. <br>
<br>
<blockquote
cite="mid:CAO-+zikDX0a8BqPbcqBqDX+U0s8FkdTeBYjjOPFd5DhLOU79SA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div><br>
</div>
Any sample how the defines with Values set works?<br>
</div>
</div>
</div>
</blockquote>
Simply by setDefine("MY_VALUE_DEFINE", "42",
osg::StateAttribute::ON) <br>
<br>
or Roberts example defining a function:<br>
<br>
stateset->setDefine("VERTEX_FUNC(v)" , "vec4(v.x, v.y, v.z *
sin(osg_SimulationTime), v.w)");<br>
<br>
<blockquote
cite="mid:CAO-+zikDX0a8BqPbcqBqDX+U0s8FkdTeBYjjOPFd5DhLOU79SA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div><br>
</div>
Thanks a bunch !<br>
<br>
</div>
Nick<br clear="all">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div><br>
-- <br>
<div class="gmail_signature">trajce
nikolov nick<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<br>
</body>
</html>