diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-20 20:05:13 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-20 20:17:11 +0300 |
commit | 4bbb1d4e5e371dce3a8ccd62f103d4e553e34388 (patch) | |
tree | 5d80ac4f200f6cbbe2fb856ebe55d6b25adb3119 /source | |
parent | 7a28dea1e173aefd08ef2130a9efc401d049e150 (diff) |
DRW: Rename some DRW_STATE_* for more consistency.
Diffstat (limited to 'source')
23 files changed, 118 insertions, 100 deletions
diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index 76407d057a2..204990de5b0 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -119,12 +119,12 @@ static void basic_cache_init(void *vedata) #ifdef USE_DEPTH /* Depth Pass */ { - psl->depth_pass = DRW_pass_create("Depth Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE); + psl->depth_pass = DRW_pass_create("Depth Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE); stl->g_data->depth_shgrp = DRW_shgroup_create(e_data.depth_sh, psl->depth_pass); psl->depth_pass_cull = DRW_pass_create( "Depth Pass Cull", - DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK); + DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK); stl->g_data->depth_shgrp_cull = DRW_shgroup_create(e_data.depth_sh, psl->depth_pass_cull); } #endif diff --git a/source/blender/draw/engines/clay/clay_engine.c b/source/blender/draw/engines/clay/clay_engine.c index 8731fd7cdcf..bcbc37ac7af 100644 --- a/source/blender/draw/engines/clay/clay_engine.c +++ b/source/blender/draw/engines/clay/clay_engine.c @@ -782,13 +782,13 @@ static void clay_cache_init(void *vedata) /* Solid Passes */ { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; psl->clay_ps = DRW_pass_create("Clay", state); psl->clay_cull_ps = DRW_pass_create("Clay Culled", state | DRW_STATE_CULL_BACK); psl->clay_flat_ps = DRW_pass_create("Clay Flat", state); psl->clay_flat_cull_ps = DRW_pass_create("Clay Flat Culled", state | DRW_STATE_CULL_BACK); - DRWState prepass_state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState prepass_state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; DRWState prepass_cull_state = prepass_state | DRW_STATE_CULL_BACK; psl->clay_pre_ps = DRW_pass_create("Clay Deferred Pre", prepass_state); psl->clay_pre_cull_ps = DRW_pass_create("Clay Deferred Pre Culled", prepass_cull_state); @@ -804,7 +804,7 @@ static void clay_cache_init(void *vedata) { psl->hair_pass = DRW_pass_create( "Hair Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE); } { diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index c07bf4337db..d2faeb6ed39 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -534,7 +534,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat } { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; psl->probe_display = DRW_pass_create("LightProbe Display", state); DRW_shgroup_instance_format(e_data.format_probe_display_cube, { diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index d6ee27ce721..123dabbe226 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -294,7 +294,7 @@ void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; psl->shadow_pass = DRW_pass_create("Shadow Pass", state); stl->g_data->shadow_shgrp = DRW_shgroup_create(e_data.shadow_sh, psl->shadow_pass); diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 6f8b233d0ea..b585b1a4f85 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -921,20 +921,20 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } { - DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE; psl->depth_pass = DRW_pass_create("Depth Pass", state); stl->g_data->depth_shgrp = DRW_shgroup_create(e_data.default_prepass_sh, psl->depth_pass); - state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK; + state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; psl->depth_pass_cull = DRW_pass_create("Depth Pass Cull", state); stl->g_data->depth_shgrp_cull = DRW_shgroup_create(e_data.default_prepass_sh, psl->depth_pass_cull); - state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CLIP_PLANES | DRW_STATE_WIRE; + state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_WIRE; psl->depth_pass_clip = DRW_pass_create("Depth Pass Clip", state); stl->g_data->depth_shgrp_clip = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->depth_pass_clip); DRW_shgroup_uniform_block(stl->g_data->depth_shgrp_clip, "clip_block", sldata->clip_ubo); - state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CLIP_PLANES | DRW_STATE_CULL_BACK; + state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_CULL_BACK; psl->depth_pass_clip_cull = DRW_pass_create("Depth Pass Cull Clip", state); stl->g_data->depth_shgrp_clip_cull = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->depth_pass_clip_cull); DRW_shgroup_uniform_block(stl->g_data->depth_shgrp_clip_cull, "clip_block", sldata->clip_ubo); @@ -946,20 +946,20 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } { - DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE; psl->refract_depth_pass = DRW_pass_create("Refract Depth Pass", state); stl->g_data->refract_depth_shgrp = DRW_shgroup_create(e_data.default_prepass_sh, psl->refract_depth_pass); - state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK; + state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; psl->refract_depth_pass_cull = DRW_pass_create("Refract Depth Pass Cull", state); stl->g_data->refract_depth_shgrp_cull = DRW_shgroup_create(e_data.default_prepass_sh, psl->refract_depth_pass_cull); - state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CLIP_PLANES | DRW_STATE_WIRE; + state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_WIRE; psl->refract_depth_pass_clip = DRW_pass_create("Refract Depth Pass Clip", state); stl->g_data->refract_depth_shgrp_clip = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->refract_depth_pass_clip); DRW_shgroup_uniform_block(stl->g_data->refract_depth_shgrp_clip, "clip_block", sldata->clip_ubo); - state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CLIP_PLANES | DRW_STATE_CULL_BACK; + state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_CULL_BACK; psl->refract_depth_pass_clip_cull = DRW_pass_create("Refract Depth Pass Cull Clip", state); stl->g_data->refract_depth_shgrp_clip_cull = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->refract_depth_pass_clip_cull); DRW_shgroup_uniform_block(stl->g_data->refract_depth_shgrp_clip_cull, "clip_block", sldata->clip_ubo); @@ -977,7 +977,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS | DRW_STATE_CLIP_PLANES | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES | DRW_STATE_WIRE; psl->transparent_pass = DRW_pass_create("Material Transparent Pass", state); } @@ -1251,11 +1251,11 @@ static void material_transparent( const bool use_prepass = ((ma->blend_flag & MA_BL_HIDE_BACKSIDE) != 0); - DRWState all_state = DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_CULL_BACK | DRW_STATE_DEPTH_LESS | DRW_STATE_DEPTH_EQUAL | + DRWState all_state = DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_CULL_BACK | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND | DRW_STATE_ADDITIVE | DRW_STATE_MULTIPLY; DRWState cur_state = DRW_STATE_WRITE_COLOR; - cur_state |= (use_prepass) ? DRW_STATE_DEPTH_EQUAL : DRW_STATE_DEPTH_LESS; + cur_state |= (use_prepass) ? DRW_STATE_DEPTH_EQUAL : DRW_STATE_DEPTH_LESS_EQUAL; cur_state |= (do_cull) ? DRW_STATE_CULL_BACK : 0; switch (ma->blend_method) { @@ -1282,7 +1282,7 @@ static void material_transparent( *shgrp_depth = DRW_shgroup_create(e_data.default_prepass_clip_sh, psl->transparent_pass); DRW_shgroup_uniform_block(*shgrp_depth, "clip_block", sldata->clip_ubo); - cur_state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + cur_state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; cur_state |= (do_cull) ? DRW_STATE_CULL_BACK : 0; DRW_shgroup_state_disable(*shgrp_depth, all_state); diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index c10d63e1ce7..420209279ad 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -116,7 +116,7 @@ static void external_cache_init(void *vedata) /* Depth Pass */ { - psl->depth_pass = DRW_pass_create("Depth Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + psl->depth_pass = DRW_pass_create("Depth Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); stl->g_data->depth_shgrp = DRW_shgroup_create(e_data.depth_sh, psl->depth_pass); } } @@ -147,7 +147,7 @@ static void external_draw_scene_do(void *vedata) ARegion *ar = draw_ctx->ar; RenderEngineType *type; - DRW_state_reset_ex(DRW_STATE_DEFAULT & ~DRW_STATE_DEPTH_LESS); + DRW_state_reset_ex(DRW_STATE_DEFAULT & ~DRW_STATE_DEPTH_LESS_EQUAL); /* Create render engine. */ if (!rv3d->render_engine) { diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 72a9431efbe..16d982ad42f 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -381,7 +381,7 @@ void workbench_materials_engine_init(WORKBENCH_Data *vedata) /* Prepass */ { - int state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + int state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; psl->prepass_pass = DRW_pass_create("Prepass", state); } } @@ -469,18 +469,18 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata) #ifdef DEBUG_SHADOW_VOLUME psl->shadow_depth_pass_pass = DRW_pass_create("Shadow Debug Pass", DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); grp = DRW_shgroup_create(e_data.shadow_pass_sh, psl->shadow_depth_pass_pass); - psl->shadow_depth_fail_pass = DRW_pass_create("Shadow Debug Fail", DRW_STATE_DEPTH_GREATER | DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); + psl->shadow_depth_fail_pass = DRW_pass_create("Shadow Debug Fail", DRW_STATE_DEPTH_GREATER_EQUAL | DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); grp = DRW_shgroup_create(e_data.shadow_fail_sh, psl->shadow_depth_fail_pass); - psl->shadow_depth_fail_caps_pass = DRW_pass_create("Shadow Depth Fail Caps", DRW_STATE_DEPTH_GREATER | DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); + psl->shadow_depth_fail_caps_pass = DRW_pass_create("Shadow Depth Fail Caps", DRW_STATE_DEPTH_GREATER_EQUAL | DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE); grp = DRW_shgroup_create(e_data.shadow_caps_sh, psl->shadow_depth_fail_caps_pass); #else - psl->shadow_depth_pass_pass = DRW_pass_create("Shadow Depth Pass", DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_STENCIL_SHADOW); + psl->shadow_depth_pass_pass = DRW_pass_create("Shadow Depth Pass", DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_STENCIL_SHADOW_PASS); grp = DRW_shgroup_create(e_data.shadow_pass_sh, psl->shadow_depth_pass_pass); DRW_shgroup_stencil_mask(grp, 0xFF); - psl->shadow_depth_fail_pass = DRW_pass_create("Shadow Depth Fail", DRW_STATE_DEPTH_GREATER | DRW_STATE_WRITE_STENCIL_SHADOW); + psl->shadow_depth_fail_pass = DRW_pass_create("Shadow Depth Fail", DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_STENCIL_SHADOW_FAIL); grp = DRW_shgroup_create(e_data.shadow_fail_sh, psl->shadow_depth_fail_pass); DRW_shgroup_stencil_mask(grp, 0xFF); - psl->shadow_depth_fail_caps_pass = DRW_pass_create("Shadow Depth Fail Caps", DRW_STATE_DEPTH_GREATER | DRW_STATE_WRITE_STENCIL_SHADOW); + psl->shadow_depth_fail_caps_pass = DRW_pass_create("Shadow Depth Fail Caps", DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_STENCIL_SHADOW_FAIL); grp = DRW_shgroup_create(e_data.shadow_caps_sh, psl->shadow_depth_fail_caps_pass); DRW_shgroup_stencil_mask(grp, 0xFF); diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 574eb245d1b..8af3e6c7859 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -258,34 +258,36 @@ void DRW_shader_free(struct GPUShader *shader); typedef enum { DRW_STATE_WRITE_DEPTH = (1 << 0), DRW_STATE_WRITE_COLOR = (1 << 1), - DRW_STATE_DEPTH_LESS = (1 << 2), - DRW_STATE_DEPTH_EQUAL = (1 << 3), - DRW_STATE_DEPTH_GREATER = (1 << 4), - DRW_STATE_DEPTH_ALWAYS = (1 << 5), - DRW_STATE_CULL_BACK = (1 << 6), - DRW_STATE_CULL_FRONT = (1 << 7), - DRW_STATE_WIRE = (1 << 8), -// DRW_STATE_WIRE_LARGE = (1 << 9), /* Removed from ogl in 3.0 */ - DRW_STATE_POINT = (1 << 10), - DRW_STATE_STIPPLE_2 = (1 << 11), - DRW_STATE_STIPPLE_3 = (1 << 12), - DRW_STATE_STIPPLE_4 = (1 << 13), - DRW_STATE_BLEND = (1 << 14), - DRW_STATE_ADDITIVE = (1 << 15), - DRW_STATE_MULTIPLY = (1 << 16), - DRW_STATE_TRANSMISSION = (1 << 17), - DRW_STATE_CLIP_PLANES = (1 << 18), - DRW_STATE_ADDITIVE_FULL = (1 << 19), /* Same as DRW_STATE_ADDITIVE but let alpha accumulate without premult. */ - DRW_STATE_BLEND_PREMUL = (1 << 20), /* Use that if color is already premult by alpha. */ - DRW_STATE_WIRE_SMOOTH = (1 << 21), - DRW_STATE_TRANS_FEEDBACK = (1 << 22), + DRW_STATE_DEPTH_ALWAYS = (1 << 2), + DRW_STATE_DEPTH_LESS = (1 << 3), + DRW_STATE_DEPTH_LESS_EQUAL = (1 << 4), + DRW_STATE_DEPTH_EQUAL = (1 << 5), + DRW_STATE_DEPTH_GREATER = (1 << 6), + DRW_STATE_DEPTH_GREATER_EQUAL = (1 << 7), + DRW_STATE_CULL_BACK = (1 << 8), + DRW_STATE_CULL_FRONT = (1 << 9), + DRW_STATE_WIRE = (1 << 10), + DRW_STATE_POINT = (1 << 11), + DRW_STATE_STIPPLE_2 = (1 << 12), + DRW_STATE_STIPPLE_3 = (1 << 13), + DRW_STATE_STIPPLE_4 = (1 << 14), + DRW_STATE_BLEND = (1 << 15), + DRW_STATE_ADDITIVE = (1 << 16), + DRW_STATE_MULTIPLY = (1 << 17), + DRW_STATE_TRANSMISSION = (1 << 18), + DRW_STATE_CLIP_PLANES = (1 << 19), + DRW_STATE_ADDITIVE_FULL = (1 << 20), /* Same as DRW_STATE_ADDITIVE but let alpha accumulate without premult. */ + DRW_STATE_BLEND_PREMUL = (1 << 21), /* Use that if color is already premult by alpha. */ + DRW_STATE_WIRE_SMOOTH = (1 << 22), + DRW_STATE_TRANS_FEEDBACK = (1 << 23), DRW_STATE_WRITE_STENCIL = (1 << 27), - DRW_STATE_WRITE_STENCIL_SHADOW = (1 << 28), - DRW_STATE_STENCIL_EQUAL = (1 << 29), - DRW_STATE_STENCIL_NEQUAL = (1 << 30), + DRW_STATE_WRITE_STENCIL_SHADOW_PASS = (1 << 28), + DRW_STATE_WRITE_STENCIL_SHADOW_FAIL = (1 << 29), + DRW_STATE_STENCIL_EQUAL = (1 << 30), + DRW_STATE_STENCIL_NEQUAL = (1 << 31), } DRWState; -#define DRW_STATE_DEFAULT (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS) +#define DRW_STATE_DEFAULT (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL) typedef enum { DRW_ATTRIB_INT, diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index eab79eb16ad..95256a2b1c8 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -330,7 +330,7 @@ void DRW_transform_to_display(GPUTexture *tex) void DRW_multisamples_resolve(GPUTexture *src_depth, GPUTexture *src_color) { drw_state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_PREMUL | - DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); int samples = GPU_texture_samples(src_depth); @@ -1695,7 +1695,7 @@ void DRW_draw_select_loop( DRW_state_lock( DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_ALWAYS | - DRW_STATE_DEPTH_LESS | + DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_DEPTH_EQUAL | DRW_STATE_DEPTH_GREATER | DRW_STATE_DEPTH_ALWAYS); diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 75754aed3a3..9f4adac0106 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -105,10 +105,13 @@ void drw_state_set(DRWState state) /* Raster Discard */ { if (CHANGED_ANY(DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | - DRW_STATE_WRITE_STENCIL | DRW_STATE_WRITE_STENCIL_SHADOW)) + DRW_STATE_WRITE_STENCIL | + DRW_STATE_WRITE_STENCIL_SHADOW_PASS | + DRW_STATE_WRITE_STENCIL_SHADOW_FAIL)) { if ((state & (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | - DRW_STATE_WRITE_STENCIL | DRW_STATE_WRITE_STENCIL_SHADOW)) != 0) + DRW_STATE_WRITE_STENCIL | DRW_STATE_WRITE_STENCIL_SHADOW_PASS | + DRW_STATE_WRITE_STENCIL_SHADOW_FAIL)) != 0) { glDisable(GL_RASTERIZER_DISCARD); } @@ -148,19 +151,26 @@ void drw_state_set(DRWState state) { DRWState test; if (CHANGED_ANY_STORE_VAR( - DRW_STATE_DEPTH_LESS | DRW_STATE_DEPTH_EQUAL | DRW_STATE_DEPTH_GREATER | DRW_STATE_DEPTH_ALWAYS, + DRW_STATE_DEPTH_LESS | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_DEPTH_EQUAL | + DRW_STATE_DEPTH_GREATER | DRW_STATE_DEPTH_GREATER_EQUAL | DRW_STATE_DEPTH_ALWAYS, test)) { if (test) { glEnable(GL_DEPTH_TEST); if (state & DRW_STATE_DEPTH_LESS) { + glDepthFunc(GL_LESS); + } + else if (state & DRW_STATE_DEPTH_LESS_EQUAL) { glDepthFunc(GL_LEQUAL); } else if (state & DRW_STATE_DEPTH_EQUAL) { glDepthFunc(GL_EQUAL); } else if (state & DRW_STATE_DEPTH_GREATER) { + glDepthFunc(GL_GREATER); + } + else if (state & DRW_STATE_DEPTH_GREATER_EQUAL) { glDepthFunc(GL_GEQUAL); } else if (state & DRW_STATE_DEPTH_ALWAYS) { @@ -299,7 +309,8 @@ void drw_state_set(DRWState state) DRWState test; if (CHANGED_ANY_STORE_VAR( DRW_STATE_WRITE_STENCIL | - DRW_STATE_WRITE_STENCIL_SHADOW | + DRW_STATE_WRITE_STENCIL_SHADOW_PASS | + DRW_STATE_WRITE_STENCIL_SHADOW_FAIL | DRW_STATE_STENCIL_EQUAL | DRW_STATE_STENCIL_NEQUAL, test)) @@ -311,11 +322,16 @@ void drw_state_set(DRWState state) glStencilMask(0xFF); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); } - else if ((state & DRW_STATE_WRITE_STENCIL_SHADOW) != 0) { + else if ((state & DRW_STATE_WRITE_STENCIL_SHADOW_PASS) != 0) { glStencilMask(0xFF); glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR_WRAP); glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR_WRAP); } + else if ((state & DRW_STATE_WRITE_STENCIL_SHADOW_FAIL) != 0) { + glStencilMask(0xFF); + glStencilOpSeparate(GL_BACK, GL_KEEP, GL_INCR_WRAP, GL_KEEP); + glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_DECR_WRAP, GL_KEEP); + } /* Stencil Test */ else if ((state & (DRW_STATE_STENCIL_EQUAL | DRW_STATE_STENCIL_NEQUAL)) != 0) { glStencilMask(0x00); /* disable write */ diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c index 7992bc73f2d..285e703afbf 100644 --- a/source/blender/draw/modes/edit_armature_mode.c +++ b/source/blender/draw/modes/edit_armature_mode.c @@ -77,25 +77,25 @@ static void EDIT_ARMATURE_cache_init(void *vedata) { /* Solid bones */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; psl->bone_solid = DRW_pass_create("Bone Solid Pass", state); } { /* Bones Outline */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; psl->bone_outline = DRW_pass_create("Bone Outline Pass", state); } { /* Wire bones */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND; psl->bone_wire = DRW_pass_create("Bone Wire Pass", state); } { /* distance outline around envelope bones */ - DRWState state = DRW_STATE_ADDITIVE | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_FRONT; + DRWState state = DRW_STATE_ADDITIVE | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_FRONT; psl->bone_envelope = DRW_pass_create("Bone Envelope Outline Pass", state); } @@ -107,7 +107,7 @@ static void EDIT_ARMATURE_cache_init(void *vedata) { /* Non Meshes Pass (Camera, empties, lamps ...) */ DRWState state = - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND | DRW_STATE_WIRE; psl->relationship = DRW_pass_create("Bone Relationship Pass", state); } diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c index bf3120882ea..8e70de5dd9f 100644 --- a/source/blender/draw/modes/edit_curve_mode.c +++ b/source/blender/draw/modes/edit_curve_mode.c @@ -196,7 +196,7 @@ static void EDIT_CURVE_cache_init(void *vedata) /* Center-Line (wire) */ psl->wire_pass = DRW_pass_create( "Curve Wire", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE); grp = DRW_shgroup_create(e_data.wire_sh, psl->wire_pass); DRW_shgroup_uniform_vec4(grp, "color", ts.colorWireEdit, 1); diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c index bcd3fa39be4..77e648f1717 100644 --- a/source/blender/draw/modes/edit_lattice_mode.c +++ b/source/blender/draw/modes/edit_lattice_mode.c @@ -172,7 +172,7 @@ static void EDIT_LATTICE_cache_init(void *vedata) { psl->wire_pass = DRW_pass_create( "Lattice Wire", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE); stl->g_data->wire_shgrp = DRW_shgroup_create(e_data.wire_sh, psl->wire_pass); psl->vert_pass = DRW_pass_create( diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index cf5d36bded6..f6e0267c25e 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -341,7 +341,7 @@ static void EDIT_MESH_cache_init(void *vedata) { psl->vcolor_faces = DRW_pass_create( "Vert Color Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); stl->g_data->fvcolor_shgrp = DRW_shgroup_create(e_data.vcolor_face_shader, psl->vcolor_faces); @@ -357,7 +357,7 @@ static void EDIT_MESH_cache_init(void *vedata) /* Complementary Depth Pass */ psl->depth_hidden_wire = DRW_pass_create( "Depth Pass Hidden Wire", - DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK); + DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK); stl->g_data->depth_shgrp_hidden_wire = DRW_shgroup_create(e_data.depth_sh, psl->depth_hidden_wire); } @@ -365,7 +365,7 @@ static void EDIT_MESH_cache_init(void *vedata) /* Normals */ psl->normals = DRW_pass_create( "Edit Mesh Normals Pass", - DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL); stl->g_data->fnormals_shgrp = DRW_shgroup_create(e_data.normals_face_sh, psl->normals); DRW_shgroup_uniform_float(stl->g_data->fnormals_shgrp, "normalSize", &size_normal, 1); @@ -382,14 +382,14 @@ static void EDIT_MESH_cache_init(void *vedata) if (!do_zbufclip) { psl->edit_face_overlay = edit_mesh_create_overlay_pass( - &face_mod, DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_DEPTH | DRW_STATE_BLEND, + &face_mod, DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WRITE_DEPTH | DRW_STATE_BLEND, &stl->g_data->face_overlay_shgrp, &stl->g_data->ledges_overlay_shgrp, &stl->g_data->lverts_overlay_shgrp, &stl->g_data->facedot_overlay_shgrp); } else { /* We render all wires with depth and opaque to a new fbo and blend the result based on depth values */ psl->edit_face_occluded = edit_mesh_create_overlay_pass( - &zero, DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_DEPTH, + &zero, DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WRITE_DEPTH, &stl->g_data->face_occluded_shgrp, &stl->g_data->ledges_occluded_shgrp, &stl->g_data->lverts_occluded_shgrp, &stl->g_data->facedot_occluded_shgrp); @@ -397,7 +397,7 @@ static void EDIT_MESH_cache_init(void *vedata) * faces are alpha blended ) so we recover them in a new pass. */ psl->facefill_occlude = DRW_pass_create( "Front Face Color", - DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND); + DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND); stl->g_data->facefill_occluded_shgrp = DRW_shgroup_create(e_data.overlay_facefill_sh, psl->facefill_occlude); DRW_shgroup_uniform_block(stl->g_data->facefill_occluded_shgrp, "globalsBlock", globals_ubo); diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c index aa848764fe3..8ac3cff2e1c 100644 --- a/source/blender/draw/modes/edit_metaball_mode.c +++ b/source/blender/draw/modes/edit_metaball_mode.c @@ -116,7 +116,7 @@ static void EDIT_METABALL_cache_init(void *vedata) { /* Create a pass */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND | DRW_STATE_WIRE; psl->pass = DRW_pass_create("My Pass", state); /* Create a shadingGroup using a function in draw_common.c or custom one */ diff --git a/source/blender/draw/modes/edit_surface_mode.c b/source/blender/draw/modes/edit_surface_mode.c index 5059dca2bff..b5cbb1baa55 100644 --- a/source/blender/draw/modes/edit_surface_mode.c +++ b/source/blender/draw/modes/edit_surface_mode.c @@ -149,7 +149,7 @@ static void EDIT_SURFACE_cache_init(void *vedata) { /* Create a pass */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND | DRW_STATE_WIRE; psl->pass = DRW_pass_create("My Pass", state); /* Create a shadingGroup using a function in draw_common.c or custom one */ diff --git a/source/blender/draw/modes/edit_text_mode.c b/source/blender/draw/modes/edit_text_mode.c index 8070c314c54..5750dc8a0b9 100644 --- a/source/blender/draw/modes/edit_text_mode.c +++ b/source/blender/draw/modes/edit_text_mode.c @@ -169,7 +169,7 @@ static void EDIT_TEXT_cache_init(void *vedata) /* Text outline (fast drawing!) */ psl->wire_pass = DRW_pass_create( "Font Wire", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE); stl->g_data->wire_shgrp = DRW_shgroup_create(e_data.wire_sh, psl->wire_pass); psl->overlay_select_pass = DRW_pass_create( diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 97dc7726510..58cdfd4e413 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -856,7 +856,7 @@ static void OBJECT_cache_init(void *vedata) g_data = stl->g_data; { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE; psl->outlines = DRW_pass_create("Outlines Depth Pass", state); GPUShader *sh = e_data.outline_prepass_sh; @@ -876,7 +876,7 @@ static void OBJECT_cache_init(void *vedata) } { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; DRWPass *pass = psl->lightprobes = DRW_pass_create("Object Probe Pass", state); struct Gwn_Batch *sphere = DRW_cache_sphere_get(); struct Gwn_Batch *quad = DRW_cache_quad_get(); @@ -987,25 +987,25 @@ static void OBJECT_cache_init(void *vedata) { /* Solid bones */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; psl->bone_solid = DRW_pass_create("Bone Solid Pass", state); psl->bone_outline = DRW_pass_create("Bone Outline Pass", state); } { /* Wire bones */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND; psl->bone_wire = DRW_pass_create("Bone Wire Pass", state); } { /* distance outline around envelope bones */ - DRWState state = DRW_STATE_ADDITIVE | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_FRONT; + DRWState state = DRW_STATE_ADDITIVE | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_FRONT; psl->bone_envelope = DRW_pass_create("Bone Envelope Outline Pass", state); } { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE; psl->bone_axes = DRW_pass_create("Bone Axes Pass", state); } @@ -1015,7 +1015,7 @@ static void OBJECT_cache_init(void *vedata) DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | - DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND | DRW_STATE_POINT; + DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND | DRW_STATE_POINT; state |= DRW_STATE_WIRE; psl->non_meshes = DRW_pass_create("Non Meshes Pass", state); @@ -1257,7 +1257,7 @@ static void OBJECT_cache_init(void *vedata) /* Particle Pass */ psl->particle = DRW_pass_create( "Particle Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_POINT | DRW_STATE_BLEND); } @@ -1265,7 +1265,7 @@ static void OBJECT_cache_init(void *vedata) /* Empty/Background Image Pass */ psl->reference_image = DRW_pass_create( "Refrence Image Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND); } } diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c index 9c83a87018f..1d7f686a51c 100644 --- a/source/blender/draw/modes/paint_texture_mode.c +++ b/source/blender/draw/modes/paint_texture_mode.c @@ -194,7 +194,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) { /* Create a pass */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_MULTIPLY | DRW_STATE_WIRE; psl->image_faces = DRW_pass_create("Image Color Pass", state); @@ -255,7 +255,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) { psl->wire_overlay = DRW_pass_create( "Wire Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); stl->g_data->lwire_shgrp = DRW_shgroup_create(e_data.wire_overlay_shader, psl->wire_overlay); } @@ -263,7 +263,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) { psl->face_overlay = DRW_pass_create( "Face Mask Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND); stl->g_data->face_shgrp = DRW_shgroup_create(e_data.face_overlay_shader, psl->face_overlay); diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c index 7efa13f1312..d335e0a4d70 100644 --- a/source/blender/draw/modes/paint_vertex_mode.c +++ b/source/blender/draw/modes/paint_vertex_mode.c @@ -111,7 +111,7 @@ static void PAINT_VERTEX_cache_init(void *vedata) /* Create a pass */ psl->vcolor_faces = DRW_pass_create( "Vert Color Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_MULTIPLY); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_MULTIPLY); stl->g_data->fvcolor_shgrp = DRW_shgroup_create(e_data.vcolor_face_shader, psl->vcolor_faces); } @@ -119,7 +119,7 @@ static void PAINT_VERTEX_cache_init(void *vedata) { psl->wire_overlay = DRW_pass_create( "Wire Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); stl->g_data->lwire_shgrp = DRW_shgroup_create(e_data.wire_overlay_shader, psl->wire_overlay); } @@ -127,7 +127,7 @@ static void PAINT_VERTEX_cache_init(void *vedata) { psl->face_overlay = DRW_pass_create( "Face Mask Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND); stl->g_data->face_shgrp = DRW_shgroup_create(e_data.face_overlay_shader, psl->face_overlay); diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c index d7ad3e93af7..13ef42d8622 100644 --- a/source/blender/draw/modes/paint_weight_mode.c +++ b/source/blender/draw/modes/paint_weight_mode.c @@ -133,7 +133,7 @@ static void PAINT_WEIGHT_cache_init(void *vedata) /* Create a pass */ psl->weight_faces = DRW_pass_create( "Weight Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_MULTIPLY); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_MULTIPLY); stl->g_data->fweights_shgrp = DRW_shgroup_create(e_data.weight_face_shader, psl->weight_faces); @@ -148,7 +148,7 @@ static void PAINT_WEIGHT_cache_init(void *vedata) { psl->wire_overlay = DRW_pass_create( "Wire Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); stl->g_data->lwire_shgrp = DRW_shgroup_create(e_data.wire_overlay_shader, psl->wire_overlay); } @@ -156,7 +156,7 @@ static void PAINT_WEIGHT_cache_init(void *vedata) { psl->face_overlay = DRW_pass_create( "Face Mask Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND); stl->g_data->face_shgrp = DRW_shgroup_create(e_data.face_overlay_shader, psl->face_overlay); @@ -167,7 +167,7 @@ static void PAINT_WEIGHT_cache_init(void *vedata) { psl->vert_overlay = DRW_pass_create( "Vert Mask Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL); stl->g_data->vert_shgrp = DRW_shgroup_create(e_data.vert_overlay_shader, psl->vert_overlay); } diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c index fe82e894495..dacd4b72834 100644 --- a/source/blender/draw/modes/particle_mode.c +++ b/source/blender/draw/modes/particle_mode.c @@ -120,7 +120,7 @@ static void particle_cache_init(void *vedata) psl->psys_edit_pass = DRW_pass_create("PSys Edit Pass", (DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | - DRW_STATE_DEPTH_LESS | + DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE | DRW_STATE_POINT)); diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c index 464c56f4761..f18402b88f9 100644 --- a/source/blender/draw/modes/pose_mode.c +++ b/source/blender/draw/modes/pose_mode.c @@ -113,25 +113,25 @@ static void POSE_cache_init(void *vedata) { /* Solid bones */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_BACK; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK; psl->bone_solid = DRW_pass_create("Bone Solid Pass", state); } { /* Bones Outline */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; psl->bone_outline = DRW_pass_create("Bone Outline Pass", state); } { /* Wire bones */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND; psl->bone_wire = DRW_pass_create("Bone Wire Pass", state); } { /* distance outline around envelope bones */ - DRWState state = DRW_STATE_ADDITIVE | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS | DRW_STATE_CULL_FRONT; + DRWState state = DRW_STATE_ADDITIVE | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_FRONT; psl->bone_envelope = DRW_pass_create("Bone Envelope Outline Pass", state); } @@ -143,7 +143,7 @@ static void POSE_cache_init(void *vedata) { /* Non Meshes Pass (Camera, empties, lamps ...) */ DRWState state = - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND | DRW_STATE_WIRE; psl->relationship = DRW_pass_create("Bone Relationship Pass", state); } |