Added setting of the gl_ClipVertex to enable clip planes to affect preciptation

This commit is contained in:
Robert Osfield
2008-12-19 16:12:40 +00:00
parent 0ea6cdeb96
commit aabf60c8e5

View File

@@ -553,6 +553,7 @@ void PrecipitationEffect::setUpGeometries(unsigned int numParticles)
" v1.xy += dp*texCoord.x;\n"
" \n"
" gl_Position = gl_ProjectionMatrix * v1;\n"
" gl_ClipVertex = v1;\n"
"}\n";
char fragmentShaderSource[] =
@@ -624,6 +625,7 @@ void PrecipitationEffect::setUpGeometries(unsigned int numParticles)
" v1.xyz += dv*texCoord.y;\n"
" \n"
" gl_Position = gl_ProjectionMatrix * v1;\n"
" gl_ClipVertex = v1;\n"
"}\n";
char fragmentShaderSource[] =
@@ -681,6 +683,7 @@ void PrecipitationEffect::setUpGeometries(unsigned int numParticles)
" gl_PointSize = ceil(pointSize);\n"
" \n"
" colour.a = 0.05+(pointSize*pointSize)/(gl_PointSize*gl_PointSize);\n"
" gl_ClipVertex = v_current;\n"
"}\n";
char fragmentShaderSource[] =