/
z-skin-out.txt
82 lines (81 loc) · 2.23 KB
/
z-skin-out.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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 {
vec4 pos;
vec4 uv;
vec2 offs;
};
#line 6
uniform sampler2D _MainTex;
uniform sampler2D _SssStretch;
uniform vec4 _SssStretch_AddMul;
#line 17
#line 17
vec4 xlat_main( in v2f_withBlurCoords i ) {
vec2 uv = i.uv.xy;
#line 21
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;
vec2 stretch = ((texture2D( _SssStretch, uv).xy * _SssStretch_AddMul.yy) + _SssStretch_AddMul.xx);
vec2 netFilterWidth = (stretch * i.offs);
vec2 coords = (uv - (netFilterWidth * 3.0));
#line 25
vec4 sum = vec4( 0.0);
float weightSum = 0.0;
int l = 0;
for ( ; (l < 7); (l++)) {
#line 30
vec4 tap = texture2D( _MainTex, coords);
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
vec4 center = texture2D( _MainTex, i.uv.xy);
sum.w = center.w;
return mix( center, sum, vec4( center.w));
}
varying vec4 xlv_TEXCOORD0;
varying vec2 xlv_TEXCOORD1;
void main() {
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:<none> type 25 arrsize 0
// _SssStretch:<none> type 25 arrsize 0
// _SssStretch_AddMul:<none> type 12 arrsize 0