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:
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);