vrshoot
annotate sdr/default.v.glsl @ 3:c179c72369be
rename candy->vr
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 03 Feb 2014 08:52:13 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@0 | 1 attribute vec4 attr_vertex; |
nuclear@0 | 2 attribute vec3 attr_normal; |
nuclear@0 | 3 attribute vec2 attr_texcoord; |
nuclear@0 | 4 |
nuclear@0 | 5 uniform mat4 st_world_matrix, st_view_matrix, st_proj_matrix; |
nuclear@0 | 6 uniform mat3 st_world_matrix3, st_view_matrix3; |
nuclear@0 | 7 |
nuclear@0 | 8 varying vec3 vpos, norm; |
nuclear@0 | 9 varying vec2 texcoord; |
nuclear@0 | 10 |
nuclear@0 | 11 void main() |
nuclear@0 | 12 { |
nuclear@0 | 13 mat4 worldview_matrix = st_view_matrix * st_world_matrix; |
nuclear@0 | 14 mat4 mvp_matrix = st_proj_matrix * worldview_matrix; |
nuclear@0 | 15 |
nuclear@0 | 16 gl_Position = mvp_matrix * attr_vertex; |
nuclear@0 | 17 |
nuclear@0 | 18 vpos = (worldview_matrix * attr_vertex).xyz; |
nuclear@0 | 19 norm = st_view_matrix3 * st_world_matrix3 * attr_normal; |
nuclear@0 | 20 texcoord = attr_texcoord; |
nuclear@0 | 21 } |