RGSS OpenGL Shader Language
This project aims to create an API for RGSS3 games so OpenGL rendering can be performed against given bitmaps.
This will eventually lead to a 3D API for drawing 3D graphics in RPG Maker games, but for now it's good for post-processing shaders.
Guide
- Download project
- Run it, talk to the other person on the map
- After you've had fun, open the script editor and study the Shader section
- Inspect Scene_Map lines 20 and 68, they run this process on the map scene
- Inspect the other person's event (Simple enough)
- Modify an existing shader and see what happens
Warning! Currently there is no shader compile failure output! This is a bug and will be solved in the future!Error output will be in version 0.02 - Write your own shaders and put them in the Shaders folder
How to use this in your project
Copy the custom Game.exe into your project and then you will be able to use the new functions (Follow the guide above and the instructions in the script itself for important info).
Download Demo
REMOVED!
Screen-shots
These are all real-time shots, not photo-shopped effects (See for yourself, download the demo)
New! GB Palette
Video
http://www.youtube.com/watch?v=2wmTbgFIzEY
Project plans
Once the API is settled I'll be porting this to a DLL so the default Game.exe can run it. There will be a performance hit compared to the custom Game.exe (Which will still be updated) so beware of this now.
As I said above, this will most likely lead to a full 3D API for RPG Maker games, so you'll be able to do 3D rendering onto a bitmap. A lot of work will need to be done to get the standard RPG Maker graphics drawing through this system, though, and I'm not going to be the one who does that (I barely know Ruby as it is!).
One big problem right now is that the only way to grab the game screen (That I can see) is Graphics.snap_to_bitmap, I want to eventually find a way to run a shader on any point within the default rendering path (Eg, make only sprites blurry or make the map background pink or all water-autotiles blur and tint blue any object that is on top of them).
Stuff you are probably thinking
What is this?
This means you can perform post-processing special effects on RGSS bitmaps.
I don't even-
It's an API for scripters, so if you don't understand then you're probably not a scripter.
How?
I created a modified Game.exe that binds some functions written in C/C++ to the current RGSS module (Tested only with RGSS3 so far, other RGSS versions are not yet supported).
I've seen these before and they were slooowww!
Yeah, well, those were done on the CPU, this uses your graphics card to do the complex calculations and rendering, so this is actually pretty fast (Please report your frame-rates, I'm at solid 60 but I have a rather beefy system).
Do I need a good machine for this?
You'll need a graphics card that supports OpenGL 3.0, ideally OpenGL 4.0 (The version tested with).
Known problems
- Currently no-way to intercept the draw order to post-process at various stages (I am working on this so one day it will be possible :smile: )
- The back buffer size is defined by the first bitmap bound to it (The fix is first bind a bitmap that is the same size as the game resolution)
No compile failure output (I have no clue why the code isn't working, it's supposed to dump a file on failure :mystery: )Solved it, will be in next version