Better ways to bake VoxelGI #6352
RandomCatDude
started this conversation in
3D
Replies: 2 comments 2 replies
-
VoxelGI is planned to get a rework in the long run to better handle this kind of issue (in a future 4.x release). |
Beta Was this translation helpful? Give feedback.
2 replies
-
We plan on eventually replacing the VoxelGI voxelizer with the one used by SDFGI, then bakes can mostly take place on the GPU and should be a bit faster. The code for it is all there (either used by SDFGI or by the VoxelGI dynamic updates) and just needs to be reconfigured. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently VoxelGI is baked on the CPU, hardcoded to rely on
BaseMaterial3D
's properties. Even then, its results are crude and inaccurate. And it has to give up completely on customShaderMaterials
, falling back to a default grey material ....Ideally, this is done on GPU, or in some way which runs the actual
Shader
's vertex and fragment codeblocks on each voxel to get accurate values and allow custom shaders to be baked.I've thought of a number of vague solutions on how it could be done:
Shader
's vertex() and fragment() codeblocks (this is what I initially came up with, but it seems too overblown... I can go into further detail if needed)All of these in effect act as faux scene shaders for the purpose of being able to use the actual
Shader
's output albedo and emission, making VoxelGI lighting and reflections appear accurate.There'll have to be special handling for view-dependent built-ins (
VIEW
, camera matrices, etc.), which I'm not sure how to address best.It'd also be ideal to let shaders detect being part of a VoxelGI bake, so that they can adjust their output to have a desired baked representation.
Beta Was this translation helpful? Give feedback.
All reactions