<div dir="ltr"><div><div><br>Okay, so you are modifying depth testing by attaching an osg::Depth object to the stateset... which OSG maps to glDepthFunc() glDepthRange() OpenGL API calls.<br><br></div>As you are not modifying gl_FragDepth and not using any fragment discard, the early Z testing would still apply before entering the fragment shader.<br><br>But I am not an expert with this, so I will leave it to other people to jump in with possible explanations for any mismatch between fixed function and shader pipeline that you are seeing.<br><br>Christian<br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-14 14:37 GMT+02:00 Yanwei Guo <span dir="ltr"><<a href="mailto:expectances@sina.com" target="_blank">expectances@sina.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
  The code is in the attachment.<br>
  And the shader files are at end of the code.<br>
<br>
  TIA.<br>
<span class=""><br>
------------------<br>
Read this topic online here:<br>
</span><a href="http://forum.openscenegraph.org/viewtopic.php?p=71275#71275" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=71275#<wbr>71275</a><br>
<br>
<br>
<br>
<br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br></div>