Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/surface_geom.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/surface_geom.glsl46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/surface_geom.glsl b/source/blender/draw/engines/eevee/shaders/surface_geom.glsl
new file mode 100644
index 00000000000..ad437dca79a
--- /dev/null
+++ b/source/blender/draw/engines/eevee/shaders/surface_geom.glsl
@@ -0,0 +1,46 @@
+
+#pragma BLENDER_REQUIRE(common_view_lib.glsl)
+#pragma BLENDER_REQUIRE(surface_lib.glsl)
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+RESOURCE_ID_VARYING
+
+/* Only used to compute barycentric coordinates. */
+
+void main()
+{
+#ifdef DO_BARYCENTRIC_DISTANCES
+ dataAttrOut.barycentricDist = calc_barycentric_distances(
+ dataIn[0].worldPosition, dataIn[1].worldPosition, dataIn[2].worldPosition);
+#endif
+
+ PASS_RESOURCE_ID
+
+#ifdef USE_ATTR
+ pass_attr(0);
+#endif
+ PASS_SURFACE_INTERFACE(0);
+ gl_Position = gl_in[0].gl_Position;
+ gl_ClipDistance[0] = gl_in[0].gl_ClipDistance[0];
+ EmitVertex();
+
+#ifdef USE_ATTR
+ pass_attr(1);
+#endif
+ PASS_SURFACE_INTERFACE(1);
+ gl_Position = gl_in[1].gl_Position;
+ gl_ClipDistance[0] = gl_in[1].gl_ClipDistance[0];
+ EmitVertex();
+
+#ifdef USE_ATTR
+ pass_attr(2);
+#endif
+ PASS_SURFACE_INTERFACE(2);
+ gl_Position = gl_in[2].gl_Position;
+ gl_ClipDistance[0] = gl_in[2].gl_ClipDistance[0];
+ EmitVertex();
+
+ EndPrimitive();
+}