From: ouv Date: Mon, 19 Sep 2005 08:58:13 +0000 (+0000) Subject: Magnification parameter added X-Git-Tag: BR-D5-38-2003_D2005-12-10~189 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=59e60e40d46cdccf5deedf9a6d9819f305249655;p=modules%2Fvisu.git Magnification parameter added --- diff --git a/resources/Vertex_Program_ARB.txt b/resources/Vertex_Program_ARB.txt index 2d8462e2..58c060b2 100755 --- a/resources/Vertex_Program_ARB.txt +++ b/resources/Vertex_Program_ARB.txt @@ -1,11 +1,20 @@ // simple vertex shader +attribute float attrib1; +attribute float attrib2; +attribute float attrib3; + +attribute float clamp; attribute float minSize; attribute float maxSize; -attribute float clamp; +attribute float magnification; float3 ComputePointSize( float3 inColor ) { + float a1 = attrib1; + float a2 = attrib2; + float a3 = attrib3; + int r = inColor.x * 255; int g = inColor.y * 255; int b = inColor.z * 255; @@ -28,7 +37,11 @@ float3 ComputePointSize( float3 inColor ) if ( b < min ) min = b; int delta = max-min; - if( whatmax == 0 ) + if( delta == 0 ) + { + h = 0; + } + else if( whatmax == 0 ) { if ( g >= b ) h = (120*(g-b)+delta)/(2*delta); @@ -50,9 +63,8 @@ float3 ComputePointSize( float3 inColor ) h = 180 + (120*(r-g+delta)+delta)/(2*delta); } - minSize = 15.0; - maxSize = 40.0; - + //minSize = 15.0; + //maxSize = 40.0; float size = minSize + ( maxSize - minSize ) * ( 1 - h / 256.0f ); return size; @@ -66,7 +78,6 @@ void main() float size = ComputePointSize( gl_Color ); - clamp = 100.0; - gl_PointSize = min( size * gl_ProjectionMatrix[0].x, clamp ); - + //clamp = 100.0; + gl_PointSize = min( magnification * size * gl_ProjectionMatrix[0].x, clamp ); }