From: ouv Date: Fri, 2 Sep 2005 06:42:15 +0000 (+0000) Subject: Vertex Shader for ARB OpenGL extension X-Git-Tag: BR-D5-38-2003_D2005-12-09~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e2786db32044e85ede7e76ea56160245111a12f;p=modules%2Fvisu.git Vertex Shader for ARB OpenGL extension --- diff --git a/resources/Vertex_Program_ARB.txt b/resources/Vertex_Program_ARB.txt new file mode 100755 index 00000000..d017060b --- /dev/null +++ b/resources/Vertex_Program_ARB.txt @@ -0,0 +1,58 @@ +!!ARBvp1.0 + +# Constant Parameters +PARAM mvp[4] = { state.matrix.mvp }; # modelview projection matrix +PARAM constColor = program.env[0]; # constant color (defined by the application) +PARAM constSize = program.env[1]; # constant size + +# constColor.x == 1.0 +# constColor.y == 1.0 +# constColor.z == 1.0 +# constColor.w == 1.0 + +# constSize.x == 1.0 +# constSize.y == 10.0 +# constSize.z == 100.0 +# constSize.w == 1000.0 + +# Per-vertex inputs +ATTRIB inPosition = vertex.position; +ATTRIB inColor = vertex.color; + +# Per-vertex outputs +OUTPUT outPosition = result.position; +OUTPUT outColor = result.color; +OUTPUT outSize = result.pointsize; + +DP4 outPosition.x, mvp[0], inPosition; # Transform the x component of the per-vertex position into clip-space +DP4 outPosition.y, mvp[1], inPosition; # Transform the y component of the per-vertex position into clip-space +DP4 outPosition.z, mvp[2], inPosition; # Transform the z component of the per-vertex position into clip-space +DP4 outPosition.w, mvp[3], inPosition; # Transform the w component of the per-vertex position into clip-space + +# Color management + +TEMP color1; +TEMP color2; + +#MOV color1, inColor.y; +#DP4 color2, color1, color1; +#MOV outColor, color1; + +MOV outColor, inColor; # Use the original per-vertex color specified +#MOV outColor, constColor; # Uncomment this to use the constant color stored at "program.env[0]" + +# Size management + +TEMP size1; + +MOV size1, constSize; + +DP4 size1.x, inColor, inColor; +MUL size1.x, size1.x, constSize.y; + +#MUL size1.x, size1.x, inColor.w; +#MUL size1.x, size1.x, constSize.y; + +MOV outSize, size1; + +END \ No newline at end of file