summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-07-27 00:25:12 +0200
committerGitHub <noreply@github.com>2022-07-27 00:25:12 +0200
commitad9a8e70f499267251daaa4cb51f3c2545d4ad4e (patch)
treeaedf446afe6f391c14f218fdce278d30e951e0aa /editor/plugins
parent0a420c478761d49b5f973ff292e1f3e4a63613b3 (diff)
parent99ac090233c7446ea11f84e37bef1ced421c993c (diff)
Merge pull request #62888 from Calinou/editor-material-preview-improve-appearance
Improve appearance of the material editor preview
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/material_editor_plugin.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index 34db75f118..e21cb7e76a 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -155,7 +155,9 @@ MaterialEditor::MaterialEditor() {
camera = memnew(Camera3D);
camera->set_transform(Transform3D(Basis(), Vector3(0, 0, 3)));
- camera->set_perspective(45, 0.1, 10);
+ // Use low field of view so the sphere/box is fully encompassed within the preview,
+ // without much distortion.
+ camera->set_perspective(20, 0.1, 10);
camera->make_current();
viewport->add_child(camera);
@@ -177,8 +179,8 @@ MaterialEditor::MaterialEditor() {
Transform3D box_xform;
box_xform.basis.rotate(Vector3(1, 0, 0), Math::deg2rad(25.0));
box_xform.basis = box_xform.basis * Basis().rotated(Vector3(0, 1, 0), Math::deg2rad(-25.0));
- box_xform.basis.scale(Vector3(0.8, 0.8, 0.8));
- box_xform.origin.y = 0.2;
+ box_xform.basis.scale(Vector3(0.7, 0.7, 0.7));
+ box_xform.origin.y = 0.05;
box_instance->set_transform(box_xform);
sphere_mesh.instantiate();