Campanion

Campanion

2M Downloads

Some blocks don't render in the tent preview

Wyn-Price opened this issue ยท 3 comments

commented

java_crGyyw4uOg

commented

Block Entities also do not render

commented

Issue arises from the cutoff alpha value for cutout being 0.1, and cutout_mipped being 0.5.

We pass a value of 0.5, meaning the fragment gets discarded only on cutout_mipped

public void setApplyModifier(boolean applyModifier) {
this.r = applyModifier ? 1F : 1F;
this.g = applyModifier ? 0.1F : 1F;
this.b = applyModifier ? 0.1F : 1F;
this.a = 0.5F;
}

Cutout render code
void main() {
    vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
    if (color.a < 0.1) {
        discard;
    }
    fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
}
Cutout Mipped render code
void main() {
    vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
    if (color.a < 0.5) {
        discard;
    }
    fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
}

We should not be calling these shaders to render translucent objects anyway. A simple fix for this would be to force a RenderType of translucent

commented

Nice find, I'll get on that and removing that mixin now!