Add depth unprojection support to batch renderer#2129
Conversation
mosra
left a comment
There was a problem hiding this comment.
22 comments, sorry, I'll stop now 😅
| /* 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.
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.
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.
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.
mosra
left a comment
There was a problem hiding this comment.
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,
DepthUnprojectionis 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:
gfxandgfx_batch.gfxshaders can referencegfx_batchshaders, but not the other way around.DepthUnprojectionis moved togfx_batchHow Has This Been Tested
Tested locally and on CI.
The following tests are added:
GfxBatchRendererTestBatchReplayRendererTestTypes of changes
Checklist