diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-09-22 03:42:57 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-09-22 03:44:40 +0300 |
commit | 1a4a1447b728082939e7b0f033602f27c0269937 (patch) | |
tree | 9060d9ff3762a5bd9709dca267c458c8fd8222d9 /source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl | |
parent | 406427bd4eac038491e69156a1b344d21a5289fd (diff) |
Edit Mesh Mode: Add a facing falloff effect
This let the user keep track of the shape by fading the center of the object.
An Opacity parameter is yet to be added.
Diffstat (limited to 'source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl index afd1e5a74a8..f83402e3869 100644 --- a/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl @@ -29,6 +29,9 @@ uniform vec2 viewportSize; in vec4 vPos[]; in vec4 pPos[]; in ivec4 vData[]; +#ifdef VERTEX_FACING +in float vFacing[]; +#endif /* these are the same for all vertices * and does not need interpolation */ @@ -40,6 +43,9 @@ flat out int clipCase; #ifdef VERTEX_SELECTION out vec3 vertexColor; #endif +#ifdef VERTEX_FACING +out float facing; +#endif /* See fragment shader */ noperspective out vec4 eData1; @@ -103,6 +109,10 @@ void doVertex(int v, vec4 pos) vertexColor = getVertexColor(v); #endif +#ifdef VERTEX_FACING + facing = vFacing[v]; +#endif + gl_Position = pos; EmitVertex(); |