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

Introduce Scene.backgroundIntensity #24876

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

WestLangley
Copy link
Collaborator

Since background textures can be HDR, we need to be able scale the background texture's brightness independently from the scene itself.

Just as we have material.envMapIntensity, this PR adds scene.backgroundIntensity.

Perhaps there is a better name for this, but I do not see how this property can be avoided.

Comments welcome.

@donmccurdy
Copy link
Collaborator

To my understanding, it's common for HDRIs to be "normalized", with units relative to some chosen baseline. In that case I would expect to see correct exposure by default. The main case I'd imagine where the background intensity must be adjusted is when using an HDR background alongside physically based lights or modified renderer.toneMappingExposure settings, to counteract the exposure and bring the (non-physical) values of the HDRI back into the original range.

The proposed naming sounds good to me. I was also thinking of .backgroundExposure, but not sure which word is better as the background is neither a light source nor a camera... Maybe just consistency w/ envMapIntensity is best.

@WestLangley
Copy link
Collaborator Author

Thanks! It looks like there is agreement. :-)

@WestLangley WestLangley added this to the r147 milestone Oct 31, 2022
@Mugen87
Copy link
Collaborator

Mugen87 commented Nov 3, 2022

Merging this to complete HDR support for Scene.background.

@Mugen87 Mugen87 merged commit a13c6a3 into mrdoob:dev Nov 3, 2022
@Mugen87
Copy link
Collaborator

Mugen87 commented Nov 3, 2022

Since we are adding new properties to Scene, the suggested design in #17420 makes more and more sense. At some point, we should consider to refactor Scene.background so it works with ColorBackground, TextureBackground and CubeTextureBackground (the last name potentially needs an update since you can assign equirect and cubeuv textures, too).

@WestLangley WestLangley deleted the dev_background_intensity branch November 3, 2022 14:46
@0b5vr 0b5vr mentioned this pull request Dec 7, 2022
12 tasks
0b5vr added a commit to three-types/three-ts-types that referenced this pull request Dec 19, 2022
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.

3 participants