… | |
… | |
92 | |
92 | |
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 | #if 0 |
|
|
98 | lz = (log (max (lz, 0) + 1) / log (1e18)) - 1; |
|
|
99 | #else |
97 | lz = ifelse (lz <= 0, |
100 | lz = ifelse (lz <= 0, |
98 | 0, |
101 | 0, |
99 | log (lz + 1) / log (1e18) |
102 | log (lz + 1) / log (1e18) |
100 | ) - 1; |
103 | ) - 1; |
|
|
104 | #endif |
101 | z (vout.position) = lz * w (vout.position); |
105 | z (vout.position) = lz * w (vout.position); |
102 | } |
106 | } |
103 | |
107 | |
104 | vsh_src = shader::shader_builder::stop (); |
108 | vsh_src = shader::shader_builder::stop (); |
105 | |
109 | |