depressed-pho / natural-mystic-shaders

Shader pack for Minecraft Bedrock aliming to be as realistic as possible
Creative Commons Zero v1.0 Universal
30 stars 3 forks source link

Desaturate far objects #5

Closed depressed-pho closed 5 years ago

depressed-pho commented 5 years ago

The vanilla terrain shader is already doing this (or kind of):

diffuse.rgb = mix( diffuse.rgb, fogColor.rgb, fogColor.a );

but this isn't enough. It may sound easy to do, as all we need is the camera distance computed in the vertex shader and passed to the fragment shader. However, it's actually not possible (at least on Bedrock 1.8.0) because simply adding a new in/out variable to renderchunk makes the shader pack practically unloadable. The game somehow takes several tens of minutes to load the pack, and even defining FOG unconditionally triggers the same issue. I have no idea what's going on.

See: https://blenderartists.org/t/help-me-write-a-pixel-shader-desaturate-based-on-distance/474031

depressed-pho commented 5 years ago

https://bugs.mojang.com/browse/MCPE-40059