Is it possible to make in Gosu some dynamic palette swapping? I know now there's no method for it, but is it doable in future? I mean loading a new palette to a Gosu::Image object from a .pal file or another image. I think it can be done with indexed images and would be very useful for me. So?
This is not a common feature in OpenGL-based libraries because OpenGL does not work with palettes in its textures. I think the best way to achieve this would be via shaders. Shader support is definitely something I'd love to support more in Gosu, but I am not an expert on them. :/
But is this the use case you would be going for? Having a few images where you vary the color spectrum in real-time? If you just need to load the same image with different palettes, this could be done in the file-to-bitmap loading phase, and even in an external library.
Oh, hacky idea: You can probably also use
and regexps to achieve the same thing relateively efficiently in Ruby, then
the blob back in...
Oh, I'd need it to be fast enough to not lag too much when used per few frames.
Well, it could just speed up loading time of my game, because I have 121 images in 8 different color schemes. I don't need it so much.
Can you separate the colored portion from the "constant" porton and draw the colorful parts with a color modifier? That would probably be faster than using shaders for lots of images (and work already :) ). I think we've had this topic on IRC recently.
I could do this, but it's much work for separating it and it wouldn't look as good. Well, if it's impossible to make it fast, I can live with that :)
TexPlay could do the same thing massively faster; it still wouldn't be good speed for per-frame manipulation though.
Powered by mwForum 2.29.1 © 1999-2013 Markus Wichitill