bgfx/3rdparty/glsl-optimizer/tests/vertex/unity-Surface_DecalAddBump2-ir.txt

184 lines
3.9 KiB
Text
Raw Normal View History

2012-04-03 23:30:07 -04:00
struct v2f_surf {
vec4 pos;
float fog;
vec4 hip_pack0;
vec2 hip_lmap;
};
struct appdata_full {
vec4 vertex;
vec4 tangent;
vec3 normal;
vec4 texcoord;
vec4 texcoord1;
vec4 color;
};
varying vec4 xlv_FOG;
attribute vec4 TANGENT;
uniform vec4 unity_Scale;
uniform vec4 unity_LightmapST;
uniform mat4 _Object2World;
uniform vec4 _Decal_ST;
uniform vec4 _DecalBump_ST;
mat3 xll_constructMat3 (
in mat4 m
)
{
vec3 tmpvar_1;
tmpvar_1 = m[0].xyz;
vec3 tmpvar_2;
tmpvar_2 = m[1].xyz;
vec3 tmpvar_3;
tmpvar_3 = m[2].xyz;
mat3 tmpvar_4;
vec3 tmpvar_5;
tmpvar_5 = tmpvar_1;
tmpvar_4[0] = tmpvar_5;
vec3 tmpvar_6;
tmpvar_6 = tmpvar_2;
tmpvar_4[1] = tmpvar_6;
vec3 tmpvar_7;
tmpvar_7 = tmpvar_3;
tmpvar_4[2] = tmpvar_7;
return tmpvar_4;
}
void PositionFog (
in vec4 v,
out vec4 pos,
out float fog
)
{
vec4 tmpvar_1;
tmpvar_1 = (gl_ModelViewProjectionMatrix * v);
pos = tmpvar_1;
float tmpvar_2;
tmpvar_2 = pos.z;
fog = tmpvar_2;
}
v2f_surf vert_surf (
in appdata_full v
)
{
mat3 rotation;
vec3 binormal;
vec3 worldN;
v2f_surf o;
PositionFog (v.vertex, o.pos, o.fog);
vec2 tmpvar_1;
tmpvar_1 = ((v.texcoord.xy * _Decal_ST.xy) + _Decal_ST.zw);
o.hip_pack0.xy = tmpvar_1.xy.xy;
vec2 tmpvar_2;
tmpvar_2 = ((v.texcoord.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw);
o.hip_pack0.zw = tmpvar_2.xxxy.zw;
vec2 tmpvar_3;
tmpvar_3 = ((v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
o.hip_lmap = tmpvar_3.xy.xy;
mat3 tmpvar_4;
tmpvar_4 = (xll_constructMat3 (_Object2World));
vec3 tmpvar_5;
tmpvar_5 = (tmpvar_4 * (v.normal * unity_Scale.w));
worldN = tmpvar_5;
vec3 tmpvar_6;
tmpvar_6 = cross (v.normal, v.tangent.xyz);
vec3 tmpvar_7;
tmpvar_7 = (tmpvar_6 * v.tangent.w);
binormal = tmpvar_7;
mat3 tmpvar_8;
float tmpvar_9;
tmpvar_9 = v.tangent.x;
tmpvar_8[0].x = tmpvar_9;
float tmpvar_10;
tmpvar_10 = binormal.x;
tmpvar_8[0].y = tmpvar_10;
float tmpvar_11;
tmpvar_11 = v.normal.x;
tmpvar_8[0].z = tmpvar_11;
float tmpvar_12;
tmpvar_12 = v.tangent.y;
tmpvar_8[1].x = tmpvar_12;
float tmpvar_13;
tmpvar_13 = binormal.y;
tmpvar_8[1].y = tmpvar_13;
float tmpvar_14;
tmpvar_14 = v.normal.y;
tmpvar_8[1].z = tmpvar_14;
float tmpvar_15;
tmpvar_15 = v.tangent.z;
tmpvar_8[2].x = tmpvar_15;
float tmpvar_16;
tmpvar_16 = binormal.z;
tmpvar_8[2].y = tmpvar_16;
float tmpvar_17;
tmpvar_17 = v.normal.z;
tmpvar_8[2].z = tmpvar_17;
mat3 tmpvar_18;
tmpvar_18 = (tmpvar_8);
rotation = (tmpvar_18);
return o;
}
void main ()
{
appdata_full xlt_v;
v2f_surf xl_retval;
vec4 tmpvar_1;
tmpvar_1 = gl_Vertex.xyzw;
vec4 tmpvar_2;
tmpvar_2 = tmpvar_1;
xlt_v.vertex = tmpvar_2;
vec4 tmpvar_3;
tmpvar_3 = TANGENT.xyzw;
vec4 tmpvar_4;
tmpvar_4 = tmpvar_3;
xlt_v.tangent = tmpvar_4;
vec3 tmpvar_5;
tmpvar_5 = gl_Normal.xyz;
vec3 tmpvar_6;
tmpvar_6 = tmpvar_5;
xlt_v.normal = tmpvar_6;
vec4 tmpvar_7;
tmpvar_7 = gl_MultiTexCoord0.xyzw;
vec4 tmpvar_8;
tmpvar_8 = tmpvar_7;
xlt_v.texcoord = tmpvar_8;
vec4 tmpvar_9;
tmpvar_9 = gl_MultiTexCoord1.xyzw;
vec4 tmpvar_10;
tmpvar_10 = tmpvar_9;
xlt_v.texcoord1 = tmpvar_10;
vec4 tmpvar_11;
tmpvar_11 = gl_Color.xyzw;
vec4 tmpvar_12;
tmpvar_12 = tmpvar_11;
xlt_v.color = tmpvar_12;
v2f_surf tmpvar_13;
tmpvar_13 = vert_surf (xlt_v);
v2f_surf tmpvar_14;
tmpvar_14 = tmpvar_13;
xl_retval = tmpvar_14;
vec4 tmpvar_15;
tmpvar_15 = xl_retval.pos.xyzw;
vec4 tmpvar_16;
tmpvar_16 = tmpvar_15;
gl_Position = tmpvar_16;
vec4 tmpvar_17;
tmpvar_17.yzw = vec3(0.0, 0.0, 0.0);
tmpvar_17.x = xl_retval.fog;
vec4 tmpvar_18;
tmpvar_18 = tmpvar_17;
xlv_FOG = tmpvar_18;
vec4 tmpvar_19;
tmpvar_19 = xl_retval.hip_pack0.xyzw;
vec4 tmpvar_20;
tmpvar_20 = tmpvar_19;
gl_TexCoord[0] = tmpvar_20;
vec4 tmpvar_21;
tmpvar_21.zw = vec2(0.0, 0.0);
tmpvar_21.xy = xl_retval.hip_lmap.xy;
vec4 tmpvar_22;
tmpvar_22 = tmpvar_21;
gl_TexCoord[1] = tmpvar_22;
}