Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Unique way of rendering clouds...

Unique way of rendering clouds...

dgreen02
dgreen02
Radioactive-Software · · 2 min read
5,699 8
Hey guys, I was working on my cloud system earlier today and decided to rollback to my old billboarded solution ... this is temporary until I get some more time. I have to put all my focus on the gameplay and more important parts of the visuals/engine so I can finally release "Armored Warfare".

Here is how the clouds are looking, I sort of came up with this hack/cheat of improving standard billboarded clouds in the last few hours...
NEW...


I didn't take any screenshots of the old billboarded clouds, so I'm going to reference this one from my online gangster game [ Urban Empires ]
OLD...this screenshot is from 2007.


My old clouds looked 'alright', but I wasn't satifisied because there was really no form of light scattering, or 'silver lining' on the clouds. I was thinking I could possibly fake it using several channels of the billboarded cloud texture.

This is an example of one of the 4 clouds I created. The way the channels are generated is sort of complicated, if anybody is interested I'll type it up. The most important part of it all is channel G, which is multiplied by the dot(sun,cloud_normal) so it produces a glow/lining on the clouds when the sun is behind the cloud.


Here is the pixel shader code I wrote to render the clouds, very friendly indeed...
//CloudAtlasSampler = texture contatining clouds//	Alpha channel = Cloud transparency//	Red channel = Blurred cloud center darkening value//	Green channel = Cloud lining/rim value//	Blue channel = unused / saved for future effects//Input.Lighting = normal vector of billboarded cloud//g_SunVector = Sun's worldspace vector//The "*0.75" "*0.9" are unique color scaling values for my game engine, to float4 CloudPixelShader( CloudVS_Output Input ) : COLOR{	  	float3 SunColor = float3(1,1,1);	float4 Texture = tex2D( CloudAtlasSampler, Input.TexCoord.xy );	float3 RimLighting = abs(dot(g_SunVector, -Input.Lighting))*Texture.ggg*SunColor;	return float4(((max(0.9,Texture.rrr)*0.75)+(0.5*RimLighting))*0.9,Texture.a);}


Some pics of the result ... not bad for the nearly non-existant FPS hit. Plus they are lit dynamically, and scroll around the world. This would be a good base to render some truely volumetric clouds over.





And here is a debug shot, to show how low poly and cheap the whole effect is, IMO it looks pretty good, though is obvioulsy not 100% realistic.



Until next time...

- Dan

Discussion

Loading comments...