Hello everyone!
I am developer of DeedPlanner program (source is available here: https://github.com/Warlander/DeedPlanner-2 ). In a nutshell this is a program which allows you to rapidly design villages for Wurm Online/Unlimited games, preview it in 3d and evaluate costs before actually starting doing anything in-game. The program is relatively large, with over 100 versions published and its original version is over 3 years old.
The program is heavily depending on customized Swing GUI’s, with JOGL GLJPanel doing the actual 3d rendering. Due to Swing dependency, it is impossible to switch to any non-JOGL based library easily. In action, it looks like this:
https://dl.dropboxusercontent.com/u/67758055/Wurm/DeedPlanner/14_05_2015__04_34_01.png
https://dl.dropboxusercontent.com/u/67758055/Wurm/DeedPlanner/14_05_2015__04_32_42.png
Rendering itself without going into details looks like this:
- Interface and JOGL panel is initialized
- For each frame:
[list]
[li]Buffers are cleared - Set current camera (perspective or orthographic projection depending on view)
- Render map: iterate all tiles in radius of “x” tiles around camera, in case of 3d view rendering everything but labels/2d borders, in 2d view - everything on current floor + 2 floors below
- In 3d view, render skybox
[/li]
[/list]
When it comes to optimizations used, textures are pre-loaded on first use and models are pre-rendered to display lists on first use. Everything else is done every frame, including ground/cave rendering. Currently program uses mostly OpenGL 1 rendering with OGL 2 elements, but I can use OGL up to 4.1 easily.
The question
I want to rewrite the rendering in program. Why?
- Program performs relatively bad when there are many objects in radius around user (can easily slow down even good PC)
- Rendering seems inflexible
- Shader support is minimal (especially as I want to implement lighting and water which actually looks like water)
Are there any specific resources I should take a look at or general guidelines I should follow? Maybe some pointers on how to refactor current rendering to make it easier to extend now and in a future?