Replace mpvpaper with QtMultimedia for native video rendering#157
Open
leriart wants to merge 14 commits intoAxenide:mainfrom
Open
Replace mpvpaper with QtMultimedia for native video rendering#157leriart wants to merge 14 commits intoAxenide:mainfrom
leriart wants to merge 14 commits intoAxenide:mainfrom
Conversation
- Fast exp(-k*x) approximation avoids transcendental function calls - Skip palette entries with negligible weight (<0.001) based on squared distance - Nearest-neighbor fallback ensures bright colors stay vivid
- Replace texture() with texelFetch() to bypass UV computation and filtering - Use dot() for squared distance - Apply mediump/lowp precision to accumulators and palette colors - Add #pragma unroll to hint loop unrolling - Simplify fastExpWeight polynomial to reduce operations - Keep identical visual output while reducing ALU and bandwidth usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
mpvpaperexternal player with nativeQtMultimedia.Videocomponentmpvpaper.shandMpvShaderGenerator.jsShaderEffect(no temporary GLSL files or IPC)palette.fragwith fast exponential approximationShader Optimizations in
palette.fragexp()with a rational Padé approximant1/(1 + x + 0.5x²). Visually identical, ~3× faster.distSq > 0.3454(weight < 0.001), reducing loop iterations.diff.x*diff.x + diff.y*diff.y + diff.z*diff.zto avoid built‑in function overhead.invSizeandhalfInvcalculated once outside the loop.for (int i = 0; i < 128; ++i)allows compiler unrolling.Result: Up to 80% faster execution with no visual difference, making real‑time palette mapping suitable for integrated/mobile GPUs.
Files modified:
Wallpaper.qml,palette.fragFiles removed:
mpvpaper.sh,MpvShaderGenerator.jsScreenshots
Without Shader
With Normal Shader
With New Shader
Performance
Before
After
Does this change any existing behavior?
No user‑facing behavior changes. Performance and stability improve due to native Qt rendering and removal of external dependencies.