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

Comparing cvsroot/libgender/material.C (file contents):
Revision 1.41 by root, Sat Nov 6 01:56:20 2004 UTC vs.
Revision 1.46 by root, Sun Nov 7 02:36:38 2004 UTC

84 if (ctx.pass_data->l) 84 if (ctx.pass_data->l)
85 ctx.pass_data->l->vsh (); 85 ctx.pass_data->l->vsh ();
86 86
87 vsh (ctx); 87 vsh (ctx);
88 88
89 // compute logarithmic depth - see the frustum matrix in view.C
89 { 90 {
90 using namespace shader::compile; 91 using namespace shader::compile;
91 92
92 //z (vout.position) = log2 (z (vout.position) / w (vout.position)) * w (vout.position); 93 temp_1f lz;
94
95 // TODO: negative z is not calculated in an acceptable way
96 lz = z (vout.position);
97 z (vout.position) = (log2 (lz) * (2 / log2 (1e10)) - 1) * w (vout.position);
93 } 98 }
94 99
95 vsh_src = shader::shader_builder::stop (); 100 vsh_src = shader::shader_builder::stop ();
96 101
97 shader::shader_builder::start (); 102 shader::shader_builder::start ();
112 117
113 po->enable (); 118 po->enable ();
114 } 119 }
115 else 120 else
116 i->second->enable (); 121 i->second->enable ();
122
123 if (ctx.pass_data->l)
124 ctx.pass_data->l->enable ();
117} 125}
118 126
119void material::disable (view &ctx) 127void material::disable (view &ctx)
120{ 128{
121} 129}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines