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.43 by root, Sat Nov 6 04:31:01 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) + 1.F) * 1.82F - 1); 93 temp_1f lz;
93 //z (vout.position) = z (vout.position) - 1; 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);
94 } 98 }
95 99
96 vsh_src = shader::shader_builder::stop (); 100 vsh_src = shader::shader_builder::stop ();
97 101
98 shader::shader_builder::start (); 102 shader::shader_builder::start ();
113 117
114 po->enable (); 118 po->enable ();
115 } 119 }
116 else 120 else
117 i->second->enable (); 121 i->second->enable ();
122
123 if (ctx.pass_data->l)
124 ctx.pass_data->l->enable ();
118} 125}
119 126
120void material::disable (view &ctx) 127void material::disable (view &ctx)
121{ 128{
122} 129}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines