… | |
… | |
144 | } |
144 | } |
145 | |
145 | |
146 | static shader::varying_3f normal; |
146 | static shader::varying_3f normal; |
147 | static shader::varying_2f texcoord; |
147 | static shader::varying_2f texcoord; |
148 | |
148 | |
|
|
149 | void test_material2::vsh (view &ctx) |
|
|
150 | { |
|
|
151 | using namespace shader::compile; |
|
|
152 | std_vsh (); |
|
|
153 | |
|
|
154 | if (ctx.pass->l) |
|
|
155 | { |
|
|
156 | normal = normal_matrix * vin.normal; |
|
|
157 | } |
|
|
158 | } |
|
|
159 | |
|
|
160 | void test_material2::fsh (view &ctx) |
|
|
161 | { |
|
|
162 | using namespace shader::compile; |
|
|
163 | |
|
|
164 | if (ctx.pass->l) |
|
|
165 | { |
|
|
166 | temp_1f fac; |
|
|
167 | fac = dot (normalize (normal), normalize (ctx.pass->l->sh_lightvec)); |
|
|
168 | xyz (fout.frag_color) = ctx.pass->l->sh_colour * fac;//normalize (ctx.pass->l->sh_lightvec); |
|
|
169 | } |
|
|
170 | } |
|
|
171 | |
149 | void test_material::vsh (view &ctx) |
172 | void test_material::vsh (view &ctx) |
150 | { |
173 | { |
151 | using namespace shader::compile; |
174 | using namespace shader::compile; |
152 | |
175 | |
153 | std_vsh (); |
176 | std_vsh (); |
… | |
… | |
200 | texvar->disable (); |
223 | texvar->disable (); |
201 | material::disable (ctx); |
224 | material::disable (ctx); |
202 | } |
225 | } |
203 | |
226 | |
204 | test_material *testmat; |
227 | test_material *testmat; |
|
|
228 | test_material2 *testmat2; |
205 | |
229 | |