summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-12-18 16:28:12 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2020-12-27 22:20:36 +0100
commit507e9b12a4bebd2df3776ec4aba9dfffeb869403 (patch)
treeb3bc9d33a976727336fc5d76c0edc20ab66f2cb5 /editor
parent36b4e035dc7c410c29cda4446f8daa2e00a31da0 (diff)
Move the brightness factor for highlighted 3D gizmos to a variable
See https://github.com/godotengine/godot/commit/8522ac77113c3d5239ff4c6cd74ab7b92e1ee663#r45230326.
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index ff3b50303f..ca734454e8 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -2674,7 +2674,8 @@ void Node3DEditorViewport::_draw() {
break;
}
handle_color.a = 1.0;
- handle_color *= Color(1.3, 1.3, 1.3, 1.0);
+ const float brightness = 1.3;
+ handle_color *= Color(brightness, brightness, brightness);
RenderingServer::get_singleton()->canvas_item_add_line(
ci,
@@ -5247,7 +5248,9 @@ void Node3DEditor::_init_indicators() {
gizmo_color[i] = mat;
Ref<StandardMaterial3D> mat_hl = mat->duplicate();
- mat_hl->set_albedo(Color(col.r * 1.3, col.g * 1.3, col.b * 1.3, 1.0));
+ const float brightness = 1.3;
+ const Color albedo = Color(col.r * brightness, col.g * brightness, col.b * brightness);
+ mat_hl->set_albedo(albedo);
gizmo_color_hl[i] = mat_hl;
Vector3 ivec;
@@ -5342,7 +5345,7 @@ void Node3DEditor::_init_indicators() {
surftool->commit(move_plane_gizmo[i]);
Ref<StandardMaterial3D> plane_mat_hl = plane_mat->duplicate();
- plane_mat_hl->set_albedo(Color(col.r * 1.3, col.g * 1.3, col.b * 1.3, 1.0));
+ plane_mat_hl->set_albedo(albedo);
plane_gizmo_color_hl[i] = plane_mat_hl; // needed, so we can draw planes from both sides
}
@@ -5425,7 +5428,7 @@ void Node3DEditor::_init_indicators() {
rotate_gizmo[i]->surface_set_material(0, rotate_mat);
Ref<ShaderMaterial> rotate_mat_hl = rotate_mat->duplicate();
- rotate_mat_hl->set_shader_param("albedo", Color(col.r * 1.3, col.g * 1.3, col.b * 1.3, 1.0));
+ rotate_mat_hl->set_shader_param("albedo", albedo);
rotate_gizmo_color_hl[i] = rotate_mat_hl;
if (i == 2) { // Rotation white outline
@@ -5552,7 +5555,7 @@ void Node3DEditor::_init_indicators() {
surftool->commit(scale_plane_gizmo[i]);
Ref<StandardMaterial3D> plane_mat_hl = plane_mat->duplicate();
- plane_mat_hl->set_albedo(Color(col.r * 1.3, col.g * 1.3, col.b * 1.3, 1.0));
+ plane_mat_hl->set_albedo(Color(col.r * 1.3, col.g * 1.3, col.b * 1.3));
plane_gizmo_color_hl[i] = plane_mat_hl; // needed, so we can draw planes from both sides
}
}