Allow for 0.5 offsets in figures

This commit is contained in:
Marcel Märtens 2020-04-29 14:10:46 +02:00
parent 19ce03d9ed
commit 83af40a460
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ void main() {
uint bone_idx = (v_ao_bone >> 2) & 0x3Fu;
mat4 combined_mat = model_mat * bones[bone_idx].bone_mat;
vec3 pos = vec3((uvec3(v_pos_norm) >> uvec3(0, 8, 16)) & uvec3(0xFFu)) - 128.0;
vec3 pos = (vec3((uvec3(v_pos_norm) >> uvec3(0, 8, 16)) & uvec3(0xFFu)) - 128.0) / 2.0;
f_pos = (
combined_mat *

View File

@ -57,7 +57,7 @@ impl Vertex {
Self {
pos_norm: pos
.map2(Vec3::new(0, 8, 16), |e, shift| {
((e + 128.0) as u32) << shift
((e * 2.0 + 128.0) as u32) << shift
})
.reduce_bitor()
| (norm_bits << 24),