GLSL转HLSL逆向分析之【函数展开】【二】

为了方便逆向还原HLSL的Shader语言,下面整理了所有HLSL函数对应的GLSL展开,也就是经过编译器编译后的GLSL代码。

abs

直接替换使用

acos

float

u_xlat0 = abs(in_POSITION0.x) * -0.0187292993 + 0.0742610022;
u_xlat0 = u_xlat0 * abs(in_POSITION0.x) + -0.212114394;
u_xlat0 = u_xlat0 * abs(in_POSITION0.x) + 1.57072878;
u_xlat1 = -abs(in_POSITION0.x) + 1.0;
u_xlat1 = sqrt(u_xlat1);
u_xlat2 = u_xlat1 * u_xlat0;
u_xlat2 = u_xlat2 * -2.0 + 3.14159274;
u_xlatb3 = in_POSITION0.x<(-in_POSITION0.x);
u_xlat2 = u_xlatb3 ? u_xlat2 : float(0.0);
gl_Position.x = u_xlat0 * u_xlat1 + u_xlat2;

float2

u_xlat0.xy = abs(in_POSITION0.xy) * vec2(-0.0187292993, -0.0187292993) + vec2(0.0742610022, 0.0742610022);
u_xlat0.xy = u_xlat0.xy * abs(in_POSITION0.xy) + vec2(-0.212114394, -0.212114394);
u_xlat0.xy = u_xlat0.xy * abs(in_POSITION0.xy) + vec2(1.57072878, 1.57072878);
u_xlat4.xy = -abs(in_POSITION0.xy) + vec2(1.0, 1.0);
u_xlat4.xy = sqrt(u_xlat4.xy);
u_xlat1.xy = u_xlat4.xy * u_xlat0.xy;
u_xlat1.xy = u_xlat1.xy * vec2(-2.0, -2.0) + vec2(3.14159274, 3.14159274);
u_xlatb5.xy = lessThan(in_POSITION0.xyxy, (-in_POSITION0.xyxy)).xy;
u_xlat1.xy = mix(vec2(0.0, 0.0), u_xlat1.xy, vec2(u_xlatb5.xy));
gl_Position.xy = u_xlat0.xy * u_xlat4.xy + u_xlat1.xy;

float3

u_xlat0.xyz = abs(in_POSITION0.xyz) * vec3(-0.0187292993, -0.0187292993, -0.0187292993) + vec3(0.0742610022, 0.0742610022, 0.0742610022);
u_xlat0.xyz = u_xlat0.xyz * abs(in_POSITION0.xyz) + vec3(-0.212114394, -0.212114394, -0.212114394);
u_xlat0.xyz = u_xlat0.xyz * abs(in_POSITION0.xyz) + vec3(1.57072878, 1.57072878, 1.57072878);
u_xlat1.xyz = -abs(in_POSITION0.xyz) + vec3(1.0, 1.0, 1.0);
u_xlat1.xyz = sqrt(u_xlat1.xyz);
u_xlat2.xyz = u_xlat0.xyz * u_xlat1.xyz;
u_xlat2.xyz = u_xlat2.xyz * vec3(-2.0, -2.0, -2.0) + vec3(3.14159274, 3.14159274, 3.14159274);
u_xlatb3.xyz = lessThan(in_POSITION0.xyzx, (-in_POSITION0.xyzx)).xyz;
u_xlat2.xyz = mix(vec3(0.0, 0.0, 0.0), u_xlat2.xyz, vec3(u_xlatb3.xyz));
gl_Position.xyz = u_xlat0.xyz * u_xlat1.xyz + u_xlat2.xyz;

float4

u_xlat0 = abs(in_POSITION0) * vec4(-0.0187292993, -0.0187292993, -0.0187292993, -0.0187292993) + vec4(0.0742610022, 0.0742610022, 0.0742610022, 0.0742610022);
u_xlat0 = u_xlat0 * abs(in_POSITION0) + vec4(-0.212114394, -0.212114394, -0.212114394, -0.212114394);
u_xlat0 = u_xlat0 * abs(in_POSITION0) + vec4(1.57072878, 1.57072878, 1.57072878, 1.57072878);
u_xlat1 = -abs(in_POSITION0) + vec4(1.0, 1.0, 1.0, 1.0);
u_xlat1 = sqrt(u_xlat1);
u_xlat2 = u_xlat0 * u_xlat1;
u_xlat2 = u_xlat2 * vec4(-2.0, -2.0, -2.0, -2.0) + vec4(3.14159274, 3.14159274, 3.14159274, 3.14159274);
u_xlatb3 = lessThan(in_POSITION0, (-in_POSITION0));
u_xlat2 = mix(vec4(0.0, 0.0, 0.0, 0.0), u_xlat2, vec4(u_xlatb3));
gl_Position = u_xlat0 * u_xlat1 + u_xlat2;

all

any

asfloat

asin

float

u_xlat0 = abs(in_POSITION0.x) * -0.0187292993 + 0.0742610022;
u_xlat0 = u_xlat0 * abs(in_POSITION0.x) + -0.212114394;
u_xlat0 = u_xlat0 * abs(in_POSITION0.x) + 1.57072878;
u_xlat1 = -abs(in_POSITION0.x) + 1.0;
u_xlat1 = sqrt(u_xlat1);
u_xlat2 = u_xlat1 * u_xlat0;
u_xlat2 = u_xlat2 * -2.0 + 3.14159274;
u_xlatb3 = in_POSITION0.x<(-in_POSITION0.x);
u_xlat2 = u_xlatb3 ? u_xlat2 : float(0.0);
u_xlat0 = u_xlat0 * u_xlat1 + u_xlat2;
gl_Position.x = (-u_xlat0) + 1.57079637;

