Skip to content

Add free transformation for lights.#350

Merged
freezy merged 10 commits into
masterfrom
feature/free-transform
Dec 5, 2021
Merged

Add free transformation for lights.#350
freezy merged 10 commits into
masterfrom
feature/free-transform

Conversation

@freezy
Copy link
Copy Markdown
Owner

@freezy freezy commented Dec 5, 2021

Before this PR, every GameObject had a transformation override, i.e. our custom code handled how the object could be transformed. This was to be sure that the object wasn't moved outside of what the physics engine supports.

However, there are GameObjects like lights that don't concern the physics engine and handling the transformation on our own only complicates things. More concretely, the problem we solved was being able to simply add a LightComponent to existing lights without the override getting confused.

In the future we could apply this to objects that can be freely transformed like primitives as well.

Additionally, code was added to fade emissive materials along with the light, should they be a child of one. It's still hacky because we multiply the alpha value with 0.3f to get somewhat correct results.

Video of it in action:

https://www.youtube.com/watch?v=wLd4VGZUKmU

Lastly, I've updated the documentation and screenshots of the setup process to work with Unity 2021.2.

@freezy freezy self-assigned this Dec 5, 2021
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 5, 2021

Codecov Report

Merging #350 (27df9dd) into master (d7525e5) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #350   +/-   ##
=======================================
  Coverage   83.91%   83.91%           
=======================================
  Files         125      125           
  Lines        6741     6741           
=======================================
  Hits         5657     5657           
  Misses       1084     1084           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 802e4c5...27df9dd. Read the comment docs.

@freezy freezy merged commit 1a4d26f into master Dec 5, 2021
@freezy freezy deleted the feature/free-transform branch December 5, 2021 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant