// simple vertex shader
-/*
-struct VS_INPUT {
- float3 Pos : POSITION;
- float I : TEXCOORD0;
-};
-struct VS_OUTPUT {
-// float4 Pos : POSITION;
-// float4 Col : COLOR0;
- float Size : PSIZE;
-};
-
-float ComputePointSize(float3 inVertex, float inSize) {
- float4 viewPos = mul(float4(inVertex, 1), WorldView);
- float dist = (viewPos.x * viewPos.x + viewPos.y * viewPos.y + viewPos.z * viewPos.z);
- float size = viewportSize.y * inSize * globalPointSize * rsqrt((1 + dist));
-
- return max( 16.0f, size );
-}
-
-VS_OUTPUT VertexShader_PointSpritePalette(VS_INPUT vIn) {
- VS_OUTPUT Out;
-
-// Out.Pos = mul(float4(vIn.Pos, 1), WorldViewProjection);
-
- if( vIn.I < limitMin || vIn.I > limitMax ) {
- Out.Size = 0;
- } else {
- float stepValue = vIn.I;
-
- float size1 = 1.0f;
- float size2 = 4.0f;
- float pSize = size1 + stepValue * (size2 - size1);
- Out.Size = ComputePointSize(vIn.Pos, pSize) * 0.5;
- }
-
- return Out;
-}
-*/
+attribute float minSize;
+attribute float maxSize;
+attribute float clamp;
float3 ComputePointSize( float3 inColor )
{
h = 180 + (120*(r-g+delta)+delta)/(2*delta);
}
- float minSize = 15.0f;
- float maxSize = 50.0f;
+ minSize = 15.0;
+ maxSize = 40.0;
float size = minSize + ( maxSize - minSize ) * ( 1 - h / 256.0f );
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- //gl_FrontColor = gl_Color;
+ gl_FrontColor = gl_Color;
float size = ComputePointSize( gl_Color );
- gl_PointSize = size * gl_ProjectionMatrix[0].x;
+ clamp = 100.0;
+ gl_PointSize = min( size * gl_ProjectionMatrix[0].x, clamp );
}