diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-09-15 01:01:52 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-11 12:01:24 +0100 |
commit | dd3682e5feb433117fbf62c363c7ba6ff214f8fa (patch) | |
tree | ebe83f2fb472140c4ae267fd5f4a7db7525acbc1 /scene/3d/ray_cast.cpp | |
parent | 6deffa62fbd1e91873afa663630b788b9ffabee3 (diff) | |
download | redot-engine-dd3682e5feb433117fbf62c363c7ba6ff214f8fa.tar.gz |
Modernized default 3D material, fixes material bugs.
Diffstat (limited to 'scene/3d/ray_cast.cpp')
-rw-r--r-- | scene/3d/ray_cast.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 616ab7cf40..0c976b9fb1 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -186,7 +186,7 @@ void RayCast::_notification(int p_what) { _update_raycast_state(); if (prev_collision_state != collided && get_tree()->is_debugging_collisions_hint()) { if (debug_material.is_valid()) { - Ref<SpatialMaterial> line_material = static_cast<Ref<SpatialMaterial> >(debug_material); + Ref<StandardMaterial3D> line_material = static_cast<Ref<StandardMaterial3D> >(debug_material); line_material->set_albedo(collided ? Color(1.0, 0, 0) : Color(1.0, 0.8, 0.6)); } } @@ -333,10 +333,10 @@ void RayCast::_bind_methods() { void RayCast::_create_debug_shape() { if (!debug_material.is_valid()) { - debug_material = Ref<SpatialMaterial>(memnew(SpatialMaterial)); + debug_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); - Ref<SpatialMaterial> line_material = static_cast<Ref<SpatialMaterial> >(debug_material); - line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); + Ref<StandardMaterial3D> line_material = static_cast<Ref<StandardMaterial3D> >(debug_material); + line_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); line_material->set_albedo(Color(1.0, 0.8, 0.6)); } |