This commit is contained in:
2025-02-07 17:04:43 -06:00
parent 33fd7ddf72
commit 8eec81c7f4
2249 changed files with 75331 additions and 685 deletions

View File

@@ -0,0 +1,36 @@
// [COMBO] {"material":"ui_editor_properties_fog","combo":"FOG","default":1}
#include "common_fragment.h"
#include "common_fog.h"
uniform sampler2D g_Texture0; // {"material":"ui_editor_properties_albedo","default":"util/white"}
uniform float g_Overbright; // {"material":"ui_editor_properties_overbright","default":1.0,"range":[0,5]}
varying vec2 v_TexCoord;
varying vec4 v_Color;
#if FOG_DIST || FOG_HEIGHT
varying vec4 v_ViewDir;
#endif
void main() {
vec4 color = v_Color * ConvertTexture0Format(texSample2D(g_Texture0, v_TexCoord.xy));
color.rgb *= g_Overbright;
#if FOG_HEIGHT || FOG_DIST
vec2 fogPixelState = CalculateFogPixelState(length(v_ViewDir.xyz), v_ViewDir.w);
color.rgb = ApplyFog(color.rgb, fogPixelState);
color.a = ApplyFogAlpha(color.a, fogPixelState);
#endif
gl_FragColor = color;
#if ALPHATOCOVERAGE
gl_FragColor.a = (gl_FragColor.a - 0.5) / max(fwidth(gl_FragColor.a), 0.0001) + 0.5;
#if GLSL
if (gl_FragColor.a < 0.5) discard;
#endif
#endif
}