Skip to content

Commit

Permalink
Fixes 3D axes flickering in the negative direction
Browse files Browse the repository at this point in the history
When zooming out in the 3d node editor view, the negative half
of all 3d axes starts flickering upon moving the camera. To fix this,
the logic surrounding 3d transform "scaled" and "translated" calls has
been altered so as to account for negative distance values.

Fixes #89215.
  • Loading branch information
Jabberdrake authored and akien-mga committed Apr 9, 2024
1 parent 9d6bdbc commit a538410
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6639,8 +6639,13 @@ void fragment() {

for (int j = 0; j < 4; j++) {
Transform3D t = Transform3D();
t = t.scaled(axis * distances[j + 1]);
t = t.translated(axis * distances[j]);
if (distances[j] > 0.0) {
t = t.scaled(axis * distances[j + 1]);
t = t.translated(axis * distances[j]);
} else {
t = t.scaled(axis * distances[j]);
t = t.translated(axis * distances[j + 1]);
}
RenderingServer::get_singleton()->multimesh_instance_set_transform(origin_multimesh, i * 4 + j, t);
RenderingServer::get_singleton()->multimesh_instance_set_color(origin_multimesh, i * 4 + j, origin_color);
}
Expand Down

0 comments on commit a538410

Please sign in to comment.