Engine design and resources
Talking about Hydra, the first release was a great success for me. It was a graphic engine wrote from scratch (int main...) and during its lifetime it teached me much things.
After that, I've began coding shaders but using asm shaders...this was actually a pain. The renderer has both Direct3D and OpenGL support, so I had to create both shaders two times.
To solve this problem, I've began coding in Cg and then converting to asm every time. This process was really slow and the shaders I've implemented were not optimized and much time was spent to fine-tune them (code, export in asm, modify gpu registry bindings...).
To support some sort of scene hierarchies, I've implemented Bounding Volume Hierarchy:
This screenshot used OpenGL renderer.
Having a simple scene hierarchy system, here comes the time to develop something more interesting.
I have always love water, both in the reality and in 3d rendering (even using max), so the natural choise was to study how to achieve the water.
I've seen what's missing in my renderer, so I create functions for both OpenGL and DirectX to support culling planes and render to texture. I created a tube under max and added some noise to create a cave, exported and then I've tried to create the water.
This was my first attempt:
The refraction was poor, and there were no noise and no light.
After this preliminary water, it comes the time to face another subject I love: shadows. This was the REAL pain. I've passed nights and many posts on gamedev to achieve a simple shadowmap, due to the texture format, due to the poor pipeline: cg->asm->hydra. It takes long time to see the shadow map working, I don't know even how much!
And then I wanted to give another touch...using normal maps.
I've noticed a family of graphic effect that derive from normal maps like parallax occlusion mapping, relief mapping, cone step mapping and stuff like that.
So I've began studying them, creating shader for normal, simple parallax and relief with fake soft shadows using FxComposer. It ended up with the overused rockwall:
So I create a function to fill the vertex buffer with those informations...using the math explained in this article: Tangent Space Calculation
The end of the story will be in part #3...stay tuned!
Demiurge
No comments:
Post a Comment