I really want to make a game that is primarily 2D (i.e. sprite-based) but has some 3D lighting effects, specifically having sprites colored differently depending on the lights in the scene. I know there are techniques that use normal (or depth) maps to achieve this, but they all end up passing information to something like OpenGL.
I’m trying to figure out the best way to do this. I don’t really want to use actual OpenGL (because it adds another dependency) so ideally some kind of fancy trick … But that sounds like it would require, well, hard-coding lighting equations, which (even if I have the math right) will certainly slow down performance …
Anyway. So my thought was - If I were to use OpenGL, how easy is this to do with OpenFL ? I understand that OpenFL is based on the Flash API, and that Flash is 2D … However, my understanding is also that OpenFL uses OpenGL to draw ? Or am I misunderstanding ? Does it … just use that in certain platforms ?
My sense is that what I’m trying to do doesn’t make sense - OpenFL is based on the Flash API and you are stuck with that functionality. I know there is OpenGLView, but (I am I’m struggling to find any documentation on it) it seems like it’s a separate entity - I presume you create a separate OpenGL context and do your stuff in it but that will be separate from any of the other, 2D, Flash-based graphics … ?
So again, and I’m just answering my own question here - Do you really only have a choice of … going full 3D (using OpenGLView, or perhaps Away3D…) and doing all the blending and filtering effects on your own (i.e. totally ignoring the Flash graphics API) or, well … That’s it really … All or nothing …
I appreciate that this, well, seems obvious to an extent but I was just hoping to get some feedback - Do you agree that, well, you really have to choose … ?
I suppose you could create an … OpenGLView for each sprite ? (I haven’t really understood how OpenGLView works) And then … I dunno, push the view onto a BitmapData … ? Jeepers, I’m pulling at straws here …