mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
57 lines
1.7 KiB
Text
57 lines
1.7 KiB
Text
uniform mat4 glstate_matrix_mvp;
|
|
attribute vec4 attrVertex;
|
|
attribute vec3 attrNormal;
|
|
attribute vec4 attrTangent;
|
|
uniform highp mat4 _Object2World;
|
|
uniform highp mat4 _World2Object;
|
|
uniform highp vec3 _WorldSpaceCameraPos;
|
|
uniform lowp vec4 _WorldSpaceLightPos0;
|
|
uniform highp vec4 unity_Scale;
|
|
varying lowp vec3 varWorldN;
|
|
varying lowp vec3 varLightDir;
|
|
varying lowp vec3 varViewDir;
|
|
void main ()
|
|
{
|
|
lowp vec3 tmpvar_1;
|
|
lowp vec3 tmpvar_2;
|
|
lowp vec3 tmpvar_3;
|
|
mat3 tmpvar_4;
|
|
tmpvar_4[0] = _Object2World[0].xyz;
|
|
tmpvar_4[1] = _Object2World[1].xyz;
|
|
tmpvar_4[2] = _Object2World[2].xyz;
|
|
highp vec3 tmpvar_5;
|
|
tmpvar_5 = (tmpvar_4 * attrNormal);
|
|
tmpvar_3 = tmpvar_5;
|
|
highp vec3 tmpvar_6;
|
|
highp vec3 tmpvar_7;
|
|
tmpvar_6 = attrTangent.xyz;
|
|
tmpvar_7 = (((attrNormal.yzx * attrTangent.zxy) - (attrNormal.zxy * attrTangent.yzx)) * attrTangent.w);
|
|
highp mat3 tmpvar_8;
|
|
tmpvar_8[0].x = tmpvar_6.x;
|
|
tmpvar_8[0].y = tmpvar_7.x;
|
|
tmpvar_8[0].z = attrNormal.x;
|
|
tmpvar_8[1].x = tmpvar_6.y;
|
|
tmpvar_8[1].y = tmpvar_7.y;
|
|
tmpvar_8[1].z = attrNormal.y;
|
|
tmpvar_8[2].x = tmpvar_6.z;
|
|
tmpvar_8[2].y = tmpvar_7.z;
|
|
tmpvar_8[2].z = attrNormal.z;
|
|
highp vec3 tmpvar_9;
|
|
tmpvar_9 = (tmpvar_8 * (_World2Object * _WorldSpaceLightPos0).xyz);
|
|
tmpvar_1 = tmpvar_9;
|
|
highp vec4 tmpvar_10;
|
|
tmpvar_10.w = 1.0;
|
|
tmpvar_10.xyz = _WorldSpaceCameraPos;
|
|
highp vec3 tmpvar_11;
|
|
tmpvar_11 = normalize((tmpvar_9 + normalize(
|
|
(tmpvar_8 * (((_World2Object * tmpvar_10).xyz * unity_Scale.w) - attrVertex.xyz))
|
|
)));
|
|
tmpvar_2 = tmpvar_11;
|
|
gl_Position = (glstate_matrix_mvp * attrVertex);
|
|
varWorldN = tmpvar_3;
|
|
varLightDir = tmpvar_1;
|
|
varViewDir = tmpvar_2;
|
|
}
|
|
|
|
|
|
// inputs: 3, stats: 16 alu 0 tex 0 flow
|