vrshoot

diff sdr/default.v.glsl @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sdr/default.v.glsl	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,21 @@
     1.4 +attribute vec4 attr_vertex;
     1.5 +attribute vec3 attr_normal;
     1.6 +attribute vec2 attr_texcoord;
     1.7 +
     1.8 +uniform mat4 st_world_matrix, st_view_matrix, st_proj_matrix;
     1.9 +uniform mat3 st_world_matrix3, st_view_matrix3;
    1.10 +
    1.11 +varying vec3 vpos, norm;
    1.12 +varying vec2 texcoord;
    1.13 +
    1.14 +void main()
    1.15 +{
    1.16 +	mat4 worldview_matrix = st_view_matrix * st_world_matrix;
    1.17 +	mat4 mvp_matrix = st_proj_matrix * worldview_matrix;
    1.18 +
    1.19 +	gl_Position = mvp_matrix * attr_vertex;
    1.20 +
    1.21 +	vpos = (worldview_matrix * attr_vertex).xyz;
    1.22 +	norm = st_view_matrix3 * st_world_matrix3 * attr_normal;
    1.23 +	texcoord = attr_texcoord;
    1.24 +}