34 lines
720 B
Plaintext
34 lines
720 B
Plaintext
#define u_fogStart (u_fogData.x)
|
|
#define u_fogEnd (u_fogData.y)
|
|
#define u_fogRange (u_fogData.z)
|
|
#define u_fogDisable (u_fogData.w)
|
|
|
|
void DoAlphaTest(float a, half2 u_alphaRef)
|
|
{
|
|
if(a < u_alphaRef.x || a >= u_alphaRef.y)
|
|
discard;
|
|
}
|
|
|
|
float4 main(
|
|
half4 v_color : COLOR0,
|
|
half2 v_tex0 : TEXCOORD0,
|
|
fixed v_fog : FOG,
|
|
uniform half4 u_fogColor,
|
|
uniform half2 u_alphaRef,
|
|
uniform float3 u_contrastAdd,
|
|
uniform float3 u_contrastMult,
|
|
uniform sampler2D tex0
|
|
) {
|
|
half4 dst = v_color*tex2D(tex0, half2(v_tex0.x, 1.0-v_tex0.y));
|
|
dst.rgb = lerp(u_fogColor.rgb, dst.rgb, v_fog);
|
|
DoAlphaTest(dst.a, u_alphaRef);
|
|
|
|
half4 color;
|
|
color.rgb = dst.rgb*u_contrastMult + u_contrastAdd;
|
|
color.a = 1.0f;
|
|
|
|
return color;
|
|
}
|
|
|
|
|