   Geometry shader fails to compile (varying problem)
  I try to get started with geometry shaders using a simple example I found on the net. It though fails to compile so I don't know what's going on. Here first the simple shaders programs:Geometry#version 120#extension GL_EXT_geometry_shader4: enablevarying out vec3 vPosition;void main(){int l;for( l=0; l&lt;6; l++ ){gl_Layer = l;gl_Position = gl_PositionIn[ 0 ];EmitVertex();gl_Position = gl_PositionIn[ 1 ];EmitVertex();gl_Position = gl_PositionIn[ 2 ];EmitVertex();EndPrimitive();}}Vertex:#version 120varying vec3 vPosition;void main( void ){vPosition = ( gl_ModelViewMatrix * vec4( gl_Vertex.xyz, 1.0 ) ).xyz;gl_Position = gl_ModelViewProjectionMatrix * vec4( gl_Vertex.xyz, 1.0 );}Fragment:#version 120uniform vec4 pOptions; // scale, offset, n/a, n/avarying vec3 vPosition;void main( void ){gl_FragDepth = clamp( length( vPosition ) * pOptions.x + pOptions.y, 0.0, 1.0 );}Programs compile but linking fails with error:Fragment shader(s) failed to link,  vertex shader(s) failed to link.ERROR: error(#277) Symbol 'vPosition' usage doesn't match between two stagesERROR: error(#277) Symbol 'vPosition' usage doesn't match between two stagesI have no idea what's going on. Also using the reference documentation I can not locate any error. Any help appreciated.   
  vertex->geometry->fragment. The vPosition varying values cannot jump through the geom.shader.   ;  I don't get you there. How is it jumping in the wrong order here?   ;Quote:Original post by RPTDI don't get you there. How is it jumping in the wrong order here?The geometry shader has to explicitly pass the value through. That means declaring both an in and out varying, and assigning the one to the other.   ;  I tried now just writing a dummy value to vPosition once in the geometry shader and that seems to allow it to link. So with other words I always have to write a dummy value in the geometry shader even if the vertex shader actually places the value?I also tried making two different vPosition varyings but that one didn't work, only the one above with vPosition declared in all three shaders.   