optionally disable emission to vanilla depth

This commit is contained in:
mcrcortex
2025-09-02 03:00:06 +10:00
parent 35f93122e5
commit 920d7db5f6
3 changed files with 15 additions and 6 deletions

View File

@@ -130,12 +130,14 @@ public class IrisVoxyRenderPipeline extends AbstractRenderPipeline {
@Override @Override
protected void finish(Viewport<?> viewport, int sourceFrameBuffer) { protected void finish(Viewport<?> viewport, int sourceFrameBuffer) {
if (this.data.renderToVanillaDepth) {
glColorMask(false, false, false, false); glColorMask(false, false, false, false);
AbstractRenderPipeline.transformBlitDepth(this.depthBlit, AbstractRenderPipeline.transformBlitDepth(this.depthBlit,
this.fbTranslucent.getDepthTex().id, sourceFrameBuffer, this.fbTranslucent.getDepthTex().id, sourceFrameBuffer,
viewport, new Matrix4f(viewport.vanillaProjection).mul(viewport.modelView)); viewport, new Matrix4f(viewport.vanillaProjection).mul(viewport.modelView));
glColorMask(true, true, true, true); glColorMask(true, true, true, true);
} }
}
private void doBindings() { private void doBindings() {

View File

@@ -23,6 +23,7 @@ public class IrisShaderPatch {
public static final boolean IMPERSONATE_DISTANT_HORIZONS = System.getProperty("voxy.impersonateDHShader", "false").equalsIgnoreCase("true"); public static final boolean IMPERSONATE_DISTANT_HORIZONS = System.getProperty("voxy.impersonateDHShader", "false").equalsIgnoreCase("true");
private static final class SSBODeserializer implements JsonDeserializer<Int2ObjectOpenHashMap<String>> { private static final class SSBODeserializer implements JsonDeserializer<Int2ObjectOpenHashMap<String>> {
@Override @Override
public Int2ObjectOpenHashMap<String> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { public Int2ObjectOpenHashMap<String> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
@@ -116,7 +117,7 @@ public class IrisShaderPatch {
public Int2ObjectOpenHashMap<String> ssbos; public Int2ObjectOpenHashMap<String> ssbos;
@JsonAdapter(BlendStateDeserializer.class) @JsonAdapter(BlendStateDeserializer.class)
public Int2ObjectOpenHashMap<BlendState> blending; public Int2ObjectOpenHashMap<BlendState> blending;
public boolean excludeLodsFromVanillaDepth;
public boolean checkValid() { public boolean checkValid() {
return this.opaqueDrawBuffers != null && this.translucentDrawBuffers != null && this.uniforms != null && this.opaquePatchData != null; return this.opaqueDrawBuffers != null && this.translucentDrawBuffers != null && this.uniforms != null && this.opaquePatchData != null;
} }
@@ -163,6 +164,10 @@ public class IrisShaderPatch {
return this.patchData.translucentDrawBuffers; return this.patchData.translucentDrawBuffers;
} }
public boolean emitToVanillaDepth() {
return !this.patchData.excludeLodsFromVanillaDepth;
}
public Runnable createBlendSetup() { public Runnable createBlendSetup() {
if (this.patchData.blending == null || this.patchData.blending.isEmpty()) { if (this.patchData.blending == null || this.patchData.blending.isEmpty()) {
return ()->{};//No blending change return ()->{};//No blending change

View File

@@ -46,6 +46,7 @@ public class IrisVoxyRenderPipelineData {
private final Runnable blendingSetup; private final Runnable blendingSetup;
private final ImageSet imageSet; private final ImageSet imageSet;
private final SSBOSet ssboSet; private final SSBOSet ssboSet;
public final boolean renderToVanillaDepth;
private IrisVoxyRenderPipelineData(IrisShaderPatch patch, int[] opaqueDrawTargets, int[] translucentDrawTargets, StructLayout uniformSet, Runnable blendingSetup, ImageSet imageSet, SSBOSet ssboSet) { private IrisVoxyRenderPipelineData(IrisShaderPatch patch, int[] opaqueDrawTargets, int[] translucentDrawTargets, StructLayout uniformSet, Runnable blendingSetup, ImageSet imageSet, SSBOSet ssboSet) {
this.opaqueDrawTargets = opaqueDrawTargets; this.opaqueDrawTargets = opaqueDrawTargets;
this.translucentDrawTargets = translucentDrawTargets; this.translucentDrawTargets = translucentDrawTargets;
@@ -55,6 +56,7 @@ public class IrisVoxyRenderPipelineData {
this.blendingSetup = blendingSetup; this.blendingSetup = blendingSetup;
this.imageSet = imageSet; this.imageSet = imageSet;
this.ssboSet = ssboSet; this.ssboSet = ssboSet;
this.renderToVanillaDepth = patch.emitToVanillaDepth();
} }
public SSBOSet getSsboSet() { public SSBOSet getSsboSet() {