Skip to content

Mip mapping with a custom downscaling algorithm#14144

Closed
HybridDog wants to merge 1 commit intoluanti-org:masterfrom
HybridDog:mipmap_custom
Closed

Mip mapping with a custom downscaling algorithm#14144
HybridDog wants to merge 1 commit intoluanti-org:masterfrom
HybridDog:mipmap_custom

Conversation

@HybridDog
Copy link
Contributor

@HybridDog HybridDog commented Dec 21, 2023

Currently, the lower-resolution mip maps in Minetest are generated without gamma correction and are therefore often too dark. Furthermore, common mip maps are downscaled without preserving the image contrast.
To fix these problems, I have implemented custom mip map generation with a SSIM-based perceptual downscaling algorithm.

Disabled mip mapping:
mipmap off

Mip mapping with the default downscaling algorithm:
mipmap simple

Mip mapping with the proposed custom downscaling algorithm:
mipmap sharp

For more pictures and information about the algorithm, see #6917 and the Perceptually Based Downscaling of Images paper.

Associated Issues: #6917, #6867
Roadmap goal: 2.1 Rendering/Graphics improvements

Unfinished rebase: https://github.com/HybridDog/minetest/tree/mipmap_custom_rebased_but_missing_setMipMapsData

How to test

Set the mip mapping setting to sharp and play

@HybridDog HybridDog force-pushed the mipmap_custom branch 2 times, most recently from 7dd8587 to 41f2f5d Compare December 22, 2023 19:14
@numberZero
Copy link
Contributor

Is perceptual downscaling even appropriate for mipmaps? They aren’t final images, they undergo stretching, skewing, and other processing before display.

@HybridDog
Copy link
Contributor Author

Is perceptual downscaling even appropriate for mipmaps?

I think it's a matter of taste. Here I have implemented the mix with 50 % linearly-downscaled texture.

@HybridDog HybridDog force-pushed the mipmap_custom branch 2 times, most recently from f3f3d22 to b898933 Compare January 7, 2024 15:35
@HybridDog HybridDog marked this pull request as ready for review January 7, 2024 15:36
@Zughy Zughy added Concept approved Approved by a core dev: PRs welcomed! Feature ✨ PRs that add or enhance a feature labels Jan 22, 2024
@sfan5 sfan5 added the Rebase needed The PR needs to be rebased by its author label Mar 20, 2024
@Zughy
Copy link
Contributor

Zughy commented Jun 2, 2024

@HybridDog rebase needed

Currently, the lower-resolution mip maps in Minetest are generated without gamma correction and are therefore often too dark.
Furthermore, common mip maps are downscaled without preserving the image contrast.

After this change, it is possible to choose between the default mip map generation
and a new custom mip map generation algorithm which preserves image sharpness and average brightness.
@HybridDog
Copy link
Contributor Author

I have rebased it. Thanks for notifying me.

@Zughy Zughy removed the Rebase needed The PR needs to be rebased by its author label Jun 2, 2024
@Zughy
Copy link
Contributor

Zughy commented Jun 27, 2025

@HybridDog rebase needed

@Zughy Zughy added the Rebase needed The PR needs to be rebased by its author label Jun 27, 2025
@sfan5
Copy link
Member

sfan5 commented Jun 27, 2025

I suppose I should be the one reviewing this since I approved the concept. Unfortunately I am short on time.

@HybridDog
Copy link
Contributor Author

After creating this Pull Request I found out that there's a patent associated with the paper (see my other comment). I still don't understand what exactly is patented and what this means for this and the other Pull Request.

@Zughy
Copy link
Contributor

Zughy commented Jul 21, 2025

@HybridDog so what would you like to do? I haven't checked the patent

@Zughy Zughy closed this Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@ Client rendering Concept approved Approved by a core dev: PRs welcomed! Feature ✨ PRs that add or enhance a feature Rebase needed The PR needs to be rebased by its author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants