[Bf-blender-cvs] [d5f3f4410d6] master: Missed adding file in recent commit

Campbell Barton noreply at git.blender.org
Mon Aug 26 17:53:27 CEST 2019


Commit: d5f3f4410d683f20eb3f168145155d01ee04c3ba
Author: Campbell Barton
Date:   Tue Aug 27 01:53:00 2019 +1000
Branches: master
https://developer.blender.org/rBd5f3f4410d683f20eb3f168145155d01ee04c3ba

Missed adding file in recent commit

===================================================================

A	source/blender/draw/modes/shaders/object_color_axes_vert.glsl

===================================================================

diff --git a/source/blender/draw/modes/shaders/object_color_axes_vert.glsl b/source/blender/draw/modes/shaders/object_color_axes_vert.glsl
new file mode 100644
index 00000000000..239dec30c42
--- /dev/null
+++ b/source/blender/draw/modes/shaders/object_color_axes_vert.glsl
@@ -0,0 +1,35 @@
+
+uniform mat4 ViewProjectionMatrix;
+uniform vec3 screenVecs[3];
+
+/* ---- Instantiated Attrs ---- */
+in float axis; /* position on the axis. [0.0-1.0] is X axis, [1.0-2.0] is Y, etc... */
+in vec2 screenPos;
+in vec3 colorAxis;
+
+/* ---- Per instance Attrs ---- */
+in mat4 InstanceModelMatrix;
+in vec4 color;
+
+flat out vec4 finalColor;
+
+void main()
+{
+  float draw_size = 4.0;
+  vec3 chosen_axis = InstanceModelMatrix[int(axis)].xyz;
+  vec3 loc = InstanceModelMatrix[3].xyz;
+  vec3 wpos = loc + chosen_axis * fract(axis) * draw_size;
+  vec3 spos = screenVecs[0].xyz * screenPos.x + screenVecs[1].xyz * screenPos.y;
+  /* Scale uniformly by axis length */
+  spos *= length(chosen_axis) * draw_size;
+
+  vec4 pos_4d = vec4(wpos + spos, 1.0);
+  gl_Position = ViewProjectionMatrix * pos_4d;
+
+  finalColor.rgb = mix(colorAxis, color.rgb, color.a);
+  finalColor.a = 1.0;
+
+#ifdef USE_WORLD_CLIP_PLANES
+  world_clip_planes_calc_clip_distance(pos_4d.xyz);
+#endif
+}



More information about the Bf-blender-cvs mailing list