[Bf-blender-cvs] [e1e984e] master: Fix T42807, variance shadow map broken afterFBO changes.

Antony Riakiotakis noreply at git.blender.org
Fri Dec 5 16:01:25 CET 2014


Commit: e1e984e437fc8fdf4a0fa1f8ec8fb64748c4ea28
Author: Antony Riakiotakis
Date:   Fri Dec 5 16:01:08 2014 +0100
Branches: master
https://developer.blender.org/rBe1e984e437fc8fdf4a0fa1f8ec8fb64748c4ea28

Fix T42807, variance shadow map broken afterFBO changes.

This code was a bit do-it-yourself instead of relying on the API. Should
be OK now.

===================================================================

M	source/blender/gpu/intern/gpu_extensions.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index a65b916..e386869 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -1098,6 +1098,10 @@ void GPU_framebuffer_blur(GPUFrameBuffer *fb, GPUTexture *tex, GPUFrameBuffer *b
 	/* We do the bind ourselves rather than using GPU_framebuffer_texture_bind() to avoid
 	 * pushing unnecessary matrices onto the OpenGL stack. */
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, blurfb->object);
+	glDrawBuffer(GL_COLOR_ATTACHMENT0);
+	
+	/* avoid warnings from texture binding */
+	GG.currentfb = blurfb->object;
 
 	GPU_shader_bind(blur_shader);
 	GPU_shader_uniform_vector(blur_shader, scale_uniform, 2, 1, (float *)scaleh);
@@ -1127,6 +1131,10 @@ void GPU_framebuffer_blur(GPUFrameBuffer *fb, GPUTexture *tex, GPUFrameBuffer *b
 	/* Blurring vertically */
 
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb->object);
+	glDrawBuffer(GL_COLOR_ATTACHMENT0);
+	
+	GG.currentfb = fb->object;
+	
 	glViewport(0, 0, GPU_texture_opengl_width(tex), GPU_texture_opengl_height(tex));
 	GPU_shader_uniform_vector(blur_shader, scale_uniform, 2, 1, (float *)scalev);
 	GPU_shader_uniform_texture(blur_shader, texture_source_uniform, blurtex);




More information about the Bf-blender-cvs mailing list