diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-03-17 01:58:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-03-18 03:56:34 +0300 |
commit | 8cad48df2801ff7e1321e477e39df8eff2f13d39 (patch) | |
tree | f2a1ef4dd160e1b3a4e84bf5a3f6658ff906e167 /source/blender/draw/modes | |
parent | cf62424e47c2b9f266128ad63a796b749d18f7e2 (diff) |
Draw Manager: Created a general fullscreen shader.
Diffstat (limited to 'source/blender/draw/modes')
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 3 | ||||
-rw-r--r-- | source/blender/draw/modes/shaders/edit_overlay_mix_frag.glsl | 9 | ||||
-rw-r--r-- | source/blender/draw/modes/shaders/edit_overlay_mix_vert.glsl | 7 |
3 files changed, 6 insertions, 13 deletions
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index 1d5b064ebbd..40404b2daff 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -166,8 +166,7 @@ static void EDIT_MESH_engine_init(void) datatoc_edit_overlay_facedot_frag_glsl, NULL); } if (!overlay_mix_sh) { - overlay_mix_sh = DRW_shader_create(datatoc_edit_overlay_mix_vert_glsl, NULL, - datatoc_edit_overlay_mix_frag_glsl, NULL); + overlay_mix_sh = DRW_shader_create_fullscreen(datatoc_edit_overlay_mix_frag_glsl, NULL); } if (!overlay_facefill_sh) { overlay_facefill_sh = DRW_shader_create(datatoc_edit_overlay_facefill_vert_glsl, NULL, diff --git a/source/blender/draw/modes/shaders/edit_overlay_mix_frag.glsl b/source/blender/draw/modes/shaders/edit_overlay_mix_frag.glsl index c63579ebc3f..02943f24031 100644 --- a/source/blender/draw/modes/shaders/edit_overlay_mix_frag.glsl +++ b/source/blender/draw/modes/shaders/edit_overlay_mix_frag.glsl @@ -1,4 +1,6 @@ +in vec4 uvcoordsvar; + out vec4 FragColor; uniform sampler2D wireColor; @@ -8,10 +10,9 @@ uniform float alpha; void main() { - ivec2 co = ivec2(gl_FragCoord.xy); - float wire_depth = texelFetch(wireDepth, co, 0).r; - float scene_depth = texelFetch(sceneDepth, co, 0).r; - vec4 wire_color = texelFetch(wireColor, co, 0).rgba; + float wire_depth = texelFetch(wireDepth, uvcoordsvar, 0).r; + float scene_depth = texelFetch(sceneDepth, uvcoordsvar, 0).r; + vec4 wire_color = texelFetch(wireColor, uvcoordsvar, 0).rgba; FragColor = wire_color; diff --git a/source/blender/draw/modes/shaders/edit_overlay_mix_vert.glsl b/source/blender/draw/modes/shaders/edit_overlay_mix_vert.glsl deleted file mode 100644 index ef3d5d717bc..00000000000 --- a/source/blender/draw/modes/shaders/edit_overlay_mix_vert.glsl +++ /dev/null @@ -1,7 +0,0 @@ - -in vec2 pos; - -void main() -{ - gl_Position = vec4(pos, 0.0, 1.0); -} |