[osg-users] Geometry shader based apps/examples have shader compile failures...

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Thu Jul 23 23:23:51 PDT 2015


Hi Mark,

If a shader gets compiled correcty has nothing to do with osg. You 
probably updated your driver recently. NVidia decided to follow the GLSL 
grammar more strictly.
For instance code like float x = vec2(1) is not working anymore, since 
implicit conversion of types is not allowed in GLSL. So try to fix your 
shaders with that in mind.
BTW: I'm using GPU ShaderAnalyzer[1] by AMD  to validate my shader code, 
as it seems to be awfully strict ;-)

Cheers
Sebastian

[1]
http://developer.amd.com/tools-and-sdks/graphics-development/gpu-shaderanalyzer/
> Hello,
>
> I am using OSG ver 3.4.0-Rc1 under Window 8.1, Visual Studio 2012 Win64. NVidia laptop driver Ver: 353.30.
>
> Of-late, I started noticing strange geometry shader compile failures with applications that worked perfectly (in 3.2) after I switched to osg 3.4.0-rc1.
>
> First-of, my own application that has one geometry shader (#version 400) that is ending up with compile errors, and then I see corrupt source string in 'src' when I did std::string src = geomObject->getShaderSource();
>
> Variables uv, normal are correctly declared but the error log says -
> GEOMETRY glCompileShader "" FAILED
> GEOMETRY Shader "" infolog:
> ERROR: 0:64: 'uv' : undeclared identifier
> ERROR: 0:64: 'assign' :  cannot convert from '2-component vector of float' to 'float'
> ERROR: 0:72: 'normal' : undeclared identifier
> ERROR: 0:72: 'assign' :  cannot convert from '3-component vector of float' to 'float'
>
> iow, original shader code says:
> out vec2 uv;
> out vec3 normal;
>
> and geomObject->getShaderSource() says:
> out vec2 uv;mal;
>
> The shader source is in a text file and is read using
> osg::ref_ptr<osg::Shader> geomObject = osg::Shader::readShaderFile(osg::Shader::GEOMETRY, gsFilename.txt);
>
> Then, I also see similar geometry shader compile failures with examples such as osgForest, osgSSBO, osgTessellationShader...
>
> I am not sure what is going on. Any help here is sincerely appreciated.
>
> Thanks, Regards,
> -Mark
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64459#64459
>
>
>
>
>
> _______________________________________________
> 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