optionally disable emission to vanilla depth
This commit is contained in:
@@ -130,11 +130,13 @@ public class IrisVoxyRenderPipeline extends AbstractRenderPipeline {
|
||||
|
||||
@Override
|
||||
protected void finish(Viewport<?> viewport, int sourceFrameBuffer) {
|
||||
glColorMask(false, false, false, false);
|
||||
AbstractRenderPipeline.transformBlitDepth(this.depthBlit,
|
||||
this.fbTranslucent.getDepthTex().id, sourceFrameBuffer,
|
||||
viewport, new Matrix4f(viewport.vanillaProjection).mul(viewport.modelView));
|
||||
glColorMask(true, true, true, true);
|
||||
if (this.data.renderToVanillaDepth) {
|
||||
glColorMask(false, false, false, false);
|
||||
AbstractRenderPipeline.transformBlitDepth(this.depthBlit,
|
||||
this.fbTranslucent.getDepthTex().id, sourceFrameBuffer,
|
||||
viewport, new Matrix4f(viewport.vanillaProjection).mul(viewport.modelView));
|
||||
glColorMask(true, true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ public class IrisShaderPatch {
|
||||
|
||||
public static final boolean IMPERSONATE_DISTANT_HORIZONS = System.getProperty("voxy.impersonateDHShader", "false").equalsIgnoreCase("true");
|
||||
|
||||
|
||||
private static final class SSBODeserializer implements JsonDeserializer<Int2ObjectOpenHashMap<String>> {
|
||||
@Override
|
||||
public Int2ObjectOpenHashMap<String> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
@@ -116,7 +117,7 @@ public class IrisShaderPatch {
|
||||
public Int2ObjectOpenHashMap<String> ssbos;
|
||||
@JsonAdapter(BlendStateDeserializer.class)
|
||||
public Int2ObjectOpenHashMap<BlendState> blending;
|
||||
|
||||
public boolean excludeLodsFromVanillaDepth;
|
||||
public boolean checkValid() {
|
||||
return this.opaqueDrawBuffers != null && this.translucentDrawBuffers != null && this.uniforms != null && this.opaquePatchData != null;
|
||||
}
|
||||
@@ -163,6 +164,10 @@ public class IrisShaderPatch {
|
||||
return this.patchData.translucentDrawBuffers;
|
||||
}
|
||||
|
||||
public boolean emitToVanillaDepth() {
|
||||
return !this.patchData.excludeLodsFromVanillaDepth;
|
||||
}
|
||||
|
||||
public Runnable createBlendSetup() {
|
||||
if (this.patchData.blending == null || this.patchData.blending.isEmpty()) {
|
||||
return ()->{};//No blending change
|
||||
|
||||
@@ -46,6 +46,7 @@ public class IrisVoxyRenderPipelineData {
|
||||
private final Runnable blendingSetup;
|
||||
private final ImageSet imageSet;
|
||||
private final SSBOSet ssboSet;
|
||||
public final boolean renderToVanillaDepth;
|
||||
private IrisVoxyRenderPipelineData(IrisShaderPatch patch, int[] opaqueDrawTargets, int[] translucentDrawTargets, StructLayout uniformSet, Runnable blendingSetup, ImageSet imageSet, SSBOSet ssboSet) {
|
||||
this.opaqueDrawTargets = opaqueDrawTargets;
|
||||
this.translucentDrawTargets = translucentDrawTargets;
|
||||
@@ -55,6 +56,7 @@ public class IrisVoxyRenderPipelineData {
|
||||
this.blendingSetup = blendingSetup;
|
||||
this.imageSet = imageSet;
|
||||
this.ssboSet = ssboSet;
|
||||
this.renderToVanillaDepth = patch.emitToVanillaDepth();
|
||||
}
|
||||
|
||||
public SSBOSet getSsboSet() {
|
||||
|
||||
Reference in New Issue
Block a user