float xll_saturate_f( float x) { return clamp( x, 0.0, 1.0); } vec2 xll_saturate_vf2( vec2 x) { return clamp( x, 0.0, 1.0); } vec3 xll_saturate_vf3( vec3 x) { return clamp( x, 0.0, 1.0); } vec4 xll_saturate_vf4( vec4 x) { return clamp( x, 0.0, 1.0); } mat2 xll_saturate_mf2x2(mat2 m) { return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); } mat3 xll_saturate_mf3x3(mat3 m) { return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0)); } mat4 xll_saturate_mf4x4(mat4 m) { return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0)); } #line 11 struct v2f_withBlurCoords { highp vec4 pos; mediump vec4 uv; mediump vec2 offs; }; #line 6 uniform sampler2D _MainTex; uniform sampler2D _SssStretch; uniform highp vec4 _SssStretch_AddMul; #line 17 #line 17 highp vec4 xlat_main( in v2f_withBlurCoords i ) { highp vec2 uv = i.uv.xy; #line 21 highp float curve[7]; curve[0] = 0.006; curve[1] = 0.061; curve[2] = 0.242; curve[3] = 0.383; curve[4] = 0.242; curve[5] = 0.061; curve[6] = 0.006; highp vec2 stretch = ((texture2D( _SssStretch, uv).xy * _SssStretch_AddMul.yy) + _SssStretch_AddMul.xx); highp vec2 netFilterWidth = (stretch * i.offs); highp vec2 coords = (uv - (netFilterWidth * 3.0)); #line 25 highp vec4 sum = vec4( 0.0); highp float weightSum = 0.0; highp int l = 0; for ( ; (l < 7); (l++)) { #line 30 highp vec4 tap = texture2D( _MainTex, coords); highp float weight = ((2.0 * xll_saturate_f((tap.w - 0.5))) * curve[l]); sum += (tap * weight); weightSum += weight; #line 34 coords += netFilterWidth; } sum = clamp( (sum / (weightSum + 0.0001)), vec4( 0.0), vec4( 10.0)); #line 38 mediump vec4 center = texture2D( _MainTex, i.uv.xy); sum.w = center.w; return mix( center, sum, vec4( center.w)); } varying mediump vec4 xlv_TEXCOORD0; varying mediump vec2 xlv_TEXCOORD1; void main() { highp vec4 xl_retval; v2f_withBlurCoords xlt_i; xlt_i.pos = vec4(0.0); xlt_i.uv = vec4(xlv_TEXCOORD0); xlt_i.offs = vec2(xlv_TEXCOORD1); xl_retval = xlat_main( xlt_i); gl_FragData[0] = vec4(xl_retval); } // uniforms: // _MainTex: type 25 arrsize 0 // _SssStretch: type 25 arrsize 0 // _SssStretch_AddMul: type 12 arrsize 0