aphadeon / OpenGame.exe

A custom Ruby-powered game engine that supports RPG Maker games.
24 stars 11 forks source link

OpenGL Bitmap class implementation #17

Open aphadeon opened 8 years ago

aphadeon commented 8 years ago

Right now the RGSS Bitmap class is mostly implemented using System.Drawing.Bitmap, for simplicity. Once changed, the related texture is disposed and recreated. Notably, some special classes are more optimized (i.e. the tileset).

While this was easier to set up, it's not the best long-term solution as it is considerably less performant than a true OpenGL solution would be (or at least only re-uploading subtextures rather than the entire image). There is a noticeable FPS snag when using heavy Bitmap features. The vanilla engine was non-performant in this category as well; but the hit is more visible in this current implementation (and we have an opportunity to exceed the performance capabilities of the original engine here).

I have a few vague ideas for how the different functions could be implemented, but this will take a significant amount of work.

I won't mark this issue for the 1.0 milestone as it's not critical to the functionality, but it's an important performance feature.

aphadeon commented 8 years ago

One thing I have no idea how to implement other than a complex shader is the bitmap "wave" effect. Basically, it causes an effect similar to retro HDMA scanline effects, where the image is heavily warped. This effect is animated. Really, it's a lot easier to just see it for yourself than for me to explain it. There are a few variables on bitmap objects that control this effect.

Depending on the implementation, if it can be done without a performance hit, I'd love to see this functionality made available for Plane as well.