[osg-users] handling of #pragma line in Shader::_computeShaderDefines()

Andreas Roth osgforum at tevs.eu
Thu Feb 25 09:17:59 PST 2016


Hi,

I stumbled upon the Shader::_computeShaderDefines() function, which as far as i could understand should extract additional information from all line starting with #pragma. When a line is found it looks for the next opening brackets and analyze the text between the #pragma and the opening bracket. But when the #pragma line does not have a opening bracket but some following line has the analyzed text is wrong.

For example use the following shader code:

Code:
#pragma vp_entryPoint atmos_fragment_main
varying vec3 atmos_vert;
void atmos_fragment_main(inout vec4 color) 
{




In this shader code the analyzed line would be "atmos_fragment_main
varying vec3 atmos_vert;        
void atmos_fragment_main" which looks wrong to me. 

I think the open bracket should only be use when it's found before the end of the current line. Right?

Regards,
Andreas

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=66430#66430








More information about the osg-users mailing list