[osg-users] Geometry shader based apps/examples have shader compile failures...
Mark Pai
mpai at hotmail.com
Mon Jul 27 21:49:25 PDT 2015
Hello Sebastian,
Thanks a lot for sending help. I installed the shader analyzer and started
testing my geometry shader. I found that if your code has a line comment
right before the code, as below, then the compile fails.
// some comment
out vec2 uv;
But, if you separate the line comment and the code with one blank line
like this
// some comment
out vec2 uv;
then all is well. Sure, I can live with this adjustment any day...
So, million thanks to you for sending out timely help.
Best regards,
-Mark
[quote="SMesserschmidt"]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/
[quote]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
[/quote]
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
------------------
Post generated by Mail2Forum[/quote]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64501#64501
More information about the osg-users
mailing list