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
Currently, it's impossible to remap/swizzle the color channels of an image on import. This is a useful feature to have when, for example, a user wants to remove some color channels.
The engine is already able to discard unused color channels when using the Optimized channel packing mode. However, the user may want more control over this process, like removing an existing alpha channel which is never used by a model.
Another use case of this would be if the image contains per-channel packed data (like ORM) that doesn't match up with the standard Godot is expecting. (For example, certain workflows use a smoothness map instead of roughness, or the order of the channels is different, etc.). Additionally, a user may want to make a colored image completely grayscale.
While these issues can be overcome by editing the image in external graphics software, this process takes more time, especially when dealing with many resources on bigger projects.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
A potential solution is to add a channel remap setting to the texture import pipeline. Each channel will support the following settings:
Red,
Green,
Blue,
Alpha,
Inverted Red,
Inverted Green,
Inverted Blue,
Inverted Alpha,
Unused (1 for alpha, 0 for others),
Zero,
One
Note that this is different from hardware swizzling which happens during texture sampling, but is limited to R/G/B/A/0/1 by most graphics APIs.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
This can be done with a script, but it will be inconvenient as currently it's not possible to easily add custom steps to the texture import pipeline. As such, the easiest way I can think of would be to make a script that will load the source image, swap its channels, then either overwrite it or create a copy that will be imported into an internal format.
Processing an already imported image isn't a very good idea, espacially when it has been compressed.
Is there a reason why this should be core and not an add-on in the asset library?
As described previously, it can be an add-on, but it would be inconvenient to use.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
The Godot Editor
Describe the problem or limitation you are having in your project
Related to #5182 and #9618
Currently, it's impossible to remap/swizzle the color channels of an image on import. This is a useful feature to have when, for example, a user wants to remove some color channels.
The engine is already able to discard unused color channels when using the Optimized channel packing mode. However, the user may want more control over this process, like removing an existing alpha channel which is never used by a model.
Another use case of this would be if the image contains per-channel packed data (like ORM) that doesn't match up with the standard Godot is expecting. (For example, certain workflows use a smoothness map instead of roughness, or the order of the channels is different, etc.). Additionally, a user may want to make a colored image completely grayscale.
While these issues can be overcome by editing the image in external graphics software, this process takes more time, especially when dealing with many resources on bigger projects.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
A potential solution is to add a channel remap setting to the texture import pipeline. Each channel will support the following settings:
Note that this is different from hardware swizzling which happens during texture sampling, but is limited to R/G/B/A/0/1 by most graphics APIs.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
A proof-of-concept implementation can be found here: godotengine/godot#99676
The settings:
The per-channel options:
If this enhancement will not be used often, can it be worked around with a few lines of script?
This can be done with a script, but it will be inconvenient as currently it's not possible to easily add custom steps to the texture import pipeline. As such, the easiest way I can think of would be to make a script that will load the source image, swap its channels, then either overwrite it or create a copy that will be imported into an internal format.
Processing an already imported image isn't a very good idea, espacially when it has been compressed.
Is there a reason why this should be core and not an add-on in the asset library?
As described previously, it can be an add-on, but it would be inconvenient to use.
The text was updated successfully, but these errors were encountered: