mrToad wrote:I really didn't mean to imply that you should provide an example, you have done quite a lot already. Although indeed I'm not sure anyone else has provided examples of FB OpenGL fragment shaders. Surely whatever you do will be helpful to many. But I somehow feel responsible for putting you to all this work.
Hahaha don't worry about it. Yes, there are examples, but for 3D and aren't exactly versatile. The code I show you is code that I had to port anyway, so don't feel bad about it ;)
mrToad wrote:I chose OpenGL because of it's speed and versatility with scaling, rotation, and other things. For my particular game a lot of those things could probably be done without it, and the speed unnecessary. I do like OpenGL but sometimes I wonder if it makes sense for such a low-res and non-taxing game. There's so many ways to accomplish the same thing. It seems like an acceptable choice in any case.
Yep, it is. Rel's lib is unfortunately outdated (nobody updated it to take advantage of shaders or some other capabilities found in GL > 2.0). In the meantime, take a look here
http://www.opengl-tutorial.org/ to see how to
really do OpenGL ;)
The code is in C++, but the FB code is equivalent.
mrToad wrote:The issue with this is the light source needs to move. Otherwise I could just create the light via pixel art. I would have to rebind the texture every cycle to render a moving light source. Heck, maybe that's not as bad as I imagine, at least for special occasions in the game.
Hahaha, indeed. I think you took me way too literally when I said that texture binding is a
relatively slow operation. You can get away perfectly fine with a couple hundreds of bindings
per frame, so your game should slice through it like a knife in hot butter ;)
See the demo to have an idea of what I tell you. The slowest blending mode is capable of doing
several hundreds of blits per second, and that in pure FB and in a piece of crap box like mine ;)
mrToad wrote:Many thanks. :)
You're welcome. Did I sneaked into the credits section yet? =D