… | |
… | |
93 | temp_1f lz; |
93 | temp_1f lz; |
94 | |
94 | |
95 | // TODO: negative z is not calculated in an acceptable way, clipping does horrible things(?) |
95 | // TODO: negative z is not calculated in an acceptable way, clipping does horrible things(?) |
96 | lz = z (vout.position); |
96 | lz = z (vout.position); |
97 | lz = ifelse (lz <= 0, |
97 | lz = ifelse (lz <= 0, |
98 | lz, |
98 | 0, |
99 | log (lz + 1) / log (1e10 + 1) |
99 | log (lz + 1) / log (1e18) |
100 | ) - 1; |
100 | ) - 1; |
101 | z (vout.position) = lz * w (vout.position); |
101 | z (vout.position) = lz * w (vout.position); |
102 | } |
102 | } |
103 | |
103 | |
104 | vsh_src = shader::shader_builder::stop (); |
104 | vsh_src = shader::shader_builder::stop (); |