Skip drawing invisible voxel sections#2096
Skip drawing invisible voxel sections#2096Metadorius wants to merge 3 commits intoPhobos-developers:developfrom
Conversation
Metadorius
commented
Feb 8, 2026
- Voxel drawing code now skips sections that are invisible (have all zeros in the transform matrix main diagonal, meaning that the scale is 0% on all axes), thus increasing drawing performance for some voxels (by Kerbiter, ZivDero)
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
Starkku
left a comment
There was a problem hiding this comment.
LGTM. Just one thing but it is basically 'who cares' kind of deal.
src/Misc/Hooks.BugFixes.cpp
Outdated
|
|
||
| auto mtx = pMotLib->GetLayerMatrix(layer, frame); | ||
|
|
||
| if (CLOSE_ENOUGH(mtx.row[0][0], 0.0) && CLOSE_ENOUGH(mtx.row[1][1], 0.0) && CLOSE_ENOUGH(mtx.row[2][2], 0.0)) |
There was a problem hiding this comment.
Pretty sure we have equal to zero float comparisons without the epsilon all over the codebase and it is my understanding that major floating point standards represent zero as exact value, I don't know if the transformation matrix data has inaccuracies from tools that specifically warrant using it here.
There was a problem hiding this comment.
I don't know either, just wanted to play it safe since I think I recall some 0,0023 or so values in the transform matrix somewhere. My memory may be playing tricks on me tho.
There was a problem hiding this comment.
I don't think there's much practical difference anyway, I don't think anyone would want to deliberately make a dot out of their voxel.
|
I don't quite understand the drawing. Could you elaborate on which |
|
Tested it under SP and MP scenarios, no desync or wrong voxel displaying so far. Can be merged once it's finished |
it is mainly intended to improve performance on section swap animated voxels, most likely that's the only thing it will improve. I am waiting for the conclusive testing results from the community members who requested that and will most likely amend the doc/code. |