You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Fix crash when creating voxel GI data
This commit is contained in:
@@ -2943,10 +2943,6 @@ void GI::VoxelGIInstance::update(bool p_update_light_instances, const Vector<RID
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// probe size relative to 1 unit in world space
|
|
||||||
Vector3 ps = gi->voxel_gi_get_octree_size(probe) / gi->voxel_gi_get_bounds(probe).size;
|
|
||||||
float cell_size = (1.0 / MAX(MAX(ps.x, ps.y), ps.z));
|
|
||||||
|
|
||||||
if (has_dynamic_object_data || p_update_light_instances || p_dynamic_objects.size()) {
|
if (has_dynamic_object_data || p_update_light_instances || p_dynamic_objects.size()) {
|
||||||
// PROCESS MIPMAPS
|
// PROCESS MIPMAPS
|
||||||
if (mipmaps.size()) {
|
if (mipmaps.size()) {
|
||||||
@@ -2954,6 +2950,9 @@ void GI::VoxelGIInstance::update(bool p_update_light_instances, const Vector<RID
|
|||||||
|
|
||||||
Vector3i probe_size = gi->voxel_gi_get_octree_size(probe);
|
Vector3i probe_size = gi->voxel_gi_get_octree_size(probe);
|
||||||
|
|
||||||
|
Vector3 ps = probe_size / gi->voxel_gi_get_bounds(probe).size;
|
||||||
|
float cell_size = (1.0 / MAX(MAX(ps.x, ps.y), ps.z)); // probe size relative to 1 unit in world space
|
||||||
|
|
||||||
VoxelGIPushConstant push_constant;
|
VoxelGIPushConstant push_constant;
|
||||||
|
|
||||||
push_constant.limits[0] = probe_size.x;
|
push_constant.limits[0] = probe_size.x;
|
||||||
@@ -3135,6 +3134,9 @@ void GI::VoxelGIInstance::update(bool p_update_light_instances, const Vector<RID
|
|||||||
|
|
||||||
RendererSceneRenderRD::get_singleton()->_render_material(to_world_xform * xform, cm, true, RendererSceneRenderRD::get_singleton()->cull_argument, dynamic_maps[0].fb, Rect2i(Vector2i(), rect.size), exposure_normalization);
|
RendererSceneRenderRD::get_singleton()->_render_material(to_world_xform * xform, cm, true, RendererSceneRenderRD::get_singleton()->cull_argument, dynamic_maps[0].fb, Rect2i(Vector2i(), rect.size), exposure_normalization);
|
||||||
|
|
||||||
|
Vector3 ps = octree_size / gi->voxel_gi_get_bounds(probe).size;
|
||||||
|
float cell_size = (1.0 / MAX(MAX(ps.x, ps.y), ps.z)); // probe size relative to 1 unit in world space
|
||||||
|
|
||||||
VoxelGIDynamicPushConstant push_constant;
|
VoxelGIDynamicPushConstant push_constant;
|
||||||
memset(&push_constant, 0, sizeof(VoxelGIDynamicPushConstant));
|
memset(&push_constant, 0, sizeof(VoxelGIDynamicPushConstant));
|
||||||
push_constant.limits[0] = octree_size.x;
|
push_constant.limits[0] = octree_size.x;
|
||||||
|
|||||||
Reference in New Issue
Block a user