ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/material.C
(Generate patch)

Comparing libgender/material.C (file contents):
Revision 1.55 by root, Thu Jan 6 03:09:24 2005 UTC vs.
Revision 1.56 by root, Mon Feb 7 07:37:00 2005 UTC

144} 144}
145 145
146static shader::varying_3f normal; 146static shader::varying_3f normal;
147static shader::varying_2f texcoord; 147static shader::varying_2f texcoord;
148 148
149void 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
160void 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
149void test_material::vsh (view &ctx) 172void 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
204test_material *testmat; 227test_material *testmat;
228test_material2 *testmat2;
205 229

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines