[Bf-blender-cvs] [1cfb12d] viewport_experiments: As usually hard to find errors are usually quite silly. We can now see the coc value
Antony Riakiotakis
noreply at git.blender.org
Tue Jan 6 19:41:40 CET 2015
Commit: 1cfb12ddbff433ef08279555ee3008f597f1f2a5
Author: Antony Riakiotakis
Date: Tue Jan 6 19:40:58 2015 +0100
Branches: viewport_experiments
https://developer.blender.org/rB1cfb12ddbff433ef08279555ee3008f597f1f2a5
As usually hard to find errors are usually quite silly. We can now see
the coc value
===================================================================
M source/blender/gpu/intern/gpu_extensions.c
M source/blender/gpu/shaders/gpu_shader_fx_dof_high_frag.glsl
===================================================================
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 9afa2cf..9d559f8 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -1099,7 +1099,7 @@ void GPU_texture_bind_as_framebuffer(GPUTexture *tex)
void GPU_framebuffer_slots_bind(GPUFrameBuffer *fb, int slot)
{
int numslots = 0, i;
- GLubyte attachments[4];
+ GLenum attachments[4];
if (!fb->colortex[slot]) {
fprintf(stderr, "Error, framebuffer slot empty!");
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_dof_high_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_dof_high_frag.glsl
index 423b06c..be54244 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_dof_high_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_dof_high_frag.glsl
@@ -35,10 +35,9 @@ void half_downsample_frag(void)
depthv.a = calculate_signed_coc(texture2D(depthbuffer, depth_uv4).r);
/* near coc, keep the min here */
- //gl_FragData[1].r = max(-min(min(depthv.r, depthv.g), min(depthv.b, depthv.a)), 0.0);
+ gl_FragData[1].r = max(-min(min(depthv.r, depthv.g), min(depthv.b, depthv.a)), 0.0);
/* far coc keep the max */
- //gl_FragData[1].g = max(max(max(depthv.r, depthv.g), max(depthv.b, depthv.a)), 0.0);
- gl_FragData[1] = vec4(1.0);
+ gl_FragData[1].g = max(max(max(depthv.r, depthv.g), max(depthv.b, depthv.a)), 0.0);
/* framebuffer output 1 is bound to half size color. linear filtering should take care of averaging here */
gl_FragData[0] = texture2D(colorbuffer, uvcoordsvar.xy);
}
@@ -47,9 +46,9 @@ void final_combine_frag(void)
{
vec4 coc = texture2D(cocbuffer, uvcoordsvar.xy);
/* framebuffer output 1 is bound to half size color. linear filtering should take care of averaging here */
-// gl_FragColor = texture2D(colorbuffer, uvcoordsvar.xy);
- gl_FragColor = coc;
-// gl_FragColor.g *= coc.g;
+ gl_FragColor = texture2D(colorbuffer, uvcoordsvar.xy);
+ gl_FragColor.g *= coc.g;
+ gl_FragColor.r *= coc.r;
}
void main(void)
More information about the Bf-blender-cvs
mailing list