Skip to content

Add secondary light to 3D Advanced Import Settings - #76140

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
jeronimo-schreyer:add_secondary_light_to_3d_resource_importer
Apr 19, 2024
Merged

Add secondary light to 3D Advanced Import Settings#76140
akien-mga merged 1 commit into
godotengine:masterfrom
jeronimo-schreyer:add_secondary_light_to_3d_resource_importer

Conversation

@jeronimo-schreyer

@jeronimo-schreyer jeronimo-schreyer commented Apr 16, 2023

Copy link
Copy Markdown
Contributor

Added a second light for the 3D Preview Viewport and UI toggle buttons which resemble the ones in the EditorMaterialPreviewPlugin

On branch add_secondary_light_to_3d_resource_importer
Changes to be committed:
modified: editor/import/scene_import_settings.cpp
modified: editor/import/scene_import_settings.h

@jeronimo-schreyer
jeronimo-schreyer requested a review from a team as a code owner April 16, 2023 17:59
@jeronimo-schreyer
jeronimo-schreyer force-pushed the add_secondary_light_to_3d_resource_importer branch from f85d165 to 616a767 Compare April 16, 2023 18:15
@Calinou Calinou added this to the 4.x milestone Apr 16, 2023
@jeronimo-schreyer
jeronimo-schreyer force-pushed the add_secondary_light_to_3d_resource_importer branch from 616a767 to d2357a1 Compare April 16, 2023 18:17
@jeronimo-schreyer
jeronimo-schreyer force-pushed the add_secondary_light_to_3d_resource_importer branch from 7595a32 to 47cd8e4 Compare August 19, 2023 01:38
@aaronfranke

Copy link
Copy Markdown
Member

Tested. I noticed that the two lights are coming from similar angles, one more on top and one more on the side. However, the material preview has light coming from very different angles, one light in the bottom and one light in the top right. Since one of the goals is to resemble that editor, shouldn't one of the lights be coming from below?

Also, in the material preview, the lights stay fixed relative to the camera. In this PR, the lights are fixed relative to the object. I think it would be better to have lights fixed relative to the camera, so you can view different parts of the model illuminated by the light at different angles relative to the model, instead of having a fixed part of the model lit at the same angle relative to the model.

@YuriSizov YuriSizov modified the milestones: 4.x, 4.3 Oct 17, 2023
@aaronfranke aaronfranke self-assigned this Apr 16, 2024
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
@aaronfranke
aaronfranke force-pushed the add_secondary_light_to_3d_resource_importer branch from 47cd8e4 to c3bc768 Compare April 16, 2024 17:16
@jeronimo-schreyer
jeronimo-schreyer requested review from a team as code owners April 16, 2024 17:16
@aaronfranke

aaronfranke commented Apr 16, 2024

Copy link
Copy Markdown
Member

Since the original author was inactive, I sent them an email asking for write access to their repo so I can push to their PRs, which they granted to me. I have taken over this PR in order to bring it to the finish line. Most of the code is still Jeronimo's work, which is itself similar to the mesh and material previewer code, so I have him marked as author.

I made the following changes to this PR:

  • Rebase and fix conflicts.
  • In a few minor ways, make the code more similar to the mesh and material previewers.
  • Introduce a new method to Node3D called set_as_top_level_keep_local, which is like set_as_top_level but simpler, as it excludes the code that preserves the global transform (instead, it preserves the local transform).
  • Implement both points in my comment above.
    • The light directions are now the same as the mesh and material previewers.
    • The lights are now fixed relative to the camera by default, for consistency with the mesh and material previews.
      • However, if you prefer the old behavior for consistency with an orbiting camera in the scene editor, that is also kept. There is now a button in the top-right that will toggle between the rotation modes:
        Screenshot 2024-04-16 at 9 45 31 AM

This new button uses a new icon called "PreviewRotate", which is the same as "ToolRotate" but with an outline and brighter (thank you to @MewPurPur for making this).

PreviewRotate

@fire fire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am ok with adding the enhancement to add a secondary light. Did not compile the code.

@akien-mga
akien-mga merged commit 42e6f9a into godotengine:master Apr 19, 2024
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@aaronfranke
aaronfranke deleted the add_secondary_light_to_3d_resource_importer branch April 19, 2024 19:16
@akien-mga akien-mga changed the title Added secondary light to 3D Advanced Import Settings Add secondary light to 3D Advanced Import Settings May 1, 2024
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…dary_light_to_3d_resource_importer

Added secondary light to 3D Advanced Import Settings
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…dary_light_to_3d_resource_importer

Added secondary light to 3D Advanced Import Settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Add a secondary light in the Advanced Import Settings preview

6 participants