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

Comparing libgender/material.C (file contents):
Revision 1.43 by root, Sat Nov 6 04:31:01 2004 UTC vs.
Revision 1.44 by root, Sat Nov 6 14:49:03 2004 UTC

69{ 69{
70} 70}
71 71
72void material::enable (view &ctx) 72void material::enable (view &ctx)
73{ 73{
74 static shader::compile::varying_1f Z;//D
75
74 pass::matmap_t &matmap = ctx.pass_data->matmap; 76 pass::matmap_t &matmap = ctx.pass_data->matmap;
75 77
76 pass::matmap_t::iterator i = matmap.find (this); 78 pass::matmap_t::iterator i = matmap.find (this);
77 79
78 if (i == matmap.end ()) 80 if (i == matmap.end ())
87 vsh (ctx); 89 vsh (ctx);
88 90
89 { 91 {
90 using namespace shader::compile; 92 using namespace shader::compile;
91 93
92 z (vout.position) = (log2 (z (vout.position) + 1.F) * 1.82F - 1); 94 Z = pow (z (vout.position) / 2.F, 0.2);
95 z (vout.position) = (Z * 2 - 1) * w (vout.position);
93 //z (vout.position) = z (vout.position) - 1; 96 //z (vout.position) = z (vout.position) - 1;
94 } 97 }
95 98
96 vsh_src = shader::shader_builder::stop (); 99 vsh_src = shader::shader_builder::stop ();
97 100
103 106
104 fsh (ctx); 107 fsh (ctx);
105 } 108 }
106 else 109 else
107 shader::compile::fout.frag_color = shader::compile::float4 (1., 0., 1., 1.); 110 shader::compile::fout.frag_color = shader::compile::float4 (1., 0., 1., 1.);
111
112 {
113 using namespace shader::compile;
114 //x (fout.frag_color) = Z;//D
115 //y (fout.frag_color) = Z;//D
116 //z (fout.frag_color) = Z;//D
117 }
108 118
109 fsh_src = shader::shader_builder::stop (); 119 fsh_src = shader::shader_builder::stop ();
110 120
111 shader::program_object po = shader::get_program (vsh_src, fsh_src); 121 shader::program_object po = shader::get_program (vsh_src, fsh_src);
112 matmap.insert (pass::matmap_t::value_type (this, po)); 122 matmap.insert (pass::matmap_t::value_type (this, po));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines