[Bf-blender-cvs] [89673f0974d] master: DRW: Make fullscreen vertex shader position and uv without attributes
Clément Foucault
noreply at git.blender.org
Fri May 17 13:38:54 CEST 2019
Commit: 89673f0974d87350bede74eaa62788684d21b36e
Author: Clément Foucault
Date: Thu May 16 14:16:23 2019 +0200
Branches: master
https://developer.blender.org/rB89673f0974d87350bede74eaa62788684d21b36e
DRW: Make fullscreen vertex shader position and uv without attributes
===================================================================
M source/blender/draw/modes/shaders/common_fullscreen_vert.glsl
===================================================================
diff --git a/source/blender/draw/modes/shaders/common_fullscreen_vert.glsl b/source/blender/draw/modes/shaders/common_fullscreen_vert.glsl
index a1e6bb0f43d..8a7fb97d98c 100644
--- a/source/blender/draw/modes/shaders/common_fullscreen_vert.glsl
+++ b/source/blender/draw/modes/shaders/common_fullscreen_vert.glsl
@@ -1,10 +1,11 @@
-in vec2 pos;
-in vec2 uvs;
out vec4 uvcoordsvar;
void main()
{
- uvcoordsvar = vec4(uvs, 0.0, 0.0);
- gl_Position = vec4(pos, 1.0, 1.0);
+ int v = gl_VertexID % 3;
+ float x = -1.0 + float((v & 1) << 2);
+ float y = -1.0 + float((v & 2) << 1);
+ gl_Position = vec4(x, y, 1.0, 1.0);
+ uvcoordsvar = vec4((gl_Position.xy + 1.0) * 0.5, 0.0, 0.0);
}
More information about the Bf-blender-cvs
mailing list