12f0bc7736a3b93c3d45cd4b7c1ba90d78af50c8
Blender grid rendering interprets voxel transforms in such a way that the voxel values are located at the center of a voxel. This is inconsistent with OpenVDB where the values are located at the lower corners for the purpose or sampling and related algorithms. While it is possible to offset grids when communicating with the OpenVDB library, this is also error-prone and does not add any major advantage. Every time a grid is passed to OpenVDB we currently have to take care to transform by half a voxel to ensure correct sampling weights are used that match the density displayed by the viewport rendering. This patch changes volume grid generation, conversion, and rendering code so that grid transforms match the corner-located values in OpenVDB. - The volume primitive cube node aligns the grid transform with the location of the first value, which is now also the same as min/max bounds input of the node. - Mesh<->Grid conversion does no longer require offsetting grid transform and mesh vertices respectively by 0.5 voxels. - Texture space for viewport rendering is offset by half a voxel, so that it covers the same area as before and voxel centers remain at the same texture space locations. Co-authored-by: Brecht Van Lommel <brecht@blender.org> Pull Request: https://projects.blender.org/blender/blender/pulls/138449
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
