3.20.2012

First plan for converting IGE to OpenGL

I've set up a list of good features I've started to implement that should enable me to fully utilize OpenGL for 2D acceleration. I was a bit careful about them to also enable the use of full 3D models and scenes. I'll at first implement a less performant variant using glBegin/glEnd and use this as a base to expand it with buffer objects later, so I won't have to call functions for each vertex or color change. Anyway, here's the full list of changes so far:

Image properties:
  • load it directly as an OpenGL texture
  • create color-keyed imaged when loading, apply fixed per-surface alpha before uploading
  • calc scaling factor < 1.0 depending on which sprite side is the greatest (for aspect ratio correcting scaling/rendering)
Screen properties:
  • define physical screen size (integer) and virtual screen size (float)
  • add OpenGL subsystem initialization
Display properties:
  • drop palette changes, color keying and alpha values (for now)
  • translation and rotation relative to the root element (changable via flag)
  • use OpenGL viewport to set clipping area
  • add new flags for interpreting translation/scaling relative to the clipping area (for GUIs etc)
  • replace source/destination coords and add translation, scaling and rotation vectors
  • keep integer z value along with float z value to seperate rendering with different depth buffer (allows scenes rendered on scenes without intersecting their model data)
  • display with same integer z will be rendered in the same scene/depth buffer moment (allows more complex scenes and even models made of quads)
  • reduce recursions by only calling new display render attemps for those display with sub displays
That's basically what's to do next. I won't have to add anything new ITK for this one, it's all just OpenGL coding (something nice for a change). Color and alpha setup as well as anti-aliasing and so on will come later - plain rendering is the most important thing right now. I know it's quite a change but not much will be change for the general interface except some different parameters and function calls. Interestingly, displays with the same integer z value can be rendered as quad lists - possibly whole scenes that'll can be precreated if they don't change that much. Will probably need add a bit more details about controlling what will be rendering in different passes to also form scenes out of multiple display list branches, but well - that's a bit too much implementation detail stuff I'd like to think about when I know more about it.

So that's it, off to coding!

No comments: