this->OpenGLHelper.vglUseProgramObjectARB( this->PointProgram );
this->myLocations.ModelViewProjection = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uModelViewProjectionMatrix" );
+ this->myLocations.Projection = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uProjectionMatrix" );
this->myLocations.GeneralPointSize = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uGeneralPointSize" );
this->myLocations.PointSprite = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uPointSprite" );
{
this->OpenGLHelper.SetUniformMatrix( this->myLocations.ModelViewProjection, wcdc );
}
+ this->OpenGLHelper.SetUniformMatrix( this->myLocations.Projection, vcdc );
this->OpenGLHelper.vglUniform1iARB( this->myLocations.GeneralPointSize, std::max( aSize[0], aSize[1] ) );
static const GLint INVALID_LOCATION = -1;
GLint ModelViewProjection;
+ GLint Projection;
GLint GeneralPointSize;
GLint PointSprite;
Locations()
: ModelViewProjection (INVALID_LOCATION),
+ Projection (INVALID_LOCATION),
GeneralPointSize (INVALID_LOCATION),
PointSprite (INVALID_LOCATION)
{
in vec4 VSColor;
void main()
{
- outColor = VSColor;
- vec4 testColor = Texture2D(uPointSprite, gl_PointCoord);
- if (testColor.r > 0.1)
- outColor = testColor * outColor;
- else
+ vec4 aColor = Texture2D(uPointSprite, gl_PointCoord) * VSColor;
+ if (aColor.a < 0.5)
discard;
+
+ outColor = aColor;
}
attribute float Diameter;
#endif
+uniform mat4 uProjectionMatrix;
uniform mat4 uModelViewProjectionMatrix;
uniform int uGeneralPointSize;
gl_Position = uModelViewProjectionMatrix * vec4 (Vertex.xyz, 1.0);
if (uGeneralPointSize == -1)
- gl_PointSize = Diameter;
+ gl_PointSize = 1400 * uProjectionMatrix[1].y * Diameter;
else
gl_PointSize = uGeneralPointSize;