Maniphest T54958

Workbench Shadows: Feedback Loop Assert/Warning
Closed, Resolved

Assigned To
Jeroen Bakker (jbakker)
Authored By
Clément Foucault (fclem)
May 4 2018, 11:03 PM
Tags
  • Code Quest
Subscribers
Clément Foucault (fclem)

Description

There is in fact a feedback loop problem

		GPU_framebuffer_ensure_config(&fbl->composite_fb, {
			GPU_ATTACHMENT_TEXTURE(dtxl->depth),
			GPU_ATTACHMENT_TEXTURE(e_data.composite_buffer_tx),
		});
static void workbench_composite_uniforms(WORKBENCH_PrivateData *wpd, DRWShadingGroup *grp)
{
	DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
	DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &dtxl->depth);

You cannot read the depth buffer and test the stencil buffer in the same pass, it's undefined behaviour : https://stackoverflow.com/questions/36782796/read-depth-values-while-stencil-testingsame-texture

So a few workaround possible:

  • Apply shadow in MULTIPLY mode in a separate pass. (not the best, performance wise).
  • Split the composite shader to not use the depth buffer (that should be simple since it's only used to handle the background).

So I would suggest the 2nd option.

Related Objects

StatusSubtypeAssignedTask
ResolvedTO DOJeroen Bakker (jbakker)
ResolvedJeroen Bakker (jbakker)

Event Timeline

Clément Foucault (fclem) lowered the priority of this task from 90 to High.May 4 2018, 11:03 PM
Clément Foucault (fclem) created this task.
Jeroen Bakker (jbakker) added a comment.May 5 2018, 2:27 PM

Ok will do this next week

Jeroen Bakker (jbakker) added a parent task: T54907: Workbench (parent task).May 8 2018, 8:35 PM
Jeroen Bakker (jbakker) raised the priority of this task from High to 90.May 9 2018, 9:56 AM
Jeroen Bakker (jbakker) moved this task from Tasks to Reviewing on the Code Quest board.
Dalai Felinto (dfelinto) lowered the priority of this task from 90 to Normal.May 14 2018, 10:00 AM
Dalai Felinto (dfelinto) moved this task from Reviewing to Done on the Code Quest board.
Dalai Felinto (dfelinto) changed the task status from Unknown Status to Resolved.May 14 2018, 10:21 AM