Skip to content

Skip drawing invisible voxel sections#2096

Open
Metadorius wants to merge 3 commits intoPhobos-developers:developfrom
Metadorius:feature/voxel-invisible-section-skip
Open

Skip drawing invisible voxel sections#2096
Metadorius wants to merge 3 commits intoPhobos-developers:developfrom
Metadorius:feature/voxel-invisible-section-skip

Conversation

@Metadorius
Copy link
Member

  • 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)

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

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.

Copy link
Contributor

@Starkku Starkku left a comment

Choose a reason for hiding this comment

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

LGTM. Just one thing but it is basically 'who cares' kind of deal.


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))
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

@TaranDahl
Copy link
Contributor

I don't quite understand the drawing. Could you elaborate on which some voxels specifically refer to?

@Coronia
Copy link
Contributor

Coronia commented Feb 10, 2026

Tested it under SP and MP scenarios, no desync or wrong voxel displaying so far. Can be merged once it's finished

@Metadorius
Copy link
Member Author

I don't quite understand the drawing. Could you elaborate on which some voxels specifically refer to?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments