mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
22 lines
638 B
Text
22 lines
638 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 vec3 t;
|
||
|
t = vec3( xll_saturate( ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)) ) );
|
||
|
return vec4(mix(base, burn, t), 1.0);
|
||
|
}
|
||
|
varying mediump vec2 xlv_TEXCOORD0;
|
||
|
void main() {
|
||
|
gl_FragColor = frag(xlv_TEXCOORD0);
|
||
|
}
|