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
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-02-10 18:20:11 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-10 18:29:10 +0300
commit0d8b701e2570d4f47c65514df09590d415622f0b (patch)
tree31d64a8687e27557815cc45af860b8e1c4382266 /source
parentbdfd9ba38abcb588eafb6413ed24ad5c310a44cb (diff)
Forward compatibility: Use triangle strips instead of quads
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/gpu/intern/gpu_compositing.c18
-rw-r--r--source/blender/makesdna/DNA_gpu_types.h1
3 files changed, 10 insertions, 11 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index aec8c884fa0..c63478b7710 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -462,7 +462,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
* running notifiers again will overwrite */
oglrender->scene->customdata_mask |= oglrender->scene->customdata_mask_modal;
- if (oglrender->v3d->shader_fx & (GPU_FX_DEPTH_OF_FIELD | GPU_FX_DEPTH_OF_FIELD)) {
+ if (oglrender->v3d->shader_fx & (GPU_FX_DEPTH_OF_FIELD | GPU_FX_SSAO)) {
oglrender->fx = GPU_create_fx_compositor();
}
}
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index a44dab78cde..73c4a31d73d 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -54,8 +54,8 @@
#include "MEM_guardedalloc.h"
-static const float fullscreencos[4][2] = {{-1.0f, -1.0f}, {1.0f, -1.0f}, {1.0f, 1.0f}, {-1.0f, 1.0f}};
-static const float fullscreenuvs[4][2] = {{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f}};
+static const float fullscreencos[4][2] = {{-1.0f, -1.0f}, {1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}};
+static const float fullscreenuvs[4][2] = {{0.0f, 0.0f}, {1.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}};
struct GPUFX {
/* we borrow the term gbuffer from deferred rendering however this is just a regular
@@ -545,7 +545,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_framebuffer_texture_attach(fx->gbuffer, target, 0, NULL);
}
glDisable(GL_DEPTH_TEST);
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(src);
@@ -633,7 +633,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_texture_bind_as_framebuffer(fx->dof_near_coc_buffer);
glDisable(GL_DEPTH_TEST);
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(src);
GPU_depth_texture_mode(fx->depth_buffer, true, false);
@@ -678,7 +678,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_final_buffer, 0, NULL);
/* Drawing quad */
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* *unbind/detach */
GPU_texture_unbind(fx->dof_near_coc_buffer);
@@ -693,7 +693,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_shader_uniform_texture(dof_shader_pass2, color_uniform, fx->dof_near_coc_final_buffer);
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_blurred_buffer, 0, NULL);
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* *unbind/detach */
GPU_depth_texture_mode(fx->depth_buffer, true, false);
@@ -725,7 +725,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_final_buffer, 0, NULL);
glDisable(GL_DEPTH_TEST);
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(fx->dof_near_coc_buffer);
GPU_texture_unbind(fx->dof_near_coc_blurred_buffer);
@@ -755,7 +755,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_buffer, 0, NULL);
glDisable(GL_DEPTH_TEST);
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(fx->dof_near_coc_final_buffer);
@@ -813,7 +813,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
GPU_framebuffer_texture_attach(fx->gbuffer, target, 0, NULL);
}
glDisable(GL_DEPTH_TEST);
- glDrawArrays(GL_QUADS, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
/* disable bindings */
GPU_texture_unbind(fx->dof_near_coc_buffer);
GPU_texture_unbind(fx->dof_near_coc_blurred_buffer);
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index 21545b168cb..2874a3c5833 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -59,6 +59,5 @@ typedef struct GPUFXOptions {
/* shaderfx enables */
#define GPU_FX_DEPTH_OF_FIELD 1
#define GPU_FX_SSAO (1 << 1)
-#define GPU_FX_HDR (1 << 2)
#endif