No-Bake (Geometryless) Clouds

5-22-2016 9-42-10 AM

The hard deck of the cloud base layer rendered here purely using shaders!

It uses a fullscreen quad which resembles the near plane of the viewing frustum which means the depth/stencil evaluation is worthless… so we have to do a painters’ algorithm to render the clouds before the models and terrain for proper sorting below the cloud layer.

I am pretty confident that this will preclude ships or structures from rendering correctly if the subject model is in the scud layer below the hard deck… but I have to work on the scud layer first before we will know what the effect is.

Raymarch Cloud Quiltwork

5-21-2016 8-49-20 PM

Finally made some headway yesterday and today on getting the frustum corner vectors properly computed and transformed. This preliminary pixel shader is showing the ray interception at 47 km (1km below the actual hard deck) where we will start our marching!

The quiltwork shows the level 7 panels that make up the clouds based on UV coordinates derived from the fractional remainders of the level 7 scale.

Geometry Shaders

We are right at the lower limit (24 FPS) for the display program running a 6-head gaming card on a monster machine with just the terrain, atmospheric effects, and two copies of the same platform model.

I had a sneaky suspicion that rendering each viewport in its entirety during the “Render” method would be slower than sending all 6 projection matrices to the HLSL shaders and letting them split the geometry across viewports.

I am happy to provide some numbers now after this evening’s spike!  I applied this change just to the terrain and turned off the model rendering: 137 FPS before, 154 FPS after (a 13% increase in performance).

So, yes… it is faster. There is one big drawback… the shader wants to know how many vertices to expect coming out of the GS (I usually just run 1 viewport on my development machine).

//--------------------------------------------------------------------------------------
// Geometry Shaders
//--------------------------------------------------------------------------------------
[maxvertexcount(18)]
void GS(triangle VSSceneOutMain In[3], inout TriangleStream TriStream)
{
GSSceneOutMain output = (GSSceneOutMain)0.0;

So it isn’t really worth doing right now… the bigger fish to fry is obviously the models rendering speed!