You are not logged in.
Pages: 1
Can someone make some scripts and shader that uses a png palette to change a sprites colors and alpha to different colors?
I was thinking along the lines of reading the png palette top to bottom, left to right
and storing the color sets in a array or map by calling palette_init
then you could call scripts like
palette_swap(cset) <-- can return
palette_effect(effect) <-- can return
palette_fadeEffect(effect,time) <-- read only
effects being
thermal
negitive
frozen
gray
sepia
ultraViolet
to change the color
Offline
GM8 doesn't support shaders... unless your using some kind of extension. it could be done with surfaces but it would be lag-intensive i think.
(negative can be done with blend modes.)
Last edited by lostdarkwolf (2016-02-02 00:31:16)
Offline
This is an extension for GM8 shaders I've used.
http://gmc.yoyogames.com/index.php?showtopic=492876
It does not work with GM8.1 and you must program your shaders with PS1.4 assembly which is not as easy as GLSL or HLSL. There may be tools to help you compile from a high-level language to assembly but I don't know what they would be. PS1.4 targets old versions of DirectX and may not be well supported by creation tools.
When making this shader, you need to limit the amount of data you pass to it. Pass the palette information as a texture and let the shader read it directly. Comparing each pixel to a pixel in a large texture could be very slow or fail to compile but for a small number of colors this should be practical.
Abusing forum power since 1986.
Offline
Pages: 1