float2

u_xlat0.xy = abs(in_POSITION0.xy) * vec2(-0.0187292993, -0.0187292993) + vec2(0.0742610022, 0.0742610022);
u_xlat0.xy = u_xlat0.xy * abs(in_POSITION0.xy) + vec2(-0.212114394, -0.212114394);
u_xlat0.xy = u_xlat0.xy * abs(in_POSITION0.xy) + vec2(1.57072878, 1.57072878);
u_xlat4.xy = -abs(in_POSITION0.xy) + vec2(1.0, 1.0);
u_xlat4.xy = sqrt(u_xlat4.xy);
u_xlat1.xy = u_xlat4.xy * u_xlat0.xy;
u_xlat1.xy = u_xlat1.xy * vec2(-2.0, -2.0) + vec2(3.14159274, 3.14159274);
u_xlatb5.xy = lessThan(in_POSITION0.xyxy, (-in_POSITION0.xyxy)).xy;
u_xlat1.xy = mix(vec2(0.0, 0.0), u_xlat1.xy, vec2(u_xlatb5.xy));
u_xlat0.xy = u_xlat0.xy * u_xlat4.xy + u_xlat1.xy;
gl_Position.xy = (-u_xlat0.xy) + vec2(1.57079637, 1.57079637);

float3

u_xlat0.xyz = abs(in_POSITION0.xyz) * vec3(-0.0187292993, -0.0187292993, -0.0187292993) + vec3(0.0742610022, 0.0742610022, 0.0742610022);
u_xlat0.xyz = u_xlat0.xyz * abs(in_POSITION0.xyz) + vec3(-0.212114394, -0.212114394, -0.212114394);
u_xlat0.xyz = u_xlat0.xyz * abs(in_POSITION0.xyz) + vec3(1.57072878, 1.57072878, 1.57072878);
u_xlat1.xyz = -abs(in_POSITION0.xyz) + vec3(1.0, 1.0, 1.0);
u_xlat1.xyz = sqrt(u_xlat1.xyz);
u_xlat2.xyz = u_xlat0.xyz * u_xlat1.xyz;
u_xlat2.xyz = u_xlat2.xyz * vec3(-2.0, -2.0, -2.0) + vec3(3.14159274, 3.14159274, 3.14159274);
u_xlatb3.xyz = lessThan(in_POSITION0.xyzx, (-in_POSITION0.xyzx)).xyz;
u_xlat2.xyz = mix(vec3(0.0, 0.0, 0.0), u_xlat2.xyz, vec3(u_xlatb3.xyz));
u_xlat0.xyz = u_xlat0.xyz * u_xlat1.xyz + u_xlat2.xyz;
gl_Position.xyz = (-u_xlat0.xyz) + vec3(1.57079637, 1.57079637, 1.57079637);

float4

u_xlat0 = abs(in_POSITION0) * vec4(-0.0187292993, -0.0187292993, -0.0187292993, -0.0187292993) + vec4(0.0742610022, 0.0742610022, 0.0742610022, 0.0742610022);
u_xlat0 = u_xlat0 * abs(in_POSITION0) + vec4(-0.212114394, -0.212114394, -0.212114394, -0.212114394);
u_xlat0 = u_xlat0 * abs(in_POSITION0) + vec4(1.57072878, 1.57072878, 1.57072878, 1.57072878);
u_xlat1 = -abs(in_POSITION0) + vec4(1.0, 1.0, 1.0, 1.0);
u_xlat1 = sqrt(u_xlat1);
u_xlat2 = u_xlat0 * u_xlat1;
u_xlat2 = u_xlat2 * vec4(-2.0, -2.0, -2.0, -2.0) + vec4(3.14159274, 3.14159274, 3.14159274, 3.14159274);
u_xlatb3 = lessThan(in_POSITION0, (-in_POSITION0));
u_xlat2 = mix(vec4(0.0, 0.0, 0.0, 0.0), u_xlat2, vec4(u_xlatb3));
u_xlat0 = u_xlat0 * u_xlat1 + u_xlat2;
gl_Position = (-u_xlat0) + vec4(1.57079637, 1.57079637, 1.57079637, 1.57079637);

asint

asuint

atan

float

u_xlat0 = max(abs(in_POSITION0.x), 1.0);
u_xlat0 = float(1.0) / u_xlat0;
u_xlat1 = min(abs(in_POSITION0.x), 1.0);
u_xlat0 = u_xlat0 * u_xlat1;
u_xlat1 = u_xlat0 * u_xlat0;
u_xlat2 = u_xlat1 * 0.0208350997 + -0.0851330012;
u_xlat2 = u_xlat1 * u_xlat2 + 0.180141002;
u_xlat2 = u_xlat1 * u_xlat2 + -0.330299497;
u_xlat1 = u_xlat1 * u_xlat2 + 0.999866009;
u_xlat2 = u_xlat1 * u_xlat0;
u_xlat2 = u_xlat2 * -2.0 + 1.57079637;
u_xlatb3 = 1.0<abs(in_POSITION0.x);
u_xlat2 = u_xlatb3 ? u_xlat2 : float(0.0);
u_xlat0 = u_xlat0 * u_xlat1 + u_xlat2;
u_xlat1 = min(in_POSITION0.x, 1.0);
u_xlatb1 = u_xlat1<(-u_xlat1);
gl_Position.x = (u_xlatb1) ? (-u_xlat0) : u_xlat0;

