… | |
… | |
84 | } |
84 | } |
85 | |
85 | |
86 | test_material::test_material () |
86 | test_material::test_material () |
87 | : tex ("textures/osama.jpg"), texvar (tex.name) |
87 | : tex ("textures/osama.jpg"), texvar (tex.name) |
88 | { |
88 | { |
89 | using namespace shader; |
89 | using namespace shader::compile; |
90 | |
90 | |
91 | p.vsh->start (); |
91 | p.vsh->start (); |
92 | |
92 | |
93 | temp_4f wpos; |
93 | temp_4f wpos; |
94 | |
94 | |
95 | wpos = shader::gl.model_view_projection_matrix * vin.vertex; |
95 | wpos = model_view_projection_matrix * vin.vertex; |
96 | |
96 | |
97 | vout.position = wpos; |
97 | vout.position = wpos; |
98 | vout.tex_coord[0] = vin.tex_coord[0]; |
98 | vout.tex_coord[0] = vin.tex_coord[0]; |
99 | vout.tex_coord[1] = shader::gl.model_view_matrix * shader::vec4 (x (vin.normal), y(vin.normal), z(vin.normal), 0); |
99 | vout.tex_coord[1] = model_view_matrix * shader::compile::vec4 (x(vin.normal), y(vin.normal), z(vin.normal), 0); |
100 | |
100 | |
101 | p.vsh->end (); |
101 | p.vsh->end (); |
102 | p.vsh->compile (); |
102 | p.vsh->compile (); |
103 | |
103 | |
104 | p.fsh->start (); |
104 | p.fsh->start (); |