shaderVectorPerVertex.geom 482 Bytes
Newer Older
1
2
3
4
5
// ShaderVectorPerVertex::geometryShaderText

uniform float vectorScale;
uniform mat4 ModelViewProjectionMatrix;
VARYING_IN vec3 VectorAttrib[];
6
7
8
9

uniform vec4 planeClip;
VARYING_IN vec3 posClip[];

10
11
void main()
{
12
13
14
15
16
17
18
19
	if (dot(planeClip,vec4(posClip[0],1.0))<=0.0)
	{
		gl_Position = ModelViewProjectionMatrix * POSITION_IN(0);
		EmitVertex();
		gl_Position = ModelViewProjectionMatrix * (POSITION_IN(0) + vec4(VectorAttrib[0] * vectorScale, 0.0));
		EmitVertex();
		EndPrimitive();
	}
20
}