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:
authorClément Foucault <foucault.clem@gmail.com>2020-04-24 00:05:39 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-04-24 00:07:48 +0300
commitd712f1f83af881be536ec0d183b7d3025c172684 (patch)
treeeabecb450ce2d4697468d2758df28fd990c14ed6 /source/blender/gpu/GPU_shader.h
parentd0ff3434cffa2e056e4f191ead21226f32ea8c15 (diff)
GPU: Add Polyline shader (wide line emulation)
This new shader is able to emulate smooth wide lines drawing using a geometry shader. This shader needs viewportSize and lineWidth uniforms to be set. There is multiple variants to replace the usage of wide lines for most shaders. This patch only fix the gizmo_types files and the navigation gizmo. Other areas could be fixed afterward, I just limited the patch size. Fix T57570. Reviewed By: billreynish Differential Revision: https://developer.blender.org/D7487
Diffstat (limited to 'source/blender/gpu/GPU_shader.h')
-rw-r--r--source/blender/gpu/GPU_shader.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h
index 1fb0b7c1f6b..dd64b858b35 100644
--- a/source/blender/gpu/GPU_shader.h
+++ b/source/blender/gpu/GPU_shader.h
@@ -156,6 +156,7 @@ typedef enum eGPUBuiltinShader {
* \param pos: in vec3
*/
GPU_SHADER_3D_UNIFORM_COLOR,
+ GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR,
/**
* Take a 3D position and color for each vertex without color interpolation.
*
@@ -171,12 +172,37 @@ typedef enum eGPUBuiltinShader {
*/
GPU_SHADER_3D_SMOOTH_COLOR,
/**
+ * Take a single color for all the vertices and a 3D position for each vertex.
+ * Used for drawing wide lines.
+ *
+ * \param color: uniform vec4
+ * \param pos: in vec3
+ */
+ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR,
+ GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR,
+ /**
+ * Take a 3D position and color for each vertex without color interpolation.
+ * Used for drawing wide lines.
+ *
+ * \param color: in vec4
+ * \param pos: in vec3
+ */
+ GPU_SHADER_3D_POLYLINE_FLAT_COLOR,
+ /**
+ * Take a 3D position and color for each vertex with perspective correct interpolation.
+ * Used for drawing wide lines.
+ *
+ * \param color: in vec4
+ * \param pos: in vec3
+ */
+ GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR,
+ /**
* Take a 3D position for each vertex and output only depth.
+ * Used for drawing wide lines.
*
* \param pos: in vec3
*/
GPU_SHADER_3D_DEPTH_ONLY,
- GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR,
/* basic image drawing */
GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE,
GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE,