Skip to content

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

Merged
kblaschke merged 3 commits intoprojectM-visualizer:masterfrom
kblaschke:bugfix/constrain-per-pixel-mesh-size
Oct 15, 2023
Merged

Constrain/clamp per-pixel mesh size to [8,300] and even values.#737
kblaschke merged 3 commits intoprojectM-visualizer:masterfrom
kblaschke:bugfix/constrain-per-pixel-mesh-size

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 The issue is (potentially) a 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
@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

bug The issue is (potentially) a bug.

Projects

Development

Successfully merging this pull request may close these issues.

3 participants