mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
DRW: Fix background image display
This make the workbench draw everything in the background routine just like eevee. This is because the workbench uses floating point buffers too and rendering background to this buffer makes it incorrect without proper color management. This could be improved because in xray the background is not blended but dithered as it's drawn after the main pass.
This commit is contained in:
parent
bb639ccc47
commit
6489243332
5 changed files with 5 additions and 14 deletions
|
|
@ -65,11 +65,6 @@ static void workbench_solid_draw_background(void *vedata)
|
|||
{
|
||||
WORKBENCH_Data *data = vedata;
|
||||
workbench_deferred_draw_background(data);
|
||||
}
|
||||
|
||||
static void workbench_solid_draw_scene(void *vedata)
|
||||
{
|
||||
WORKBENCH_Data *data = vedata;
|
||||
workbench_deferred_draw_scene(data);
|
||||
workbench_deferred_draw_finish(data);
|
||||
}
|
||||
|
|
@ -113,7 +108,7 @@ DrawEngineType draw_engine_workbench_solid = {
|
|||
&workbench_solid_cache_populate,
|
||||
&workbench_solid_cache_finish,
|
||||
&workbench_solid_draw_background,
|
||||
&workbench_solid_draw_scene,
|
||||
NULL,
|
||||
&workbench_solid_view_update,
|
||||
&workbench_solid_id_update,
|
||||
&workbench_render_to_image,
|
||||
|
|
|
|||
|
|
@ -63,11 +63,6 @@ static void workbench_transparent_draw_background(void *vedata)
|
|||
{
|
||||
WORKBENCH_Data *data = vedata;
|
||||
workbench_forward_draw_background(data);
|
||||
}
|
||||
|
||||
static void workbench_transparent_draw_scene(void *vedata)
|
||||
{
|
||||
WORKBENCH_Data *data = vedata;
|
||||
workbench_forward_draw_scene(data);
|
||||
workbench_forward_draw_finish(data);
|
||||
}
|
||||
|
|
@ -95,7 +90,7 @@ DrawEngineType draw_engine_workbench_transparent = {
|
|||
&workbench_transparent_cache_populate,
|
||||
&workbench_transparent_cache_finish,
|
||||
&workbench_transparent_draw_background,
|
||||
&workbench_transparent_draw_scene,
|
||||
NULL,
|
||||
&workbench_transparent_view_update,
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -1458,10 +1458,10 @@ void DRW_draw_render_loop_ex(
|
|||
}
|
||||
|
||||
if (do_bg_image) {
|
||||
GPU_framebuffer_bind(DST.default_framebuffer);
|
||||
ED_view3d_draw_bgpic_test(scene, depsgraph, ar, v3d, false, true);
|
||||
}
|
||||
|
||||
|
||||
DRW_draw_callbacks_pre_scene();
|
||||
if (DST.draw_ctx.evil_C) {
|
||||
ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.ar, REGION_DRAW_PRE_VIEW);
|
||||
|
|
|
|||
|
|
@ -679,7 +679,7 @@ static void view3d_draw_bgpic(Scene *scene, Depsgraph *depsgraph,
|
|||
ibuf = ibuf->mipmap[mip - 1];
|
||||
}
|
||||
|
||||
GPU_depth_test(false);
|
||||
GPU_depth_test(!do_foreground);
|
||||
glDepthMask(GL_FALSE);
|
||||
|
||||
GPU_blend(true);
|
||||
|
|
|
|||
|
|
@ -9,5 +9,6 @@ out vec2 texCoord_interp;
|
|||
void main()
|
||||
{
|
||||
gl_Position = ModelViewProjectionMatrix * vec4(pos.xy, 0.0f, 1.0f);
|
||||
gl_Position.z = 1.0;
|
||||
texCoord_interp = texCoord;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue