change bumpmap_to_normalmap range from [1...255] to [0...255]
This commit is contained in:
parent
617d3cde1a
commit
4bea98de40
1 changed files with 3 additions and 3 deletions
|
@ -2410,9 +2410,9 @@ void Image::bumpmap_to_normalmap(float bump_scale) {
|
||||||
Vector3 normal = across.cross(up);
|
Vector3 normal = across.cross(up);
|
||||||
normal.normalize();
|
normal.normalize();
|
||||||
|
|
||||||
write_ptr[((ty * width + tx) << 2) + 0] = (128.0 + normal.x * 127.0);
|
write_ptr[((ty * width + tx) << 2) + 0] = (127.5 + normal.x * 127.5);
|
||||||
write_ptr[((ty * width + tx) << 2) + 1] = (128.0 + normal.y * 127.0);
|
write_ptr[((ty * width + tx) << 2) + 1] = (127.5 + normal.y * 127.5);
|
||||||
write_ptr[((ty * width + tx) << 2) + 2] = (128.0 + normal.z * 127.0);
|
write_ptr[((ty * width + tx) << 2) + 2] = (127.5 + normal.z * 127.5);
|
||||||
write_ptr[((ty * width + tx) << 2) + 3] = 255;
|
write_ptr[((ty * width + tx) << 2) + 3] = 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue