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

Physically based camera #4585

Merged
merged 11 commits into from
Sep 5, 2022
Merged

Physically based camera #4585

merged 11 commits into from
Sep 5, 2022

Conversation

GSterbrant
Copy link
Contributor

Description

Initial PR for physical light units #3252 by enabling the use of physically based camera properties. The default properties (f/1.0, ISO 100, 1s) could have an effect on the overall lighting in the scene, so these are behind a switch.

@GSterbrant GSterbrant added enhancement area: graphics Graphics related issue labels Aug 23, 2022
@GSterbrant GSterbrant self-assigned this Aug 23, 2022
src/scene/camera.js Outdated Show resolved Hide resolved
src/scene/scene.js Outdated Show resolved Hide resolved
src/scene/scene.js Outdated Show resolved Hide resolved
GSterbrant and others added 2 commits September 2, 2022 09:45
Co-authored-by: Will Eastcott <will@playcanvas.com>
src/scene/scene.js Outdated Show resolved Hide resolved
}

/**
* Set camera shutter speed in seconds, the default value is 1s. Longer shutter means more exposure.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm really not sure about 1s as a default here. What are we going to do in the future when we perhaps add a motion blur? I think the default value should be something that would work reasonably well for future purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressing that here:

#4617

Comment on lines +322 to +344
set aperture(newValue) {
this._aperture = newValue;
}

get aperture() {
return this._aperture;
}

set sensitivity(newValue) {
this._sensitivity = newValue;
}

get sensitivity() {
return this._sensitivity;
}

set shutter(newValue) {
this._shutter = newValue;
}

get shutter() {
return this._shutter;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently these functions do nothing other than se / return the value. Personally, I'd remove them, and just rename the private variables to not have underscores in them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was just to have it be consistent with the other parameters, like clearDepth and clearDepthBuffer, etc.

@GSterbrant GSterbrant merged commit f2475ca into main Sep 5, 2022
@GSterbrant GSterbrant deleted the gsterbrant_pb_camera branch September 5, 2022 10:57
@GSterbrant GSterbrant restored the gsterbrant_pb_camera branch September 5, 2022 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants