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.47 by root, Sun Nov 7 03:01:03 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);
98#if 0
99 z (vout.position) =
100 ifelse (
101 z < 0,
102 -1,
103 log2 (lz) * (2 / log2 (1e10)) - 1
104 ) * w (vout.position);
105#endif
93 } 106 }
94 107
95 vsh_src = shader::shader_builder::stop (); 108 vsh_src = shader::shader_builder::stop ();
96 109
97 shader::shader_builder::start (); 110 shader::shader_builder::start ();
112 125
113 po->enable (); 126 po->enable ();
114 } 127 }
115 else 128 else
116 i->second->enable (); 129 i->second->enable ();
130
131 if (ctx.pass_data->l)
132 ctx.pass_data->l->enable ();
117} 133}
118 134
119void material::disable (view &ctx) 135void material::disable (view &ctx)
120{ 136{
121} 137}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines