Skip to content
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

Constrain/clamp per-pixel mesh size to [8,300] and even values. #737

Conversation

kblaschke
Copy link
Member

The per-mixel mesh size needs to be a mutiple of two to avoid "bars" being rendered in each axis if the resolution is an odd number.

Also now clamping the value range from 8 to 300 (inclusive) on each axis, with 300 being well above anyone would need (Milkdrop's default of 64x48 is totally sufficient even in 4K).

The third commit just fixes a few compiler warnings by making the casts explicit.

The warp mesh is now always resized/recalculated dynamically when a frame is drawn, nothing needs to be reloaded anymore.
Many of those internal types need a cleanup later to consolidate them a bit more.
@kblaschke kblaschke added the bug label Oct 14, 2023
@kblaschke kblaschke added this to the 4.1 milestone Oct 14, 2023
@kblaschke kblaschke self-assigned this Oct 14, 2023
@labkey-matthewb
Copy link
Contributor

I recall that the mesh size might get rounded to a multiple of 4 internally to enable SSE optimization.

@kblaschke
Copy link
Member Author

kblaschke commented Oct 15, 2023

I recall that the mesh size might get rounded to a multiple of 4 internally to enable SSE optimization.

The SSE code has been removed, as the U/V coordinate calculations are now done in the warp mesh vertex shader, which is even better than using SSE (and portable to ARM as well).

But this explains why it wasn't an issue in the 3.x versions.

@labkey-matthewb
Copy link
Contributor

I recall that the mesh size might get rounded to a multiple of 4 internally to enable SSE optimization.

The SSE code has been removed, as the U/V coordinate calculations are now done in the warp mesh vertex shader, which is even better than using SSE (and portable to ARM as well).

But this explains why it wasn't an issue in the 3.x versions.

Very cool!

@kblaschke kblaschke merged commit 8461bb9 into projectM-visualizer:master Oct 15, 2023
9 checks passed
@kblaschke kblaschke deleted the bugfix/constrain-per-pixel-mesh-size branch October 15, 2023 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

3 participants