… | |
… | |
87 | ctx.pass_data->l->vsh (); |
87 | ctx.pass_data->l->vsh (); |
88 | |
88 | |
89 | po->vsh->compile (shader::shader_builder::stop ()); |
89 | po->vsh->compile (shader::shader_builder::stop ()); |
90 | |
90 | |
91 | shader::shader_builder::start (); |
91 | shader::shader_builder::start (); |
|
|
92 | shader::compile::fout.frag_color = shader::compile::float4 (1., 1., 0., 1.); |
92 | fsh (ctx); |
93 | fsh (ctx); |
93 | po->fsh->compile (shader::shader_builder::stop ()); |
94 | po->fsh->compile (shader::shader_builder::stop ()); |
94 | |
95 | |
95 | po->link (); |
96 | po->link (); |
96 | |
97 | |
… | |
… | |
145 | |
146 | |
146 | fac = dot (normalize (normal), normalize (lightvec)); |
147 | fac = dot (normalize (normal), normalize (lightvec)); |
147 | fac = pow (max (fac, 0.0), 2); |
148 | fac = pow (max (fac, 0.0), 2); |
148 | xyz (fout.frag_color) = texture_2d (texvar, texcoord) * lc * fac; |
149 | xyz (fout.frag_color) = texture_2d (texvar, texcoord) * lc * fac; |
149 | } |
150 | } |
150 | else |
|
|
151 | fout.frag_color = float4(1,1,1,1); |
|
|
152 | } |
151 | } |
153 | |
152 | |
154 | void test_material::enable (view &ctx) |
153 | void test_material::enable (view &ctx) |
155 | { |
154 | { |
156 | material::enable (ctx); |
155 | material::enable (ctx); |