You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed with @reduz on IRC, there could be a EditorImporterTexturePlugin API to allow tweaking the texture import process, and do things like changing how mipmaps are computed, before compression takes on.
The initial use case I have is the use of a splatmap with a repeating texture. Over the distance, it looks really bad:
I tried changing the bias of mipmaps, but it also looks bad, and for some reasons mipmaps don't converge to a single color:
So instead, I decided to blend towards a solid color, taken from the center of the highest mip. This looks a lot better:
Unfortunately, doing this has a pretty high cost, because it doubles the required texture fetches in a shader that already has a lot to do. So I figured out a very nice alternative would be to bake that color blend into the mipmaps themselves, resulting in that fix being free and nicely integrated.
Doing that requires to alter the texture importing process, and that's where such API would be needed.
I'm coming back to this issue with yet another terrain-related use case.
I wish to make an importer for packed textures. This means the importer matches a special lightweight file type describing how channels are combined from various sources, along with a few extra operations, and then feeds the result to the regular StreamTexture import process.
Unfortunately, to do this I have to re-implement the entire texture importer in GDScript (and there is a LOT going on there, especially to handle VRAM formats), and yet it's incomplete because some functions are not even exposed.
Then I also need the same for TextureArray, which again requires a rewrite.
Perhaps this would end up as a proposal nowadays, however I'm running out of time to make one for now, until I get to the end of my journey...
As discussed with @reduz on IRC, there could be a EditorImporterTexturePlugin API to allow tweaking the texture import process, and do things like changing how mipmaps are computed, before compression takes on.
The initial use case I have is the use of a splatmap with a repeating texture. Over the distance, it looks really bad:
I tried changing the bias of mipmaps, but it also looks bad, and for some reasons mipmaps don't converge to a single color:
So instead, I decided to blend towards a solid color, taken from the center of the highest mip. This looks a lot better:
Unfortunately, doing this has a pretty high cost, because it doubles the required texture fetches in a shader that already has a lot to do. So I figured out a very nice alternative would be to bake that color blend into the mipmaps themselves, resulting in that fix being free and nicely integrated.
Doing that requires to alter the texture importing process, and that's where such API would be needed.
Also, as @Calinou mentionned, there are other effects depending on custom mipmaps, mentionned here https://www.youtube.com/watch?v=exp1Yrxt50A (8:00)
And this could even make channel packing easier, which I currently achieve manually by making this plugin: https://godotengine.org/asset-library/asset/230
The text was updated successfully, but these errors were encountered: