-
Notifications
You must be signed in to change notification settings - Fork 427
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
Add depth unprojection support to batch renderer #2129
Conversation
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.
22 comments, sorry, I'll stop now 😅
src/esp/gfx_batch/Renderer.cpp
Outdated
/* Combined view and projection matrices. Updated from updateCamera() */ | ||
Cr::Containers::Array<ProjectionPadded> cameraMatrices; | ||
/* Unprojection for cameras. Updated from updateCamera() */ | ||
Cr::Containers::Array<Mn::Vector2> cameraUnprojections; |
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.
Couldn't this be put into the Scene
struct among all other per-scene data? Feels unnecessary to allocate a dedicated array for these.
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'm inclined to leave this as-is until we have multi-sensor support because it'll be more straightforward to refactor per-sensor data.
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.
it'll be more straightforward to refactor
I don't know :) There most probably will be another array, yes, but that's about it, its size and contents will be significantly different. In the context of this PR it's unnecessary noise.
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.
Final set of code golf suggestions because this was bothering me :P
1ae1473
to
b100aad
Compare
Did the two remaining requested changes myself, see the commits below for details. |
No need to maintain a whole new array for it.
58f56ed
to
ec15aac
Compare
My suggestion was meant to *replace* the original and adapt the code as necessary, not add a new overload without actually testing any of it. Due to the copypaste the new overload also had no FMV attribute applied, meaning it suddenly got significantly slower for no reason.
Takes too long in Debug.
ec15aac
to
46b8286
Compare
Motivation and Context
This changeset adds support for unprojecting depth within the batch renderer.
In this context, unprojected depth means that each pixel of the depth image represents the distance in meters from the camera, rather than the raw depth buffer.
To accomplish this,
DepthUnprojection
is now shared by the classic and the batch renderer. To preserve batch renderer isolation, it was moved to the batch renderer along with the shaders.Summary:
gfx
andgfx_batch
.gfx
shaders can referencegfx_batch
shaders, but not the other way around.DepthUnprojection
is moved togfx_batch
How Has This Been Tested
Tested locally and on CI.
The following tests are added:
GfxBatchRendererTest
BatchReplayRendererTest
Types of changes
Checklist