EnhancedBlockEntities icon indicating copy to clipboard operation
EnhancedBlockEntities copied to clipboard

Chest opening animation is black on canvas

Open supsm opened this issue 4 years ago • 3 comments

Happens on all pipelines that I have image

supsm avatar Mar 23 '21 16:03 supsm

Likely an issue with how Canvas applies material shaders, since the rendering of the chest lid directly emits quads to a vertex consumer. Will be looked into but is likely a fix Canvas has to implement.

FoundationGames avatar Apr 17 '21 20:04 FoundationGames

Is it possible to create a shader pipeline or something that changes this?

supsm avatar Apr 17 '21 20:04 supsm

This is an issue with AO. I don't have a full grasp of what is happening Java-side but on the shader-side the chest lid has an AO value of 0 or something close to 0.

Some facts:

  1. Canvas only computes AO for the terrain render context.
  2. When the AO isn't computed, it will be set to 255.
final int ao = aoData == null ? 255 : (Math.round(aoData[i] * 255));

If we go by those facts alone, perhaps the chest lid is rendered with terrain render context when it should be rendered with block entity render context. This is just a guess.

Despite this, the chest lid seems to be rendered against camera origin as opposed to render region origin like the terrain usual is.

If you want a shader side solution @supsm Lumi Lights already disabled vanilla AO for things rendered against camera origin (presumed to be entities). Similar fix can be applied to Canvas built in pipeline shader since the problem seems specific to Canvas but I'm not fully confident about the nature of this workaround.

spiralhalo avatar May 22 '21 07:05 spiralhalo