MCLegoMan / Perspective

Client-side features for Fabric and Quilt
GNU Lesser General Public License v3.0
3 stars 1 forks source link

Perspective shaders don't use transparency shader framebuffers. #9

Closed MCLegoMan closed 5 months ago

MCLegoMan commented 6 months ago

When Minecraft loads the transparency shader, it also sets several framebuffer variables that are used during the rendering process.

    this.translucentFramebuffer = postEffectProcessor.getSecondaryTarget("translucent");
    this.entityFramebuffer = postEffectProcessor.getSecondaryTarget("itemEntity");
    this.particlesFramebuffer = postEffectProcessor.getSecondaryTarget("particles");
    this.weatherFramebuffer = postEffectProcessor.getSecondaryTarget("weather");
    this.cloudsFramebuffer = postEffectProcessor.getSecondaryTarget("clouds");

These variables are used in RenderPhase, and WorldRenderer. Interestingly, the targets in RenderPhase are only executed when using Fabulous graphics.

As Perspective doesn't load these, it can't match the output of all transparency shaders.

This can be easily tested by modifying bradleyq's mc_vanilla_shaders to run through Perspective, without these framebuffers the water reflections aren't rendered. (I think you only need translucent for the reflections.)

Current Solutions:

  1. Store these framebuffers in Perspective, and load them alongside transparency shaders.
    • This is the preferred option, however I'm currently unsure of how to execute it.
  2. Disable Transparency Shaders, and load transparency shaders through Perspective.
    • Whilst this option would work, it's not preferred as I would rather layer super secret settings on top of the transparency shader.
MCLegoMan commented 6 months ago

I've managed to get solution 1 to work, however some of perspective's depth shaders don't overlap well with mc_vanilla_shaders (the shader linked above that I'm using as a test).

Some shaders, the sun and moon have a black boarder, other shaders just don't load when the hud is enabled. This doesn't happen when using fabulous without this shaderpack, so it could be how this shader in particular is made.

Interestingly, running mc_vanilla_shaders through perspective works fine on both fabulous and fast graphics settings, but not on fancy - the screen is black when the hud is enabled.

MCLegoMan commented 5 months ago

1.3.0 will fix this.