float2

u_xlat0.xy = max(abs(in_POSITION0.xy), vec2(1.0, 1.0));
u_xlat0.xy = vec2(1.0, 1.0) / u_xlat0.xy;
u_xlat4.xy = min(abs(in_POSITION0.xy), vec2(1.0, 1.0));
u_xlat0.xy = u_xlat0.xy * u_xlat4.xy;
u_xlat4.xy = u_xlat0.xy * u_xlat0.xy;
u_xlat1.xy = u_xlat4.xy * vec2(0.0208350997, 0.0208350997) + vec2(-0.0851330012, -0.0851330012);
u_xlat1.xy = u_xlat4.xy * u_xlat1.xy + vec2(0.180141002, 0.180141002);
u_xlat1.xy = u_xlat4.xy * u_xlat1.xy + vec2(-0.330299497, -0.330299497);
u_xlat4.xy = u_xlat4.xy * u_xlat1.xy + vec2(0.999866009, 0.999866009);
u_xlat1.xy = u_xlat4.xy * u_xlat0.xy;
u_xlat1.xy = u_xlat1.xy * vec2(-2.0, -2.0) + vec2(1.57079637, 1.57079637);
u_xlatb5.xy = lessThan(vec4(1.0, 1.0, 1.0, 1.0), abs(in_POSITION0.xyxy)).xy;
u_xlat1.xy = mix(vec2(0.0, 0.0), u_xlat1.xy, vec2(u_xlatb5.xy));
u_xlat0.xy = u_xlat0.xy * u_xlat4.xy + u_xlat1.xy;
u_xlat4.xy = min(in_POSITION0.xy, vec2(1.0, 1.0));
u_xlatb4.xy = lessThan(u_xlat4.xyxy, (-u_xlat4.xyxy)).xy;
gl_Position.x = (u_xlatb4.x) ? (-u_xlat0.x) : u_xlat0.x;
gl_Position.y = (u_xlatb4.y) ? (-u_xlat0.y) : u_xlat0.y;

float3

u_xlat0.xyz = max(abs(in_POSITION0.xyz), vec3(1.0, 1.0, 1.0));
u_xlat0.xyz = vec3(1.0, 1.0, 1.0) / u_xlat0.xyz;
u_xlat1.xyz = min(abs(in_POSITION0.xyz), vec3(1.0, 1.0, 1.0));
u_xlat0.xyz = u_xlat0.xyz * u_xlat1.xyz;
u_xlat1.xyz = u_xlat0.xyz * u_xlat0.xyz;
u_xlat2.xyz = u_xlat1.xyz * vec3(0.0208350997, 0.0208350997, 0.0208350997) + vec3(-0.0851330012, -0.0851330012, -0.0851330012);
u_xlat2.xyz = u_xlat1.xyz * u_xlat2.xyz + vec3(0.180141002, 0.180141002, 0.180141002);
u_xlat2.xyz = u_xlat1.xyz * u_xlat2.xyz + vec3(-0.330299497, -0.330299497, -0.330299497);
u_xlat1.xyz = u_xlat1.xyz * u_xlat2.xyz + vec3(0.999866009, 0.999866009, 0.999866009);
u_xlat2.xyz = u_xlat0.xyz * u_xlat1.xyz;
u_xlat2.xyz = u_xlat2.xyz * vec3(-2.0, -2.0, -2.0) + vec3(1.57079637, 1.57079637, 1.57079637);
u_xlatb3.xyz = lessThan(vec4(1.0, 1.0, 1.0, 0.0), abs(in_POSITION0.xyzx)).xyz;
u_xlat2.xyz = mix(vec3(0.0, 0.0, 0.0), u_xlat2.xyz, vec3(u_xlatb3.xyz));
u_xlat0.xyz = u_xlat0.xyz * u_xlat1.xyz + u_xlat2.xyz;
u_xlat1.xyz = min(in_POSITION0.xyz, vec3(1.0, 1.0, 1.0));
u_xlatb1.xyz = lessThan(u_xlat1.xyzx, (-u_xlat1.xyzx)).xyz;
gl_Position.x = (u_xlatb1.x) ? (-u_xlat0.x) : u_xlat0.x;
gl_Position.y = (u_xlatb1.y) ? (-u_xlat0.y) : u_xlat0.y;
gl_Position.z = (u_xlatb1.z) ? (-u_xlat0.z) : u_xlat0.z;

float4

