bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-inES.txt
Branimir Karadzic dee3fe5266 Initial commit.
2012-04-03 20:30:07 -07:00

21 lines
637 B
Text

float xll_saturate(float x) {
return clamp(x, 0.0, 1.0);
}
vec3 xll_saturate(vec3 x) {
return clamp(x, 0.0, 1.0);
}
uniform sampler2D _MainTex;
uniform sampler2D _BurntTex;
uniform mediump float _EmberFadeEnd;
uniform mediump float _EmberFadeStart;
lowp vec4 frag (mediump vec2 uv) {
lowp vec3 base = texture2D(_MainTex, uv).xyz;
lowp vec3 burn = texture2D(_BurntTex, uv).xyz;
lowp float t;
t = xll_saturate( ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)) );
return vec4(mix(base, burn, vec3(t)), 1.0);
}
varying mediump vec2 xlv_TEXCOORD0;
void main() {
gl_FragColor = frag(xlv_TEXCOORD0);
}