The last couple of weeks had been not in our favor especially not in my favor. I tried a couple of optimization tricks ghosting through my mind but hit a couple of brick walls shattering most of them. Some though stuck which gave at least some progress in these otherwise frustrating weeks. And one of them are dragons on a wake-board and dragon dolls which though I spare for later ( or you crawl over my youtube profile as you can find them there ).
Graphics... again U.=.U
The graphics module is one receiving a lot of work time since it consumes the most performance. It is therefore vital to squeeze as much speed out of this module as possible since graphics are not the only parts of an engine competing for the scarce frame time. I had a couple of ideas to optimize the speed and ended up disappointed with many of them. It seems as if I've hit the speed limit of what my card can junk out without reducing visual fidelity. This should buy us now enough time to push out the engine in a first release and to bother about further optimizations later on. Some stuff though still stuck and will be therefore mentioned here.
- For transparent faces the color shadow casting ( or transparent shadows ) has been disabled. This gains some speed and it is highly unlikely somebody is going to noticed the lack of colored shadows on transparent objects.
- Shadow maps for transparent render passes are now batched so they are rendered only once. In the test scene the gain had been barely noticeable but in more complex scenes this can very well gain some speed.
- In general the shader system has been improved further splitting individual GPU unit source codes from each other to allow reusing them as well as allowing custom shaders later on. Game developers do not touch shaders directly but define them indirectly using skin files. More to come later about this.
- Another trick had been using render task objects. This allows for more aggressive batching of similar objects than the old code. This is comparable to instancing which though is not much of a topic under OpenGL since it has very little overhead in contrary to DirectX which has a tremendous overhead ( hence why they invented instancing to begin with ).
- Tried also the occlusion reduction trick on the semi point lights but not much gain there. Semi point lights are therefore operating at their peek limit. Not much to gain from them. A typical room with 2 or 3 semi point lights clocks now in at 60 to 90 fps pure rendering only. That should keep us warm through the night for some time.
- Fixed the shadow depth offset calculation for semi-point lights and point lights. For spot lights the hardware knows how to do this but for the other light types you have to do this manually. Self shadowing artifacts have vanished now except some extreme cases. Players can mess with the parameters to optimize this for their graphic cards.
- Eventually fixed the mirror skins. They can now be used on any static or dynamic model. You can even apply it to animated and bone weighted faces as long as the faces are mostly coplanar. For all faces a mirror plane is calculated which fits best the faces. Mirrors are perfect and for flat surfaces. For round surfaces environment reflection mapping is going to implemented later on.
- Added a new set of shaders to handle height terrains with multiple textures. Up to 4 textures can be processed at once now. Reduces most situations to one or two render calls instead of up to 8 passes. Buys us some more speed until the ultimate texture algorithm is finished: the SWAT system ( keep guessing, I won't reveil more right now ).
- Modified the old renderables turning them into a dynamic skin object. This makes handling dynamic skins for the game developer a lot easier.
- Modified the normal mapping shader algorithm to also provide fake lighting for back faces. This way objects are not flat on the back side. The technique is based on the one used in the Source Engine.
Dragons on a wake-board
A couple of videos ago we showed the dragon locomotion system. This contained also tilting the body up and down to align the dragon with the ground below. This though worked only for the up-down case but not sidewards tilting. Furthermore testing such animations had been a chore as you had to walk around in simulation mode all time. This has been now changed.
First left-right tilting has been added to the animation code. This way now the dragon can tilt properly in up and down as well as leaning sidewards while on a left-right aligned slope. The feet have been modified too to align with the ground. This code is rather generic working for all 4-legged creatures where the 4 legs are located under the body like with a dragon. To test the animation better the Animator Editor received a new testing mode, the wake-board mode. If this mode is enabled a plan is placed under the character. This plane can be interactively tilted up and down as well as left and right up to 30 degrees. This way the reaction of the character to different underground slopes can be tested and improved. The first video shows the wakeboard mode in action ( youtube version ).
The results are not yet top notch since the inverse kinematic code is still rough around the edges and still fails at certain situations. Furthermore all the body tilting is done only using procedural animator rules. For optimal results animation sequences for different tilting situations have to be created and blended together. Using procedural animator rules though any kind of 4-legged creature can be quickly animated in a reasonable way without loosing time creating all the animations. Once the animator works properly the individual animations can be created and the result improved. The second video shows the dragon in action on a bumpy terrain ( youtube version ). Important to note is that although the body tilts around a lot the first person view is rock steady. Hence walking around on bumpy terrain your view stays where you want it to be and does not sway around. Yet if you use the chase or movie camera instead you get the results seen here.
There is still some work to be done on the graphic module. Not all shaders are changed to GLSL 1.3 yet. This is one of the next goals to modify them all. Another point of work is the sky light source. There are a couple of optimizations possible and required to improve speed. Another problematic point is the transparency. Currently a typical depth peeling approach is used but this is not the fasted solution on earth. I've got a quirky idea on how to deal with this but that requires some preparation work. This aside there is a lot of other work to be done before this engine is ready for a first release. So stay tuned.