u_xlat0 = max(abs(in_POSITION0), vec4(1.0, 1.0, 1.0, 1.0));
u_xlat0 = vec4(1.0, 1.0, 1.0, 1.0) / u_xlat0;
u_xlat1 = min(abs(in_POSITION0), vec4(1.0, 1.0, 1.0, 1.0));
u_xlat0 = u_xlat0 * u_xlat1;
u_xlat1 = u_xlat0 * u_xlat0;
u_xlat2 = u_xlat1 * vec4(0.0208350997, 0.0208350997, 0.0208350997, 0.0208350997) + vec4(-0.0851330012, -0.0851330012, -0.0851330012, -0.0851330012);
u_xlat2 = u_xlat1 * u_xlat2 + vec4(0.180141002, 0.180141002, 0.180141002, 0.180141002);
u_xlat2 = u_xlat1 * u_xlat2 + vec4(-0.330299497, -0.330299497, -0.330299497, -0.330299497);
u_xlat1 = u_xlat1 * u_xlat2 + vec4(0.999866009, 0.999866009, 0.999866009, 0.999866009);
u_xlat2 = u_xlat0 * u_xlat1;
u_xlat2 = u_xlat2 * vec4(-2.0, -2.0, -2.0, -2.0) + vec4(1.57079637, 1.57079637, 1.57079637, 1.57079637);
u_xlatb3 = lessThan(vec4(1.0, 1.0, 1.0, 1.0), abs(in_POSITION0));
u_xlat2 = mix(vec4(0.0, 0.0, 0.0, 0.0), u_xlat2, vec4(u_xlatb3));
u_xlat0 = u_xlat0 * u_xlat1 + u_xlat2;
u_xlat1 = min(in_POSITION0, vec4(1.0, 1.0, 1.0, 1.0));
u_xlatb1 = lessThan(u_xlat1, (-u_xlat1));
gl_Position.x = (u_xlatb1.x) ? (-u_xlat0.x) : u_xlat0.x;
gl_Position.y = (u_xlatb1.y) ? (-u_xlat0.y) : u_xlat0.y;
gl_Position.z = (u_xlatb1.z) ? (-u_xlat0.z) : u_xlat0.z;
gl_Position.w = (u_xlatb1.w) ? (-u_xlat0.w) : u_xlat0.w;

atan2

ceil

直接替换使用

clamp

float

u_xlat0 = max(in_POSITION0.x, data_min);
gl_Position.x = min(u_xlat0, data_max);

float2

u_xlat0 = max(in_POSITION0.x, data_min);
gl_Position.xy = min(u_xlat0, data_max);

float3

u_xlat0 = max(in_POSITION0.x, data_min);
gl_Position.xyz = min(u_xlat0, data_max);

float4

u_xlat0 = max(in_POSITION0.x, data_min);
gl_Position = min(u_xlat0, data_max);

clip

float

u_xlatb1 = u_xlat10_0.w<0.0;
SV_Target0 = u_xlat10_0;
if(((int(u_xlatb1) * -1))!=0){discard;}

float2

u_xlatb1.xy = lessThan(u_xlat10_0.xyxx, vec4(0.0, 0.0, 0.0, 0.0)).xy;
u_xlatb0 = u_xlatb1.y || u_xlatb1.x;
if(((int(u_xlatb0) * -1))!=0){discard;}

float3

u_xlatb1.xyz = lessThan(u_xlat10_0.xyzx, vec4(0.0, 0.0, 0.0, 0.0)).xyz;
u_xlatb0 = u_xlatb1.y || u_xlatb1.x;
u_xlatb0 = u_xlatb1.z || u_xlatb0;
if(((int(u_xlatb0) * -1))!=0){discard;}

float4

u_xlatb1 = lessThan(u_xlat0, vec4(0.0, 0.0, 0.0, 0.0));
u_xlatb0.x = u_xlatb1.z || u_xlatb1.x;
u_xlatb0.y = u_xlatb1.w || u_xlatb1.y;
u_xlatb0.x = u_xlatb0.y || u_xlatb0.x;
if(((int(u_xlatb0.x) * -1))!=0){discard;}

float4x4

u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[0].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[0].xxxx + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[0].zzzz + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[0].wwww + u_xlat0;
u_xlat1.x = u_xlat0.x;
u_xlat2 = hlslcc_mtx4x4unity_ObjectToWorld[1].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[1].xxxx + u_xlat2;
u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[1].zzzz + u_xlat2;
u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[3].xwyz * hlslcc_mtx4x4unity_ObjectToWorld[1].wwww + u_xlat2.xwyz;
u_xlat1.y = u_xlat2.x;
u_xlat3 = hlslcc_mtx4x4unity_ObjectToWorld[2].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat3 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[2].xxxx + u_xlat3;
u_xlat3 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[2].zzzz + u_xlat3;
u_xlat3 = hlslcc_mtx4x4unity_MatrixVP[3].xzyw * hlslcc_mtx4x4unity_ObjectToWorld[2].wwww + u_xlat3.xzyw;
u_xlat1.z = u_xlat3.x;
u_xlat4 = hlslcc_mtx4x4unity_ObjectToWorld[3].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat4 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[3].xxxx + u_xlat4;
u_xlat4 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[3].zzzz + u_xlat4;
u_xlat4 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[3].wwww + u_xlat4;
u_xlat1.w = u_xlat4.x;
u_xlatb1 = lessThan(u_xlat1, vec4(0.0, 0.0, 0.0, 0.0));
u_xlat5.x = u_xlat0.z;
u_xlat5.y = u_xlat2.w;
u_xlat5.z = u_xlat3.y;
u_xlat5.w = u_xlat4.z;
u_xlatb5 = lessThan(u_xlat5, vec4(0.0, 0.0, 0.0, 0.0));
u_xlati1 = op_or((ivec4(u_xlatb1) * -1), (ivec4(u_xlatb5) * -1));
u_xlat3.x = u_xlat0.y;
u_xlat2.x = u_xlat0.w;
u_xlat3.y = u_xlat2.z;
u_xlat2.z = u_xlat3.w;
u_xlat3.w = u_xlat4.y;
u_xlat2.w = u_xlat4.w;
u_xlatb0 = lessThan(u_xlat2, vec4(0.0, 0.0, 0.0, 0.0));
u_xlatb2 = lessThan(u_xlat3, vec4(0.0, 0.0, 0.0, 0.0));
u_xlati0 = op_or((ivec4(u_xlatb0) * -1), (ivec4(u_xlatb2) * -1));
u_xlati0 = op_or(u_xlati0, u_xlati1);
u_xlati0.xy = op_or(u_xlati0.zw, u_xlati0.xy);
u_xlati0.x = op_or(u_xlati0.y, u_xlati0.x);
if((u_xlati0.x)!=0){discard;}

cos

可直接替换

cosh

float

u_xlat0 = in_POSITION0.x * 1.44269502;
u_xlat1 = exp2(u_xlat0);
u_xlat0 = exp2((-u_xlat0));
u_xlat0 = u_xlat0 + u_xlat1;
gl_Position.x = u_xlat0 * 0.5;

float2

u_xlat0.xy = in_POSITION0.xy * vec2(1.44269502, 1.44269502);
u_xlat2.xy = exp2(u_xlat0.xy);
u_xlat0.xy = exp2((-u_xlat0.xy));
u_xlat0.xy = u_xlat0.xy + u_xlat2.xy;
gl_Position.xy = u_xlat0.xy * vec2(0.5, 0.5);

float3

u_xlat0.xyz = in_POSITION0.xyz * vec3(1.44269502, 1.44269502, 1.44269502);
u_xlat1.xyz = exp2(u_xlat0.xyz);
u_xlat0.xyz = exp2((-u_xlat0.xyz));
u_xlat0.xyz = u_xlat0.xyz + u_xlat1.xyz;
gl_Position.xyz = u_xlat0.xyz * vec3(0.5, 0.5, 0.5);

float4

u_xlat0 = in_POSITION0 * vec4(1.44269502, 1.44269502, 1.44269502, 1.44269502);
u_xlat1 = exp2(u_xlat0);
u_xlat0 = exp2((-u_xlat0));
u_xlat0 = u_xlat0 + u_xlat1;
gl_Position = u_xlat0 * vec4(0.5, 0.5, 0.5, 0.5);

cross

float3

u_xlat0.xyz = in_POSITION0.zxy * data_vec3_0;
gl_Position.xyz = in_POSITION0.yzx * data_vec3_0 + (-u_xlat0.xyz);

D3DCOLORtoUBYTE4

ddx

使用 dFdx 替代

ddy

使用 dFdy 替代

degrees

float

gl_Position.x = in_POSITION0.x * 57.2957802;

determinant

float4x4

u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[0].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[0].xxxx + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[0].zzzz + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[0].wwww + u_xlat0;
u_xlat1 = hlslcc_mtx4x4unity_ObjectToWorld[1].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[1].xxxx + u_xlat1;
u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[1].zzzz + u_xlat1;
u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[1].wwww + u_xlat1;
u_xlat2 = hlslcc_mtx4x4unity_ObjectToWorld[2].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[2].xxxx + u_xlat2;
u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[2].zzzz + u_xlat2;
u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[2].wwww + u_xlat2;
u_xlat3 = hlslcc_mtx4x4unity_ObjectToWorld[3].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat3 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[3].xxxx + u_xlat3;
u_xlat3 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[3].zzzz + u_xlat3;
u_xlat3 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[3].wwww + u_xlat3;
u_xlat4.xyz = u_xlat2.wyz * u_xlat3.zwy;
u_xlat4.xyz = u_xlat2.zwy * u_xlat3.wyz + (-u_xlat4.xyz);
u_xlat4.x = dot(u_xlat4.xyz, u_xlat1.yzw);
u_xlat5.xyz = u_xlat2.zwx * u_xlat3.wxz;
u_xlat5.xyz = u_xlat2.wxz * u_xlat3.zwx + (-u_xlat5.xyz);
u_xlat4.y = dot(u_xlat5.xyz, u_xlat1.xzw);
u_xlat5.xyz = u_xlat2.wxy * u_xlat3.ywx;
u_xlat5.xyz = u_xlat2.ywx * u_xlat3.wxy + (-u_xlat5.xyz);
u_xlat4.z = dot(u_xlat5.xyz, u_xlat1.xyw);
u_xlat5.xyz = u_xlat2.yzx * u_xlat3.zxy;
u_xlat2.xyz = u_xlat2.zxy * u_xlat3.yzx + (-u_xlat5.xyz);
u_xlat4.w = dot(u_xlat2.xyz, u_xlat1.xyz);
gl_Position.x = dot(u_xlat4, u_xlat0);

distance

float2

u_xlat0.xyz = in_POSITION0.xy + data_vec2_0;
u_xlat0.x = dot(u_xlat0.xyz, u_xlat0.xyz);
gl_Position.x = sqrt(u_xlat0.x);

float3

u_xlat0.xyz = in_POSITION0.xyz + data_vec3_0;
u_xlat0.x = dot(u_xlat0.xyz, u_xlat0.xyz);
gl_Position.x = sqrt(u_xlat0.x);

dot

float2

gl_Position.x = dot(in_POSITION0.xy, data_vec2_0);

float3

gl_Position.x = dot(in_POSITION0.xyz, data_vec3_0);

exp

float

u_xlat0 = in_POSITION0.x * 1.44269502;
gl_Position.x = exp2(u_xlat0);

exp2

可以直接替换

faceforward

floor

可以直接替换

fmod

fmod(x, y)
返回a / b的浮点余数

float

u_xlat0 = in_POSITION0.x / in_POSITION0.y;
#ifdef UNITY_ADRENO_ES3
u_xlatb1 = !!(u_xlat0>=(-u_xlat0));
#else
u_xlatb1 = u_xlat0>=(-u_xlat0);
#endif
u_xlat0 = fract(abs(u_xlat0));
u_xlat0 = (u_xlatb1) ? u_xlat0 : (-u_xlat0);
gl_Position.x = u_xlat0 * in_POSITION0.y;

