TerraformersMC / Campanion

A camping companion mod that adds items and utilities to improve your life away from home
GNU Lesser General Public License v3.0
81 stars 31 forks source link

Some blocks don't render in the tent preview #167

Closed Wyn-Price closed 2 years ago

Wyn-Price commented 2 years ago

java_crGyyw4uOg

Wyn-Price commented 2 years ago

Block Entities also do not render

Wyn-Price commented 2 years ago

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 https://github.com/TerraformersMC/Campanion/blob/22856268935c64a53e8aca77e90d34f84b2c3435/src/main/java/com/terraformersmc/campanion/client/util/TentPreviewBufferBuilder.java#L16-L21

Cutout render code ```glsl 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 ```glsl 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

jhbuchanan45 commented 2 years ago

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