-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CameraFrame API in the engine #7129
base: main
Are you sure you want to change the base?
Conversation
* @typedef {Object} Bloom | ||
* @property {number} intensity - The intensity of the bloom effect, 0-0.1 range. Defaults to 0, | ||
* making it disabled. | ||
* @property {number} lastMipLevel - The last mip level of the bloom effect, 0-12 range. Defaults to 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I struggle to understand what this will do. Can we expose this in a more obvious/friendly way?
* @property {string} type - The type of the SSAO determines how it is applied in the rendering | ||
* process. Defaults to {@link SSAOTYPE_NONE}. Can be: | ||
* | ||
* - {@link SSAOTYPE_NONE} | ||
* - {@link SSAOTYPE_LIGHTING} | ||
* - {@link SSAOTYPE_COMBINE} | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally have trouble understanding/visualizing the 3 SSAO types. I would prefer an enabled
flag and have it do the most common or nicest looking code path, but provide a further flag along the lines of 'ignoreLighting' or something.
*/ | ||
|
||
/** | ||
* @typedef {Object} Bloom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't help but feel that an enabled
property per effect would make for a more logical, guessable API.
* preference. Defaults to [{@link PIXELFORMAT_111110F}, {@link PIXELFORMAT_RGBA16F}, | ||
* {@link PIXELFORMAT_RGBA32F}]. | ||
* @property {boolean} stencil - Whether the render buffer has a stencil buffer. Defaults to false. | ||
* @property {number} renderTargetScale - The scale of the frame buffer, 0.1-1 range. Defaults to 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not obvious what this does.
Fixes #7129
(separate improvements / changes can be tracked separately)
This adds a new CameraFrame class as part of the engine, which is a public API for the currently exposed render pass based rendering.
The script which exposes this to the Editor now uses an instance of this CameraFrame, and simply passes attributes to it, without containing any logic. This allows it to not access any private engine functionality.
This is the new public API (too long to copy here)
https://github.com/playcanvas/engine/blob/mc-engine-camera-frame/src/extras/render-passes/camera-frame.js