frac

frac(x)
返回输入值的小数部分

可以直接替换

frexp

frexp(x, exp)
返回输入值的尾数和指数

fwidth

fwidth(x)
返回 abs ( ddx (x) + abs ( ddy(x))

float2

u_xlat0.xy = dFdx(vs_TEXCOORD0.xy);
u_xlat2.xy = dFdy(vs_TEXCOORD0.xy);
u_xlat0.xy = abs(u_xlat2.xy) + abs(u_xlat0.xy);

GetRenderTargetSampleCount

GetRenderTargetSamplePosition

isfinite

isfinite(x)
如果输入值为有限值则返回true,否则返回false

isinf

isinf(x)
如何输入值为无限的则返回true

isnan

isnan(x)
如果输入值为NAN或QNAN则返回true

ldexp

ldexp(x, exp)
frexp的逆运算,返回 x * 2 ^ exp

length

length(v)
返回输入向量的长度

float2

u_xlat0 = dot(in_POSITION0.xy, in_POSITION0.xy);
gl_Position.x = sqrt(u_xlat0);

float3

u_xlat0 = dot(in_POSITION0.xyz, in_POSITION0.xyz);
gl_Position.x = sqrt(u_xlat0);

lerp

lerp(x, y, s)
对输入值进行插值计算

float3

u_xlat16_1.xyz = (-in_POSITION0.xyz) + data_vec3_0;
SV_Target0.xyz = in_POSITION0.www * u_xlat16_1.xyz + in_POSITION0.xyz;

lit

lit(n • l, n • h, m)
返回光照向量(环境光,漫反射光,镜面高光,1)

log

log(x)
返回以e为底的对数

float

u_xlat0 = log2(in_POSITION0.x);
gl_Position.x = u_xlat0 * 0.693147182;

log10

log10(x)
返回以10为底的对数

float

u_xlat0 = log2(in_POSITION0.x);
gl_Position.x = u_xlat0 * 0.30103001;

log2

log2(x)
返回以2为底的对数

可直接替换

max

max(x, y)
返回两个输入值中较大的一个

可直接替换

min

min(x, y)
返回两个输入值中较小的一个

可直接替换

modf

modf(x, out ip)
把输入值分解为整数和小数部分

float

u_xlat0 = trunc(in_POSITION0.x);
gl_Position.x = (-u_xlat0) + in_POSITION0.x;
gl_Position.y = u_xlat0;

mul

mul(x, y)
返回输入矩阵相乘的积

float

u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[0].y * hlslcc_mtx4x4unity_MatrixVP[1].x;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0].x * hlslcc_mtx4x4unity_ObjectToWorld[0].x + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2].x * hlslcc_mtx4x4unity_ObjectToWorld[0].z + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3].x * hlslcc_mtx4x4unity_ObjectToWorld[0].w + u_xlat0;
gl_Position.x = u_xlat0 * in_POSITION0.x;

float2

u_xlat0.xy = hlslcc_mtx4x4unity_ObjectToWorld[0].yy * hlslcc_mtx4x4unity_MatrixVP[1].xy;
u_xlat0.xy = hlslcc_mtx4x4unity_MatrixVP[0].xy * hlslcc_mtx4x4unity_ObjectToWorld[0].xx + u_xlat0.xy;
u_xlat0.xy = hlslcc_mtx4x4unity_MatrixVP[2].xy * hlslcc_mtx4x4unity_ObjectToWorld[0].zz + u_xlat0.xy;
u_xlat0.xy = hlslcc_mtx4x4unity_MatrixVP[3].xy * hlslcc_mtx4x4unity_ObjectToWorld[0].ww + u_xlat0.xy;
gl_Position.x = dot(in_POSITION0.xy, u_xlat0.xy);
u_xlat0.xy = hlslcc_mtx4x4unity_ObjectToWorld[1].yy * hlslcc_mtx4x4unity_MatrixVP[1].xy;
u_xlat0.xy = hlslcc_mtx4x4unity_MatrixVP[0].xy * hlslcc_mtx4x4unity_ObjectToWorld[1].xx + u_xlat0.xy;
u_xlat0.xy = hlslcc_mtx4x4unity_MatrixVP[2].xy * hlslcc_mtx4x4unity_ObjectToWorld[1].zz + u_xlat0.xy;
u_xlat0.xy = hlslcc_mtx4x4unity_MatrixVP[3].xy * hlslcc_mtx4x4unity_ObjectToWorld[1].ww + u_xlat0.xy;
gl_Position.y = dot(in_POSITION0.xy, u_xlat0.xy);

float3

u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[0].yyy * hlslcc_mtx4x4unity_MatrixVP[1].xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[0].xyz * hlslcc_mtx4x4unity_ObjectToWorld[0].xxx + u_xlat0.xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[2].xyz * hlslcc_mtx4x4unity_ObjectToWorld[0].zzz + u_xlat0.xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[3].xyz * hlslcc_mtx4x4unity_ObjectToWorld[0].www + u_xlat0.xyz;
gl_Position.x = dot(in_POSITION0.xyz, u_xlat0.xyz);
u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[1].yyy * hlslcc_mtx4x4unity_MatrixVP[1].xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[0].xyz * hlslcc_mtx4x4unity_ObjectToWorld[1].xxx + u_xlat0.xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[2].xyz * hlslcc_mtx4x4unity_ObjectToWorld[1].zzz + u_xlat0.xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[3].xyz * hlslcc_mtx4x4unity_ObjectToWorld[1].www + u_xlat0.xyz;
gl_Position.y = dot(in_POSITION0.xyz, u_xlat0.xyz);
u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[2].yyy * hlslcc_mtx4x4unity_MatrixVP[1].xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[0].xyz * hlslcc_mtx4x4unity_ObjectToWorld[2].xxx + u_xlat0.xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[2].xyz * hlslcc_mtx4x4unity_ObjectToWorld[2].zzz + u_xlat0.xyz;
u_xlat0.xyz = hlslcc_mtx4x4unity_MatrixVP[3].xyz * hlslcc_mtx4x4unity_ObjectToWorld[2].www + u_xlat0.xyz;
gl_Position.z = dot(in_POSITION0.xyz, u_xlat0.xyz);

float4

u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[0].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[0].xxxx + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[0].zzzz + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[0].wwww + u_xlat0;
gl_Position.x = dot(in_POSITION0, u_xlat0);
u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[1].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[1].xxxx + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[1].zzzz + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[1].wwww + u_xlat0;
gl_Position.y = dot(in_POSITION0, u_xlat0);
u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[2].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[2].xxxx + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[2].zzzz + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[2].wwww + u_xlat0;
gl_Position.z = dot(in_POSITION0, u_xlat0);
u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[3].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[3].xxxx + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[3].zzzz + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[3].wwww + u_xlat0;
gl_Position.w = dot(in_POSITION0, u_xlat0);

noise

noise(x)
Generates a random value using the Perlin-noise algorithm.

normalize

normalize(x)
返回规范化的向量,定义为 x / length(x)

float3

u_xlat16_1 = dot(u_xlat16_0.xyz, u_xlat16_0.xyz);
u_xlat16_1 = inversesqrt(u_xlat16_1);
SV_Target0.xyz = u_xlat16_0.xyz * vec3(u_xlat16_1);

pow

pow(x, y)
返回输入值的指定次幂

float

u_xlat0 = log2(in_POSITION0.x);
u_xlat0 = u_xlat0 * in_POSITION0.y;
gl_Position.x = exp2(u_xlat0);

radians

radians(x)
角度到弧度的转换

float

gl_Position.x = in_POSITION0.x * 0.0174532924;

reflect

reflect(i, n)
返回入射光线i对表面法线n的反射光线

float3

u_xlat16_6 = dot(data_vec3_0.xyz, data_vec3_1.xyz);
u_xlat16_6 = u_xlat16_6 + u_xlat16_6;
data_vec3_0.xyz = data_vec3_1.xyz * (-vec3(u_xlat16_6)) + data_vec3_0.xyz;
SV_Target0.xyz = data_vec3_0.xyz;

refract

refract(i, n, R)
返回在入射光线i,表面法线n,折射率为eta下的折射光线v

float3

    u_xlat16_10 = dot(data_vec3_0.xyz, data_vec3_1.xyz);
    u_xlat16_2 = (-u_xlat16_10) * u_xlat16_10 + 1.0;
    u_xlat0.x = (-u_xlat0.x) * u_xlat16_2 + 1.0;
    u_xlat2 = sqrt(u_xlat0.x);
#ifdef UNITY_ADRENO_ES3
    u_xlatb0 = !!(u_xlat0.x>=0.0);
#else
    u_xlatb0 = u_xlat0.x>=0.0;
#endif
    u_xlat10 = data_vec_0.x * u_xlat16_10 + u_xlat2;
    u_xlat1.xyz = data_vec3_1.xyz * vec3(u_xlat10);
    u_xlat3.xyz = data_vec_0.xxx * data_vec3_0.xyz + (-u_xlat1.xyz);
    u_xlat0.xyz = mix(vec3(0.0, 0.0, 0.0), u_xlat3.xyz, vec3(bvec3(u_xlatb0)));
    SV_Target0.xyz = u_xlat0.xyz;

round

round(x)
返回最接近于输入值的整数

float

gl_Position.x = roundEven(in_POSITION0.x);

rsqrt

rsqrt(x)
返回输入值平方根的倒数

float

gl_Position.x = inversesqrt(in_POSITION0.x);

saturate

saturate(x)
把输入值限制到[0, 1]之间

float

#ifdef UNITY_ADRENO_ES3
    SV_Target0.w = min(max(data_vec_0, 0.0), 1.0);
#else
    SV_Target0.w = clamp(data_vec_0, 0.0, 1.0);
#endif

sign

sign(x)
计算输入值的符号

float

#ifdef UNITY_ADRENO_ES3
    { bool cond = 0.0<in_POSITION0.x; u_xlati0 = int(!!cond ? 0xFFFFFFFFu : uint(0)); }
#else
    u_xlati0 = int((0.0<in_POSITION0.x) ? 0xFFFFFFFFu : uint(0));
#endif
#ifdef UNITY_ADRENO_ES3
    { bool cond = in_POSITION0.x<0.0; u_xlati1 = int(!!cond ? 0xFFFFFFFFu : uint(0)); }
#else
    u_xlati1 = int((in_POSITION0.x<0.0) ? 0xFFFFFFFFu : uint(0));
#endif
    u_xlati0 = (-u_xlati0) + u_xlati1;
    gl_Position.x = float(u_xlati0);

sin

sin(x)
计算输入值的正弦值

可直接替换

sincos

sincos(x, out s, out c)
返回输入值的正弦和余弦值

