This commit is contained in:
Branimir Karadžić 2016-09-21 21:01:52 -07:00
Родитель 3640d30be2
Коммит 8cb4c671f1
66 изменённых файлов: 1126 добавлений и 974 удалений

7
3rdparty/glsl-optimizer/Changelog.md поставляемый
Просмотреть файл

@ -1,6 +1,13 @@
GLSL optimizer Change Log
=========================
2016 09
-------
* Metal: Fixed constant precision propagation in some cases.
* Metal: Fixed shadowmap sampling when reference Z value is outside of 0..1 range (now clamps to match GLES specs).
2016 06
-------

Просмотреть файл

@ -3046,6 +3046,11 @@ process_initializer(ir_variable *var, ast_declaration *decl,
if (type->qualifier.flags.q.constant) {
ir_constant *constant_value = rhs->constant_expression_value();
constant_value->set_precision((glsl_precision)type->qualifier.precision);
if (constant_value->type->is_array()) {
for (unsigned i = 0; i < constant_value->type->length; i++) {
constant_value->get_array_element(i)->set_precision((glsl_precision)type->qualifier.precision);
}
}
}
/* Calculate the constant value if this is a const or uniform

Просмотреть файл

@ -677,6 +677,20 @@ void ir_print_metal_visitor::visit(ir_variable *ir)
buffer.asprintf_append (" = ");
visit (ir->constant_value);
}
if ((ir->data.mode == ir_var_auto || ir->data.mode == ir_var_temporary) && (ir->type->matrix_columns == 1)) {
switch (ir->type->base_type) {
case GLSL_TYPE_INT:
case GLSL_TYPE_FLOAT:
buffer.asprintf_append (" = 0");
break;
case GLSL_TYPE_BOOL:
buffer.asprintf_append (" = false");
break;
default:
break;
}
}
}
@ -1110,9 +1124,10 @@ void ir_print_metal_visitor::visit(ir_expression *ir)
else if (op0cast)
{
print_cast (buffer, arg_prec, ir->operands[0]);
buffer.asprintf_append ("(");
}
ir->operands[0]->accept(this);
if (op0castTo1)
if (op0castTo1 || op0cast)
{
buffer.asprintf_append (")");
}
@ -1131,9 +1146,10 @@ void ir_print_metal_visitor::visit(ir_expression *ir)
else if (op1cast)
{
print_cast (buffer, arg_prec, ir->operands[1]);
buffer.asprintf_append ("(");
}
ir->operands[1]->accept(this);
if (op1castTo0)
if (op1castTo0 || op1cast)
{
buffer.asprintf_append (")");
}
@ -1214,14 +1230,17 @@ static void print_texture_uv (ir_print_metal_visitor* vis, ir_texture* ir, bool
}
else if (is_shadow)
{
// Note that on metal sample_compare works differently than shadow2DEXT on GLES:
// it does not clamp neither the pixel value nor compare value to the [0.0, 1.0] range. To
// preserve same behavior we're clamping the argument explicitly.
if (!is_proj)
{
// regular shadow
vis->buffer.asprintf_append (uv_dim == 4 ? "(float3)(" : "(float2)(");
ir->coordinate->accept(vis);
vis->buffer.asprintf_append (uv_dim == 4 ? ").xyz, (" : ").xy, (float)(");
vis->buffer.asprintf_append (uv_dim == 4 ? ").xyz, (" : ").xy, saturate((float)(");
ir->coordinate->accept(vis);
vis->buffer.asprintf_append (uv_dim == 4 ? ").w" : ").z");
vis->buffer.asprintf_append (uv_dim == 4 ? ").w" : ").z)");
}
else
{
@ -1230,11 +1249,11 @@ static void print_texture_uv (ir_print_metal_visitor* vis, ir_texture* ir, bool
ir->coordinate->accept(vis);
vis->buffer.asprintf_append (").xy / (float)(");
ir->coordinate->accept(vis);
vis->buffer.asprintf_append (").w, (float)(");
vis->buffer.asprintf_append (").w, saturate((float)(");
ir->coordinate->accept(vis);
vis->buffer.asprintf_append (").z / (float)(");
ir->coordinate->accept(vis);
vis->buffer.asprintf_append (").w");
vis->buffer.asprintf_append (").w)");
}
}
}
@ -1258,7 +1277,7 @@ void ir_print_metal_visitor::visit(ir_texture *ir)
// For shadow sampling, Metal right now needs a hardcoded sampler state :|
if (!ctx.shadowSamplerDone)
{
ctx.prefixStr.asprintf_append("constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);\n");
ctx.prefixStr.asprintf_append("constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);\n");
ctx.shadowSamplerDone = true;
}
buffer.asprintf_append (".sample_compare(_mtl_xl_shadow_sampler");

Просмотреть файл

@ -11,7 +11,7 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 c_1 = 0;
c_1.zw = half2(float2(0.0, 0.0));
c_1.xy = half2(float2(-0.3441301, 0.05004501));
_mtl_o._fragData = c_1;

Просмотреть файл

@ -11,7 +11,7 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 c_1 = 0;
c_1.zw = half2(float2(0.0, 0.0));
c_1.xy = half2(float2(-0.3441301, 0.05004501));
_mtl_o._fragData = c_1;

Просмотреть файл

@ -12,7 +12,7 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float a_2;
float a_2 = 0;
if ((_mtl_i.gl_FragCoord.x == 1.0)) {
discard_fragment();
};

Просмотреть файл

@ -18,57 +18,57 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 t_1;
half4 tmpvar_2;
half4 t_1 = 0;
half4 tmpvar_2 = 0;
tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
t_1 = tmpvar_2;
if ((_mtl_u._NumPasses > (half)0.0)) {
half passes_3;
if ((_mtl_u._NumPasses > (half)(0.0))) {
half passes_3 = 0;
passes_3 = _mtl_u._NumPasses;
float i_4;
half3 res_5;
float i_4 = 0;
half3 res_5 = 0;
res_5 = tmpvar_2.xyz;
i_4 = 0.0;
while (true) {
if ((i_4 >= 4.0)) {
break;
};
if ((i_4 == (float)passes_3)) {
if ((i_4 == (float)(passes_3))) {
break;
};
if ((i_4 == 0.0)) {
half3 tmpvar_6;
half val_7;
val_7 = ((_mtl_u._ContrastShift.x * (half)3.0) + (half)12.0);
half tmpvar_8;
tmpvar_8 = pow ((cos(val_7) + (half)1.0), val_7);
tmpvar_6 = ((res_5 - (half)0.5) * tmpvar_8);
half3 tmpvar_6 = 0;
half val_7 = 0;
val_7 = ((_mtl_u._ContrastShift.x * (half)(3.0)) + (half)(12.0));
half tmpvar_8 = 0;
tmpvar_8 = pow ((cos(val_7) + (half)(1.0)), val_7);
tmpvar_6 = ((res_5 - (half)(0.5)) * tmpvar_8);
res_5 = tmpvar_6;
} else {
if ((i_4 == 1.0)) {
half3 tmpvar_9;
half val_10;
val_10 = ((_mtl_u._SaturationShift.y * (half)3.0) + (half)12.0);
half tmpvar_11;
tmpvar_11 = pow ((cos(val_10) + (half)1.0), val_10);
tmpvar_9 = ((res_5 - (half)0.5) * tmpvar_11);
half3 tmpvar_9 = 0;
half val_10 = 0;
val_10 = ((_mtl_u._SaturationShift.y * (half)(3.0)) + (half)(12.0));
half tmpvar_11 = 0;
tmpvar_11 = pow ((cos(val_10) + (half)(1.0)), val_10);
tmpvar_9 = ((res_5 - (half)(0.5)) * tmpvar_11);
res_5 = tmpvar_9;
} else {
if ((i_4 == 2.0)) {
half3 tmpvar_12;
half val_13;
val_13 = ((_mtl_u._HueShift.z * (half)3.0) + (half)12.0);
half tmpvar_14;
tmpvar_14 = pow ((cos(val_13) + (half)1.0), val_13);
tmpvar_12 = ((res_5 - (half)0.5) * tmpvar_14);
half3 tmpvar_12 = 0;
half val_13 = 0;
val_13 = ((_mtl_u._HueShift.z * (half)(3.0)) + (half)(12.0));
half tmpvar_14 = 0;
tmpvar_14 = pow ((cos(val_13) + (half)(1.0)), val_13);
tmpvar_12 = ((res_5 - (half)(0.5)) * tmpvar_14);
res_5 = tmpvar_12;
} else {
half3 tmpvar_15;
half val_16;
val_16 = ((_mtl_u._LuminosityShift.x * (half)3.0) + (half)12.0);
half tmpvar_17;
tmpvar_17 = pow ((cos(val_16) + (half)1.0), val_16);
tmpvar_15 = ((res_5 - (half)0.5) * tmpvar_17);
half3 tmpvar_15 = 0;
half val_16 = 0;
val_16 = ((_mtl_u._LuminosityShift.x * (half)(3.0)) + (half)(12.0));
half tmpvar_17 = 0;
tmpvar_17 = pow ((cos(val_16) + (half)(1.0)), val_16);
tmpvar_15 = ((res_5 - (half)(0.5)) * tmpvar_17);
res_5 = tmpvar_15;
};
};
@ -77,7 +77,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
};
t_1.xyz = res_5;
};
half4 tmpvar_18;
half4 tmpvar_18 = 0;
tmpvar_18.w = half(1.0);
tmpvar_18.xyz = t_1.xyz;
_mtl_o._fragData = tmpvar_18;

Просмотреть файл

@ -13,7 +13,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<float> _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
float4 tmpvar_1;
float4 tmpvar_1 = 0;
tmpvar_1 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.varUV), level(0.0)).xxxx;
_mtl_o._fragData = half4(tmpvar_1);
return _mtl_o;

Просмотреть файл

@ -23,48 +23,48 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _NoiseTex [[texture(4)]], sampler _mtlsmp__NoiseTex [[sampler(4)]])
{
xlatMtlShaderOutput _mtl_o;
float2 tmpvar_1;
float2 tmpvar_1 = 0;
tmpvar_1 = _mtl_i.xlv_TEXCOORD0;
float4 jitteredDir_3;
float4 sum_4;
float weight_5;
float zx_6;
float2 vx_7;
float2 x_8;
float2 xf_9;
float4 jitteredDir_3 = 0;
float4 sum_4 = 0;
float weight_5 = 0;
float zx_6 = 0;
float2 vx_7 = 0;
float2 x_8 = 0;
float2 xf_9 = 0;
xf_9 = _mtl_i.xlv_TEXCOORD0;
x_8 = _mtl_i.xlv_TEXCOORD0;
if ((_mtl_u._MainTex_TexelSize.y < 0.0)) {
xf_9.y = (1.0 - _mtl_i.xlv_TEXCOORD0.y);
};
half4 tmpvar_10;
half4 tmpvar_10 = 0;
tmpvar_10 = _NeighbourMaxTex.sample(_mtlsmp__NeighbourMaxTex, (float2)(xf_9), level(0.0));
float2 tmpvar_11;
float2 tmpvar_11 = 0;
tmpvar_11 = float2(tmpvar_10.xy);
half4 tmpvar_12;
half4 tmpvar_12 = 0;
tmpvar_12 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0));
float4 tmpvar_13;
float4 tmpvar_13 = 0;
tmpvar_13 = float4(tmpvar_12);
half4 tmpvar_14;
half4 tmpvar_14 = 0;
tmpvar_14 = _VelTex.sample(_mtlsmp__VelTex, (float2)(xf_9), level(0.0));
float2 tmpvar_15;
float2 tmpvar_15 = 0;
tmpvar_15 = float2(tmpvar_14.xy);
vx_7 = tmpvar_15;
float4 tmpvar_16;
float4 tmpvar_16 = 0;
tmpvar_16.zw = float2(0.0, 0.0);
tmpvar_16.xy = _mtl_i.xlv_TEXCOORD0;
float4 coord_17;
float4 coord_17 = 0;
coord_17 = (tmpvar_16 * 11.0);
half4 tmpvar_18;
half4 tmpvar_18 = 0;
tmpvar_18 = _NoiseTex.sample(_mtlsmp__NoiseTex, (float2)(coord_17.xy), level(coord_17.w));
float4 tmpvar_19;
tmpvar_19 = float4(((tmpvar_18 * (half)2.0) - (half)1.0));
float4 tmpvar_19 = 0;
tmpvar_19 = float4(((tmpvar_18 * (half)(2.0)) - (half)(1.0)));
zx_6 = -((1.0/((
(_mtl_u._ZBufferParams.x * _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0)).x)
+ _mtl_u._ZBufferParams.y))));
weight_5 = 1.0;
sum_4 = tmpvar_13;
float4 tmpvar_20;
float4 tmpvar_20 = 0;
tmpvar_20 = (tmpvar_11.xyxy + (tmpvar_19 * (_mtl_u._MainTex_TexelSize.xyxy * _mtl_u._Jitter)).xyyz);
jitteredDir_3 = ((max (
abs(tmpvar_20.xyxy)
@ -72,50 +72,50 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
((_mtl_u._MainTex_TexelSize.xyxy * _mtl_u._MaxVelocity) * 0.15)
) * sign(tmpvar_20.xyxy)) * float4(1.0, 1.0, -1.0, -1.0));
for (int l_2 = 0; l_2 < 12; l_2++) {
float zy_21;
float4 yf_22;
float4 tmpvar_23;
float zy_21 = 0;
float4 yf_22 = 0;
float4 tmpvar_23 = 0;
tmpvar_23 = (tmpvar_1.xyxy + ((jitteredDir_3.xyxy * _xlat_mtl_const1[l_2].xyxy) * float4(1.0, 1.0, -1.0, -1.0)));
yf_22 = tmpvar_23;
if ((_mtl_u._MainTex_TexelSize.y < 0.0)) {
yf_22.yw = (1.0 - tmpvar_23.yw);
};
half4 tmpvar_24;
half4 tmpvar_24 = 0;
tmpvar_24 = _VelTex.sample(_mtlsmp__VelTex, (float2)(yf_22.xy), level(0.0));
float2 tmpvar_25;
float2 tmpvar_25 = 0;
tmpvar_25 = float2(tmpvar_24.xy);
zy_21 = -((1.0/((
(_mtl_u._ZBufferParams.x * _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(tmpvar_23.xy), level(0.0)).x)
+ _mtl_u._ZBufferParams.y))));
float2 x_26;
float2 x_26 = 0;
x_26 = (x_8 - tmpvar_23.xy);
float2 x_27;
float2 x_27 = 0;
x_27 = (tmpvar_23.xy - x_8);
float tmpvar_28;
float tmpvar_28 = 0;
tmpvar_28 = sqrt(dot (tmpvar_25, tmpvar_25));
float2 x_29;
float2 x_29 = 0;
x_29 = (tmpvar_23.xy - x_8);
float edge0_30;
float edge0_30 = 0;
edge0_30 = (0.95 * tmpvar_28);
float tmpvar_31;
float tmpvar_31 = 0;
tmpvar_31 = clamp (((
sqrt(dot (x_29, x_29))
- edge0_30) / (
(1.05 * tmpvar_28)
- edge0_30)), 0.0, 1.0);
float tmpvar_32;
float tmpvar_32 = 0;
tmpvar_32 = sqrt(dot (vx_7, vx_7));
float2 x_33;
float2 x_33 = 0;
x_33 = (x_8 - tmpvar_23.xy);
float edge0_34;
float edge0_34 = 0;
edge0_34 = (0.95 * tmpvar_32);
float tmpvar_35;
float tmpvar_35 = 0;
tmpvar_35 = clamp (((
sqrt(dot (x_33, x_33))
- edge0_34) / (
(1.05 * tmpvar_32)
- edge0_34)), 0.0, 1.0);
float tmpvar_36;
float tmpvar_36 = 0;
tmpvar_36 = (((
clamp ((1.0 - ((zy_21 - zx_6) / _mtl_u._SoftZDistance)), 0.0, 1.0)
*
@ -141,14 +141,14 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
(2.0 * tmpvar_35)
))))
) * 2.0));
half4 tmpvar_37;
half4 tmpvar_37 = 0;
tmpvar_37 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_23.xy), level(0.0));
float4 tmpvar_38;
float4 tmpvar_38 = 0;
tmpvar_38 = float4(tmpvar_37);
sum_4 = (sum_4 + (tmpvar_38 * tmpvar_36));
weight_5 = (weight_5 + tmpvar_36);
};
float4 tmpvar_39;
float4 tmpvar_39 = 0;
tmpvar_39 = (sum_4 / weight_5);
_mtl_o._fragData = half4(tmpvar_39);
return _mtl_o;

Просмотреть файл

@ -15,16 +15,16 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
c_1 = half4(((float4)_mtl_i.uv + _mtl_i.gl_FragCoord));
float tmpvar_2;
half4 c_1 = 0;
c_1 = half4(((float4)(_mtl_i.uv) + _mtl_i.gl_FragCoord));
float tmpvar_2 = 0;
if (_mtl_i.gl_FrontFacing) {
tmpvar_2 = 1.0;
} else {
tmpvar_2 = 0.0;
};
c_1.x = (c_1.x + (half)tmpvar_2);
c_1.xy = half2(((float2)c_1.xy + _mtl_i.gl_PointCoord));
c_1.x = (c_1.x + (half)(tmpvar_2));
c_1.xy = half2(((float2)(c_1.xy) + _mtl_i.gl_PointCoord));
_mtl_o._fragData = c_1;
return _mtl_o;
}

Просмотреть файл

@ -24,6 +24,7 @@ mediump vec4 frag( in v2f i ) {
h += ha[j];
f += fa[j];
f += (p * ha[0]);
f += (ha[1] * p);
}
return vec4( h.xy, f.xy);
}

Просмотреть файл

@ -19,6 +19,7 @@ void main ()
h_6 = (h_6 + vec3[3](vec3(1.0, 2.0, 3.0), vec3(4.0, 5.0, 6.0), vec3(7.0, 8.0, 9.0))[j_3]);
f_5 = (f_5 + vec3[3](vec3(11.0, 12.0, 13.0), vec3(14.0, 15.0, 16.0), vec3(17.0, 18.0, 19.0))[j_3]);
f_5 = (f_5 + (p_4 * vec3(1.0, 2.0, 3.0)));
f_5 = (f_5 + (vec3(4.0, 5.0, 6.0) * p_4));
};
highp vec4 tmpvar_8;
tmpvar_8.xy = h_6.xy;
@ -28,6 +29,6 @@ void main ()
}
// stats: 12 alu 0 tex 2 flow
// stats: 14 alu 0 tex 2 flow
// inputs: 1
// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]

Просмотреть файл

@ -1,7 +1,7 @@
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
constant half3 _xlat_mtl_const1[3] = {float3(1.0, 2.0, 3.0), float3(4.0, 5.0, 6.0), float3(7.0, 8.0, 9.0)};
constant half3 _xlat_mtl_const1[3] = {half3(1.0, 2.0, 3.0), half3(4.0, 5.0, 6.0), half3(7.0, 8.0, 9.0)};
constant float3 _xlat_mtl_const2[3] = {float3(11.0, 12.0, 13.0), float3(14.0, 15.0, 16.0), float3(17.0, 18.0, 19.0)};
struct xlatMtlShaderInput {
half2 xlv_TEXCOORD0;
@ -14,24 +14,25 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
half2 tmpvar_2;
half4 tmpvar_1 = 0;
half2 tmpvar_2 = 0;
tmpvar_2 = _mtl_i.xlv_TEXCOORD0;
float3 p_4;
float3 f_5;
half3 h_6;
float3 p_4 = 0;
float3 f_5 = 0;
half3 h_6 = 0;
h_6 = half3(float3(0.0, 0.0, 0.0));
f_5 = float3(0.0, 0.0, 0.0);
half3 tmpvar_7;
half3 tmpvar_7 = 0;
tmpvar_7.z = half(1.0);
tmpvar_7.xy = _mtl_i.xlv_TEXCOORD0;
p_4 = float3(tmpvar_7);
for (int j_3 = 0; j_3 < short((tmpvar_2.x * (half)3.0)); j_3++) {
for (int j_3 = 0; j_3 < short((tmpvar_2.x * (half)(3.0))); j_3++) {
h_6 = (h_6 + _xlat_mtl_const1[j_3]);
f_5 = (f_5 + _xlat_mtl_const2[j_3]);
f_5 = (f_5 + (p_4 * float3(1.0, 2.0, 3.0)));
f_5 = (f_5 + (p_4 * (float3)(half3(1.0, 2.0, 3.0))));
f_5 = (f_5 + ((float3)(half3(4.0, 5.0, 6.0)) * p_4));
};
float4 tmpvar_8;
float4 tmpvar_8 = 0;
tmpvar_8.xy = float2(h_6.xy);
tmpvar_8.zw = f_5.xy;
tmpvar_1 = half4(tmpvar_8);
@ -40,6 +41,6 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
}
// stats: 12 alu 0 tex 2 flow
// stats: 14 alu 0 tex 2 flow
// inputs: 1
// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]

Просмотреть файл

@ -13,12 +13,12 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 xlt_ocol_1;
half4 xlt_ocol_1 = 0;
xlt_ocol_1 = _mtl_i._glesFragData_0;
half4 ocol_2;
half4 ocol_2 = 0;
ocol_2.w = xlt_ocol_1.w;
ocol_2.xy = _mtl_i.xlv_TEXCOORD0.xy;
ocol_2.z = (xlt_ocol_1.z * (half)2.0);
ocol_2.z = (xlt_ocol_1.z * (half)(2.0));
xlt_ocol_1 = ocol_2;
_mtl_o._glesFragData_0 = ocol_2;
return _mtl_o;

Просмотреть файл

@ -1,7 +1,7 @@
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
struct FragmentCommonData {
half3 diffColor;
half3 specColor;
@ -45,125 +45,125 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, depth2d<float> _ShadowMapTexture [[texture(3)]], sampler _mtlsmp__ShadowMapTexture [[sampler(3)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half atten_2;
half4 tmpvar_3;
half4 c_1 = 0;
half atten_2 = 0;
half4 tmpvar_3 = 0;
tmpvar_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0.xy));
half2 tmpvar_4;
half2 tmpvar_4 = 0;
tmpvar_4.x = _mtl_u._Metallic;
tmpvar_4.y = _mtl_u._Glossiness;
half3 tmpvar_5;
half3 tmpvar_5 = 0;
tmpvar_5 = (_mtl_u._Color.xyz * tmpvar_3.xyz);
half3 tmpvar_6;
half3 tmpvar_7;
half3 tmpvar_6 = 0;
half3 tmpvar_7 = 0;
tmpvar_7 = mix (_mtl_u.unity_ColorSpaceDielectricSpec.xyz, tmpvar_5, half3(_mtl_u._Metallic));
half tmpvar_8;
half tmpvar_8 = 0;
tmpvar_8 = (_mtl_u.unity_ColorSpaceDielectricSpec.w - (_mtl_u._Metallic * _mtl_u.unity_ColorSpaceDielectricSpec.w));
tmpvar_6 = (tmpvar_5 * tmpvar_8);
half3 tmpvar_9;
half3 tmpvar_9 = 0;
tmpvar_9 = normalize(_mtl_i.xlv_TEXCOORD2_2.xyz);
half3 tmpvar_10;
half3 tmpvar_10 = 0;
tmpvar_10 = normalize(_mtl_i.xlv_TEXCOORD1);
half3 tmpvar_11;
half3 tmpvar_11 = 0;
tmpvar_11 = _mtl_u._LightColor0.xyz;
half shadow_12;
half tmpvar_13;
half shadow_12 = 0;
half tmpvar_13 = 0;
tmpvar_13 = _ShadowMapTexture.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.xlv_TEXCOORD6.xyz).xy, (float)(_mtl_i.xlv_TEXCOORD6.xyz).z);
half tmpvar_14;
half tmpvar_14 = 0;
tmpvar_14 = tmpvar_13;
shadow_12 = (_mtl_u._LightShadowData.x + (tmpvar_14 * ((half)1.0 - _mtl_u._LightShadowData.x)));
shadow_12 = (_mtl_u._LightShadowData.x + (tmpvar_14 * ((half)(1.0) - _mtl_u._LightShadowData.x)));
atten_2 = shadow_12;
half occ_15;
half tmpvar_16;
half occ_15 = 0;
half tmpvar_16 = 0;
tmpvar_16 = _OcclusionMap.sample(_mtlsmp__OcclusionMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).y;
occ_15 = tmpvar_16;
half tmpvar_17;
tmpvar_17 = (((half)1.0 - _mtl_u._OcclusionStrength) + (occ_15 * _mtl_u._OcclusionStrength));
half tmpvar_17 = 0;
tmpvar_17 = (((half)(1.0) - _mtl_u._OcclusionStrength) + (occ_15 * _mtl_u._OcclusionStrength));
FragmentCommonData s_18;
s_18 = _xlat_mtl_const1;
s_18.oneMinusRoughness = tmpvar_4.y;
s_18.normalWorld = tmpvar_9;
s_18.eyeVec = tmpvar_10;
s_18.posWorld = half3(float3(0.0, 0.0, 0.0));
half3 tmpvar_19;
half3 tmpvar_20;
half3 tmpvar_19 = 0;
half3 tmpvar_20 = 0;
tmpvar_19 = s_18.normalWorld;
tmpvar_20 = s_18.eyeVec;
float4 tmpvar_21;
float4 tmpvar_21 = 0;
tmpvar_21 = float4(_mtl_u.unity_SpecCube0_HDR);
half tmpvar_22;
tmpvar_22 = ((half)1.0 - s_18.oneMinusRoughness);
half3 tmpvar_23;
tmpvar_23 = (tmpvar_20 - ((half)2.0 * (
half tmpvar_22 = 0;
tmpvar_22 = ((half)(1.0) - s_18.oneMinusRoughness);
half3 tmpvar_23 = 0;
tmpvar_23 = (tmpvar_20 - ((half)(2.0) * (
dot (tmpvar_19, tmpvar_20)
* tmpvar_19)));
half4 tmpvar_24;
half4 tmpvar_24 = 0;
tmpvar_24.w = half(1.0);
tmpvar_24.xyz = tmpvar_19;
half3 x_25;
half3 x_25 = 0;
x_25.x = dot (_mtl_u.unity_SHAr, tmpvar_24);
x_25.y = dot (_mtl_u.unity_SHAg, tmpvar_24);
x_25.z = dot (_mtl_u.unity_SHAb, tmpvar_24);
half4 hdr_26;
half4 hdr_26 = 0;
hdr_26 = half4(tmpvar_21);
half4 tmpvar_27;
half4 tmpvar_27 = 0;
tmpvar_27.xyz = tmpvar_23;
tmpvar_27.w = ((tmpvar_22 * ((half)1.7 -
((half)0.7 * tmpvar_22)
)) * (half)6.0);
half4 tmpvar_28;
tmpvar_27.w = ((tmpvar_22 * ((half)(1.7) -
((half)(0.7) * tmpvar_22)
)) * (half)(6.0));
half4 tmpvar_28 = 0;
tmpvar_28 = unity_SpecCube0.sample(_mtlsmp_unity_SpecCube0, (float3)(tmpvar_23), level(tmpvar_27.w));
half4 tmpvar_29;
half4 tmpvar_29 = 0;
tmpvar_29 = tmpvar_28;
half3 viewDir_30;
half3 viewDir_30 = 0;
viewDir_30 = -(tmpvar_10);
half3 tmpvar_31;
half3 inVec_32;
half3 tmpvar_31 = 0;
half3 inVec_32 = 0;
inVec_32 = (_mtl_u._WorldSpaceLightPos0.xyz + viewDir_30);
tmpvar_31 = (inVec_32 * rsqrt(max ((half)0.001,
dot (inVec_32, inVec_32)
)));
half tmpvar_33;
half tmpvar_33 = 0;
tmpvar_33 = max ((half)0.0, dot (_mtl_u._WorldSpaceLightPos0.xyz, tmpvar_31));
half tmpvar_34;
tmpvar_34 = ((half)1.0 - _mtl_u._Glossiness);
half tmpvar_35;
half tmpvar_34 = 0;
tmpvar_34 = ((half)(1.0) - _mtl_u._Glossiness);
half tmpvar_35 = 0;
tmpvar_35 = max ((half)0.0001, (tmpvar_34 * tmpvar_34));
half tmpvar_36;
tmpvar_36 = max ((((half)2.0 /
half tmpvar_36 = 0;
tmpvar_36 = max ((((half)(2.0) /
(tmpvar_35 * tmpvar_35)
) - (half)2.0), (half)0.0001);
half x_37;
x_37 = ((half)1.0 - max ((half)0.0, dot (tmpvar_9, viewDir_30)));
half4 tmpvar_38;
) - (half)(2.0)), (half)0.0001);
half x_37 = 0;
x_37 = ((half)(1.0) - max ((half)0.0, dot (tmpvar_9, viewDir_30)));
half4 tmpvar_38 = 0;
tmpvar_38.w = half(1.0);
tmpvar_38.xyz = (((
((tmpvar_6 + (sqrt(
max ((half)0.0001, (((tmpvar_36 + (half)1.0) * pow (
max ((half)0.0001, (((tmpvar_36 + (half)(1.0)) * pow (
max ((half)0.0, dot (tmpvar_9, tmpvar_31))
, tmpvar_36)) / ((
((half)8.0 * (((tmpvar_33 * tmpvar_33) * _mtl_u._Glossiness) + (tmpvar_34 * tmpvar_34)))
* tmpvar_33) + (half)0.0001)))
((half)(8.0) * (((tmpvar_33 * tmpvar_33) * _mtl_u._Glossiness) + (tmpvar_34 * tmpvar_34)))
* tmpvar_33) + (half)(0.0001))))
) * tmpvar_7)) * (tmpvar_11 * atten_2))
*
max ((half)0.0, dot (tmpvar_9, _mtl_u._WorldSpaceLightPos0.xyz))
) + (
(max ((((half)1.055 *
(max ((((half)(1.055) *
pow (max ((half3)float3(0.0, 0.0, 0.0), (_mtl_i.xlv_TEXCOORD5.xyz + x_25)), (half3)float3(0.4166667, 0.4166667, 0.4166667))
) - (half)0.055), (half3)float3(0.0, 0.0, 0.0)) * tmpvar_17)
) - (half)(0.055)), (half3)float3(0.0, 0.0, 0.0)) * tmpvar_17)
* tmpvar_6)) + ((
((half)1.0 - ((tmpvar_34 * tmpvar_34) * (tmpvar_34 * (half)0.28)))
((half)(1.0) - ((tmpvar_34 * tmpvar_34) * (tmpvar_34 * (half)(0.28))))
*
(((hdr_26.x * tmpvar_29.w) * tmpvar_29.xyz) * tmpvar_17)
) * mix (tmpvar_7, half3(
clamp ((_mtl_u._Glossiness + ((half)1.0 - tmpvar_8)), (half)0.0, (half)1.0)
clamp ((_mtl_u._Glossiness + ((half)(1.0) - tmpvar_8)), (half)0.0, (half)1.0)
), half3(
((x_37 * x_37) * (x_37 * x_37))
))));
c_1 = (tmpvar_38 * _mtl_i.xlv_COLOR);
c_1.xyz = c_1.xyz;
c_1.xyz = c_1.xyz;
half4 xlat_varoutput_39;
half4 xlat_varoutput_39 = 0;
xlat_varoutput_39.xyz = c_1.xyz;
xlat_varoutput_39.w = half(1.0);
_mtl_o.FragData_0 = xlat_varoutput_39;

Просмотреть файл

@ -12,7 +12,7 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 v_1;
half4 v_1 = 0;
v_1.w = half(-1.0);
v_1.x = ((half)(1.2 + _mtl_u.nonSqMat[0].x));
v_1.y = half(6.0);

Просмотреть файл

@ -12,148 +12,148 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 c_1 = 0;
c_1 = half4(float4(0.0, 0.0, 0.0, 0.0));
float tmpvar_2;
float tmpvar_2 = 0;
tmpvar_2 = (_mtl_i.xlv_TEXCOORD0.x / 2.0);
float tmpvar_3;
float tmpvar_3 = 0;
tmpvar_3 = (fract(abs(tmpvar_2)) * 2.0);
float tmpvar_4;
float tmpvar_4 = 0;
if ((tmpvar_2 >= 0.0)) {
tmpvar_4 = tmpvar_3;
} else {
tmpvar_4 = -(tmpvar_3);
};
c_1.x = half(tmpvar_4);
float2 tmpvar_5;
float2 tmpvar_5 = 0;
tmpvar_5 = (_mtl_i.xlv_TEXCOORD0.xy / float2(2.0, 2.0));
float2 tmpvar_6;
float2 tmpvar_6 = 0;
tmpvar_6 = (fract(abs(tmpvar_5)) * float2(2.0, 2.0));
float tmpvar_7;
float tmpvar_7 = 0;
if ((tmpvar_5.x >= 0.0)) {
tmpvar_7 = tmpvar_6.x;
} else {
tmpvar_7 = -(tmpvar_6.x);
};
float tmpvar_8;
float tmpvar_8 = 0;
if ((tmpvar_5.y >= 0.0)) {
tmpvar_8 = tmpvar_6.y;
} else {
tmpvar_8 = -(tmpvar_6.y);
};
float2 tmpvar_9;
float2 tmpvar_9 = 0;
tmpvar_9.x = tmpvar_7;
tmpvar_9.y = tmpvar_8;
c_1.xy = ((half2)((float2)c_1.xy + tmpvar_9));
float3 tmpvar_10;
c_1.xy = ((half2)((float2)(c_1.xy) + tmpvar_9));
float3 tmpvar_10 = 0;
tmpvar_10 = (_mtl_i.xlv_TEXCOORD0.xyz / float3(2.0, 2.0, 2.0));
float3 tmpvar_11;
float3 tmpvar_11 = 0;
tmpvar_11 = (fract(abs(tmpvar_10)) * float3(2.0, 2.0, 2.0));
float tmpvar_12;
float tmpvar_12 = 0;
if ((tmpvar_10.x >= 0.0)) {
tmpvar_12 = tmpvar_11.x;
} else {
tmpvar_12 = -(tmpvar_11.x);
};
float tmpvar_13;
float tmpvar_13 = 0;
if ((tmpvar_10.y >= 0.0)) {
tmpvar_13 = tmpvar_11.y;
} else {
tmpvar_13 = -(tmpvar_11.y);
};
float tmpvar_14;
float tmpvar_14 = 0;
if ((tmpvar_10.z >= 0.0)) {
tmpvar_14 = tmpvar_11.z;
} else {
tmpvar_14 = -(tmpvar_11.z);
};
float3 tmpvar_15;
float3 tmpvar_15 = 0;
tmpvar_15.x = tmpvar_12;
tmpvar_15.y = tmpvar_13;
tmpvar_15.z = tmpvar_14;
c_1.xyz = ((half3)((float3)c_1.xyz + tmpvar_15));
float4 tmpvar_16;
c_1.xyz = ((half3)((float3)(c_1.xyz) + tmpvar_15));
float4 tmpvar_16 = 0;
tmpvar_16 = (_mtl_i.xlv_TEXCOORD0 / float4(2.0, 2.0, 2.0, 2.0));
float4 tmpvar_17;
float4 tmpvar_17 = 0;
tmpvar_17 = (fract(abs(tmpvar_16)) * float4(2.0, 2.0, 2.0, 2.0));
float tmpvar_18;
float tmpvar_18 = 0;
if ((tmpvar_16.x >= 0.0)) {
tmpvar_18 = tmpvar_17.x;
} else {
tmpvar_18 = -(tmpvar_17.x);
};
float tmpvar_19;
float tmpvar_19 = 0;
if ((tmpvar_16.y >= 0.0)) {
tmpvar_19 = tmpvar_17.y;
} else {
tmpvar_19 = -(tmpvar_17.y);
};
float tmpvar_20;
float tmpvar_20 = 0;
if ((tmpvar_16.z >= 0.0)) {
tmpvar_20 = tmpvar_17.z;
} else {
tmpvar_20 = -(tmpvar_17.z);
};
float tmpvar_21;
float tmpvar_21 = 0;
if ((tmpvar_16.w >= 0.0)) {
tmpvar_21 = tmpvar_17.w;
} else {
tmpvar_21 = -(tmpvar_17.w);
};
float4 tmpvar_22;
float4 tmpvar_22 = 0;
tmpvar_22.x = tmpvar_18;
tmpvar_22.y = tmpvar_19;
tmpvar_22.z = tmpvar_20;
tmpvar_22.w = tmpvar_21;
c_1 = ((half4)((float4)c_1 + tmpvar_22));
float tmpvar_23;
half ip_24;
int tmpvar_25;
c_1 = ((half4)((float4)(c_1) + tmpvar_22));
float tmpvar_23 = 0;
half ip_24 = 0;
int tmpvar_25 = 0;
tmpvar_25 = int(_mtl_i.xlv_TEXCOORD0.x);
ip_24 = half(float(tmpvar_25));
tmpvar_23 = (_mtl_i.xlv_TEXCOORD0.x - (float)ip_24);
c_1.x = ((half)((float)c_1.x + tmpvar_23));
float2 tmpvar_26;
int2 tmpvar_27;
tmpvar_23 = (_mtl_i.xlv_TEXCOORD0.x - (float)(ip_24));
c_1.x = ((half)((float)(c_1.x) + tmpvar_23));
float2 tmpvar_26 = 0;
int2 tmpvar_27 = 0;
tmpvar_27 = int2(_mtl_i.xlv_TEXCOORD0.xy);
half2 tmpvar_28;
half2 tmpvar_28 = 0;
tmpvar_28 = half2(float2(tmpvar_27));
tmpvar_26 = (_mtl_i.xlv_TEXCOORD0.xy - (float2)tmpvar_28);
c_1.xy = ((half2)((float2)c_1.xy + tmpvar_26));
float3 tmpvar_29;
int3 tmpvar_30;
tmpvar_26 = (_mtl_i.xlv_TEXCOORD0.xy - (float2)(tmpvar_28));
c_1.xy = ((half2)((float2)(c_1.xy) + tmpvar_26));
float3 tmpvar_29 = 0;
int3 tmpvar_30 = 0;
tmpvar_30 = int3(_mtl_i.xlv_TEXCOORD0.xyz);
half3 tmpvar_31;
half3 tmpvar_31 = 0;
tmpvar_31 = half3(float3(tmpvar_30));
tmpvar_29 = (_mtl_i.xlv_TEXCOORD0.xyz - (float3)tmpvar_31);
c_1.xyz = ((half3)((float3)c_1.xyz + tmpvar_29));
float4 tmpvar_32;
int4 tmpvar_33;
tmpvar_29 = (_mtl_i.xlv_TEXCOORD0.xyz - (float3)(tmpvar_31));
c_1.xyz = ((half3)((float3)(c_1.xyz) + tmpvar_29));
float4 tmpvar_32 = 0;
int4 tmpvar_33 = 0;
tmpvar_33 = int4(_mtl_i.xlv_TEXCOORD0);
half4 tmpvar_34;
half4 tmpvar_34 = 0;
tmpvar_34 = half4(float4(tmpvar_33));
tmpvar_32 = (_mtl_i.xlv_TEXCOORD0 - (float4)tmpvar_34);
c_1 = ((half4)((float4)c_1 + tmpvar_32));
float tmpvar_35;
tmpvar_32 = (_mtl_i.xlv_TEXCOORD0 - (float4)(tmpvar_34));
c_1 = ((half4)((float4)(c_1) + tmpvar_32));
float tmpvar_35 = 0;
tmpvar_35 = (float(fmod (_mtl_i.xlv_TEXCOORD0.x, (float)tmpvar_34.x)));
c_1.x = half(((float)c_1.x + tmpvar_35));
float2 tmpvar_36;
c_1.x = half(((float)(c_1.x) + tmpvar_35));
float2 tmpvar_36 = 0;
tmpvar_36 = (float2(fmod (_mtl_i.xlv_TEXCOORD0.xy, (float2)tmpvar_34.xy)));
c_1.xy = half2(((float2)c_1.xy + tmpvar_36));
float3 tmpvar_37;
c_1.xy = half2(((float2)(c_1.xy) + tmpvar_36));
float3 tmpvar_37 = 0;
tmpvar_37 = (float3(fmod (_mtl_i.xlv_TEXCOORD0.xyz, (float3)tmpvar_34.xyz)));
c_1.xyz = half3(((float3)c_1.xyz + tmpvar_37));
float tmpvar_38;
c_1.xyz = half3(((float3)(c_1.xyz) + tmpvar_37));
float tmpvar_38 = 0;
tmpvar_38 = (1.0/(_mtl_i.xlv_TEXCOORD0.x));
c_1.x = half(((float)c_1.x + tmpvar_38));
float tmpvar_39;
c_1.x = half(((float)(c_1.x) + tmpvar_38));
float tmpvar_39 = 0;
tmpvar_39 = max (0.0, tmpvar_38);
c_1.x = half(((float)c_1.x + tmpvar_39));
c_1.x = half(((float)(c_1.x) + tmpvar_39));
c_1.y = (c_1.y + ((half)1.0/(c_1.z)));
c_1.y = (c_1.y + max ((half)0.0, ((half)1.0/(c_1.w))));
float tmpvar_40;
float tmpvar_40 = 0;
tmpvar_40 = max (_mtl_i.xlv_TEXCOORD0.x, (float)c_1.z);
c_1.x = half(((float)c_1.x + tmpvar_40));
c_1.x = half(((float)(c_1.x) + tmpvar_40));
_mtl_o._fragData = c_1;
return _mtl_o;
}

Просмотреть файл

@ -15,14 +15,14 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
half3 light_2;
half4 col_3;
half4 tmpvar_1 = 0;
half3 light_2 = 0;
half4 col_3 = 0;
col_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_uv));
light_2 = ((col_3.xyz * _mtl_i.xlv_nl.x) * _mtl_u._TerrainTreeLightColors[0].xyz);
light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.y) * _mtl_u._TerrainTreeLightColors[1].xyz));
light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.z) * _mtl_u._TerrainTreeLightColors[2].xyz));
half4 tmpvar_4;
half4 tmpvar_4 = 0;
tmpvar_4.w = half(1.0);
tmpvar_4.xyz = light_2;
tmpvar_1 = tmpvar_4;

Просмотреть файл

@ -15,17 +15,17 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
half3 light_2;
half4 tmpvar_3;
half4 tmpvar_1 = 0;
half3 light_2 = 0;
half4 tmpvar_3 = 0;
tmpvar_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_uv));
if ((tmpvar_3.w < (half)0.5)) {
if ((tmpvar_3.w < (half)(0.5))) {
discard_fragment();
};
light_2 = ((tmpvar_3.xyz * _mtl_i.xlv_nl.x) * _mtl_u._TerrainTreeLightColors[0].xyz);
light_2 = (light_2 + ((tmpvar_3.xyz * _mtl_i.xlv_nl.y) * _mtl_u._TerrainTreeLightColors[1].xyz));
light_2 = (light_2 + ((tmpvar_3.xyz * _mtl_i.xlv_nl.z) * _mtl_u._TerrainTreeLightColors[2].xyz));
half4 tmpvar_4;
half4 tmpvar_4 = 0;
tmpvar_4.w = half(1.0);
tmpvar_4.xyz = light_2;
tmpvar_1 = tmpvar_4;

Просмотреть файл

@ -23,18 +23,18 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _DecalNorm [[texture(1)]], sampler _mtlsmp__DecalNorm [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
half4 res_1;
half3 worldN_2;
half3 combinedNormal_3;
half3 tmpvar_4;
tmpvar_4 = ((_DecalNorm.sample(_mtlsmp__DecalNorm, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz * (half)2.0) - (half)1.0);
half3 tmpvar_5;
tmpvar_5 = ((_PanelNorm.sample(_mtlsmp__PanelNorm, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz * (half)2.0) - (half)1.0);
half3 tmpvar_6;
half4 res_1 = 0;
half3 worldN_2 = 0;
half3 combinedNormal_3 = 0;
half3 tmpvar_4 = 0;
tmpvar_4 = ((_DecalNorm.sample(_mtlsmp__DecalNorm, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz * (half)(2.0)) - (half)(1.0));
half3 tmpvar_5 = 0;
tmpvar_5 = ((_PanelNorm.sample(_mtlsmp__PanelNorm, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz * (half)(2.0)) - (half)(1.0));
half3 tmpvar_6 = 0;
tmpvar_6.x = tmpvar_4.z;
tmpvar_6.y = tmpvar_4.y;
tmpvar_6.z = -(tmpvar_4.x);
half3 tmpvar_7;
half3 tmpvar_7 = 0;
tmpvar_7.x = tmpvar_4.x;
tmpvar_7.y = tmpvar_4.z;
tmpvar_7.z = -(tmpvar_4.y);
@ -50,33 +50,33 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
tmpvar_9[2].y = tmpvar_7.z;
tmpvar_9[2].z = tmpvar_4.z;
tmpvar_8 = _xlcast_float3x3(tmpvar_9);
float3 v_10;
float3 v_10 = 0;
v_10.x = tmpvar_8[0].x;
v_10.y = tmpvar_8[1].x;
v_10.z = tmpvar_8[2].x;
float3 v_11;
float3 v_11 = 0;
v_11.x = tmpvar_8[0].y;
v_11.y = tmpvar_8[1].y;
v_11.z = tmpvar_8[2].y;
float3 v_12;
float3 v_12 = 0;
v_12.x = tmpvar_8[0].z;
v_12.y = tmpvar_8[1].z;
v_12.z = tmpvar_8[2].z;
combinedNormal_3 = normalize(((
((half3)((float)tmpvar_5.x * v_10))
((half3)((float)(tmpvar_5.x) * v_10))
+
((half3)((float)tmpvar_5.y * v_11))
) + ((half3)((float)tmpvar_5.z * v_12))));
float tmpvar_13;
((half3)((float)(tmpvar_5.y) * v_11))
) + ((half3)((float)(tmpvar_5.z) * v_12))));
float tmpvar_13 = 0;
tmpvar_13 = dot (_mtl_i.xlv_TEXCOORD1.xyz, (float3)combinedNormal_3);
worldN_2.x = half(tmpvar_13);
float tmpvar_14;
float tmpvar_14 = 0;
tmpvar_14 = dot (_mtl_i.xlv_TEXCOORD2.xyz, (float3)combinedNormal_3);
worldN_2.y = half(tmpvar_14);
float tmpvar_15;
float tmpvar_15 = 0;
tmpvar_15 = dot (_mtl_i.xlv_TEXCOORD3.xyz, (float3)combinedNormal_3);
worldN_2.z = half(tmpvar_15);
res_1.xyz = ((worldN_2 * (half)0.5) + (half)0.5);
res_1.xyz = ((worldN_2 * (half)(0.5)) + (half)(0.5));
res_1.w = half(0.0);
_mtl_o._fragData = res_1;
return _mtl_o;

Просмотреть файл

@ -28,11 +28,11 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
xlatMtlShaderOutput _mtl_o;
half2x2 halfMatrix_1;
float2x2 rotationMatrix_2;
float tmpvar_3;
float tmpvar_4;
float tmpvar_3 = 0;
float tmpvar_4 = 0;
tmpvar_4 = (_mtl_u._Speed * _mtl_u._Time.x);
tmpvar_3 = sin(tmpvar_4);
float tmpvar_5;
float tmpvar_5 = 0;
tmpvar_5 = cos(tmpvar_4);
float2x2 tmpvar_6;
tmpvar_6[0].x = tmpvar_5;
@ -50,14 +50,14 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
tmpvar_7[1].x = -(tmpvar_3);
tmpvar_7[1].y = tmpvar_5;
halfMatrix_1 = _xlcast_half2x2(tmpvar_7);
halfMatrix_1 = (halfMatrix_1 * (half)2.0);
halfMatrix_1 = (halfMatrix_1 * (half)(2.0));
halfMatrix_1 = (halfMatrix_1 - _xlinit_half2x2(1.0));
halfMatrix_1 = _xlcast_half2x2(((float2x2)(_xlinit_half2x2(tmpvar_3) - halfMatrix_1)));
halfMatrix_1 = _xlcast_half2x2(((float2x2)(_xlinit_half2x2(tmpvar_5) + halfMatrix_1)));
halfMatrix_1 = _xlcast_half2x2(((float2x2)(halfMatrix_1 * (1.0h/half(tmpvar_3)))));
float4 tmpvar_8;
float4 tmpvar_8 = 0;
tmpvar_8.xy = (rotationMatrix_2 * _mtl_i.uv);
tmpvar_8.zw = ((float2)(halfMatrix_1 * (half2)_mtl_i.uv));
tmpvar_8.zw = ((float2)(halfMatrix_1 * (half2)(_mtl_i.uv)));
_mtl_o._fragData = half4(tmpvar_8);
return _mtl_o;
}

Просмотреть файл

@ -13,9 +13,9 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
float4 tmpvar_2;
tmpvar_2 = ((float4)_mtl_i.xlv_COLOR0 * _mtl_u._Color);
half4 c_1 = 0;
float4 tmpvar_2 = 0;
tmpvar_2 = ((float4)(_mtl_i.xlv_COLOR0) * _mtl_u._Color);
c_1 = half4(tmpvar_2);
_mtl_o._glesFragData_0 = c_1;
return _mtl_o;

Просмотреть файл

@ -14,10 +14,10 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half tmpvar_2;
half4 c_1 = 0;
half tmpvar_2 = 0;
tmpvar_2 = dot (_mtl_i.normal, _mtl_i.halfDir);
half4 tmpvar_3;
half4 tmpvar_3 = 0;
tmpvar_3 = half4(pow (tmpvar_2, _mtl_u.specPower));
c_1 = tmpvar_3;
_mtl_o._fragData = c_1;

Просмотреть файл

@ -13,13 +13,13 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 r_1;
half3 lightCoord_2;
float4 tmpvar_3;
half4 r_1 = 0;
half3 lightCoord_2 = 0;
float4 tmpvar_3 = 0;
tmpvar_3.w = 1.0;
tmpvar_3.xyz = _mtl_u._WorldPos;
float3 tmpvar_4;
tmpvar_4 = ((float4)(_mtl_u._LightMatrix * (half4)tmpvar_3)).xyz;
float3 tmpvar_4 = 0;
tmpvar_4 = ((float4)(_mtl_u._LightMatrix * (half4)(tmpvar_3))).xyz;
lightCoord_2 = half3(tmpvar_4);
r_1.xyz = lightCoord_2;
r_1.w = half(1.0);

Просмотреть файл

@ -12,7 +12,7 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 c_1 = 0;
half3x3 tmpvar_2;
tmpvar_2[0].x = half(0.8164966);
tmpvar_2[0].y = half(-0.4082483);

Просмотреть файл

@ -18,21 +18,21 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texturecube<float> cubehigh [[texture(5)]], sampler _mtlsmp_cubehigh [[sampler(5)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 tmpvar_2;
half4 c_1 = 0;
half4 tmpvar_2 = 0;
tmpvar_2 = texlow.sample(_mtlsmp_texlow, (float2)(_mtl_i.varUV.xy));
c_1 = tmpvar_2;
c_1 = (c_1 + texmed.sample(_mtlsmp_texmed, (float2)(_mtl_i.varUV.xy)));
float4 tmpvar_3;
float4 tmpvar_3 = 0;
tmpvar_3 = texhigh.sample(_mtlsmp_texhigh, (float2)(_mtl_i.varUV.xy));
c_1 = half4(((float4)c_1 + tmpvar_3));
half4 tmpvar_4;
c_1 = half4(((float4)(c_1) + tmpvar_3));
half4 tmpvar_4 = 0;
tmpvar_4 = cubelow.sample(_mtlsmp_cubelow, (float3)(_mtl_i.varUV.xyz));
c_1 = (c_1 + tmpvar_4);
c_1 = (c_1 + cubemed.sample(_mtlsmp_cubemed, (float3)(_mtl_i.varUV.xyz)));
float4 tmpvar_5;
float4 tmpvar_5 = 0;
tmpvar_5 = cubehigh.sample(_mtlsmp_cubehigh, (float3)(_mtl_i.varUV.xyz));
c_1 = half4(((float4)c_1 + tmpvar_5));
c_1 = half4(((float4)(c_1) + tmpvar_5));
_mtl_o._fragData = c_1;
return _mtl_o;
}

Просмотреть файл

@ -12,45 +12,45 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 c_1 = 0;
c_1 = half4(float4(0.0, 0.0, 0.0, 0.0));
float tmpvar_2;
float tmpvar_2 = 0;
if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
tmpvar_2 = 0.9;
} else {
tmpvar_2 = 0.1;
};
c_1 = half4(float4(tmpvar_2));
float4 tmpvar_3;
float4 tmpvar_3 = 0;
if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
tmpvar_3 = float4(0.9, 0.9, 0.9, 0.9);
} else {
tmpvar_3 = float4(0.1, 0.1, 0.1, 0.1);
};
c_1 = ((half4)(float4(tmpvar_2) + tmpvar_3));
float3 tmpvar_4;
float3 tmpvar_4 = 0;
if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
tmpvar_4 = float3(0.9, 0.9, 0.9);
} else {
tmpvar_4 = float3(0.1, 0.1, 0.1);
};
c_1.xyz = (c_1.xyz + (half3)tmpvar_4);
float2 tmpvar_5;
c_1.xyz = (c_1.xyz + (half3)(tmpvar_4));
float2 tmpvar_5 = 0;
if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
tmpvar_5 = float2(0.9, 0.9);
} else {
tmpvar_5 = float2(0.1, 0.1);
};
c_1.xy = (c_1.xy + (half2)tmpvar_5);
float tmpvar_6;
c_1.xy = (c_1.xy + (half2)(tmpvar_5));
float tmpvar_6 = 0;
tmpvar_6 = fract(_mtl_i.xlv_TEXCOORD0.x);
float tmpvar_7;
float tmpvar_7 = 0;
if (bool(tmpvar_6)) {
tmpvar_7 = 0.9;
} else {
tmpvar_7 = 0.1;
};
c_1.x = (c_1.x + (half)tmpvar_7);
c_1.x = (c_1.x + (half)(tmpvar_7));
_mtl_o._fragData = c_1;
return _mtl_o;
}

Просмотреть файл

@ -12,164 +12,164 @@ struct xlatMtlShaderUniform {
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
float4 a_2;
half4 tmpvar_1 = 0;
float4 a_2 = 0;
a_2 = float4(0.0, 0.0, 0.0, 0.0);
bool4 tmpvar_3;
bool4 tmpvar_3 = false;
tmpvar_3 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
float tmpvar_4;
float tmpvar_4 = 0;
if (tmpvar_3.x) {
tmpvar_4 = 1.0;
} else {
tmpvar_4 = 5.0;
};
float tmpvar_5;
float tmpvar_5 = 0;
if (tmpvar_3.y) {
tmpvar_5 = 2.0;
} else {
tmpvar_5 = 6.0;
};
float tmpvar_6;
float tmpvar_6 = 0;
if (tmpvar_3.z) {
tmpvar_6 = 3.0;
} else {
tmpvar_6 = 7.0;
};
float tmpvar_7;
float tmpvar_7 = 0;
if (tmpvar_3.w) {
tmpvar_7 = 4.0;
} else {
tmpvar_7 = 8.0;
};
float4 tmpvar_8;
float4 tmpvar_8 = 0;
tmpvar_8.x = tmpvar_4;
tmpvar_8.y = tmpvar_5;
tmpvar_8.z = tmpvar_6;
tmpvar_8.w = tmpvar_7;
a_2 = tmpvar_8;
bool4 tmpvar_9;
bool4 tmpvar_9 = false;
tmpvar_9 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
float tmpvar_10;
float tmpvar_10 = 0;
if (tmpvar_9.x) {
tmpvar_10 = 1.0;
} else {
tmpvar_10 = 5.0;
};
float tmpvar_11;
float tmpvar_11 = 0;
if (tmpvar_9.y) {
tmpvar_11 = 2.0;
} else {
tmpvar_11 = 6.0;
};
float tmpvar_12;
float tmpvar_12 = 0;
if (tmpvar_9.z) {
tmpvar_12 = 3.0;
} else {
tmpvar_12 = 7.0;
};
float tmpvar_13;
float tmpvar_13 = 0;
if (tmpvar_9.w) {
tmpvar_13 = 4.0;
} else {
tmpvar_13 = 8.0;
};
float4 tmpvar_14;
float4 tmpvar_14 = 0;
tmpvar_14.x = tmpvar_10;
tmpvar_14.y = tmpvar_11;
tmpvar_14.z = tmpvar_12;
tmpvar_14.w = tmpvar_13;
a_2 = (tmpvar_8 + tmpvar_14);
bool4 tmpvar_15;
bool4 tmpvar_15 = false;
tmpvar_15 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
float tmpvar_16;
float tmpvar_16 = 0;
if (tmpvar_15.x) {
tmpvar_16 = 1.0;
} else {
tmpvar_16 = 2.0;
};
float tmpvar_17;
float tmpvar_17 = 0;
if (tmpvar_15.y) {
tmpvar_17 = 1.0;
} else {
tmpvar_17 = 2.0;
};
float tmpvar_18;
float tmpvar_18 = 0;
if (tmpvar_15.z) {
tmpvar_18 = 1.0;
} else {
tmpvar_18 = 2.0;
};
float tmpvar_19;
float tmpvar_19 = 0;
if (tmpvar_15.w) {
tmpvar_19 = 1.0;
} else {
tmpvar_19 = 2.0;
};
float4 tmpvar_20;
float4 tmpvar_20 = 0;
tmpvar_20.x = tmpvar_16;
tmpvar_20.y = tmpvar_17;
tmpvar_20.z = tmpvar_18;
tmpvar_20.w = tmpvar_19;
a_2 = (a_2 + tmpvar_20);
bool4 tmpvar_21;
bool4 tmpvar_21 = false;
tmpvar_21 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
float tmpvar_22;
float tmpvar_22 = 0;
if (tmpvar_21.x) {
tmpvar_22 = 1.0;
} else {
tmpvar_22 = 2.0;
};
float tmpvar_23;
float tmpvar_23 = 0;
if (tmpvar_21.y) {
tmpvar_23 = 1.0;
} else {
tmpvar_23 = 2.0;
};
float tmpvar_24;
float tmpvar_24 = 0;
if (tmpvar_21.z) {
tmpvar_24 = 1.0;
} else {
tmpvar_24 = 2.0;
};
float tmpvar_25;
float tmpvar_25 = 0;
if (tmpvar_21.w) {
tmpvar_25 = 1.0;
} else {
tmpvar_25 = 2.0;
};
float4 tmpvar_26;
float4 tmpvar_26 = 0;
tmpvar_26.x = tmpvar_22;
tmpvar_26.y = tmpvar_23;
tmpvar_26.z = tmpvar_24;
tmpvar_26.w = tmpvar_25;
a_2 = (a_2 + tmpvar_26);
bool4 tmpvar_27;
bool4 tmpvar_27 = false;
tmpvar_27 = bool4(fract(_mtl_i.xlv_TEXCOORD0));
float tmpvar_28;
float tmpvar_28 = 0;
if (tmpvar_27.x) {
tmpvar_28 = 1.0;
} else {
tmpvar_28 = 2.0;
};
float tmpvar_29;
float tmpvar_29 = 0;
if (tmpvar_27.y) {
tmpvar_29 = 1.0;
} else {
tmpvar_29 = 2.0;
};
float tmpvar_30;
float tmpvar_30 = 0;
if (tmpvar_27.z) {
tmpvar_30 = 1.0;
} else {
tmpvar_30 = 2.0;
};
float tmpvar_31;
float tmpvar_31 = 0;
if (tmpvar_27.w) {
tmpvar_31 = 1.0;
} else {
tmpvar_31 = 2.0;
};
float4 tmpvar_32;
float4 tmpvar_32 = 0;
tmpvar_32.x = tmpvar_28;
tmpvar_32.y = tmpvar_29;
tmpvar_32.z = tmpvar_30;

Просмотреть файл

@ -13,21 +13,21 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d_array<half> myarr [[texture(0)]], sampler _mtlsmp_myarr [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
float4 slod_2;
half4 tmpvar_3;
half4 tmpvar_1 = 0;
float4 slod_2 = 0;
half4 tmpvar_3 = 0;
tmpvar_3 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z));
float4 tmpvar_4;
float4 tmpvar_4 = 0;
tmpvar_4 = float4(tmpvar_3);
half4 tmpvar_5;
half4 tmpvar_5 = 0;
tmpvar_5 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyw).xy), (uint)((_mtl_i.uv.xyw).z));
float4 tmpvar_6;
float4 tmpvar_6 = 0;
tmpvar_6 = float4(tmpvar_5);
half4 tmpvar_7;
half4 tmpvar_7 = 0;
tmpvar_7 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), bias(1.5));
float4 tmpvar_8;
float4 tmpvar_8 = 0;
tmpvar_8 = float4(tmpvar_7);
half4 tmpvar_9;
half4 tmpvar_9 = 0;
tmpvar_9 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), level(2.5));
slod_2 = float4(tmpvar_9);
tmpvar_1 = half4(((tmpvar_4 + tmpvar_6) + (tmpvar_8 + slod_2)));

Просмотреть файл

@ -15,13 +15,13 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half2 tmpvar_1;
half2 tmpvar_1 = 0;
tmpvar_1 = dfdx(_mtl_i.uv1.xy);
half2 tmpvar_2;
half2 tmpvar_2 = 0;
tmpvar_2 = dfdy(_mtl_i.uv1.xy);
float2 tmpvar_3;
float2 tmpvar_3 = 0;
tmpvar_3 = dfdx(_mtl_i.uv2.xy);
float2 tmpvar_4;
float2 tmpvar_4 = 0;
tmpvar_4 = dfdy(_mtl_i.uv2.xy);
_mtl_o._fragColor = ((tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv1.xy), gradient2d((float2)(tmpvar_1), (float2)(tmpvar_2))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(tmpvar_3), (float2)(tmpvar_4)))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(_mtl_i.uv1.xy), (float2)(_mtl_i.uv1.xy))));
return _mtl_o;

Просмотреть файл

@ -15,11 +15,11 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
half4 tmpvar_2;
half4 tmpvar_1 = 0;
half4 tmpvar_2 = 0;
tmpvar_2 = tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uvHi.xy), level(0.0));
tmpvar_1 = tmpvar_2;
half4 tmpvar_3;
half4 tmpvar_3 = 0;
tmpvar_3 = tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uvMed.xy), level(_mtl_i.uvMed.z));
_mtl_o._fragColor = (tmpvar_1 + tmpvar_3);
return _mtl_o;

Просмотреть файл

@ -1,7 +1,7 @@
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
struct xlatMtlShaderInput {
float4 uvHi;
half4 uvMed;
@ -16,11 +16,11 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, depth2d<float> shadowmap [[texture(0)]], sampler _mtlsmp_shadowmap [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 r_1;
half4 tmpvar_2;
tmpvar_2 = half4((shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi.xyz).xy, (float)(_mtl_i.uvHi.xyz).z) + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi).xy / (float)(_mtl_i.uvHi).w, (float)(_mtl_i.uvHi).z / (float)(_mtl_i.uvHi).w)));
half4 r_1 = 0;
half4 tmpvar_2 = 0;
tmpvar_2 = half4((shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi.xyz).xy, saturate((float)(_mtl_i.uvHi.xyz).z)) + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi).xy / (float)(_mtl_i.uvHi).w, saturate((float)(_mtl_i.uvHi).z / (float)(_mtl_i.uvHi).w))));
r_1.yzw = tmpvar_2.yzw;
r_1.x = (tmpvar_2.x + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvMed.xyz).xy, (float)(_mtl_i.uvMed.xyz).z));
r_1.x = (tmpvar_2.x + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvMed.xyz).xy, saturate((float)(_mtl_i.uvMed.xyz).z)));
_mtl_o._fragColor = r_1;
return _mtl_o;
}

Просмотреть файл

@ -1,7 +1,7 @@
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
struct xlatMtlShaderInput {
half4 uv;
};
@ -15,7 +15,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, depthcube<float> shadowmap [[texture(0)]], sampler _mtlsmp_shadowmap [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
half4 tmpvar_1 = 0;
tmpvar_1 = half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float3)(_mtl_i.uv).xyz, (_mtl_i.uv).w));
_mtl_o._fragColor = tmpvar_1;
return _mtl_o;

Просмотреть файл

@ -14,7 +14,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture3d<half> vol [[texture(1)]], sampler _mtlsmp_vol [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 c_1 = 0;
c_1 = (tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv.xy)) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv.xy), bias(0.5)));
c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(_mtl_i.uv)));
c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(_mtl_i.uv), bias(-0.5)));

Просмотреть файл

@ -1,7 +1,7 @@
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
struct xlatMtlShaderInput {
float4 uv;
};
@ -15,12 +15,12 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, depth2d<float> shadowmap [[texture(1)]], sampler _mtlsmp_shadowmap [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 c_1 = 0;
c_1 = (tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w)) + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv.xyz).xy / (float)(_mtl_i.uv.xyz).z)));
c_1 = (c_1 + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w), level(1.0)));
c_1 = (c_1 + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv.xyz).xy / (float)(_mtl_i.uv.xyz).z), level(1.0)));
c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv.xyz).xy, (float)(_mtl_i.uv.xyz).z)));
c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w, (float)(_mtl_i.uv).z / (float)(_mtl_i.uv).w)));
c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv.xyz).xy, saturate((float)(_mtl_i.uv.xyz).z))));
c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w, saturate((float)(_mtl_i.uv).z / (float)(_mtl_i.uv).w))));
_mtl_o._fragData = c_1;
return _mtl_o;
}

Просмотреть файл

@ -0,0 +1,44 @@
#version 300 es
#define gl_FragData _glesFragData
layout(location = 0) out mediump vec4 _glesFragData[1];
uniform sampler2D _MainTex;
struct u2v {
vec4 pos;
vec2 uv;
};
struct v2f {
vec4 pos;
vec2 uv;
};
v2f vert (u2v v) {
v2f o;
o.pos = v.pos;
o.uv = v.uv;
return o;
}
vec4 frag (in v2f i) {
vec4 foo;
bool bar;
mat4 mat;
vec4 leet = vec4(0.5);
vec4 col = texture(_MainTex, i.uv);
col += bar ? foo : leet;
col += mat[0];
return col;
}
in mediump vec2 xlv_TEXCOORD0;
void main() {
mediump vec4 xl_retval;
v2f xlt_i;
xlt_i.pos = vec4(0.0);
xlt_i.uv = vec2(xlv_TEXCOORD0);
xl_retval = frag(xlt_i);
gl_FragData[0] = vec4(xl_retval);
}

Просмотреть файл

@ -0,0 +1,32 @@
#version 300 es
layout(location=0) out mediump vec4 _glesFragData[1];
uniform sampler2D _MainTex;
in mediump vec2 xlv_TEXCOORD0;
void main ()
{
mediump vec4 xl_retval_1;
lowp vec4 col_2;
highp vec4 mat_0_3;
bool bar_4;
highp vec4 foo_5;
lowp vec4 tmpvar_6;
tmpvar_6 = texture (_MainTex, xlv_TEXCOORD0);
col_2 = tmpvar_6;
highp vec4 tmpvar_7;
if (bar_4) {
tmpvar_7 = foo_5;
} else {
tmpvar_7 = vec4(0.5, 0.5, 0.5, 0.5);
};
col_2 = (tmpvar_6 + tmpvar_7);
col_2 = (col_2 + mat_0_3);
xl_retval_1 = col_2;
_glesFragData[0] = xl_retval_1;
}
// stats: 3 alu 1 tex 1 flow
// inputs: 1
// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
// textures: 1
// #0: _MainTex (low 2d) 0x0 [-1]

Просмотреть файл

@ -0,0 +1,42 @@
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
struct xlatMtlShaderInput {
half2 xlv_TEXCOORD0;
};
struct xlatMtlShaderOutput {
half4 _glesFragData_0 [[color(0)]];
};
struct xlatMtlShaderUniform {
};
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
, texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 xl_retval_1 = 0;
half4 col_2 = 0;
float4 mat_0_3 = 0;
bool bar_4 = false;
float4 foo_5 = 0;
half4 tmpvar_6 = 0;
tmpvar_6 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
col_2 = tmpvar_6;
float4 tmpvar_7 = 0;
if (bar_4) {
tmpvar_7 = foo_5;
} else {
tmpvar_7 = float4(0.5, 0.5, 0.5, 0.5);
};
col_2 = (tmpvar_6 + (half4)(tmpvar_7));
col_2 = (col_2 + (half4)(mat_0_3));
xl_retval_1 = col_2;
_mtl_o._glesFragData_0 = xl_retval_1;
return _mtl_o;
}
// stats: 3 alu 1 tex 1 flow
// inputs: 1
// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
// textures: 1
// #0: _MainTex (low 2d) 0x0 [-1] loc 0

Просмотреть файл

@ -16,15 +16,15 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(2)]], sampler _mtlsmp__MainTex [[sampler(2)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half3 tmpvar_2;
half3 tmpvar_3;
half4 c_4;
half4 tmpvar_5;
half4 c_1 = 0;
half3 tmpvar_2 = 0;
half3 tmpvar_3 = 0;
half4 c_4 = 0;
half4 tmpvar_5 = 0;
tmpvar_5 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
c_4 = tmpvar_5;
tmpvar_2 = c_4.xyz;
tmpvar_3 = ((c_4.xyz * (half)2.0) - (half)1.0);
tmpvar_3 = ((c_4.xyz * (half)(2.0)) - (half)(1.0));
half3x3 tmpvar_6;
tmpvar_6[0].x = half(0.8164966);
tmpvar_6[0].y = half(-0.4082483);
@ -35,15 +35,15 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
tmpvar_6[2].x = half(0.5773503);
tmpvar_6[2].y = half(0.5773503);
tmpvar_6[2].z = half(0.5773503);
half3 normal_7;
half3 normal_7 = 0;
normal_7 = tmpvar_3;
half3 scalePerBasisVector_8;
half3 lm_9;
half3 tmpvar_10;
tmpvar_10 = ((half)2.0 * unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
half3 scalePerBasisVector_8 = 0;
half3 lm_9 = 0;
half3 tmpvar_10 = 0;
tmpvar_10 = ((half)(2.0) * unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
lm_9 = tmpvar_10;
half3 tmpvar_11;
tmpvar_11 = ((half)2.0 * unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
half3 tmpvar_11 = 0;
tmpvar_11 = ((half)(2.0) * unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
scalePerBasisVector_8 = tmpvar_11;
lm_9 = (lm_9 * dot (clamp (
(tmpvar_6 * normal_7)

Просмотреть файл

@ -20,101 +20,101 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
float4 depth_1;
float2 coordTemp_2;
float sampleOnEpipolarLine_3;
float tmpvar_4;
float4 depth_1 = 0;
float2 coordTemp_2 = 0;
float sampleOnEpipolarLine_3 = 0;
float tmpvar_4 = 0;
tmpvar_4 = clamp ((_mtl_i.xlv_TEXCOORD0.y - (0.5 / _mtl_u._CoordTexDim.y)), 0.0, 1.0);
sampleOnEpipolarLine_3 = ((_mtl_i.xlv_TEXCOORD0.x - (0.5 / _mtl_u._CoordTexDim.x)) * (_mtl_u._CoordTexDim.x / (_mtl_u._CoordTexDim.x - 1.0)));
float tmpvar_5;
float tmpvar_5 = 0;
tmpvar_5 = clamp (sampleOnEpipolarLine_3, 0.0, 1.0);
sampleOnEpipolarLine_3 = tmpvar_5;
int tmpvar_6;
int tmpvar_6 = 0;
tmpvar_6 = int(clamp (floor(
(tmpvar_4 * 4.0)
), 0.0, 3.0));
float tmpvar_7;
float tmpvar_7 = 0;
tmpvar_7 = (-1.0 + (2.0 * fract(
(tmpvar_4 * 4.0)
)));
float4 tmpvar_8;
float4 tmpvar_8 = 0;
tmpvar_8.xz = float2(-1.0, 1.0);
tmpvar_8.y = tmpvar_7;
tmpvar_8.w = -(tmpvar_7);
float4 tmpvar_9;
float4 tmpvar_9 = 0;
tmpvar_9.yw = float2(-1.0, 1.0);
tmpvar_9.x = -(tmpvar_7);
tmpvar_9.z = tmpvar_7;
bool4 tmpvar_10;
bool4 tmpvar_10 = false;
tmpvar_10 = bool4((int4(tmpvar_6) == int4(0, 1, 2, 3)));
half4 tmpvar_11;
half4 tmpvar_11 = 0;
tmpvar_11 = half4(tmpvar_10);
half4 tmpvar_12;
half4 tmpvar_12 = 0;
tmpvar_12 = half4(tmpvar_10);
float2 tmpvar_13;
float2 tmpvar_13 = 0;
tmpvar_13.x = dot (tmpvar_9, (float4)tmpvar_11);
tmpvar_13.y = dot (tmpvar_8, (float4)tmpvar_12);
coordTemp_2 = ((mix (_mtl_u._LightPos.xy,
-(tmpvar_13)
, float2(tmpvar_5)) * 0.5) + 0.5);
float4 tmpvar_14;
float4 tmpvar_14 = 0;
tmpvar_14.zw = float2(0.0, 0.0);
tmpvar_14.xy = coordTemp_2;
coordTemp_2 = ((floor(
(coordTemp_2 * _mtl_u._ScreenTexDim.xy)
) + 0.5) * _mtl_u._ScreenTexDim.zw);
half4 tmpvar_15;
half4 tmpvar_15 = 0;
tmpvar_15 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(coordTemp_2));
float tmpvar_16;
float z_17;
float tmpvar_16 = 0;
float z_17 = 0;
z_17 = float(tmpvar_15.x);
tmpvar_16 = (1.0/(((_mtl_u._ZBufferParams.x * z_17) + _mtl_u._ZBufferParams.y)));
depth_1 = float4(tmpvar_16);
float4 v_18;
float4 v_18 = 0;
v_18.x = _mtl_u._FrustumRays[0].x;
v_18.y = _mtl_u._FrustumRays[1].x;
v_18.z = _mtl_u._FrustumRays[2].x;
v_18.w = _mtl_u._FrustumRays[3].x;
float4 v_19;
float4 v_19 = 0;
v_19.x = _mtl_u._FrustumRays[0].y;
v_19.y = _mtl_u._FrustumRays[1].y;
v_19.z = _mtl_u._FrustumRays[2].y;
v_19.w = _mtl_u._FrustumRays[3].y;
float4 v_20;
float4 v_20 = 0;
v_20.x = _mtl_u._FrustumRays[0].w;
v_20.y = _mtl_u._FrustumRays[1].w;
v_20.z = _mtl_u._FrustumRays[2].w;
v_20.w = _mtl_u._FrustumRays[3].w;
float4 v_21;
float4 v_21 = 0;
v_21.x = _mtl_u._FrustumRays[0].z;
v_21.y = _mtl_u._FrustumRays[1].z;
v_21.z = _mtl_u._FrustumRays[2].z;
v_21.w = _mtl_u._FrustumRays[3].z;
float3 tmpvar_22;
float3 tmpvar_22 = 0;
tmpvar_22 = mix (mix (v_18.xyz, v_19.xyz, tmpvar_14.xxx), mix (v_20.xyz, v_21.xyz, tmpvar_14.xxx), tmpvar_14.yyy);
float tmpvar_23;
float tmpvar_23 = 0;
tmpvar_23 = sqrt(dot (tmpvar_22, tmpvar_22));
bool tmpvar_24;
float3 tmpvar_25;
bool tmpvar_24 = false;
float3 tmpvar_25 = 0;
tmpvar_25 = (1.0/((tmpvar_22 / tmpvar_23)));
float3 tmpvar_26;
float3 tmpvar_26 = 0;
tmpvar_26 = (tmpvar_25 * (-0.5 - _mtl_u._CameraPosLocal.xyz));
float3 tmpvar_27;
float3 tmpvar_27 = 0;
tmpvar_27 = (tmpvar_25 * (0.5 - _mtl_u._CameraPosLocal.xyz));
float3 tmpvar_28;
float3 tmpvar_28 = 0;
tmpvar_28 = min (tmpvar_27, tmpvar_26);
float3 tmpvar_29;
float3 tmpvar_29 = 0;
tmpvar_29 = max (tmpvar_27, tmpvar_26);
float2 tmpvar_30;
float2 tmpvar_30 = 0;
tmpvar_30 = max (tmpvar_28.xx, tmpvar_28.yz);
float tmpvar_31;
float tmpvar_31 = 0;
tmpvar_31 = max (tmpvar_30.x, tmpvar_30.y);
float2 tmpvar_32;
float2 tmpvar_32 = 0;
tmpvar_32 = min (tmpvar_29.xx, tmpvar_29.yz);
float tmpvar_33;
float tmpvar_33 = 0;
tmpvar_33 = min (tmpvar_32.x, tmpvar_32.y);
tmpvar_24 = bool(((tmpvar_31 < tmpvar_33) && (tmpvar_33 > 0.0)));
if (((bool)!(tmpvar_24) || (tmpvar_16 < (tmpvar_31 / tmpvar_23)))) {
if (((bool)(!(tmpvar_24)) || (tmpvar_16 < (tmpvar_31 / tmpvar_23)))) {
depth_1 = -(float4(tmpvar_16));
} else {
depth_1 = min (depth_1, float4((tmpvar_33 / tmpvar_23)));

Просмотреть файл

@ -21,26 +21,26 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half3 tmpvar_2;
half tmpvar_3;
half4 tmpvar_4;
half4 c_1 = 0;
half3 tmpvar_2 = 0;
half tmpvar_3 = 0;
half4 tmpvar_4 = 0;
tmpvar_4 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i._uv0.xy));
tmpvar_2 = (tmpvar_4.xyz * _mtl_u._Color.xyz);
tmpvar_3 = (tmpvar_4.w * _mtl_u._Color.w);
half4 tmpvar_5;
half4 tmpvar_5 = 0;
tmpvar_5 = _BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i._uv0.zw));
half4 packednormal_6;
half4 packednormal_6 = 0;
packednormal_6 = tmpvar_5;
half4 normal_7;
normal_7.xy = ((packednormal_6.wy * (half)2.0) - (half)1.0);
normal_7.z = sqrt((((half)1.0 -
half4 normal_7 = 0;
normal_7.xy = ((packednormal_6.wy * (half)(2.0)) - (half)(1.0));
normal_7.z = sqrt((((half)(1.0) -
(normal_7.x * normal_7.x)
) - (normal_7.y * normal_7.y)));
half4 c_8;
half spec_9;
half tmpvar_10;
float y_11;
half4 c_8 = 0;
half spec_9 = 0;
half tmpvar_10 = 0;
float y_11 = 0;
y_11 = (_mtl_u._Shininess * 128.0);
tmpvar_10 = ((half)pow ((float)max ((half)0.0, dot (normal_7.xyz,
normalize((_mtl_i._uv2 + normalize(_mtl_i._uv1)))
@ -52,11 +52,11 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
max ((half)0.0, dot (normal_7.xyz, _mtl_i._uv2))
) + (
(_mtl_u._LightColor0.xyz * _mtl_u._SpecColor.xyz)
* spec_9)) * (half)2.0);
* spec_9)) * (half)(2.0));
c_8.w = (tmpvar_3 + ((_mtl_u._LightColor0.w * _mtl_u._SpecColor.w) * spec_9));
c_1.xyz = (c_8.xyz + (tmpvar_2 * _mtl_i._uv3));
c_1.w = tmpvar_3;
half4 tmpvar_12;
half4 tmpvar_12 = 0;
tmpvar_12 = c_1;
_mtl_o._fragData = tmpvar_12;
return _mtl_o;

Просмотреть файл

@ -23,34 +23,34 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _ShadowMapTexture [[texture(1)]], sampler _mtlsmp__ShadowMapTexture [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
float4 res_2;
float depth_3;
half4 tmpvar_4;
half4 tmpvar_1 = 0;
float4 res_2 = 0;
float depth_3 = 0;
half4 tmpvar_4 = 0;
tmpvar_4 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.xlv_TEXCOORD0));
depth_3 = float(tmpvar_4.x);
float tmpvar_5;
float tmpvar_5 = 0;
tmpvar_5 = (1.0/(((_mtl_u._ZBufferParams.x * depth_3) + _mtl_u._ZBufferParams.y)));
depth_3 = tmpvar_5;
float4 tmpvar_6;
float4 tmpvar_6 = 0;
tmpvar_6.w = 1.0;
tmpvar_6.xyz = (_mtl_i.xlv_TEXCOORD1 * tmpvar_5);
half shadow_7;
float4 weights_8;
float4 far_9;
float4 near_10;
bool4 tmpvar_11;
half shadow_7 = 0;
float4 weights_8 = 0;
float4 far_9 = 0;
float4 near_10 = 0;
bool4 tmpvar_11 = false;
tmpvar_11 = bool4((tmpvar_6.zzzz >= _mtl_u._LightSplitsNear));
half4 tmpvar_12;
half4 tmpvar_12 = 0;
tmpvar_12 = half4(tmpvar_11);
near_10 = float4(tmpvar_12);
bool4 tmpvar_13;
bool4 tmpvar_13 = false;
tmpvar_13 = bool4((tmpvar_6.zzzz < _mtl_u._LightSplitsFar));
half4 tmpvar_14;
half4 tmpvar_14 = 0;
tmpvar_14 = half4(tmpvar_13);
far_9 = float4(tmpvar_14);
weights_8 = (near_10 * far_9);
float4 tmpvar_15;
float4 tmpvar_15 = 0;
tmpvar_15.w = 1.0;
tmpvar_15.xyz = (((
((_mtl_u._View2Shadow * tmpvar_6).xyz * weights_8.x)
@ -59,10 +59,10 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
) + (
(_mtl_u._View2Shadow2 * tmpvar_6)
.xyz * weights_8.z)) + ((_mtl_u._View2Shadow3 * tmpvar_6).xyz * weights_8.w));
half4 tmpvar_16;
half4 tmpvar_16 = 0;
tmpvar_16 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float2)(tmpvar_15.xy));
float tmpvar_17;
if (((float)tmpvar_16.x < tmpvar_15.z)) {
float tmpvar_17 = 0;
if (((float)(tmpvar_16.x) < tmpvar_15.z)) {
tmpvar_17 = _mtl_u._LightShadowData.x;
} else {
tmpvar_17 = 1.0;
@ -70,9 +70,9 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
shadow_7 = half(tmpvar_17);
res_2.x = float(shadow_7);
res_2.y = 1.0;
float2 enc_18;
float2 enc_18 = 0;
enc_18 = (float2(1.0, 255.0) * (1.0 - tmpvar_5));
float2 tmpvar_19;
float2 tmpvar_19 = 0;
tmpvar_19 = fract(enc_18);
enc_18.y = tmpvar_19.y;
enc_18.x = (tmpvar_19.x - (tmpvar_19.y * 0.00392157));

Просмотреть файл

@ -14,119 +14,119 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
float2 rcpFrame_1;
float2 rcpFrame_1 = 0;
rcpFrame_1 = _mtl_u._MainTex_TexelSize.xy;
half3 tmpvar_2;
bool doneP_4;
bool doneN_5;
half lumaEndP_6;
half lumaEndN_7;
float2 offNP_8;
float2 posP_9;
float2 posN_10;
half gradientN_11;
float lengthSign_12;
half3 rgbL_13;
half lumaS_14;
half lumaN_15;
float4 tmpvar_16;
half3 tmpvar_2 = 0;
bool doneP_4 = false;
bool doneN_5 = false;
half lumaEndP_6 = 0;
half lumaEndN_7 = 0;
float2 offNP_8 = 0;
float2 posP_9 = 0;
float2 posN_10 = 0;
half gradientN_11 = 0;
float lengthSign_12 = 0;
half3 rgbL_13 = 0;
half lumaS_14 = 0;
half lumaN_15 = 0;
float4 tmpvar_16 = 0;
tmpvar_16.zw = float2(0.0, 0.0);
tmpvar_16.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(0.0, -1.0) * _mtl_u._MainTex_TexelSize.xy));
half4 tmpvar_17;
half4 tmpvar_17 = 0;
tmpvar_17 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_16.xy), level(0.0));
float4 tmpvar_18;
float4 tmpvar_18 = 0;
tmpvar_18.zw = float2(0.0, 0.0);
tmpvar_18.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(-1.0, 0.0) * _mtl_u._MainTex_TexelSize.xy));
half4 tmpvar_19;
half4 tmpvar_19 = 0;
tmpvar_19 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_18.xy), level(0.0));
half4 tmpvar_20;
half4 tmpvar_20 = 0;
tmpvar_20 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0));
float4 tmpvar_21;
float4 tmpvar_21 = 0;
tmpvar_21.zw = float2(0.0, 0.0);
tmpvar_21.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(1.0, 0.0) * _mtl_u._MainTex_TexelSize.xy));
half4 tmpvar_22;
half4 tmpvar_22 = 0;
tmpvar_22 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_21.xy), level(0.0));
float4 tmpvar_23;
float4 tmpvar_23 = 0;
tmpvar_23.zw = float2(0.0, 0.0);
tmpvar_23.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(0.0, 1.0) * _mtl_u._MainTex_TexelSize.xy));
half4 tmpvar_24;
half4 tmpvar_24 = 0;
tmpvar_24 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_23.xy), level(0.0));
half tmpvar_25;
tmpvar_25 = ((tmpvar_17.y * (half)1.963211) + tmpvar_17.x);
half tmpvar_25 = 0;
tmpvar_25 = ((tmpvar_17.y * (half)(1.963211)) + tmpvar_17.x);
lumaN_15 = tmpvar_25;
half tmpvar_26;
tmpvar_26 = ((tmpvar_19.y * (half)1.963211) + tmpvar_19.x);
half tmpvar_27;
tmpvar_27 = ((tmpvar_20.y * (half)1.963211) + tmpvar_20.x);
half tmpvar_28;
tmpvar_28 = ((tmpvar_22.y * (half)1.963211) + tmpvar_22.x);
half tmpvar_29;
tmpvar_29 = ((tmpvar_24.y * (half)1.963211) + tmpvar_24.x);
half tmpvar_26 = 0;
tmpvar_26 = ((tmpvar_19.y * (half)(1.963211)) + tmpvar_19.x);
half tmpvar_27 = 0;
tmpvar_27 = ((tmpvar_20.y * (half)(1.963211)) + tmpvar_20.x);
half tmpvar_28 = 0;
tmpvar_28 = ((tmpvar_22.y * (half)(1.963211)) + tmpvar_22.x);
half tmpvar_29 = 0;
tmpvar_29 = ((tmpvar_24.y * (half)(1.963211)) + tmpvar_24.x);
lumaS_14 = tmpvar_29;
half tmpvar_30;
half tmpvar_30 = 0;
tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
half tmpvar_31;
half tmpvar_31 = 0;
tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min (
min (tmpvar_26, tmpvar_29)
, tmpvar_28)));
half tmpvar_32;
tmpvar_32 = max ((half)0.04166667, (tmpvar_30 * (half)0.125));
half tmpvar_32 = 0;
tmpvar_32 = max ((half)0.04166667, (tmpvar_30 * (half)(0.125)));
if ((tmpvar_31 < tmpvar_32)) {
tmpvar_2 = tmpvar_20.xyz;
} else {
half tmpvar_33;
half tmpvar_33 = 0;
tmpvar_33 = min ((half)0.75, (max ((half)0.0,
((abs((
(((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * (half)0.25)
- tmpvar_27)) / tmpvar_31) - (half)0.25)
) * (half)1.333333));
float4 tmpvar_34;
(((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * (half)(0.25))
- tmpvar_27)) / tmpvar_31) - (half)(0.25))
) * (half)(1.333333)));
float4 tmpvar_34 = 0;
tmpvar_34.zw = float2(0.0, 0.0);
tmpvar_34.xy = (_mtl_i.xlv_TEXCOORD0 - _mtl_u._MainTex_TexelSize.xy);
half4 tmpvar_35;
half4 tmpvar_35 = 0;
tmpvar_35 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_34.xy), level(0.0));
float4 tmpvar_36;
float4 tmpvar_36 = 0;
tmpvar_36.zw = float2(0.0, 0.0);
tmpvar_36.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(1.0, -1.0) * _mtl_u._MainTex_TexelSize.xy));
half4 tmpvar_37;
half4 tmpvar_37 = 0;
tmpvar_37 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_36.xy), level(0.0));
float4 tmpvar_38;
float4 tmpvar_38 = 0;
tmpvar_38.zw = float2(0.0, 0.0);
tmpvar_38.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(-1.0, 1.0) * _mtl_u._MainTex_TexelSize.xy));
half4 tmpvar_39;
half4 tmpvar_39 = 0;
tmpvar_39 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_38.xy), level(0.0));
float4 tmpvar_40;
float4 tmpvar_40 = 0;
tmpvar_40.zw = float2(0.0, 0.0);
tmpvar_40.xy = (_mtl_i.xlv_TEXCOORD0 + _mtl_u._MainTex_TexelSize.xy);
half4 tmpvar_41;
half4 tmpvar_41 = 0;
tmpvar_41 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_40.xy), level(0.0));
rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
(tmpvar_37.xyz + tmpvar_39.xyz)
+ tmpvar_41.xyz)));
rgbL_13 = (rgbL_13 * (half3)float3(0.1111111, 0.1111111, 0.1111111));
half tmpvar_42;
tmpvar_42 = ((tmpvar_35.y * (half)1.963211) + tmpvar_35.x);
half tmpvar_43;
tmpvar_43 = ((tmpvar_37.y * (half)1.963211) + tmpvar_37.x);
half tmpvar_44;
tmpvar_44 = ((tmpvar_39.y * (half)1.963211) + tmpvar_39.x);
half tmpvar_45;
tmpvar_45 = ((tmpvar_41.y * (half)1.963211) + tmpvar_41.x);
bool tmpvar_46;
rgbL_13 = (rgbL_13 * (half3)(float3(0.1111111, 0.1111111, 0.1111111)));
half tmpvar_42 = 0;
tmpvar_42 = ((tmpvar_35.y * (half)(1.963211)) + tmpvar_35.x);
half tmpvar_43 = 0;
tmpvar_43 = ((tmpvar_37.y * (half)(1.963211)) + tmpvar_37.x);
half tmpvar_44 = 0;
tmpvar_44 = ((tmpvar_39.y * (half)(1.963211)) + tmpvar_39.x);
half tmpvar_45 = 0;
tmpvar_45 = ((tmpvar_41.y * (half)(1.963211)) + tmpvar_41.x);
bool tmpvar_46 = false;
tmpvar_46 = (((
abs(((((half)0.25 * tmpvar_42) + ((half)-0.5 * tmpvar_26)) + ((half)0.25 * tmpvar_44)))
abs(((((half)(0.25) * tmpvar_42) + ((half)(-0.5) * tmpvar_26)) + ((half)(0.25) * tmpvar_44)))
+
abs(((((half)0.5 * tmpvar_25) - tmpvar_27) + ((half)0.5 * tmpvar_29)))
abs(((((half)(0.5) * tmpvar_25) - tmpvar_27) + ((half)(0.5) * tmpvar_29)))
) + abs(
((((half)0.25 * tmpvar_43) + ((half)-0.5 * tmpvar_28)) + ((half)0.25 * tmpvar_45))
((((half)(0.25) * tmpvar_43) + ((half)(-0.5) * tmpvar_28)) + ((half)(0.25) * tmpvar_45))
)) >= ((
abs(((((half)0.25 * tmpvar_42) + ((half)-0.5 * tmpvar_25)) + ((half)0.25 * tmpvar_43)))
abs(((((half)(0.25) * tmpvar_42) + ((half)(-0.5) * tmpvar_25)) + ((half)(0.25) * tmpvar_43)))
+
abs(((((half)0.5 * tmpvar_26) - tmpvar_27) + ((half)0.5 * tmpvar_28)))
abs(((((half)(0.5) * tmpvar_26) - tmpvar_27) + ((half)(0.5) * tmpvar_28)))
) + abs(
((((half)0.25 * tmpvar_44) + ((half)-0.5 * tmpvar_29)) + ((half)0.25 * tmpvar_45))
((((half)(0.25) * tmpvar_44) + ((half)(-0.5) * tmpvar_29)) + ((half)(0.25) * tmpvar_45))
)));
float tmpvar_47;
float tmpvar_47 = 0;
if (tmpvar_46) {
tmpvar_47 = -(_mtl_u._MainTex_TexelSize.y);
} else {
@ -139,14 +139,14 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
if (!(tmpvar_46)) {
lumaS_14 = tmpvar_28;
};
half tmpvar_48;
half tmpvar_48 = 0;
tmpvar_48 = abs((lumaN_15 - tmpvar_27));
gradientN_11 = tmpvar_48;
half tmpvar_49;
half tmpvar_49 = 0;
tmpvar_49 = abs((lumaS_14 - tmpvar_27));
lumaN_15 = ((lumaN_15 + tmpvar_27) * (half)0.5);
lumaS_14 = ((lumaS_14 + tmpvar_27) * (half)0.5);
bool tmpvar_50;
lumaN_15 = ((lumaN_15 + tmpvar_27) * (half)(0.5));
lumaS_14 = ((lumaS_14 + tmpvar_27) * (half)(0.5));
bool tmpvar_50 = false;
tmpvar_50 = (tmpvar_48 >= tmpvar_49);
if (!(tmpvar_50)) {
lumaN_15 = lumaS_14;
@ -157,30 +157,30 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
if (!(tmpvar_50)) {
lengthSign_12 = -(tmpvar_47);
};
float tmpvar_51;
float tmpvar_51 = 0;
if (tmpvar_46) {
tmpvar_51 = 0.0;
} else {
tmpvar_51 = (lengthSign_12 * 0.5);
};
posN_10.x = (_mtl_i.xlv_TEXCOORD0.x + tmpvar_51);
float tmpvar_52;
float tmpvar_52 = 0;
if (tmpvar_46) {
tmpvar_52 = (lengthSign_12 * 0.5);
} else {
tmpvar_52 = 0.0;
};
posN_10.y = (_mtl_i.xlv_TEXCOORD0.y + tmpvar_52);
gradientN_11 = (gradientN_11 * (half)0.25);
gradientN_11 = (gradientN_11 * (half)(0.25));
posP_9 = posN_10;
float2 tmpvar_53;
float2 tmpvar_53 = 0;
if (tmpvar_46) {
float2 tmpvar_54;
float2 tmpvar_54 = 0;
tmpvar_54.y = 0.0;
tmpvar_54.x = rcpFrame_1.x;
tmpvar_53 = tmpvar_54;
} else {
float2 tmpvar_55;
float2 tmpvar_55 = 0;
tmpvar_55.x = 0.0;
tmpvar_55.y = rcpFrame_1.y;
tmpvar_53 = tmpvar_55;
@ -194,23 +194,23 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
posP_9 = (posP_9 + tmpvar_53);
for (int i_3 = 0; i_3 < 16; i_3++) {
if (!(doneN_5)) {
half4 tmpvar_56;
half4 tmpvar_56 = 0;
tmpvar_56 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posN_10), level(0.0));
lumaEndN_7 = ((tmpvar_56.y * (half)1.963211) + tmpvar_56.x);
lumaEndN_7 = ((tmpvar_56.y * (half)(1.963211)) + tmpvar_56.x);
};
if (!(doneP_4)) {
half4 tmpvar_57;
half4 tmpvar_57 = 0;
tmpvar_57 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posP_9), level(0.0));
lumaEndP_6 = ((tmpvar_57.y * (half)1.963211) + tmpvar_57.x);
lumaEndP_6 = ((tmpvar_57.y * (half)(1.963211)) + tmpvar_57.x);
};
bool tmpvar_58;
bool tmpvar_58 = false;
if (doneN_5) {
tmpvar_58 = bool(bool(1));
} else {
tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11);
};
doneN_5 = tmpvar_58;
bool tmpvar_59;
bool tmpvar_59 = false;
if (doneP_4) {
tmpvar_59 = bool(bool(1));
} else {
@ -227,66 +227,66 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
posP_9 = (posP_9 + offNP_8);
};
};
float tmpvar_60;
float tmpvar_60 = 0;
if (tmpvar_46) {
tmpvar_60 = (_mtl_i.xlv_TEXCOORD0.x - posN_10.x);
} else {
tmpvar_60 = (_mtl_i.xlv_TEXCOORD0.y - posN_10.y);
};
float tmpvar_61;
float tmpvar_61 = 0;
if (tmpvar_46) {
tmpvar_61 = (posP_9.x - _mtl_i.xlv_TEXCOORD0.x);
} else {
tmpvar_61 = (posP_9.y - _mtl_i.xlv_TEXCOORD0.y);
};
bool tmpvar_62;
bool tmpvar_62 = false;
tmpvar_62 = (tmpvar_60 < tmpvar_61);
half tmpvar_63;
half tmpvar_63 = 0;
if (tmpvar_62) {
tmpvar_63 = lumaEndN_7;
} else {
tmpvar_63 = lumaEndP_6;
};
lumaEndN_7 = tmpvar_63;
if ((((tmpvar_27 - lumaN_15) < (half)0.0) == ((tmpvar_63 - lumaN_15) < (half)0.0))) {
if ((((tmpvar_27 - lumaN_15) < (half)(0.0)) == ((tmpvar_63 - lumaN_15) < (half)(0.0)))) {
lengthSign_12 = 0.0;
};
float tmpvar_64;
float tmpvar_64 = 0;
tmpvar_64 = (tmpvar_61 + tmpvar_60);
float tmpvar_65;
float tmpvar_65 = 0;
if (tmpvar_62) {
tmpvar_65 = tmpvar_60;
} else {
tmpvar_65 = tmpvar_61;
};
float tmpvar_66;
float tmpvar_66 = 0;
tmpvar_66 = ((0.5 + (tmpvar_65 *
(-1.0 / tmpvar_64)
)) * lengthSign_12);
float tmpvar_67;
float tmpvar_67 = 0;
if (tmpvar_46) {
tmpvar_67 = 0.0;
} else {
tmpvar_67 = tmpvar_66;
};
float tmpvar_68;
float tmpvar_68 = 0;
if (tmpvar_46) {
tmpvar_68 = tmpvar_66;
} else {
tmpvar_68 = 0.0;
};
float2 tmpvar_69;
float2 tmpvar_69 = 0;
tmpvar_69.x = (_mtl_i.xlv_TEXCOORD0.x + tmpvar_67);
tmpvar_69.y = (_mtl_i.xlv_TEXCOORD0.y + tmpvar_68);
half4 tmpvar_70;
half4 tmpvar_70 = 0;
tmpvar_70 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_69), level(0.0));
half3 tmpvar_71;
half3 tmpvar_71 = 0;
tmpvar_71.x = -(tmpvar_33);
tmpvar_71.y = -(tmpvar_33);
tmpvar_71.z = -(tmpvar_33);
tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * half3(tmpvar_33)) + tmpvar_70.xyz));
};
half4 tmpvar_72;
half4 tmpvar_72 = 0;
tmpvar_72.w = half(0.0);
tmpvar_72.xyz = tmpvar_2;
_mtl_o._fragData = tmpvar_72;

Просмотреть файл

@ -28,138 +28,138 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texturecube<half> _ShadowMapTexture [[texture(4)]], sampler _mtlsmp__ShadowMapTexture [[sampler(4)]])
{
xlatMtlShaderOutput _mtl_o;
half4 res_1;
float spec_2;
half3 h_3;
float atten_4;
half3 lightDir_5;
float3 tolight_6;
float3 wpos_7;
float depth_8;
half3 normal_9;
half4 nspec_10;
float2 uv_11;
half4 res_1 = 0;
float spec_2 = 0;
half3 h_3 = 0;
float atten_4 = 0;
half3 lightDir_5 = 0;
float3 tolight_6 = 0;
float3 wpos_7 = 0;
float depth_8 = 0;
half3 normal_9 = 0;
half4 nspec_10 = 0;
float2 uv_11 = 0;
uv_11 = (_mtl_i.xlv_TEXCOORD0.xy / _mtl_i.xlv_TEXCOORD0.w);
half4 tmpvar_12;
half4 tmpvar_12 = 0;
tmpvar_12 = _CameraNormalsTexture.sample(_mtlsmp__CameraNormalsTexture, (float2)(uv_11));
nspec_10 = tmpvar_12;
normal_9 = ((nspec_10.xyz * (half)2.0) - (half)1.0);
normal_9 = ((nspec_10.xyz * (half)(2.0)) - (half)(1.0));
normal_9 = normalize(normal_9);
half4 tmpvar_13;
half4 tmpvar_13 = 0;
tmpvar_13 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(uv_11));
depth_8 = float(tmpvar_13.x);
float tmpvar_14;
float tmpvar_14 = 0;
tmpvar_14 = (1.0/(((_mtl_u._ZBufferParams.x * depth_8) + _mtl_u._ZBufferParams.y)));
depth_8 = tmpvar_14;
float4 tmpvar_15;
float4 tmpvar_15 = 0;
tmpvar_15.w = 1.0;
tmpvar_15.xyz = ((_mtl_i.xlv_TEXCOORD1 * (_mtl_u._ProjectionParams.z / _mtl_i.xlv_TEXCOORD1.z)) * tmpvar_14);
wpos_7 = (_mtl_u._CameraToWorld * tmpvar_15).xyz;
tolight_6 = (wpos_7 - _mtl_u._LightPos.xyz);
float3 tmpvar_16;
float3 tmpvar_16 = 0;
tmpvar_16 = normalize(tolight_6);
lightDir_5 = half3(-(tmpvar_16));
float2 tmpvar_17;
float2 tmpvar_17 = 0;
tmpvar_17 = float2((dot (tolight_6, tolight_6) * _mtl_u._LightPos.w));
half4 tmpvar_18;
half4 tmpvar_18 = 0;
tmpvar_18 = _LightTextureB0.sample(_mtlsmp__LightTextureB0, (float2)(tmpvar_17));
atten_4 = float(tmpvar_18.w);
float mydist_19;
float mydist_19 = 0;
mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _mtl_u._LightPositionRange.w);
mydist_19 = (mydist_19 * 0.97);
float4 shadowVals_20;
float3 vec_21;
float4 shadowVals_20 = 0;
float3 vec_21 = 0;
vec_21 = (tolight_6 + float3(0.0078125, 0.0078125, 0.0078125));
float4 packDist_22;
half4 tmpvar_23;
float4 packDist_22 = 0;
half4 tmpvar_23 = 0;
tmpvar_23 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_21));
packDist_22 = float4(tmpvar_23);
shadowVals_20.x = dot (packDist_22, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
float3 vec_24;
float3 vec_24 = 0;
vec_24 = (tolight_6 + float3(-0.0078125, -0.0078125, 0.0078125));
float4 packDist_25;
half4 tmpvar_26;
float4 packDist_25 = 0;
half4 tmpvar_26 = 0;
tmpvar_26 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_24));
packDist_25 = float4(tmpvar_26);
shadowVals_20.y = dot (packDist_25, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
float3 vec_27;
float3 vec_27 = 0;
vec_27 = (tolight_6 + float3(-0.0078125, 0.0078125, -0.0078125));
float4 packDist_28;
half4 tmpvar_29;
float4 packDist_28 = 0;
half4 tmpvar_29 = 0;
tmpvar_29 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_27));
packDist_28 = float4(tmpvar_29);
shadowVals_20.z = dot (packDist_28, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
float3 vec_30;
float3 vec_30 = 0;
vec_30 = (tolight_6 + float3(0.0078125, -0.0078125, -0.0078125));
float4 packDist_31;
half4 tmpvar_32;
float4 packDist_31 = 0;
half4 tmpvar_32 = 0;
tmpvar_32 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_30));
packDist_31 = float4(tmpvar_32);
shadowVals_20.w = dot (packDist_31, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
bool4 tmpvar_33;
bool4 tmpvar_33 = false;
tmpvar_33 = bool4((shadowVals_20 < float4(mydist_19)));
float4 tmpvar_34;
float4 tmpvar_34 = 0;
tmpvar_34 = _mtl_u._LightShadowData.xxxx;
float tmpvar_35;
float tmpvar_35 = 0;
if (tmpvar_33.x) {
tmpvar_35 = tmpvar_34.x;
} else {
tmpvar_35 = 1.0;
};
float tmpvar_36;
float tmpvar_36 = 0;
if (tmpvar_33.y) {
tmpvar_36 = tmpvar_34.y;
} else {
tmpvar_36 = 1.0;
};
float tmpvar_37;
float tmpvar_37 = 0;
if (tmpvar_33.z) {
tmpvar_37 = tmpvar_34.z;
} else {
tmpvar_37 = 1.0;
};
float tmpvar_38;
float tmpvar_38 = 0;
if (tmpvar_33.w) {
tmpvar_38 = tmpvar_34.w;
} else {
tmpvar_38 = 1.0;
};
half4 tmpvar_39;
half4 tmpvar_39 = 0;
tmpvar_39.x = half(tmpvar_35);
tmpvar_39.y = half(tmpvar_36);
tmpvar_39.z = half(tmpvar_37);
tmpvar_39.w = half(tmpvar_38);
half tmpvar_40;
half tmpvar_40 = 0;
tmpvar_40 = dot (tmpvar_39, (half4)float4(0.25, 0.25, 0.25, 0.25));
atten_4 = (atten_4 * (float)tmpvar_40);
float4 tmpvar_41;
atten_4 = (atten_4 * (float)(tmpvar_40));
float4 tmpvar_41 = 0;
tmpvar_41.w = 1.0;
tmpvar_41.xyz = wpos_7;
half4 tmpvar_42;
float3 P_43;
half4 tmpvar_42 = 0;
float3 P_43 = 0;
P_43 = (_mtl_u._LightMatrix0 * tmpvar_41).xyz;
tmpvar_42 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float3)(P_43));
atten_4 = (atten_4 * (float)tmpvar_42.w);
float3 tmpvar_44;
tmpvar_44 = normalize(((float3)lightDir_5 - normalize(
atten_4 = (atten_4 * (float)(tmpvar_42.w));
float3 tmpvar_44 = 0;
tmpvar_44 = normalize(((float3)(lightDir_5) - normalize(
(wpos_7 - _mtl_u._WorldSpaceCameraPos)
)));
h_3 = half3(tmpvar_44);
half tmpvar_45;
tmpvar_45 = pow (max ((half)0.0, dot (h_3, normal_9)), (nspec_10.w * (half)128.0));
half tmpvar_45 = 0;
tmpvar_45 = pow (max ((half)0.0, dot (h_3, normal_9)), (nspec_10.w * (half)(128.0)));
spec_2 = float(tmpvar_45);
spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0));
res_1.xyz = half3((_mtl_u._LightColor.xyz * ((float)max ((half)0.0,
res_1.xyz = half3((_mtl_u._LightColor.xyz * ((float)(max ((half)0.0,
dot (lightDir_5, normal_9)
) * atten_4)));
half3 c_46;
)) * atten_4)));
half3 c_46 = 0;
c_46 = half3(_mtl_u._LightColor.xyz);
res_1.w = half((spec_2 * (float)dot (c_46, (half3)float3(0.22, 0.707, 0.071))));
float tmpvar_47;
res_1.w = half((spec_2 * (float)(dot (c_46, (half3)float3(0.22, 0.707, 0.071)))));
float tmpvar_47 = 0;
tmpvar_47 = clamp ((1.0 - (
(tmpvar_15.z * _mtl_u.unity_LightmapFade.z)
+ _mtl_u.unity_LightmapFade.w)), 0.0, 1.0);
res_1 = ((half4)((float4)res_1 * tmpvar_47));
res_1 = ((half4)((float4)(res_1) * tmpvar_47));
_mtl_o._fragData = exp2(-(res_1));
return _mtl_o;
}

Просмотреть файл

@ -15,26 +15,26 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _Curve [[texture(1)]], sampler _mtlsmp__Curve [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
float newLum_1;
float3 cie_2;
float4 color_3;
half4 tmpvar_4;
float newLum_1 = 0;
float3 cie_2 = 0;
float4 color_3 = 0;
half4 tmpvar_4 = 0;
tmpvar_4 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
color_3 = float4(tmpvar_4);
float3 Yxy_5;
float3 tmpvar_6;
float3 Yxy_5 = 0;
float3 tmpvar_6 = 0;
tmpvar_6 = (float3x3(float3(0.514136, 0.265068, 0.0241188), float3(0.323879, 0.670234, 0.122818), float3(0.160364, 0.0640916, 0.844427)) * color_3.xyz);
Yxy_5.x = tmpvar_6.y;
Yxy_5.yz = (tmpvar_6.xy / dot (float3(1.0, 1.0, 1.0), tmpvar_6));
cie_2.yz = Yxy_5.yz;
float2 tmpvar_7;
float2 tmpvar_7 = 0;
tmpvar_7.y = 0.5;
tmpvar_7.x = (tmpvar_6.y * _mtl_u._RangeScale);
half tmpvar_8;
half tmpvar_8 = 0;
tmpvar_8 = _Curve.sample(_mtlsmp__Curve, (float2)(tmpvar_7)).x;
newLum_1 = float(tmpvar_8);
cie_2.x = newLum_1;
float3 XYZ_9;
float3 XYZ_9 = 0;
XYZ_9.x = ((newLum_1 * Yxy_5.y) / Yxy_5.z);
XYZ_9.y = cie_2.x;
XYZ_9.z = ((newLum_1 * (

Просмотреть файл

@ -24,31 +24,31 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _TranslucencyMap [[texture(2)]], sampler _mtlsmp__TranslucencyMap [[sampler(2)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half nh_2;
half nl_3;
half3 lightColor_4;
half3 backContribs_5;
half3 light_6;
half gloss_7;
half specular_8;
half3 albedo_9;
half4 tmpvar_10;
half4 c_1 = 0;
half nh_2 = 0;
half nl_3 = 0;
half3 lightColor_4 = 0;
half3 backContribs_5 = 0;
half3 light_6 = 0;
half gloss_7 = 0;
half specular_8 = 0;
half3 albedo_9 = 0;
half4 tmpvar_10 = 0;
tmpvar_10 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
half x_11;
half x_11 = 0;
x_11 = (tmpvar_10.w - _mtl_u._Cutoff);
if ((x_11 < (half)0.0)) {
if ((x_11 < (half)(0.0))) {
discard_fragment();
};
albedo_9 = half3(((float3)tmpvar_10.xyz * _mtl_i.xlv_TEXCOORD1));
half4 tmpvar_12;
albedo_9 = half3(((float3)(tmpvar_10.xyz) * _mtl_i.xlv_TEXCOORD1));
half4 tmpvar_12 = 0;
tmpvar_12 = _BumpSpecMap.sample(_mtlsmp__BumpSpecMap, (float2)(_mtl_i.xlv_TEXCOORD0));
specular_8 = (tmpvar_12.x * (half)128.0);
half4 tmpvar_13;
specular_8 = (tmpvar_12.x * (half)(128.0));
half4 tmpvar_13 = 0;
tmpvar_13 = _TranslucencyMap.sample(_mtlsmp__TranslucencyMap, (float2)(_mtl_i.xlv_TEXCOORD0));
gloss_7 = tmpvar_13.w;
light_6 = (_mtl_u.UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9);
backContribs_5 = half3((_mtl_i.xlv_TEXCOORD2 * (float)tmpvar_13.z));
backContribs_5 = half3((_mtl_i.xlv_TEXCOORD2 * (float)(tmpvar_13.z)));
lightColor_4 = half3(_mtl_u._TerrainTreeLightColors[0].xyz);
nl_3 = half(_mtl_i.xlv_TEXCOORD3.x);
nh_2 = half(_mtl_i.xlv_TEXCOORD4.x);
@ -73,7 +73,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
+
(_mtl_u._SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
) * lightColor_4));
c_1.xyz = (light_6 * (half)2.0);
c_1.xyz = (light_6 * (half)(2.0));
c_1.w = half(1.0);
_mtl_o._fragData = c_1;
return _mtl_o;

Просмотреть файл

@ -35,10 +35,10 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _SelfIllum [[texture(11)]], sampler _mtlsmp__SelfIllum [[sampler(11)]])
{
xlatMtlShaderOutput _mtl_o;
half3 lightDir_1;
half3 env_2;
float3 tmpvar_3;
float3 tmpvar_4;
half3 lightDir_1 = 0;
half3 env_2 = 0;
float3 tmpvar_3 = 0;
float3 tmpvar_4 = 0;
tmpvar_3 = _mtl_i.xlv_TEXCOORD3.xyz;
tmpvar_4 = (((_mtl_i.xlv_TEXCOORD2.yzx * _mtl_i.xlv_TEXCOORD3.zxy) - (_mtl_i.xlv_TEXCOORD2.zxy * _mtl_i.xlv_TEXCOORD3.yzx)) * _mtl_i.xlv_TEXCOORD3.www);
float3x3 tmpvar_5;
@ -51,51 +51,51 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
tmpvar_5[2].x = tmpvar_3.z;
tmpvar_5[2].y = tmpvar_4.z;
tmpvar_5[2].z = _mtl_i.xlv_TEXCOORD2.z;
half3 normal_6;
normal_6.xy = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).wy * (half)2.0) - (half)1.0);
normal_6.xy = ((half2)((float2)normal_6.xy * _mtl_u._BumpScale));
normal_6.z = sqrt(((half)1.0 - clamp (
half3 normal_6 = 0;
normal_6.xy = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).wy * (half)(2.0)) - (half)(1.0));
normal_6.xy = ((half2)((float2)(normal_6.xy) * _mtl_u._BumpScale));
normal_6.z = sqrt(((half)(1.0) - clamp (
dot (normal_6.xy, normal_6.xy)
, (half)0.0, (half)1.0)));
half3 normal_7;
normal_7.xy = ((_DetailNormalMap.sample(_mtlsmp__DetailNormalMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).wy * (half)2.0) - (half)1.0);
normal_7.xy = ((half2)((float2)normal_7.xy * _mtl_u._DetailNormalMapScale));
normal_7.z = sqrt(((half)1.0 - clamp (
half3 normal_7 = 0;
normal_7.xy = ((_DetailNormalMap.sample(_mtlsmp__DetailNormalMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).wy * (half)(2.0)) - (half)(1.0));
normal_7.xy = ((half2)((float2)(normal_7.xy) * _mtl_u._DetailNormalMapScale));
normal_7.z = sqrt(((half)(1.0) - clamp (
dot (normal_7.xy, normal_7.xy)
, (half)0.0, (half)1.0)));
half3 tmpvar_8;
half3 tmpvar_8 = 0;
tmpvar_8.xy = (normal_6.xy + normal_7.xy);
tmpvar_8.z = (normal_6.z * normal_7.z);
half3 tmpvar_9;
half3 tmpvar_9 = 0;
tmpvar_9 = normalize(tmpvar_8);
half3 tmpvar_10;
tmpvar_10 = ((half3)((float3)tmpvar_9 * tmpvar_5));
float3 tmpvar_11;
half3 tmpvar_10 = 0;
tmpvar_10 = ((half3)((float3)(tmpvar_9) * tmpvar_5));
float3 tmpvar_11 = 0;
tmpvar_11 = normalize((_mtl_i.xlv_TEXCOORD1.xyz - _mtl_u._WorldSpaceCameraPos));
half4 tmpvar_12;
half4 tmpvar_12 = 0;
tmpvar_12 = _SpecGlossMap.sample(_mtlsmp__SpecGlossMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy));
half tmpvar_13;
half tmpvar_13 = 0;
tmpvar_13 = dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114));
half tmpvar_14;
tmpvar_14 = ((half)1.0 - tmpvar_12.w);
half4 tmpvar_15;
tmpvar_15.xyz = ((half3)(tmpvar_11 - (float3)((half)2.0 * (
half tmpvar_14 = 0;
tmpvar_14 = ((half)(1.0) - tmpvar_12.w);
half4 tmpvar_15 = 0;
tmpvar_15.xyz = ((half3)(tmpvar_11 - (float3)(((half)(2.0) * (
((half)dot ((float3)tmpvar_10, tmpvar_11))
* tmpvar_10))));
tmpvar_15.w = (tmpvar_14 * (half)5.0);
half4 tmpvar_16;
* tmpvar_10)))));
tmpvar_15.w = (tmpvar_14 * (half)(5.0));
half4 tmpvar_16 = 0;
tmpvar_16 = _SpecCube.sample(_mtlsmp__SpecCube, (float3)(tmpvar_15.xyz), level(tmpvar_15.w));
half tmpvar_17;
half tmpvar_17 = 0;
tmpvar_17 = (tmpvar_16.w * tmpvar_16.w);
half2 tmpvar_18;
half2 tmpvar_18 = 0;
tmpvar_18.x = tmpvar_17;
tmpvar_18.y = (tmpvar_16.w * tmpvar_17);
env_2 = (((half3)((float3)(tmpvar_16.xyz *
env_2 = (((half3)((float3)((tmpvar_16.xyz *
dot ((half2)float2(0.7532, 0.2468), tmpvar_18)
) * _mtl_u._Exposure)) * _Occlusion.sample(_mtlsmp__Occlusion, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).x);
half4 tmpvar_19;
)) * _mtl_u._Exposure)) * _Occlusion.sample(_mtlsmp__Occlusion, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).x);
half4 tmpvar_19 = 0;
tmpvar_19 = unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy));
half4 tmpvar_20;
half4 tmpvar_20 = 0;
tmpvar_20 = unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy));
float3x3 tmpvar_21;
tmpvar_21[0].x = 0.816497;
@ -107,80 +107,80 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
tmpvar_21[2].x = 0.57735;
tmpvar_21[2].y = 0.57735;
tmpvar_21[2].z = 0.57735;
half3 tmpvar_22;
tmpvar_22 = (((half)8.0 * tmpvar_20.w) * tmpvar_20.xyz);
float3 v_23;
half3 tmpvar_22 = 0;
tmpvar_22 = (((half)(8.0) * tmpvar_20.w) * tmpvar_20.xyz);
float3 v_23 = 0;
v_23.x = tmpvar_21[0].x;
v_23.y = tmpvar_21[1].x;
v_23.z = tmpvar_21[2].x;
float3 v_24;
float3 v_24 = 0;
v_24.x = tmpvar_21[0].y;
v_24.y = tmpvar_21[1].y;
v_24.z = tmpvar_21[2].y;
float3 v_25;
float3 v_25 = 0;
v_25.x = tmpvar_21[0].z;
v_25.y = tmpvar_21[1].z;
v_25.z = tmpvar_21[2].z;
lightDir_1 = ((half3)((float3)normalize((
((tmpvar_22.x * (half3)v_23) + (tmpvar_22.y * (half3)v_24))
lightDir_1 = ((half3)((float3)(normalize((
((tmpvar_22.x * (half3)(v_23)) + (tmpvar_22.y * (half3)(v_24)))
+
(tmpvar_22.z * (half3)v_25)
)) * tmpvar_5));
half3 tmpvar_26;
(tmpvar_22.z * (half3)(v_25))
))) * tmpvar_5));
half3 tmpvar_26 = 0;
tmpvar_26 = normalize(lightDir_1);
lightDir_1 = tmpvar_26;
half3 lightColor_27;
half3 lightColor_27 = 0;
lightColor_27 = (_ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, ((float2)(_mtl_i.xlv_TEXCOORD5).xy / (float)(_mtl_i.xlv_TEXCOORD5).w)).x * ((
((half)8.0 * tmpvar_19.w)
((half)(8.0) * tmpvar_19.w)
* tmpvar_19.xyz) * dot (
clamp (((half3)(tmpvar_21 * (float3)tmpvar_9)), (half)0.0, (half)1.0)
clamp (((half3)(tmpvar_21 * (float3)(tmpvar_9))), (half)0.0, (half)1.0)
, tmpvar_22)));
float3 viewDir_28;
float3 viewDir_28 = 0;
viewDir_28 = -(tmpvar_11);
half3 tmpvar_29;
tmpvar_29 = normalize(((half3)((float3)tmpvar_26 + viewDir_28)));
half tmpvar_30;
half3 tmpvar_29 = 0;
tmpvar_29 = normalize(((half3)((float3)(tmpvar_26) + viewDir_28)));
half tmpvar_30 = 0;
tmpvar_30 = max ((half)0.0, dot (tmpvar_10, tmpvar_26));
half tmpvar_31;
half tmpvar_31 = 0;
tmpvar_31 = max ((half)0.0, dot (tmpvar_10, tmpvar_29));
half tmpvar_32;
half tmpvar_32 = 0;
tmpvar_32 = max ((half)0.0, ((half)dot ((float3)tmpvar_10, viewDir_28)));
half tmpvar_33;
half tmpvar_33 = 0;
tmpvar_33 = max ((half)0.0, ((half)dot (viewDir_28, (float3)tmpvar_29)));
half VdotH_34;
VdotH_34 = (tmpvar_33 + (half)1e-05);
half tmpvar_35;
half VdotH_34 = 0;
VdotH_34 = (tmpvar_33 + (half)(1e-05));
half tmpvar_35 = 0;
tmpvar_35 = (((half)1.0/((
pow (tmpvar_14, (half)4.0)
+ (half)1e-05))) - (half)2.0);
half tmpvar_36;
half tmpvar_37;
+ (half)(1e-05)))) - (half)(2.0));
half tmpvar_36 = 0;
half tmpvar_37 = 0;
tmpvar_37 = max ((half)0.0, dot (tmpvar_26, tmpvar_29));
tmpvar_36 = ((half)0.5 + (((half)2.0 * tmpvar_37) * (tmpvar_37 * tmpvar_14)));
half4 tmpvar_38;
tmpvar_36 = ((half)(0.5) + (((half)(2.0) * tmpvar_37) * (tmpvar_37 * tmpvar_14)));
half4 tmpvar_38 = 0;
tmpvar_38.xyz = (((
(min ((((half3)(_mtl_u._Color.xyz * (float3)_MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz)) * ((half)2.0 * _DetailAlbedoMap.sample(_mtlsmp__DetailAlbedoMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz)), ((half3)float3(1.0, 1.0, 1.0) - tmpvar_13)) * (((
((half)1.0 + ((tmpvar_36 - (half)1.0) * pow (((half)1.00001 - tmpvar_30), (half)5.0)))
(min ((((half3)(_mtl_u._Color.xyz * (float3)(_MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz))) * ((half)(2.0) * _DetailAlbedoMap.sample(_mtlsmp__DetailAlbedoMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz)), ((half3)(float3(1.0, 1.0, 1.0)) - tmpvar_13)) * (((
((half)(1.0) + ((tmpvar_36 - (half)(1.0)) * pow (((half)(1.00001) - tmpvar_30), (half)5.0)))
*
((half)1.0 + ((tmpvar_36 - (half)1.0) * pow (((half)1.00001 - tmpvar_32), (half)5.0)))
((half)(1.0) + ((tmpvar_36 - (half)(1.0)) * pow (((half)(1.00001) - tmpvar_32), (half)5.0)))
) * tmpvar_30) * lightColor_27))
+
(tmpvar_12.xyz * (env_2 + (lightColor_27 * max ((half)0.0,
((((tmpvar_13 +
(((half)1.0 - tmpvar_13) * pow (abs(((half)1.0 - tmpvar_33)), (half)5.0))
(((half)(1.0) - tmpvar_13) * pow (abs(((half)(1.0) - tmpvar_33)), (half)5.0))
) * min ((half)1.0,
min (((((half)2.0 * tmpvar_31) * tmpvar_32) / VdotH_34), ((((half)2.0 * tmpvar_31) * tmpvar_30) / VdotH_34))
min (((((half)(2.0) * tmpvar_31) * tmpvar_32) / VdotH_34), ((((half)(2.0) * tmpvar_31) * tmpvar_30) / VdotH_34))
)) * max ((half)0.0, (
pow (tmpvar_31, tmpvar_35)
*
((tmpvar_35 + (half)1.0) / (half)6.28318)
))) / (((half)4.0 * tmpvar_32) + (half)1e-05))
((tmpvar_35 + (half)(1.0)) / (half)(6.28318))
))) / (((half)(4.0) * tmpvar_32) + (half)(1e-05)))
))))
) + (
((((half)1.0 - dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114))) * ((half)1.0 - tmpvar_14)) * pow (abs(((half)1.0 - tmpvar_32)), (half)5.0))
* env_2)) + ((half3)((float3)_SelfIllum.sample(_mtlsmp__SelfIllum, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz * _mtl_u._SelfIllumScale)));
tmpvar_38.w = ((half)((float)_AlphaMap.sample(_mtlsmp__AlphaMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).w * _mtl_u._Color.w));
half4 tmpvar_39;
((((half)(1.0) - dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114))) * ((half)(1.0) - tmpvar_14)) * pow (abs(((half)(1.0) - tmpvar_32)), (half)5.0))
* env_2)) + ((half3)((float3)(_SelfIllum.sample(_mtlsmp__SelfIllum, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz) * _mtl_u._SelfIllumScale)));
tmpvar_38.w = ((half)((float)(_AlphaMap.sample(_mtlsmp__AlphaMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).w) * _mtl_u._Color.w));
half4 tmpvar_39 = 0;
tmpvar_39 = tmpvar_38;
_mtl_o._fragData = tmpvar_39;
return _mtl_o;

Просмотреть файл

@ -20,44 +20,44 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(2)]], sampler _mtlsmp__MainTex [[sampler(2)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half atten_2;
half4 lightCoord_3;
float3 tmpvar_4;
half4 c_1 = 0;
half atten_2 = 0;
half4 lightCoord_3 = 0;
float3 tmpvar_4 = 0;
tmpvar_4 = normalize((_mtl_u._WorldSpaceLightPos0.xyz - _mtl_i.xlv_TEXCOORD2));
half3 tmpvar_5;
half tmpvar_6;
half4 c_7;
half4 tmpvar_8;
half3 tmpvar_5 = 0;
half tmpvar_6 = 0;
half4 c_7 = 0;
half4 tmpvar_8 = 0;
tmpvar_8 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
c_7 = tmpvar_8;
tmpvar_5 = c_7.xyz;
tmpvar_6 = c_7.w;
float4 tmpvar_9;
float4 tmpvar_9 = 0;
tmpvar_9.w = 1.0;
tmpvar_9.xyz = _mtl_i.xlv_TEXCOORD2;
float4 tmpvar_10;
tmpvar_10 = ((float4)(_mtl_u._LightMatrix0 * (half4)tmpvar_9));
float4 tmpvar_10 = 0;
tmpvar_10 = ((float4)(_mtl_u._LightMatrix0 * (half4)(tmpvar_9)));
lightCoord_3 = half4(tmpvar_10);
half4 tmpvar_11;
half2 P_12;
P_12 = ((lightCoord_3.xy / lightCoord_3.w) + (half)0.5);
half4 tmpvar_11 = 0;
half2 P_12 = 0;
P_12 = ((lightCoord_3.xy / lightCoord_3.w) + (half)(0.5));
tmpvar_11 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float2)(P_12));
half tmpvar_13;
half tmpvar_13 = 0;
tmpvar_13 = dot (lightCoord_3.xyz, lightCoord_3.xyz);
half4 tmpvar_14;
half4 tmpvar_14 = 0;
tmpvar_14 = _LightTextureB0.sample(_mtlsmp__LightTextureB0, (float2)(half2(tmpvar_13)));
half tmpvar_15;
half tmpvar_15 = 0;
tmpvar_15 = ((half(
(lightCoord_3.z > (half)0.0)
(lightCoord_3.z > (half)(0.0))
) * tmpvar_11.w) * tmpvar_14.w);
atten_2 = tmpvar_15;
half3 lightDir_16;
half3 lightDir_16 = 0;
lightDir_16 = half3(tmpvar_4);
half4 c_17;
half4 c_17 = 0;
c_17.xyz = ((tmpvar_5 * _mtl_u._LightColor0.xyz) * ((
max ((half)0.0, dot (_mtl_i.xlv_TEXCOORD1, lightDir_16))
* atten_2) * (half)2.0));
* atten_2) * (half)(2.0)));
c_17.w = tmpvar_6;
c_1.xyz = c_17.xyz;
c_1.w = half(0.0);

Просмотреть файл

@ -19,23 +19,23 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
half4 c_1;
half4 tmpvar_2;
half4 c_1 = 0;
half4 tmpvar_2 = 0;
tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
half3 tmpvar_3;
tmpvar_3 = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0)).xyz * (half)2.0) - (half)1.0);
half3 halfDir_4;
half3 tmpvar_3 = 0;
tmpvar_3 = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0)).xyz * (half)(2.0)) - (half)(1.0));
half3 halfDir_4 = 0;
halfDir_4 = _mtl_i.xlv_TEXCOORD1;
half4 c_5;
half spec_6;
half tmpvar_7;
half4 c_5 = 0;
half spec_6 = 0;
half tmpvar_7 = 0;
tmpvar_7 = max ((half)0.0, dot (tmpvar_3, halfDir_4));
half tmpvar_8;
tmpvar_8 = pow (tmpvar_7, (_mtl_u._Shininess * (half)128.0));
half tmpvar_8 = 0;
tmpvar_8 = pow (tmpvar_7, (_mtl_u._Shininess * (half)(128.0)));
spec_6 = (tmpvar_8 * tmpvar_2.w);
c_5.xyz = (((
(tmpvar_2.xyz * max ((half)0.0, dot (tmpvar_3, _mtl_i.xlv_TEXCOORD2)))
+ spec_6) * _mtl_u._LightColor0.xyz) * (half)2.0);
+ spec_6) * _mtl_u._LightColor0.xyz) * (half)(2.0));
c_5.w = half(0.0);
c_1.w = c_5.w;
c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * _mtl_i.xlv_TEXCOORD3));

Просмотреть файл

@ -18,23 +18,23 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
, texture2d<half> _RandomTexture [[texture(1)]], sampler _mtlsmp__RandomTexture [[sampler(1)]])
{
xlatMtlShaderOutput _mtl_o;
half tmpvar_1;
float2 tmpvar_2;
half tmpvar_1 = 0;
float2 tmpvar_2 = 0;
tmpvar_2 = _mtl_i.xlv_TEXCOORD0;
float occ_4;
float scale_5;
float depth_6;
float3 viewNorm_7;
half3 randN_8;
half3 tmpvar_9;
tmpvar_9 = ((_RandomTexture.sample(_mtlsmp__RandomTexture, (float2)(_mtl_i.xlv_TEXCOORD1)).xyz * (half)2.0) - (half)1.0);
float occ_4 = 0;
float scale_5 = 0;
float depth_6 = 0;
float3 viewNorm_7 = 0;
half3 randN_8 = 0;
half3 tmpvar_9 = 0;
tmpvar_9 = ((_RandomTexture.sample(_mtlsmp__RandomTexture, (float2)(_mtl_i.xlv_TEXCOORD1)).xyz * (half)(2.0)) - (half)(1.0));
randN_8 = tmpvar_9;
float4 tmpvar_10;
float4 tmpvar_10 = 0;
tmpvar_10 = _CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)(_mtl_i.xlv_TEXCOORD0));
float3 n_11;
float3 tmpvar_12;
float3 n_11 = 0;
float3 tmpvar_12 = 0;
tmpvar_12 = ((tmpvar_10.xyz * float3(3.5554, 3.5554, 0.0)) + float3(-1.7777, -1.7777, 1.0));
float tmpvar_13;
float tmpvar_13 = 0;
tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12));
n_11.xy = (tmpvar_13 * tmpvar_12.xy);
n_11.z = (tmpvar_13 - 1.0);
@ -43,29 +43,29 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
scale_5 = (_mtl_u._Params.x / depth_6);
occ_4 = 0.0;
for (int s_3 = 0; s_3 < 8; s_3++) {
half3 randomDir_14;
float3 tmpvar_15;
float3 I_16;
half3 randomDir_14 = 0;
float3 tmpvar_15 = 0;
float3 I_16 = 0;
I_16 = _xlat_mtl_const1[s_3];
tmpvar_15 = (I_16 - (float3)((half)2.0 * ((half3)(
tmpvar_15 = (I_16 - (float3)(((half)(2.0) * ((half3)(
dot ((float3)randN_8, I_16)
* (float3)randN_8))));
* (float3)(randN_8))))));
randomDir_14 = half3(tmpvar_15);
float tmpvar_17;
float tmpvar_17 = 0;
tmpvar_17 = dot (viewNorm_7, (float3)randomDir_14);
half tmpvar_18;
half tmpvar_18 = 0;
if ((tmpvar_17 < 0.0)) {
tmpvar_18 = half(1.0);
} else {
tmpvar_18 = half(-1.0);
};
randomDir_14 = (randomDir_14 * -(tmpvar_18));
randomDir_14 = half3(((float3)randomDir_14 + (viewNorm_7 * 0.3)));
float tmpvar_19;
randomDir_14 = half3(((float3)(randomDir_14) + (viewNorm_7 * 0.3)));
float tmpvar_19 = 0;
tmpvar_19 = clamp (((depth_6 -
((float)randomDir_14.z * _mtl_u._Params.x)
((float)(randomDir_14.z) * _mtl_u._Params.x)
) - (
dot (_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)((tmpvar_2 + ((float2)randomDir_14.xy * scale_5)))).zw, float2(1.0, 0.00392157))
dot (_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)((tmpvar_2 + ((float2)(randomDir_14.xy) * scale_5)))).zw, float2(1.0, 0.00392157))
* _mtl_u._ProjectionParams.z)), 0.0, 1.0);
if ((tmpvar_19 > _mtl_u._Params.y)) {
occ_4 = (occ_4 + pow ((1.0 - tmpvar_19), _mtl_u._Params.z));

Просмотреть файл

@ -35,46 +35,46 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float3 tmpvar_1;
float4 tmpvar_2;
float3 tmpvar_1 = 0;
float4 tmpvar_2 = 0;
tmpvar_1 = float3(_mtl_i._inNormal);
tmpvar_2 = float4(_mtl_i._color);
half4 tmpvar_3;
float noiseWave_4;
float noiseTime_5;
float wave_6;
float time_7;
float3 BBLocalPos_8;
float3 localDir_9;
float3 centerLocal_10;
float3 centerOffs_11;
float3 tmpvar_12;
half4 tmpvar_3 = 0;
float noiseWave_4 = 0;
float noiseTime_5 = 0;
float wave_6 = 0;
float time_7 = 0;
float3 BBLocalPos_8 = 0;
float3 localDir_9 = 0;
float3 centerLocal_10 = 0;
float3 centerOffs_11 = 0;
float3 tmpvar_12 = 0;
tmpvar_12.z = 0.0;
tmpvar_12.xy = (float2(0.5, 0.5) - tmpvar_2.xy);
centerOffs_11 = (tmpvar_12 * _mtl_i._uv1.xyy);
centerLocal_10 = (_mtl_i._inVertex.xyz + centerOffs_11);
float4 tmpvar_13;
float4 tmpvar_13 = 0;
tmpvar_13.w = 1.0;
tmpvar_13.xyz = _mtl_u._WorldSpaceCameraPos;
localDir_9 = ((_mtl_u._World2Object * tmpvar_13).xyz - centerLocal_10);
localDir_9.y = (localDir_9.y * _mtl_u._VerticalBillboarding);
float tmpvar_14;
float tmpvar_14 = 0;
tmpvar_14 = sqrt(dot (localDir_9, localDir_9));
float3 dir_15;
float3 dir_15 = 0;
dir_15 = (localDir_9 / tmpvar_14);
float tmpvar_16;
float tmpvar_16 = 0;
tmpvar_16 = abs(dir_15.y);
float3 tmpvar_17;
float3 tmpvar_17 = 0;
if ((tmpvar_16 > 0.999)) {
tmpvar_17 = float3(0.0, 0.0, 1.0);
} else {
tmpvar_17 = float3(0.0, 1.0, 0.0);
};
float3 tmpvar_18;
float3 tmpvar_18 = 0;
tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx)));
float3 tmpvar_19;
float3 tmpvar_19 = 0;
tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx));
float tmpvar_20;
float tmpvar_20 = 0;
tmpvar_20 = min ((max (
(tmpvar_14 - _mtl_u._SizeGrowStartDist)
, 0.0) / _mtl_u._SizeGrowEndDist), 1.0);
@ -92,23 +92,23 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
(_mtl_u._MaxGrowSize * tmpvar_2.w)
)));
time_7 = (_mtl_u._Time.y + (_mtl_u._BlinkingTimeOffsScale * tmpvar_2.z));
float y_21;
float y_21 = 0;
y_21 = (_mtl_u._TimeOnDuration + _mtl_u._TimeOffDuration);
float tmpvar_22;
float tmpvar_22 = 0;
tmpvar_22 = (time_7 / y_21);
float tmpvar_23;
float tmpvar_23 = 0;
tmpvar_23 = (fract(abs(tmpvar_22)) * y_21);
float tmpvar_24;
float tmpvar_24 = 0;
if ((tmpvar_22 >= 0.0)) {
tmpvar_24 = tmpvar_23;
} else {
tmpvar_24 = -(tmpvar_23);
};
float tmpvar_25;
float tmpvar_25 = 0;
tmpvar_25 = clamp ((tmpvar_24 / (_mtl_u._TimeOnDuration * 0.25)), 0.0, 1.0);
float edge0_26;
float edge0_26 = 0;
edge0_26 = (_mtl_u._TimeOnDuration * 0.75);
float tmpvar_27;
float tmpvar_27 = 0;
tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_mtl_u._TimeOnDuration - edge0_26)), 0.0, 1.0);
wave_6 = ((tmpvar_25 * (tmpvar_25 *
(3.0 - (2.0 * tmpvar_25))
@ -123,19 +123,19 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
(noiseTime_5 * 0.6366)
+ 56.7272))) + 0.5)
)) + (1.0 - _mtl_u._NoiseAmount));
float tmpvar_28;
float tmpvar_28 = 0;
if ((_mtl_u._NoiseAmount < 0.01)) {
tmpvar_28 = wave_6;
} else {
tmpvar_28 = noiseWave_4;
};
wave_6 = (tmpvar_28 + _mtl_u._Bias);
float4 tmpvar_29;
float4 tmpvar_29 = 0;
tmpvar_29.w = 1.0;
tmpvar_29.xyz = BBLocalPos_8;
float ffadeout_30;
float nfadeout_31;
float tmpvar_32;
float ffadeout_30 = 0;
float nfadeout_31 = 0;
float tmpvar_32 = 0;
tmpvar_32 = clamp ((tmpvar_14 / _mtl_u._FadeOutDistNear), 0.0, 1.0);
ffadeout_30 = (1.0 - clamp ((
max ((tmpvar_14 - _mtl_u._FadeOutDistFar), 0.0)

Просмотреть файл

@ -17,33 +17,33 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float3 viewDir_1;
float3 tmpvar_2;
float4 tmpvar_3;
float3 viewDir_1 = 0;
float3 tmpvar_2 = 0;
float4 tmpvar_3 = 0;
tmpvar_3.w = 1.0;
tmpvar_3.xyz = _mtl_u._WorldSpaceCameraPos;
viewDir_1 = normalize(((_mtl_u._World2Object * tmpvar_3).xyz - _mtl_i._glesVertex.xyz));
half tmpvar_4;
float tmpvar_5;
half tmpvar_4 = 0;
float tmpvar_5 = 0;
tmpvar_5 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[0])), 0.0, 1.0);
tmpvar_4 = half(tmpvar_5);
float3 tmpvar_6;
float3 tmpvar_6 = 0;
tmpvar_6.yz = tmpvar_2.yz;
tmpvar_6.x = float((tmpvar_4 * (half)2.0));
half tmpvar_7;
float tmpvar_8;
tmpvar_6.x = float((tmpvar_4 * (half)(2.0)));
half tmpvar_7 = 0;
float tmpvar_8 = 0;
tmpvar_8 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[1])), 0.0, 1.0);
tmpvar_7 = half(tmpvar_8);
float3 tmpvar_9;
float3 tmpvar_9 = 0;
tmpvar_9.xz = tmpvar_6.xz;
tmpvar_9.y = float((tmpvar_7 * (half)2.0));
half tmpvar_10;
float tmpvar_11;
tmpvar_9.y = float((tmpvar_7 * (half)(2.0)));
half tmpvar_10 = 0;
float tmpvar_11 = 0;
tmpvar_11 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[2])), 0.0, 1.0);
tmpvar_10 = half(tmpvar_11);
float3 tmpvar_12;
float3 tmpvar_12 = 0;
tmpvar_12.xy = tmpvar_9.xy;
tmpvar_12.z = float((tmpvar_10 * (half)2.0));
tmpvar_12.z = float((tmpvar_10 * (half)(2.0)));
tmpvar_2 = tmpvar_12;
_mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
_mtl_o.xlv_TEXCOORD2 = tmpvar_12;

Просмотреть файл

@ -16,12 +16,12 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
, uint gl_VertexID [[vertex_id]])
{
xlatMtlShaderOutput _mtl_o;
float3 p_1;
float3 p_1 = 0;
p_1.z = _mtl_i._inPos.z;
p_1.x = (_mtl_i._inPos.x + float(gl_VertexID));
p_1.y = (_mtl_i._inPos.y + float(gl_InstanceID));
p_1 = (p_1 + _mtl_i._inNor);
float4 tmpvar_2;
float4 tmpvar_2 = 0;
tmpvar_2.w = 1.0;
tmpvar_2.xyz = p_1;
_mtl_o.gl_Position = tmpvar_2;

Просмотреть файл

@ -17,14 +17,14 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half2 tmpvar_1;
half2 tmpvar_1 = 0;
tmpvar_1 = half2(_mtl_i._glesMultiTexCoord0.xy);
float4 tmpvar_2;
float4 tmpvar_2 = 0;
tmpvar_2.xyz = normalize(_mtl_i._glesTANGENT.xyz);
tmpvar_2.w = _mtl_i._glesTANGENT.w;
half4 tmpvar_3;
tmpvar_3.xy = (tmpvar_1 * (half)0.3);
tmpvar_3.xyz = half3(((float3)tmpvar_3.xyz + ((tmpvar_2.xyz * 0.5) + 0.5)));
half4 tmpvar_3 = 0;
tmpvar_3.xy = (tmpvar_1 * (half)(0.3));
tmpvar_3.xyz = half3(((float3)(tmpvar_3.xyz) + ((tmpvar_2.xyz * 0.5) + 0.5)));
tmpvar_3.w = half(0.0);
_mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
_mtl_o.xlv_TEXCOORD0 = tmpvar_1;

Просмотреть файл

@ -48,12 +48,12 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float4 phase0_Output0_1;
float4 Temp_0_2;
float4 Temp_1_3;
float4 Temp_2_4;
float4 Temp_3_5;
int4 Temp_int_0_6;
float4 phase0_Output0_1 = 0;
float4 Temp_0_2 = 0;
float4 Temp_1_3 = 0;
float4 Temp_2_4 = 0;
float4 Temp_3_5 = 0;
int4 Temp_int_0_6 = 0;
Temp_0_2 = (_mtl_i.dcl_Input0_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1]);
Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.dcl_Input0_POSITION0.xxxx) + Temp_0_2);
Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.dcl_Input0_POSITION0.zzzz) + Temp_0_2);

Просмотреть файл

@ -28,11 +28,11 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float4 phase0_Output2_1;
float4 Temp_2_2;
float4 Temp_3_3;
int4 Temp_int_0_4;
int4 Temp_int_1_5;
float4 phase0_Output2_1 = 0;
float4 Temp_2_2 = 0;
float4 Temp_3_3 = 0;
int4 Temp_int_0_4 = 0;
int4 Temp_int_1_5 = 0;
Temp_int_0_4 = as_type<int4>((_mtl_i.in_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1]));
Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.in_POSITION0.xxxx) + as_type<float4>(Temp_int_0_4)));
Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.in_POSITION0.zzzz) + as_type<float4>(Temp_int_0_4)));

Просмотреть файл

@ -17,38 +17,38 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float3 tmpvar_1;
float3 tmpvar_1 = 0;
tmpvar_1 = _mtl_i._glesVertex.xyz;
int j_2;
int j_3;
int il_4;
half3 lcolor_5;
half3 eyeNormal_6;
half4 color_7;
half4 tmpvar_8;
int j_2 = 0;
int j_3 = 0;
int il_4 = 0;
half3 lcolor_5 = 0;
half3 eyeNormal_6 = 0;
half4 color_7 = 0;
half4 tmpvar_8 = 0;
color_7 = half4(float4(0.0, 0.0, 0.0, 1.1));
eyeNormal_6 = half3(_mtl_i._glesNormal);
lcolor_5 = half3(float3(0.0, 0.0, 0.0));
il_4 = 0;
while (true) {
float tmpvar_9;
float tmpvar_9 = 0;
tmpvar_9 = min (8.0, float(_mtl_u.unity_VertexLightParams.x));
if ((float(il_4) >= tmpvar_9)) {
break;
};
float3 tmpvar_10;
float3 tmpvar_10 = 0;
tmpvar_10 = _mtl_u.unity_LightPosition[il_4].xyz;
half3 dirToLight_11;
half3 dirToLight_11 = 0;
dirToLight_11 = half3(tmpvar_10);
lcolor_5 = (lcolor_5 + min ((
(max (dot (eyeNormal_6, dirToLight_11), (half)0.0) * _mtl_u.unity_LightColor[il_4].xyz)
* (half)0.5), (half3)float3(1.0, 1.0, 1.0)));
* (half)(0.5)), (half3)float3(1.0, 1.0, 1.0)));
il_4++;
};
color_7.xyz = lcolor_5;
j_3 = 0;
while (true) {
float tmpvar_12;
float tmpvar_12 = 0;
tmpvar_12 = min (float(_mtl_u.unity_VertexLightParams.y), 4.0);
if ((j_3 >= int(tmpvar_12))) {
break;
@ -58,7 +58,7 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
};
j_2 = 0;
while (true) {
int tmpvar_13;
int tmpvar_13 = 0;
tmpvar_13 = min (_mtl_u.unity_VertexLightParams.y, 4);
if ((j_2 >= tmpvar_13)) {
break;
@ -67,7 +67,7 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
j_2++;
};
tmpvar_8 = color_7;
float4 tmpvar_14;
float4 tmpvar_14 = 0;
tmpvar_14.w = 1.0;
tmpvar_14.xyz = tmpvar_1;
_mtl_o.xlv_COLOR0 = tmpvar_8;

Просмотреть файл

@ -16,31 +16,31 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float4 l_1_1;
float4 l_2;
half4 tmpvar_3;
half4 tmpvar_4;
float4 l_1_1 = 0;
float4 l_2 = 0;
half4 tmpvar_3 = 0;
half4 tmpvar_4 = 0;
tmpvar_3 = half4((_mtl_u.UNITY_MATRIX_MVP * _mtl_i._inVertex));
tmpvar_4 = half4(_mtl_u.unity_LightColor[0]);
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[0]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[3]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[3]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1]));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[0]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[0]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[2]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[3]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[3]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[2]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1]));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[0]));
l_2 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].x);
tmpvar_4 = half4(((float4)tmpvar_4 + l_2));
tmpvar_4 = half4(((float4)(tmpvar_4) + l_2));
l_2 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].x);
tmpvar_4 = half4(((float4)tmpvar_4 + l_2));
tmpvar_4 = half4(((float4)(tmpvar_4) + l_2));
l_1_1 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].z);
tmpvar_4 = half4(((float4)tmpvar_4 + l_1_1));
tmpvar_4 = half4(((float4)(tmpvar_4) + l_1_1));
l_1_1 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].z);
tmpvar_4 = half4(((float4)tmpvar_4 + l_1_1));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1].x));
tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2].x));
tmpvar_4 = half4(((float4)(tmpvar_4) + l_1_1));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1].x));
tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[2].x));
_mtl_o.gl_Position = float4(tmpvar_3);
_mtl_o.xlv_TEXCOORD0 = tmpvar_4;
return _mtl_o;

Просмотреть файл

@ -27,13 +27,13 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
float4x4 htof4_3;
half2x2 ftoh2_4;
half4x4 ftoh4_5;
float4 r_6;
float4 r_6 = 0;
r_6.yzw = float3(0.0, 0.0, 0.0);
ftoh4_5 = _xlcast_half4x4(_mtl_u.uniMat4F);
r_6.x = float(ftoh4_5[0].x);
r_6.x = (r_6.x + (float)ftoh4_5[0].x);
r_6.x = (r_6.x + (float)(ftoh4_5[0].x));
ftoh2_4 = _xlcast_half2x2(_mtl_u.uniMat2F);
r_6.x = (r_6.x + (float)ftoh2_4[0].x);
r_6.x = (r_6.x + (float)(ftoh2_4[0].x));
htof4_3 = _xlcast_float4x4(_mtl_u.uniMat4H);
r_6.x = (r_6.x + htof4_3[0].x);
htof3_2 = _xlcast_float3x3(_mtl_u.uniMat3H);

Просмотреть файл

@ -23,21 +23,21 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half3 lightDir_1;
float3 worldN_2;
half3 tmpvar_3;
half3 tmpvar_4;
half3 tmpvar_5;
half3 lightDir_1 = 0;
float3 worldN_2 = 0;
half3 tmpvar_3 = 0;
half3 tmpvar_4 = 0;
half3 tmpvar_5 = 0;
float3x3 tmpvar_6;
tmpvar_6[0] = _mtl_u._Object2World[0].xyz;
tmpvar_6[1] = _mtl_u._Object2World[1].xyz;
tmpvar_6[2] = _mtl_u._Object2World[2].xyz;
half3 tmpvar_7;
tmpvar_7 = ((half3)(tmpvar_6 * (float3)_mtl_i.attrNormal));
half3 tmpvar_7 = 0;
tmpvar_7 = ((half3)(tmpvar_6 * (float3)(_mtl_i.attrNormal)));
worldN_2 = float3(tmpvar_7);
tmpvar_5 = half3(worldN_2);
half3 tmpvar_8;
half3 tmpvar_9;
half3 tmpvar_8 = 0;
half3 tmpvar_9 = 0;
tmpvar_8 = _mtl_i.attrTangent.xyz;
tmpvar_9 = (((_mtl_i.attrNormal.yzx * _mtl_i.attrTangent.zxy) - (_mtl_i.attrNormal.zxy * _mtl_i.attrTangent.yzx)) * _mtl_i.attrTangent.w);
half3x3 tmpvar_10;
@ -50,16 +50,16 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
tmpvar_10[2].x = tmpvar_8.z;
tmpvar_10[2].y = tmpvar_9.z;
tmpvar_10[2].z = _mtl_i.attrNormal.z;
float3 tmpvar_11;
tmpvar_11 = ((float3)(tmpvar_10 * (half3)(_mtl_u._World2Object * (float4)_mtl_u._WorldSpaceLightPos0).xyz));
float3 tmpvar_11 = 0;
tmpvar_11 = ((float3)(tmpvar_10 * (half3)((_mtl_u._World2Object * (float4)(_mtl_u._WorldSpaceLightPos0)).xyz)));
lightDir_1 = half3(tmpvar_11);
tmpvar_3 = lightDir_1;
float4 tmpvar_12;
float4 tmpvar_12 = 0;
tmpvar_12.w = 1.0;
tmpvar_12.xyz = _mtl_u._WorldSpaceCameraPos;
float3 tmpvar_13;
tmpvar_13 = normalize(((float3)lightDir_1 + normalize(
((float3)(tmpvar_10 * (half3)(((_mtl_u._World2Object * tmpvar_12).xyz * _mtl_u.unity_Scale.w) - _mtl_i.attrVertex.xyz)))
float3 tmpvar_13 = 0;
tmpvar_13 = normalize(((float3)(lightDir_1) + normalize(
((float3)(tmpvar_10 * (half3)((((_mtl_u._World2Object * tmpvar_12).xyz * _mtl_u.unity_Scale.w) - _mtl_i.attrVertex.xyz))))
)));
tmpvar_4 = half3(tmpvar_13);
_mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i.attrVertex);

Просмотреть файл

@ -16,9 +16,9 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half4 tmpvar_1;
half4 tmpvar_1 = 0;
tmpvar_1 = half4(_mtl_i._glesMultiTexCoord0);
float4 tmpvar_2;
float4 tmpvar_2 = 0;
tmpvar_2 = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
tmpvar_2.z = (tmpvar_2.z + clamp ((_mtl_u.unity_LightShadowBias.x / tmpvar_2.w), 0.0, 1.0));
tmpvar_2.z = mix (tmpvar_2.z, max (tmpvar_2.z, -(tmpvar_2.w)), _mtl_u.unity_LightShadowBias.y);

Просмотреть файл

@ -18,8 +18,8 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
half2 tmpvar_1;
half4 tmpvar_2;
half2 tmpvar_1 = 0;
half4 tmpvar_2 = 0;
tmpvar_2.w = _mtl_i._color.w;
tmpvar_2.xyz = (_mtl_i._color.xyz + _mtl_i._inNormal);
tmpvar_1 = half2(_mtl_i._uv0);

Просмотреть файл

@ -24,18 +24,18 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float3 tmpvar_1;
float3 tmpvar_1 = 0;
tmpvar_1 = _mtl_i._glesVertex.xyz;
float3 n_2;
float3 n_2 = 0;
n_2 = float3(_mtl_i._glesNormal);
half4 tmpvar_3;
float4 tmpvar_4;
half4 tmpvar_3 = 0;
float4 tmpvar_4 = 0;
tmpvar_4.w = 1.0;
tmpvar_4.xyz = tmpvar_1;
float3 lightColor_5;
float3 viewN_6;
float3 viewpos_7;
float4 tmpvar_8;
float3 lightColor_5 = 0;
float3 viewN_6 = 0;
float3 viewpos_7 = 0;
float4 tmpvar_8 = 0;
tmpvar_8.w = 1.0;
tmpvar_8.xyz = tmpvar_1;
viewpos_7 = (_mtl_u.glstate_matrix_modelview0 * tmpvar_8).xyz;
@ -44,37 +44,37 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
tmpvar_9[1] = _mtl_u.glstate_matrix_invtrans_modelview0[1].xyz;
tmpvar_9[2] = _mtl_u.glstate_matrix_invtrans_modelview0[2].xyz;
viewN_6 = (tmpvar_9 * n_2);
float3 tmpvar_10;
float3 tmpvar_10 = 0;
tmpvar_10 = (_mtl_u.unity_LightPosition[0].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[0].w));
lightColor_5 = (_mtl_u.glstate_lightmodel_ambient.xyz + ((float3)_mtl_u.unity_LightColor[0].xyz * (
lightColor_5 = (_mtl_u.glstate_lightmodel_ambient.xyz + ((float3)(_mtl_u.unity_LightColor[0].xyz) * (
max (0.0, dot (viewN_6, normalize(tmpvar_10)))
*
(1.0/((1.0 + (dot (tmpvar_10, tmpvar_10) * (float)_mtl_u.unity_LightAtten[0].z))))
(1.0/((1.0 + (dot (tmpvar_10, tmpvar_10) * (float)(_mtl_u.unity_LightAtten[0].z)))))
)));
float3 tmpvar_11;
float3 tmpvar_11 = 0;
tmpvar_11 = (_mtl_u.unity_LightPosition[1].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[1].w));
lightColor_5 = (lightColor_5 + ((float3)_mtl_u.unity_LightColor[1].xyz * (
lightColor_5 = (lightColor_5 + ((float3)(_mtl_u.unity_LightColor[1].xyz) * (
max (0.0, dot (viewN_6, normalize(tmpvar_11)))
*
(1.0/((1.0 + (dot (tmpvar_11, tmpvar_11) * (float)_mtl_u.unity_LightAtten[1].z))))
(1.0/((1.0 + (dot (tmpvar_11, tmpvar_11) * (float)(_mtl_u.unity_LightAtten[1].z)))))
)));
float3 tmpvar_12;
float3 tmpvar_12 = 0;
tmpvar_12 = (_mtl_u.unity_LightPosition[2].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[2].w));
lightColor_5 = (lightColor_5 + ((float3)_mtl_u.unity_LightColor[2].xyz * (
lightColor_5 = (lightColor_5 + ((float3)(_mtl_u.unity_LightColor[2].xyz) * (
max (0.0, dot (viewN_6, normalize(tmpvar_12)))
*
(1.0/((1.0 + (dot (tmpvar_12, tmpvar_12) * (float)_mtl_u.unity_LightAtten[2].z))))
(1.0/((1.0 + (dot (tmpvar_12, tmpvar_12) * (float)(_mtl_u.unity_LightAtten[2].z)))))
)));
float3 tmpvar_13;
float3 tmpvar_13 = 0;
tmpvar_13 = (_mtl_u.unity_LightPosition[3].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[3].w));
lightColor_5 = (lightColor_5 + ((float3)_mtl_u.unity_LightColor[3].xyz * (
lightColor_5 = (lightColor_5 + ((float3)(_mtl_u.unity_LightColor[3].xyz) * (
max (0.0, dot (viewN_6, normalize(tmpvar_13)))
*
(1.0/((1.0 + (dot (tmpvar_13, tmpvar_13) * (float)_mtl_u.unity_LightAtten[3].z))))
(1.0/((1.0 + (dot (tmpvar_13, tmpvar_13) * (float)(_mtl_u.unity_LightAtten[3].z)))))
)));
float4 tmpvar_14;
float4 tmpvar_14 = 0;
tmpvar_14.w = 1.0;
tmpvar_14.xyz = ((lightColor_5 * (float3)_mtl_u._Color.xyz) * 2.0);
tmpvar_14.xyz = ((lightColor_5 * (float3)(_mtl_u._Color.xyz)) * 2.0);
tmpvar_3 = half4(tmpvar_14);
_mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * tmpvar_4);
_mtl_o.xlv_COLOR0 = tmpvar_3;

Просмотреть файл

@ -17,140 +17,140 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
, texture2d<half> _DynLampInfo [[texture(0)]], sampler _mtlsmp__DynLampInfo [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
half3 tmpvar_1;
float3 tmpvar_2;
half3 tmpvar_1 = 0;
float3 tmpvar_2 = 0;
tmpvar_2 = (_mtl_u._Object2World * _mtl_i._glesVertex).xyz;
float3 tmpvar_3;
half3 hybridCol_4;
int4 tmpvar_5;
float3 tmpvar_3 = 0;
half3 hybridCol_4 = 0;
int4 tmpvar_5 = 0;
tmpvar_5.xyz = int3(tmpvar_2);
tmpvar_5.w = int(-(tmpvar_2.x));
float2 tmpvar_6;
float2 tmpvar_6 = 0;
tmpvar_6.y = 1.0;
tmpvar_6.x = float(tmpvar_5.x);
half2 coord_7;
half2 coord_7 = 0;
coord_7 = half2(tmpvar_6);
half4 tmpvar_8;
half4 tmpvar_8 = 0;
tmpvar_8.zw = half2(float2(0.0, 0.0));
tmpvar_8.xy = (coord_7 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_9;
half4 tmpvar_10;
half4 tmpvar_9 = 0;
half4 tmpvar_10 = 0;
tmpvar_10 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_8.xy), level(0.0));
tmpvar_9 = tmpvar_10;
float2 tmpvar_11;
float2 tmpvar_11 = 0;
tmpvar_11.y = 2.0;
tmpvar_11.x = float(tmpvar_5.x);
half2 coord_12;
half2 coord_12 = 0;
coord_12 = half2(tmpvar_11);
half4 tmpvar_13;
half4 tmpvar_13 = 0;
tmpvar_13.zw = half2(float2(0.0, 0.0));
tmpvar_13.xy = (coord_12 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_14;
half4 tmpvar_15;
half4 tmpvar_14 = 0;
half4 tmpvar_15 = 0;
tmpvar_15 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_13.xy), level(0.0));
tmpvar_14 = tmpvar_15;
float2 tmpvar_16;
float2 tmpvar_16 = 0;
tmpvar_16.y = 1.0;
tmpvar_16.x = float(tmpvar_5.y);
half2 coord_17;
half2 coord_17 = 0;
coord_17 = half2(tmpvar_16);
half4 tmpvar_18;
half4 tmpvar_18 = 0;
tmpvar_18.zw = half2(float2(0.0, 0.0));
tmpvar_18.xy = (coord_17 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_19;
half4 tmpvar_20;
half4 tmpvar_19 = 0;
half4 tmpvar_20 = 0;
tmpvar_20 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_18.xy), level(0.0));
tmpvar_19 = tmpvar_20;
float2 tmpvar_21;
float2 tmpvar_21 = 0;
tmpvar_21.y = 2.0;
tmpvar_21.x = float(tmpvar_5.y);
half2 coord_22;
half2 coord_22 = 0;
coord_22 = half2(tmpvar_21);
half4 tmpvar_23;
half4 tmpvar_23 = 0;
tmpvar_23.zw = half2(float2(0.0, 0.0));
tmpvar_23.xy = (coord_22 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_24;
half4 tmpvar_25;
half4 tmpvar_24 = 0;
half4 tmpvar_25 = 0;
tmpvar_25 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_23.xy), level(0.0));
tmpvar_24 = tmpvar_25;
float2 tmpvar_26;
float2 tmpvar_26 = 0;
tmpvar_26.y = 1.0;
tmpvar_26.x = float(tmpvar_5.z);
half2 coord_27;
half2 coord_27 = 0;
coord_27 = half2(tmpvar_26);
half4 tmpvar_28;
half4 tmpvar_28 = 0;
tmpvar_28.zw = half2(float2(0.0, 0.0));
tmpvar_28.xy = (coord_27 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_29;
half4 tmpvar_30;
half4 tmpvar_29 = 0;
half4 tmpvar_30 = 0;
tmpvar_30 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_28.xy), level(0.0));
tmpvar_29 = tmpvar_30;
float2 tmpvar_31;
float2 tmpvar_31 = 0;
tmpvar_31.y = 2.0;
tmpvar_31.x = float(tmpvar_5.z);
half2 coord_32;
half2 coord_32 = 0;
coord_32 = half2(tmpvar_31);
half4 tmpvar_33;
half4 tmpvar_33 = 0;
tmpvar_33.zw = half2(float2(0.0, 0.0));
tmpvar_33.xy = (coord_32 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_34;
half4 tmpvar_35;
half4 tmpvar_34 = 0;
half4 tmpvar_35 = 0;
tmpvar_35 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_33.xy), level(0.0));
tmpvar_34 = tmpvar_35;
float2 tmpvar_36;
float2 tmpvar_36 = 0;
tmpvar_36.y = 1.0;
tmpvar_36.x = float(tmpvar_5.w);
half2 coord_37;
half2 coord_37 = 0;
coord_37 = half2(tmpvar_36);
half4 tmpvar_38;
half4 tmpvar_38 = 0;
tmpvar_38.zw = half2(float2(0.0, 0.0));
tmpvar_38.xy = (coord_37 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_39;
half4 tmpvar_40;
half4 tmpvar_39 = 0;
half4 tmpvar_40 = 0;
tmpvar_40 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_38.xy), level(0.0));
tmpvar_39 = tmpvar_40;
float2 tmpvar_41;
float2 tmpvar_41 = 0;
tmpvar_41.y = 2.0;
tmpvar_41.x = float(tmpvar_5.w);
half2 coord_42;
half2 coord_42 = 0;
coord_42 = half2(tmpvar_41);
half4 tmpvar_43;
half4 tmpvar_43 = 0;
tmpvar_43.zw = half2(float2(0.0, 0.0));
tmpvar_43.xy = (coord_42 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_44;
half4 tmpvar_45;
half4 tmpvar_44 = 0;
half4 tmpvar_45 = 0;
tmpvar_45 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_43.xy), level(0.0));
tmpvar_44 = tmpvar_45;
half3 hybridCol_46;
half4 atten_47;
float3 tmpvar_48;
tmpvar_48 = ((float3)tmpvar_9.xyz - tmpvar_2);
float tmpvar_49;
half3 hybridCol_46 = 0;
half4 atten_47 = 0;
float3 tmpvar_48 = 0;
tmpvar_48 = ((float3)(tmpvar_9.xyz) - tmpvar_2);
float tmpvar_49 = 0;
tmpvar_49 = dot (tmpvar_48, tmpvar_48);
half4 tmpvar_50;
half4 tmpvar_50 = 0;
tmpvar_50.yzw = atten_47.yzw;
tmpvar_50.x = half((tmpvar_49 * (float)tmpvar_9.w));
float3 tmpvar_51;
tmpvar_51 = ((float3)tmpvar_19.xyz - tmpvar_2);
float tmpvar_52;
tmpvar_50.x = half((tmpvar_49 * (float)(tmpvar_9.w)));
float3 tmpvar_51 = 0;
tmpvar_51 = ((float3)(tmpvar_19.xyz) - tmpvar_2);
float tmpvar_52 = 0;
tmpvar_52 = dot (tmpvar_51, tmpvar_51);
half4 tmpvar_53;
half4 tmpvar_53 = 0;
tmpvar_53.xzw = tmpvar_50.xzw;
tmpvar_53.y = half((tmpvar_52 * (float)tmpvar_19.w));
float3 tmpvar_54;
tmpvar_54 = ((float3)tmpvar_29.xyz - tmpvar_2);
float tmpvar_55;
tmpvar_53.y = half((tmpvar_52 * (float)(tmpvar_19.w)));
float3 tmpvar_54 = 0;
tmpvar_54 = ((float3)(tmpvar_29.xyz) - tmpvar_2);
float tmpvar_55 = 0;
tmpvar_55 = dot (tmpvar_54, tmpvar_54);
half4 tmpvar_56;
half4 tmpvar_56 = 0;
tmpvar_56.xyw = tmpvar_53.xyw;
tmpvar_56.z = half((tmpvar_55 * (float)tmpvar_29.w));
float3 tmpvar_57;
tmpvar_57 = ((float3)tmpvar_39.xyz - tmpvar_2);
float tmpvar_58;
tmpvar_56.z = half((tmpvar_55 * (float)(tmpvar_29.w)));
float3 tmpvar_57 = 0;
tmpvar_57 = ((float3)(tmpvar_39.xyz) - tmpvar_2);
float tmpvar_58 = 0;
tmpvar_58 = dot (tmpvar_57, tmpvar_57);
half4 tmpvar_59;
half4 tmpvar_59 = 0;
tmpvar_59.xyz = tmpvar_56.xyz;
tmpvar_59.w = half((tmpvar_58 * (float)tmpvar_39.w));
tmpvar_59.w = half((tmpvar_58 * (float)(tmpvar_39.w)));
atten_47 = tmpvar_59;
hybridCol_46 = (hybridCol_4 + (tmpvar_14.xyz * tmpvar_50.x));
hybridCol_46 = (hybridCol_46 + (tmpvar_24.xyz * tmpvar_53.y));

Просмотреть файл

@ -18,18 +18,18 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float4 tmpvar_1;
float3 tmpvar_2;
float4 tmpvar_1 = 0;
float3 tmpvar_2 = 0;
tmpvar_1 = (_mtl_u.glstate_matrix_mvp * _mtl_i._vertex);
float4 o_3;
float4 o_3 = 0;
o_3 = (tmpvar_1 * 0.5);
float2 tmpvar_4;
float2 tmpvar_4 = 0;
tmpvar_4.x = o_3.x;
tmpvar_4.y = (o_3.y * _mtl_u._ProjectionParams.x);
o_3.xy = (tmpvar_4 + o_3.w);
o_3.zw = tmpvar_1.zw;
tmpvar_2 = ((_mtl_u.glstate_matrix_modelview0 * _mtl_i._vertex).xyz * float3(-1.0, -1.0, 1.0));
float3 tmpvar_5;
float3 tmpvar_5 = 0;
tmpvar_5 = mix (tmpvar_2, _mtl_i._normal, float3(float((_mtl_i._normal.z != 0.0))));
tmpvar_2 = tmpvar_5;
_mtl_o.gl_Position = tmpvar_1;

Просмотреть файл

@ -36,56 +36,56 @@ struct xlatMtlShaderUniform {
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
float4 tmpvar_1;
float3 tmpvar_2;
float4 tmpvar_3;
float4 tmpvar_1 = 0;
float3 tmpvar_2 = 0;
float4 tmpvar_3 = 0;
tmpvar_1 = float4(_mtl_i.TANGENT);
tmpvar_2 = float3(_mtl_i._inNormal);
tmpvar_3 = float4(_mtl_i._color);
float3 binormal_4;
float4 tmpvar_5;
float4 tmpvar_6;
float4 pos_7;
float isBillboard_8;
float3 binormal_4 = 0;
float4 tmpvar_5 = 0;
float4 tmpvar_6 = 0;
float4 pos_7 = 0;
float isBillboard_8 = 0;
isBillboard_8 = (1.0 - abs(tmpvar_1.w));
float4 tmpvar_9;
float4 tmpvar_9 = 0;
tmpvar_9.w = 0.0;
tmpvar_9.xyz = tmpvar_2;
float4 tmpvar_10;
float4 tmpvar_10 = 0;
tmpvar_10.w = 0.0;
tmpvar_10.xyz = tmpvar_1.xyz;
float4 tmpvar_11;
float4 tmpvar_11 = 0;
tmpvar_11.zw = float2(0.0, 0.0);
tmpvar_11.xy = tmpvar_2.xy;
pos_7 = (_mtl_i._inVertex + ((tmpvar_11 * _mtl_u.glstate_matrix_invtrans_modelview0) * isBillboard_8));
float3 tmpvar_12;
float3 tmpvar_12 = 0;
tmpvar_12 = mix (tmpvar_2, normalize((tmpvar_9 * _mtl_u.glstate_matrix_invtrans_modelview0)).xyz, float3(isBillboard_8));
float4 tmpvar_13;
float4 tmpvar_13 = 0;
tmpvar_13.w = -1.0;
tmpvar_13.xyz = normalize((tmpvar_10 * _mtl_u.glstate_matrix_invtrans_modelview0)).xyz;
float4 tmpvar_14;
float4 tmpvar_14 = 0;
tmpvar_14 = mix (tmpvar_1, tmpvar_13, float4(isBillboard_8));
tmpvar_5.w = pos_7.w;
tmpvar_6.w = tmpvar_14.w;
tmpvar_5.xyz = (pos_7.xyz * _mtl_u._Scale.xyz);
float4 pos_15;
float4 pos_15 = 0;
pos_15.w = tmpvar_5.w;
float3 bend_16;
float2 vWavesSum_17;
float4 vWaves_18;
float fBranchPhase_19;
float3 bend_16 = 0;
float2 vWavesSum_17 = 0;
float4 vWaves_18 = 0;
float fBranchPhase_19 = 0;
fBranchPhase_19 = (dot (_mtl_u._Object2World[3].xyz, float3(1.0, 1.0, 1.0)) + tmpvar_3.x);
float2 tmpvar_20;
float2 tmpvar_20 = 0;
tmpvar_20.x = dot (tmpvar_5.xyz, float3((tmpvar_3.y + fBranchPhase_19)));
tmpvar_20.y = fBranchPhase_19;
vWaves_18 = ((fract(
((_mtl_u._Time.yy + tmpvar_20).xxyy * float4(1.975, 0.793, 0.375, 0.193))
) * 2.0) - 1.0);
float4 tmpvar_21;
float4 tmpvar_21 = 0;
tmpvar_21 = abs(((
fract((vWaves_18 + 0.5))
* 2.0) - 1.0));
float4 tmpvar_22;
float4 tmpvar_22 = 0;
tmpvar_22 = ((tmpvar_21 * tmpvar_21) * (3.0 - (2.0 * tmpvar_21)));
vWaves_18 = tmpvar_22;
vWavesSum_17 = (tmpvar_22.xz + tmpvar_22.yw);
@ -97,18 +97,18 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
((_mtl_u._Wind.xyz * vWavesSum_17.y) * _mtl_i._uv1.y)
) * _mtl_u._Wind.w));
pos_15.xyz = (pos_15.xyz + (_mtl_i._uv1.x * _mtl_u._Wind.xyz));
float3 tmpvar_23;
float3 tmpvar_23 = 0;
tmpvar_23 = mix ((pos_15.xyz - (
(dot (_mtl_u._SquashPlaneNormal.xyz, pos_15.xyz) + _mtl_u._SquashPlaneNormal.w)
* _mtl_u._SquashPlaneNormal.xyz)), pos_15.xyz, float3(_mtl_u._SquashAmount));
float4 tmpvar_24;
float4 tmpvar_24 = 0;
tmpvar_24.w = 1.0;
tmpvar_24.xyz = tmpvar_23;
tmpvar_5 = tmpvar_24;
float4 tmpvar_25;
float4 tmpvar_25 = 0;
tmpvar_25.xyz = float3(1.0, 1.0, 1.0);
tmpvar_25.w = tmpvar_3.w;
float3 tmpvar_26;
float3 tmpvar_26 = 0;
tmpvar_26 = normalize(tmpvar_12);
tmpvar_6.xyz = normalize(tmpvar_14.xyz);
binormal_4 = (((tmpvar_26.yzx * tmpvar_6.zxy) - (tmpvar_26.zxy * tmpvar_6.yzx)) * tmpvar_14.w);
@ -122,21 +122,21 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
tmpvar_27[2].x = tmpvar_6.z;
tmpvar_27[2].y = binormal_4.z;
tmpvar_27[2].z = tmpvar_26.z;
float4 tmpvar_28;
float4 tmpvar_28 = 0;
tmpvar_28.w = 1.0;
tmpvar_28.xyz = _mtl_u._WorldSpaceCameraPos;
_mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * tmpvar_24);
_mtl_o.xlv_TEXCOORD0 = ((_mtl_i._uv0.xy * _mtl_u._MainTex_ST.xy) + _mtl_u._MainTex_ST.zw);
_mtl_o.xlv_COLOR0 = half4(tmpvar_25);
float3 tmpvar_29;
float3 tmpvar_29 = 0;
tmpvar_29 = (tmpvar_27 * (_mtl_u._World2Object * _mtl_u._WorldSpaceLightPos0).xyz);
_mtl_o.xlv_TEXCOORD1 = half3(tmpvar_29);
float3 tmpvar_30;
float3 tmpvar_30 = 0;
tmpvar_30 = (tmpvar_27 * ((
(_mtl_u._World2Object * tmpvar_28)
.xyz * _mtl_u.unity_Scale.w) - tmpvar_23));
_mtl_o.xlv_TEXCOORD2 = half3(tmpvar_30);
float2 tmpvar_31;
float2 tmpvar_31 = 0;
tmpvar_31 = (_mtl_u._LightMatrix0 * (_mtl_u._Object2World * tmpvar_24)).xy;
_mtl_o.xlv_TEXCOORD3 = half2(tmpvar_31);
return _mtl_o;