Open Arnklit opened 8 months ago
Can you link to an algorithm that performs this processing?
I believe this is the code used for GIMP's .dds exporter. https://github.com/GNOME/gimp/blob/748b2b5767dd8ce14b961cee178800420150a5ed/plug-ins/file-dds/mipmap.c#L933
Looking around a bit. I see that O3DE also has this option and is open source, so might be a good place to look.
https://www.docs.o3de.org/docs/user-guide/assets/texture-settings/interface/#mipmap-settings
Ignacio Castanos MIT licensed implementation was succesfully used in The Witness.
Explanation:http://the-witness.net/news/2010/09/computing-alpha-mipmaps/?source=post_page-----8b177335ae4f--------------------------------
Describe the project you are working on
Various 3D projects.
Describe the problem or limitation you are having in your project
Materials using alpha scissor look bad farther away from camera due to higher mip map levels making them dissolve.
Example: Close up looks good.
Zoomed out the alpha clipping makes the leaves a noisy disintigrating mess.
There is already a solution for this, which is to use .dds textures that are exported with mipmaps that have alpha testing in mind:
The problem is most people don't have the technical knowledge to know why this is happening or how to resolve it and knowing how to export .dds textures and what settings to use is quite a burden on users.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I suggest we add an option to the texture importer to generate the mip maps that preserve the alpha test coverage.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add an option in the mipmaps section. Possibly it could be set to detect and auto enable when used with alpha scissor.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This would be used often in 3d scenes.
Is there a reason why this should be core and not an add-on in the asset library?
It would have to be in core to be useful.