summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote/shaders/vertex.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/asymptote/shaders/vertex.glsl')
-rwxr-xr-xMaster/texmf-dist/asymptote/shaders/vertex.glsl83
1 files changed, 49 insertions, 34 deletions
diff --git a/Master/texmf-dist/asymptote/shaders/vertex.glsl b/Master/texmf-dist/asymptote/shaders/vertex.glsl
index 9e3feda6988..9a54d3211ca 100755
--- a/Master/texmf-dist/asymptote/shaders/vertex.glsl
+++ b/Master/texmf-dist/asymptote/shaders/vertex.glsl
@@ -1,34 +1,49 @@
-in vec3 position;
-in vec3 normal;
-
-#ifdef EXPLICIT_COLOR
-in uint color;
-#endif
-
-in int material;
-
-uniform mat4 projViewMat;
-uniform mat4 viewMat;
-uniform mat4 normMat;
-
-out vec3 ViewPosition;
-out vec3 Normal;
-
-#ifdef EXPLICIT_COLOR
-out vec4 Color;
-#endif
-
-flat out int materialIndex;
-
-void main()
-{
- gl_Position=projViewMat*vec4(position,1.0);
- ViewPosition=(viewMat*vec4(position,1.0)).xyz;
- Normal=normalize((normMat*vec4(normal,0)).xyz);
-
-#ifdef EXPLICIT_COLOR
- Color=unpackUnorm4x8(color);
-#endif
-
- materialIndex=material;
-}
+in vec3 position;
+
+uniform mat3 normMat;
+
+#ifdef NORMAL
+#ifndef ORTHOGRAPHIC
+out vec3 ViewPosition;
+#endif
+in vec3 normal;
+out vec3 Normal;
+#endif
+
+in int material;
+
+#ifdef COLOR
+in vec4 color;
+out vec4 Color;
+#endif
+
+#ifdef WIDTH
+in float width;
+#endif
+
+uniform mat4 projViewMat;
+uniform mat4 viewMat;
+
+flat out int materialIndex;
+
+void main()
+{
+ vec4 v=vec4(position,1.0);
+ gl_Position=projViewMat*v;
+#ifdef NORMAL
+#ifndef ORTHOGRAPHIC
+ ViewPosition=(viewMat*v).xyz;
+#endif
+ Normal=normal*normMat;
+#endif
+
+#ifdef COLOR
+ Color=color;
+#endif
+
+#ifdef WIDTH
+ gl_PointSize=width;
+#endif
+
+ materialIndex=material;
+}