sinh

sinh(x)
返回x的双曲正弦

float

u_xlat0 = in_POSITION0.x * 1.44269502;
u_xlat1 = exp2(u_xlat0);
u_xlat0 = exp2((-u_xlat0));
u_xlat0 = (-u_xlat0) + u_xlat1;
gl_Position.x = u_xlat0 * 0.5;

smoothstep

smoothstep(min, max, x)
返回一个在输入值之间平稳变化的插值

float

    u_xlat16_1 = (-data_vec3_0) + data_vec3_1;
    u_xlat0 = (-data_vec3_0) + data_vec_0.x;
    u_xlat16_1 = float(1.0) / u_xlat16_1;
    u_xlat0 = u_xlat16_1 * u_xlat0;
#ifdef UNITY_ADRENO_ES3
    u_xlat0 = min(max(u_xlat0, 0.0), 1.0);
#else
    u_xlat0 = clamp(u_xlat0, 0.0, 1.0);
#endif
    u_xlat1 = u_xlat0 * -2.0 + 3.0;
    u_xlat0 = u_xlat0 * u_xlat0;
    u_xlat0 = u_xlat0 * u_xlat1;
    SV_Target0.x = u_xlat0;

float2

    u_xlat0.xy = (-data_vec3_0.xy) + data_vec_0.xx;
    data_vec3_1.xy = vec2(1.0, 1.0) / data_vec3_1.xy;
    u_xlat0.xy = data_vec3_1.xy * u_xlat0.xy;
#ifdef UNITY_ADRENO_ES3
    u_xlat0.xy = min(max(u_xlat0.xy, 0.0), 1.0);
#else
    u_xlat0.xy = clamp(u_xlat0.xy, 0.0, 1.0);
#endif
    u_xlat2.xy = u_xlat0.xy * vec2(-2.0, -2.0) + vec2(3.0, 3.0);
    u_xlat0.xy = u_xlat0.xy * u_xlat0.xy;
    u_xlat0.xy = u_xlat0.xy * u_xlat2.xy;
    SV_Target0.xy = u_xlat0.xy;

float3

    u_xlat0.xyz = (-data_vec3_0.xyz) + data_vec_0.xxx;
    data_vec3_1.xyz = vec3(1.0, 1.0, 1.0) / data_vec3_1.xyz;
    u_xlat0.xyz = u_xlat0.xyz * data_vec3_1.xyz;
#ifdef UNITY_ADRENO_ES3
    u_xlat0.xyz = min(max(u_xlat0.xyz, 0.0), 1.0);
#else
    u_xlat0.xyz = clamp(u_xlat0.xyz, 0.0, 1.0);
#endif
    u_xlat1.xyz = u_xlat0.xyz * vec3(-2.0, -2.0, -2.0) + vec3(3.0, 3.0, 3.0);
    u_xlat0.xyz = u_xlat0.xyz * u_xlat0.xyz;
    u_xlat0.xyz = u_xlat0.xyz * u_xlat1.xyz;
    SV_Target0.xyz = u_xlat0.xyz;

float4

sqrt

sqrt(x)
返回输入值的平方根

可直接替换

step

step(a, x)
返回(x >= a)? 1 : 0

float

#ifdef UNITY_ADRENO_ES3
    u_xlatb0 = !!(in_POSITION0.y>=in_POSITION0.x);
#else
    u_xlatb0 = in_POSITION0.y>=in_POSITION0.x;
#endif
    gl_Position.x = u_xlatb0 ? 1.0 : float(0.0);

tan

tan(x)
返回输入值的正切值

float

u_xlat0 = sin(in_POSITION0.x);
u_xlat1 = cos(in_POSITION0.x);
gl_Position.x = u_xlat0 / u_xlat1;

tanh

tanh(x)
返回输入值的双曲线切线

float

u_xlat0 = in_POSITION0.x * 1.44269502;
u_xlat1 = exp2(u_xlat0);
u_xlat0 = exp2((-u_xlat0));
u_xlat2 = u_xlat0 + u_xlat1;
u_xlat0 = (-u_xlat0) + u_xlat1;
u_xlat1 = float(1.0) / u_xlat2;
gl_Position.x = u_xlat1 * u_xlat0;

tex1D

tex1Dbias

tex1Dgrad

tex1Dlod

tex1Dproj

tex2D

tex2D(s, t)
2D纹理查询

u_xlat16_0 = texture(_MainTex, vs_TEXCOORD0.xy);
SV_Target0 = u_xlat16_0;

tex2Dbias

tex2Dgrad

tex2Dlod

tex2Dproj

tex3D

tex3D(s, t)
3D纹理查询


tex3Dbias

tex3Dgrad

tex3Dlod

tex3Dproj

texCUBE

texCUBEbias

texCUBEgrad

texCUBElod

texCUBEproj

transpose

transpose(m)
返回输入矩阵的转置

u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[0].yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[0] * hlslcc_mtx4x4unity_ObjectToWorld[0].xxxx + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[2] * hlslcc_mtx4x4unity_ObjectToWorld[0].zzzz + u_xlat0;
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * hlslcc_mtx4x4unity_ObjectToWorld[0].wwww + u_xlat0;

trunc

trunc(x)
Truncates floating-point value(s) to integer value(s)

可直接替换

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,530评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 86,403评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,120评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,770评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,758评论 5 367
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,649评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,021评论 3 398
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,675评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,931评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,659评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,751评论 1 330
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,410评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,004评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,969评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,203评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,042评论 2 350
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,493评论 2 343