Godot-proposals: Allow indexed mode pictures

Created on 1 Feb 2020  路  2Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
A 2D fighting game.

Describe the problem or limitation you are having in your project:
I want to have my character have multiple color pallethes.

Describe how this feature / enhancement will help you overcome this problem or limitation:
Having indexed pictures was an older technique that allowed cool tricks like easy recoloring of sprites without heavy performance punishments.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Allow to import pictures in indexed mode, I know is possible with bmps but not sure if pngs allow index mode, but most 2D tools allow for indexed mode.

Describe implementation detail for your proposal (in code), if possible:
A way to improve the module function, by having a second argument using a .pal pallethe file or other type of color pallethe files some applications like aseprite can easily output.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
Would help things like easily replacing an entire sprite set or enemies or even groups of enemies with some nice effects like having them on certain collor pallethes, like kof uses as special effects like fire or poison.

Is there a reason why this should be core and not an add-on in the asset library?:
Would be a great improvement over the modulate function, making it more powerful, maybe allow to add some color pallethe to override the previous index mode colors.

import rendering

Most helpful comment

I like indexed mode too but as Juan Linietsky has stated in the past graphics cards are pretty much universally truecolour only now and all palette effects can be implemented pretty easily in shader code.

All 2 comments

I like indexed mode too but as Juan Linietsky has stated in the past graphics cards are pretty much universally truecolour only now and all palette effects can be implemented pretty easily in shader code.

99% this won't happen: godotengine/godot#28013. 馃檭

But I've managed to implement this in a module anyway, but it takes some time to learn how to compile Godot from source if you're feeling adventurous.

For your particular use case, shaders are solution, but some features are missing, like this: godotengine/godot#10751 (for instance, passing PoolColorArray as uniform, aka palette).

graphics cards are pretty much universally truecolour only

It doesn't mean that index and palette data can't be stored on the image data level, which was the idea behind the above PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SpyrexDE picture SpyrexDE  路  3Comments

lupoDharkael picture lupoDharkael  路  3Comments

arkology picture arkology  路  3Comments

regakakobigman picture regakakobigman  路  3Comments

PLyczkowski picture PLyczkowski  路  3Comments