[osg-users] Custom shader not working on Mac OS

Pierre-Jean Petitprez pierre-jean.petitprez at inria.fr
Fri Feb 19 05:51:21 PST 2016


Hi Sebastian,

> setUseVertexAttributeAliasing should be active, when you are using 
> osg_Vertex etc.
> It might be, that the driver on your first machine simply assigns the 
> "in-slot" accidentally to the correct input.
> Are there any outputs on the console?
My mistake, my shader should obviously use gl_Vertex, and not 
osg_Vertex. I failed a copy/paste and did not double-checked.
But to answer your question, there is no console output at all (no 
warnings or fails) related to the shaders, even with osg::setNotifyLevel 
set to most verbose option.
I will check my shader as soon as I can but I'm almost sure the problem 
was from this gl_Vertex mistake.

Thank you,
Pierre-Jean


>
> If this is not working two hints:
> 1. #pragma version 150 compatibility
> The version is epxected to be the first line in any shader.
> 2.Use gl_ instead on osg_ attributes and uniforms for testing fixed 
> function.
>
>
>>
>> I saw a strange thing in the log : on Mac gl_MultiTexCoord0 is 
>> converted to  osg_MultiTexCoord0 even if 
>> setUseVertexAttributeAliasing is set to false. On Linux
>> gl_MultiTexCoord0 is not converted and is keeped.
>> By the way if I set setUseVertexAttributeAliasing to true and replace 
>> gl_MultiTexCoord0 by osg_MultiTexCoord0, my model is properly visible 
>> (but I don't want that because I lose fixed pipeline functions).
> Cannot say anything on the first issue, but you are not "loosing" any 
> functionality by using the aliasing. OSG will simply replace gl_ names 
> with its osg_ aliases when uploading the shader to the driver. All 
> other functions will still work as expected.
>>
>> Has anybody an idea of where this behavior comes from ?
> As I said,  drivers will do stuff behind your back. So a shader with 
> obvious errors might run one machine while failing on another.
>
> Cheers
> Sebastian
>>
>> Thank you!
>>
>> Cheers,
>> Pierre-Jean
>>
>> ------------------
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=66344#66344
>>
>>
>>
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




More information about the osg-users mailing list