SkyGradient.rar [818kb] – VB 2005 (VS.NET 2005)
I had a request from the same MMORPG developer which asked me for Non-Reflective Water to make a simpler version of my old “HLSL Sky Demo”, which I haven’t put on my blog yet because I’m not all that proud of the code.
Basically, I was asked to copy Worlds Of Warcraft’s skies; so make a tweakable gradient-based day sky solution, that renders fast and looks good, and most importantly that behaves well in huge worlds with big height variations.
- 5-Colors gradient updated in realtime : The sky colors is formed of 5 colors placed at different heights, from horizon to zenith. This allows for a huge variety of sky appearances, and realtime sky transitions.
- Blends with fog seamlessly : The sky mesh is a sphere, so it doesn’t matter if you see lower than the horizon; you’ll just see the fog color.
- Renders always at the back : Gone are the “is my sky mesh big enough” worries, because the sky shader does not write to the Z-Buffer! That means if you render it first, it’ll always appear in the background of the scene.
- Tweakable clouds appearance : How “round” or how “flat” the clouds layer looks can be tweaked at initialization time of the sky module; the sample has a control on the information getting form.
- Fancy color interpolation : There is a setting to choose between Hermite interpolation or plain Linear interpolation for the gradient transitions, which makes it all pretty and sophisticated.