<div dir="ltr"><div><div><div>Thanks Sebastian,<br><br></div>I thought it would be that easy<br><br></div>Cheers,<br></div>Nick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 21, 2015 at 7:33 AM, Sebastian Messerschmidt <span dir="ltr"><<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hi Nick,<br>
      <br>
    </div><span class="">
    <blockquote 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></span>
    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><span class="">
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div><br>
            </div>
            Any sample how the defines with Values set works?<br>
          </div>
        </div>
      </div>
    </blockquote></span>
    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 type="cite"><span class="">
      <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>trajce
                                    nikolov nick<br>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </span><pre>_______________________________________________
osg-users mailing list
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">trajce nikolov nick<br></div>
</div>