summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-01-01 00:52:20 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2020-01-01 00:54:25 +0100
commitac18665c8803916236cdf326b7b9a00951bf140d (patch)
treefe54a0c85eaf5c3ebadb540f3c47ac0da7758c0f /editor/plugins
parent7fddf5eb7c6b6e58f891aaaa5b396f2b0cf616f8 (diff)
Tint 3D light gizmos using the light's color
This makes navigation more convenient in the 3D viewport, especially when using the unshaded display mode.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp2
-rw-r--r--editor/plugins/spatial_editor_plugin.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index a7c1becabd..da2fbfd66c 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -6145,6 +6145,8 @@ void EditorSpatialGizmoPlugin::create_icon_material(const String &p_name, const
icon->set_albedo(color);
icon->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ icon->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ icon->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
icon->set_cull_mode(SpatialMaterial::CULL_DISABLED);
icon->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED);
icon->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index ecb7363401..1c6c31dd21 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -102,11 +102,11 @@ protected:
static void _bind_methods();
public:
- void add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard = false);
+ void add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard = false, const Color &p_modulate = Color(1, 1, 1));
void add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard = false, const Ref<SkinReference> &p_skin_reference = Ref<SkinReference>(), const Ref<Material> &p_material = Ref<Material>());
void add_collision_segments(const Vector<Vector3> &p_lines);
void add_collision_triangles(const Ref<TriangleMesh> &p_tmesh);
- void add_unscaled_billboard(const Ref<Material> &p_material, float p_scale = 1);
+ void add_unscaled_billboard(const Ref<Material> &p_material, float p_scale = 1, const Color &p_modulate = Color(1, 1, 1));
void add_handles(const Vector<Vector3> &p_handles, const Ref<Material> &p_material, bool p_billboard = false, bool p_secondary = false);
void add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position = Vector3());