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:
authorAntony Riakiotakis <kalast@gmail.com>2015-03-20 17:26:13 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-03-20 17:26:13 +0300
commit07b2508305d58d0c772464f9a174fca2b96036c2 (patch)
treee224074efb61874b31e9b67f57b7cbdc0544c58f /source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl
parent3d6642db835a9e35ea15cf9f856ce047447690ca (diff)
Fix high quality depth of field on the Mac.
Quite a few things wrong here: * Mac did not support EXT_draw_instanced, only ARB_draw_instanced * Draw instanced did not work unless data came from vertex buffer, which is second time we see weird things with vertex arrays in mac * There were a few stupid mistakes by me as well, such as binding to uniform locations for the wrong shaders (it's a wonder it ever worked :p)
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl
index e8c505bd15f..09a0c75facc 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl
@@ -27,11 +27,11 @@ void vert_dof_downsample()
/* geometry shading pass, calculate a texture coordinate based on the indexed id */
void vert_dof_coc_scatter_pass()
{
- vec2 pixel = vec2(1.0 / float(rendertargetdim.x), 1.0 / float(rendertargetdim.y));
+ vec2 pixel = vec2(rendertargetdim.x, rendertargetdim.y);
/* some math to get the target pixel */
int row = gl_InstanceID / rendertargetdim.x;
int column = gl_InstanceID % rendertargetdim.x;
- uvcoord = vec2(column, row) * pixel + 0.5 * pixel;
+ uvcoord = (vec2(column, row) + vec2(0.5)) / pixel;
vec2 pos = uvcoord * 2.0 - vec2(1.0);
gl_Position = vec4(pos.x, pos.y, 0.0, 1.0);