Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow scene to use phong shading and custom light setups #515

Merged
merged 3 commits into from
Mar 5, 2020

Conversation

matthewjmay
Copy link
Contributor

Motivation and Context

Previously, we assumed that all scenes would be flat shaded, and all physics objects would be phong shaded. These assumptions are wrong given some new example scenes. This PR allows scenes to be loaded in with a light setup other than NO_LIGHT_KEY.

This is slightly more complicated than just adding a parameter, since we take a certain path if an asset is flat shaded versus phong shaded (ie. skip generating normals, override ambient material textures with diffuse, etc.). If an asset is attempted to be reloaded with different lighting requirements, for now we just warn the user and render with existing loaded materials/normals. If required, in the future we can hold two "variations" of the same asset to allow for both cases to be instantiated at once.

How Has This Been Tested

  • added screenshot test with a phong shaded scene with custom lighting
  • old flat shaded scene still passes screenshot test
  • visual test with different sceneLightSetups in viewer

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@matthewjmay matthewjmay changed the title allow scene to use a phong shading and custom light setup Allow scene to use a phong shading and custom light setup Mar 3, 2020
@matthewjmay matthewjmay changed the title Allow scene to use a phong shading and custom light setup Allow scene to use phong shading and custom light setup Mar 3, 2020
@matthewjmay matthewjmay changed the title Allow scene to use phong shading and custom light setup Allow scene to use phong shading and custom light setups Mar 3, 2020
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 3, 2020
@codecov
Copy link

codecov bot commented Mar 3, 2020

Codecov Report

Merging #515 into master will decrease coverage by 0.37%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #515      +/-   ##
=========================================
- Coverage   61.48%   61.1%   -0.38%     
=========================================
  Files         165     165              
  Lines        7578    7516      -62     
  Branches       84      84              
=========================================
- Hits         4659    4593      -66     
- Misses       2919    2923       +4
Flag Coverage Δ
#CPP 55.87% <100%> (-0.66%) ⬇️
#JavaScript 10% <ø> (ø) ⬆️
#Python 80.7% <80%> (-0.08%) ⬇️
Impacted Files Coverage Δ
src/esp/assets/MeshMetaData.h 100% <ø> (ø) ⬆️
src/esp/sim/Simulator.h 100% <ø> (ø) ⬆️
src/esp/assets/Asset.h 100% <ø> (ø) ⬆️
src/esp/assets/Attributes.cpp 36.81% <100%> (+0.34%) ⬆️
src/tests/SimTest.cpp 100% <100%> (ø) ⬆️
src/esp/assets/Asset.cpp 78.94% <100%> (+9.71%) ⬆️
src/esp/assets/ResourceManager.h 100% <100%> (ø) ⬆️
examples/settings.py 97.56% <80%> (-2.44%) ⬇️
src/tests/CullingTest.cpp 97.75% <0%> (-2.25%) ⬇️
src/esp/physics/bullet/BulletPhysicsManager.cpp 57.14% <0%> (-0.98%) ⬇️
... and 17 more

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 c948835...c92ae7c. Read the comment docs.

Copy link
Collaborator

@mosra mosra left a comment

Choose a reason for hiding this comment

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

It's extremely unusual for me, but this time I have nothing to complain about :D

@matthewjmay matthewjmay merged commit 4d59a56 into master Mar 5, 2020
@aclegg3 aclegg3 mentioned this pull request Mar 13, 2020
@matthewjmay matthewjmay deleted the allow-lighted-scene branch March 17, 2020 06:21
Ram81 pushed a commit to Ram81/habitat-web-sim that referenced this pull request Dec 10, 2020
…earch#515)

* allow scene to use a light setup

* add test for scene with lighting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants