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-02-17 20:08:28 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-17 20:11:22 +0300
commitff7220349d32e747c7559809d68de7d835c0c1cd (patch)
treec6955f0b86bcf12ab6dc5d87b4a48300375d3da3 /source/blender/gpu/GPU_compositing.h
parenta0d7db503d82c1a5b56a5723da90364f11569b37 (diff)
Compositing works with X-Ray.
Basically, before drawing X-Rays, we now bind a second depth buffer. After drawing XRays, we do an extra resolve pass where we overwrite the non-XRay depth buffer in pixels where the depth is not maximum (which means background pixel, since depth is cleared before drawing X-Ray objects). This ensures both scene and X-Rays keep their depth values and are ready for compositing. Well, the odd effect due to depth discontinuities can be expected, and X-Rays are a bit more expensive (extra buffer + resolve pass) but at least X-Rays won't invalidate depth values anymore. Whee!
Diffstat (limited to 'source/blender/gpu/GPU_compositing.h')
-rw-r--r--source/blender/gpu/GPU_compositing.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_compositing.h b/source/blender/gpu/GPU_compositing.h
index 796341d4830..93f1bc64922 100644
--- a/source/blender/gpu/GPU_compositing.h
+++ b/source/blender/gpu/GPU_compositing.h
@@ -60,10 +60,12 @@ typedef enum GPUFXShaderEffect {
GPU_SHADER_FX_DEPTH_OF_FIELD_PASS_THREE = 4,
GPU_SHADER_FX_DEPTH_OF_FIELD_PASS_FOUR = 5,
GPU_SHADER_FX_DEPTH_OF_FIELD_PASS_FIVE = 6,
+
+ GPU_SHADER_FX_DEPTH_RESOLVE = 7,
} GPUFXShaderEffect;
/* keep in synch with enum above! */
-#define MAX_FX_SHADERS 11
+#define MAX_FX_SHADERS 8
/* generate a new FX compositor */
GPUFX *GPU_fx_compositor_create(void);
@@ -79,6 +81,12 @@ bool GPU_fx_compositor_initialize_passes(
/* do compositing on the fx passes that have been initialized */
bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, struct Scene *scene, struct GPUOffScreen *ofs);
+/* bind new depth buffer for XRay pass */
+void GPU_fx_compositor_setup_XRay_pass(GPUFX *fx, bool do_xray);
+
+/* resolve a final depth buffer by compositing the XRay and normal depth buffers */
+void GPU_fx_compositor_XRay_resolve(GPUFX *fx);
+
void GPU_fx_compositor_init_dof_settings(struct GPUDOFSettings *dof);
void GPU_fx_compositor_init_ssao_settings(struct GPUSSAOSettings *ssao);
#ifdef __cplusplus