… | |
… | |
93 | temp_1f lz; |
93 | temp_1f lz; |
94 | |
94 | |
95 | // TODO: negative z is not calculated in an acceptable way |
95 | // TODO: negative z is not calculated in an acceptable way |
96 | lz = z (vout.position); |
96 | lz = z (vout.position); |
97 | z (vout.position) = (log2 (lz) * (2 / log2 (1e10)) - 1) * w (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 |
98 | } |
106 | } |
99 | |
107 | |
100 | vsh_src = shader::shader_builder::stop (); |
108 | vsh_src = shader::shader_builder::stop (); |
101 | |
109 | |
102 | shader::shader_builder::start (); |
110 | shader::shader_builder::start (); |