PDA

View Full Version : i have a problem. when use GLSL on the ATI HD 3850



Hyunwoo
03-28-2011, 10:22 AM
hello.

i use opengl 3.3.10524 version and glew.

and i saw this error.

----------------------------------------------------------
Fragment shader fail to compile with the following errors:
ERROR : 0:2: error(#138) 'varying in' supported in geometry shaders only
----------------------------------------------------------

this code is my fragment shader. just simply cartoon effect.
----------------------------------------------------------
varying in vec3 normal;

void main(void)
{
vec3 Id = normalize( vec3(gl_LightSource[0].position) );
float ity = dot( Id, normal );
vec4 fc;
if( ity > 0.95 ) fc = 1.00 * gl_Color;
else if( ity > 0.50 ) fc = 0.50 * gl_Color;
else if( ity > 0.25 ) fc = 0.25 * gl_Color;
else fc = 0.10 * gl_Color;
gl_FragColor = fc;
}

----------------------------------------------------------

what`s problem?

i knew HD 3850 (Graphic Driver 9.12 over) is Support for OpenGL Shading Language 1.50 and my Graphic Driver Catalyst 11.2 !!

need help !!

Alfonse Reinheart
03-28-2011, 10:52 AM
i knew HD 3850 (Graphic Driver 9.12 over) is Support for OpenGL Shading Language 1.50 and my Graphic Driver Catalyst 11.2 !!

Yes, but "varying in" is not actual grammar according to the OpenGL Shading Language. A variable can be "varying" (but only with the compatibility flag or in a compatibility context) or "in"; it cannot be both.

The compiler isn't really providing a useful message though, since "varying in" isn't supported by any stage.

Hyunwoo
03-28-2011, 11:52 AM
thanks for answer to my bad english :)
and maybe... i can not exactly understand your answer..
but my fragment shader.. clean compiled on Geforce GT415M and running..
it is hardware dependency?

Alfonse Reinheart
03-28-2011, 12:04 PM
clean compiled on Geforce GT415M and running..

NVIDIA's compilers generally are more accepting of off-spec behavior than ATI's.

Hyunwoo
03-28-2011, 12:12 PM
thank you for help :)

have a nice day lol