summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-27 10:47:10 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-27 10:47:10 -0600
commitc5cd7c66ee417f6854fb5e36812e870849c46c3e (patch)
tree46866e6b84e18ebd0ada42389bb1eac119b7571a /modules
parent06f4bcdefb14c77b553f10a805188057952b9cdf (diff)
parent612981c1ea7d1beb927b53a2e4056827ed6ca32a (diff)
downloadredot-engine-c5cd7c66ee417f6854fb5e36812e870849c46c3e.tar.gz
Merge pull request #85443 from smix8/gridmap_castshadows
Add ShadowCastingSetting to MeshLibrary / GridMap items
Diffstat (limited to 'modules')
-rw-r--r--modules/gridmap/editor/grid_map_editor_plugin.cpp2
-rw-r--r--modules/gridmap/grid_map.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp
index 0d522a0562..e76e9e4953 100644
--- a/modules/gridmap/editor/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp
@@ -1233,6 +1233,8 @@ void GridMapEditor::_update_cursor_instance() {
Ref<Mesh> mesh = node->get_mesh_library()->get_item_mesh(selected_palette);
if (!mesh.is_null() && mesh->get_rid().is_valid()) {
cursor_instance = RenderingServer::get_singleton()->instance_create2(mesh->get_rid(), get_tree()->get_root()->get_world_3d()->get_scenario());
+ RS::ShadowCastingSetting cast_shadows = (RS::ShadowCastingSetting)node->get_mesh_library()->get_item_mesh_cast_shadow(selected_palette);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(cursor_instance, cast_shadows);
}
}
} else if (mode_buttons_group->get_pressed_button() == select_mode_button) {
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 0588ba034a..29634a0a75 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -714,6 +714,9 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
RS::get_singleton()->instance_set_transform(instance, get_global_transform());
}
+ RS::ShadowCastingSetting cast_shadows = (RS::ShadowCastingSetting)mesh_library->get_item_mesh_cast_shadow(E.key);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, cast_shadows);
+
mmi.multimesh = mm;
mmi.instance = instance;