mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
66 lines
1.6 KiB
Text
66 lines
1.6 KiB
Text
|
#ifdef GL_ES
|
|||
|
precision highp float;
|
|||
|
#endif // GL_ES
|
|||
|
|
|||
|
uniform mat4 u_viewProj;
|
|||
|
uniform mat4 u_view;
|
|||
|
varying vec2 v_texcoord0;
|
|||
|
varying vec3 v_tangent;
|
|||
|
varying vec3 v_normal;
|
|||
|
varying vec3 v_view;
|
|||
|
varying vec3 v_wpos;
|
|||
|
attribute vec4 i_data3;
|
|||
|
attribute vec4 i_data2;
|
|||
|
attribute vec4 i_data1;
|
|||
|
attribute vec4 i_data0;
|
|||
|
attribute vec2 a_texcoord0;
|
|||
|
attribute vec3 a_tangent;
|
|||
|
attribute vec3 a_normal;
|
|||
|
attribute vec3 a_position;
|
|||
|
void main ()
|
|||
|
{
|
|||
|
mat4 model_1;
|
|||
|
model_1[0] = i_data0;
|
|||
|
model_1[1] = i_data1;
|
|||
|
model_1[2] = i_data2;
|
|||
|
model_1[3] = i_data3;
|
|||
|
vec4 tmpvar_2;
|
|||
|
tmpvar_2.w = 1.0;
|
|||
|
tmpvar_2.xyz = a_position;
|
|||
|
vec3 tmpvar_3;
|
|||
|
tmpvar_3 = (model_1 * tmpvar_2).xyz;
|
|||
|
vec4 tmpvar_4;
|
|||
|
tmpvar_4.w = 1.0;
|
|||
|
tmpvar_4.xyz = tmpvar_3;
|
|||
|
gl_Position = (u_viewProj * tmpvar_4);
|
|||
|
vec4 tmpvar_5;
|
|||
|
tmpvar_5.w = 0.0;
|
|||
|
tmpvar_5.xyz = ((a_normal * 2.0) - 1.0);
|
|||
|
vec4 tmpvar_6;
|
|||
|
tmpvar_6.w = 0.0;
|
|||
|
tmpvar_6.xyz = ((a_tangent * 2.0) - 1.0);
|
|||
|
vec4 tmpvar_7;
|
|||
|
tmpvar_7.w = 0.0;
|
|||
|
tmpvar_7.xyz = (model_1 * tmpvar_5).xyz;
|
|||
|
vec3 tmpvar_8;
|
|||
|
tmpvar_8 = normalize((u_view * tmpvar_7).xyz);
|
|||
|
vec4 tmpvar_9;
|
|||
|
tmpvar_9.w = 0.0;
|
|||
|
tmpvar_9.xyz = (model_1 * tmpvar_6).xyz;
|
|||
|
vec3 tmpvar_10;
|
|||
|
tmpvar_10 = normalize((u_view * tmpvar_9).xyz);
|
|||
|
mat3 tmpvar_11;
|
|||
|
tmpvar_11[0] = tmpvar_10;
|
|||
|
tmpvar_11[1] = ((tmpvar_8.yzx * tmpvar_10.zxy) - (tmpvar_8.zxy * tmpvar_10.yzx));
|
|||
|
tmpvar_11[2] = tmpvar_8;
|
|||
|
v_wpos = tmpvar_3;
|
|||
|
vec4 tmpvar_12;
|
|||
|
tmpvar_12.w = 1.0;
|
|||
|
tmpvar_12.xyz = tmpvar_3;
|
|||
|
v_view = (tmpvar_11 * -((u_view * tmpvar_12).xyz));
|
|||
|
v_normal = tmpvar_8;
|
|||
|
v_tangent = tmpvar_10;
|
|||
|
v_texcoord0 = a_texcoord0;
|
|||
|
}
|
|||
|
|
|||
|
|