<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 Michael, <br>
      <br>
    </div>
    <blockquote
cite="mid:CAEt8o9ik19m=GGKU4TAfUJ9zcj+a=sVnP81M=4eDknfOyuxz8A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>Hi.<br>
                </div>
                Currently I have a forward pass fragment shader ( <a
                  moz-do-not-send="true"
href="https://github.com/OGStudio/editor/blob/master/pipeline/pass1.frag"><a class="moz-txt-link-freetext" href="https://github.com/OGStudio/editor/blob/master/pipeline/pass1.frag">https://github.com/OGStudio/editor/blob/master/pipeline/pass1.frag</a></a>
                ) with uniforms "useNormalMap", "useGlowMap" which
                define if certain draw buffers should be filled with
                bumps and glows.<br>
              </div>
              <div>I provide those uniforms with
                NODE->getOrCreateStateSet()->addUniform(), it
                works perfectly fine.<br>
              </div>
              <div><br>
              </div>
              I also have a deferred pass fragment shader ( <a
                moz-do-not-send="true"
href="https://github.com/OGStudio/editor/blob/master/pipeline/pass2.frag"><a class="moz-txt-link-freetext" href="https://github.com/OGStudio/editor/blob/master/pipeline/pass2.frag">https://github.com/OGStudio/editor/blob/master/pipeline/pass2.frag</a></a>
              ) with uniforms that I provide with
              PASS->getOrCreateStateSet()->addUniform(), it works
              perfectly fine.<br>
              <br>
            </div>
            Now I tried to provide a new uniform to the deferred pass
            fragment shader with
            NODE->getOrCreateStateSet()->addUniform(), and it does
            not work. Only PASS approach works for the deferred pass
            fragment shader.<br>
          </div>
          Is it possible to pass uniform value from the NODE's StateSet
          to the deferred pass fragment shader? Am I missing something?<br>
        </div>
      </div>
    </blockquote>
    You can set the uniform to the Camera node for the pass to make it
    per pass. If you set the uniform down in the camera's subgraph at
    node-level and you don't use OVERRIDE or PROTECTED in between the
    node's uniform should overwrite the state above. In your case it
    should simply work.<br>
    I personally usually use the pragmatic shader composition for things
    like normal-mapping etc. since it is static for the given mesh and
    will work pretty well if you have nodes in different passes. So
    basically you set the shader program to the pass-camera and set the
    defines per node. <br>
    <br>
    Cheers<br>
    Sebastian <br>
    <br>
    <blockquote
cite="mid:CAEt8o9ik19m=GGKU4TAfUJ9zcj+a=sVnP81M=4eDknfOyuxz8A@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks.<br>
      </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>