<div dir="ltr">Hi Robert,<div><br></div><div>I did look in the State.cpp sources for shaders string processing and I couldn't spot anything. But there is a difference between what OSG reports wrt. shader source being passed to OpenGL and this interesting thing apitrace. Let just work with the header, and the #version string is dismissed totaly - this is on Ubuntu 14.04, then I switched back on Windows and all was passed correctly across all the players down to OpenGL. However, I have this 'OpenGL error after Renderer:compile' with no further info (maybe time to extend the error messaging in OSG ;-) ). I am fooling around with gDEBugger now to see if I can catch that reported error (anyone with gDEBugger knowledge how to setup a breakpoint on GL_ERROR??). But thanks anyway for the hints so far !!!</div><div><br></div><div>The findings on Linux and api trace, Windows works fine</div><div><br></div><div>This is my shader string (in the code):</div><div><br></div><div><div>"#version 330 compatibility\n"</div><div>"uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG\n"</div><div>"out vec3 normal, eyeVec;\n"</div></div><div><br></div><div>This is the output with OSG_NOTIFY_LEVEL=INFO</div><div><br></div><div><div>++Before Converted source </div><div>#version 330 compatibility</div><div>uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG</div><div>out vec3 normal, eyeVec;</div></div><div><br></div><div><div>-------- Converted source </div><div>#version 330 compatibility</div><div>uniform mat3 osg_NormalMatrix;</div><div>uniform mat4 osg_ModelViewProjectionMatrix;</div><div>uniform mat4 osg_ModelViewMatrix;</div><div>uniform mat4 osg_ViewMatrixInverse; // Automatically updated by OSG</div><div>out vec3 normal, eyeVec;</div></div><div><br></div><div>The apitrace dump was ignoring the #version line, but works fine on Windows, so I guess this apitrace is buggy for Linux.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 5, 2016 at 9:13 AM, Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nick,<br>
<br>
I haven't had the time to look into so don't have any specific<br>
answers. From your description it sounds like the osg::State's<br>
support for automatically tweaking shaders is enabled, perhaps this is<br>
either doing something inappropriate or something else in the mix (i.e<br>
osgShadow) or the other shader source.<br>
<br>
One thing you can do is enable debugging via the OSG_NOTIFY=DEBUG env<br>
var setting and then watch the output to see what shader is being<br>
passed to OpenGL. Also have a look at the shader substitution code in<br>
osg::State to see what it's doing. The method to look at is<br>
osg::State::<wbr>convertVertexShaderSourceToOsg<wbr>BuiltIns(std::string&).<br>
<br>
Since OSG-3.4 there have been a few changes to this code so there is<br>
chance that OSG master will behave differently so might be worth a<br>
try.<br>
<br>
Robert.<br>
<br>
<br>
<br>
On 4 September 2016 at 22:49, Trajce Nikolov NICK<br>
<div><div class="h5"><<a href="mailto:trajce.nikolov.nick@gmail.com">trajce.nikolov.nick@gmail.com</a><wbr>> wrote:<br>
> Robert,<br>
><br>
> are there any changes in the shader management, I mean are the shaders<br>
> changed by the OSG code somehow (I am using the built-om uniforms)? Here is<br>
> my shader source line:<br>
><br>
> "varying vec4 projShadow;\n"<br>
><br>
> that apitrace logs as (this is being compiled but differs from the original<br>
> shader source):<br>
><br>
> out vec4 projShadow;<br>
><br>
> and then I get this warning<br>
><br>
> warning C5060: out can't be used with non-varying projShadow<br>
><br>
> ?<br>
><br>
> Thanks a lot as always!<br>
><br>
> Nick<br>
><br>
> p.s. Chris, thanks for the apitrace hint<br>
><br>
> On Fri, Sep 2, 2016 at 2:09 AM, Trajce Nikolov NICK<br>
> <<a href="mailto:trajce.nikolov.nick@gmail.com">trajce.nikolov.nick@gmail.com</a><wbr>> wrote:<br>
>><br>
>> Hi Community,<br>
>><br>
>> I had some discussion and coding some sample with Wojtek's help 2010 :-).<br>
>> It is about a sample code that illustrates a simple lights and obstacles. It<br>
>> become actual for me again so I started with this archived example as a<br>
>> testbed to work on it and integrate it into much larger project. Here is the<br>
>> link of the code:<br>
>><br>
>><br>
>> <a href="http://markmail.org/message/ccscbkzyxsgmb5vl#query:+page:1+mid:c542rbpj3jdw3v5d+state:results" rel="noreferrer" target="_blank">http://markmail.org/message/<wbr>ccscbkzyxsgmb5vl#query:+page:<wbr>1+mid:c542rbpj3jdw3v5d+state:<wbr>results</a><br>
>><br>
>> I know it was working till recent times. And it doesn't anymore :-/. So I<br>
>> went to see what might have changed in OpenGL and OSG since then (bit crazy<br>
>> but I had to start somewhere). It uses shadow2DProj which I found it was<br>
>> replaced by the texture call in GLSL after 130. Also on OSG side to use the<br>
>> built in uniforms I know it has to be enabled in the camera's gc state with<br>
>> setUseModelViewAndProjectionUn<wbr>iforms. So far these were my findings which<br>
>> didn't helped.<br>
>><br>
>> I would like to ask you for any hints and for a bit of will to see if<br>
>> someone can spot something - the code is simple, selfcontained, it has<br>
>> lighting from the red book implemented and use simple shadow mapping to make<br>
>> the lights to not appear behind obstacles.<br>
>><br>
>> As always, thanks a bunch!!!!!<br>
>><br>
>> Cheers,<br>
>> Nick<br>
>><br>
>> --<br>
>> trajce nikolov nick<br>
><br>
><br>
><br>
><br>
> --<br>
> trajce nikolov nick<br>
><br>
</div></div>> ______________________________<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>
______________________________<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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>