Skip to main content
gamedev.net
🔒 Locked

Clouds ?

Started by Mythar Jan 21, 2007 at 1:26 PM 2 replies 800+ views
Original Post
Mythar
Mythar
Been working on perlin noise and clouds for some time now, but i just cant seem to get it to look good. Anyone have some sort of trick to make it look better ? I tryed out diffrent texture sizes for the "base" noise, but got almost the same result. Below is the image made by the following shader code (noise texture = 32x32) :

float4 PShader_Cloud_2x(VS_OUTPUT i) : COLOR
{
  float4 o;
  float n;
  n  = tex2D(noise, i.tc);
  n += tex2D(noise, i.tc*2)*0.5;
  n += tex2D(noise, i.tc*4)*0.25;
  n += tex2D(noise, i.tc*8)*0.125;
  n += tex2D(noise, i.tc*16)*0.0625;
  n += tex2D(noise, i.tc*32)*0.03125;
  n += tex2D(noise, i.tc*64)*0.015625;
  n += tex2D(noise, i.tc*128)*0.0078125;
  n += tex2D(noise, i.tc*256)*0.00390625;

  float f = (n*255) - 220;
  if (f < 0) f = 0;
  o.a = (255 - (pow(0.97,f)*255)) * 0.00390625;
  o.rgb = (o.a, o.a, o.a);
  return o;
}

Clouds
TohaTalib
TohaTalib
You'll never get enough pretty clouds using only noise generation. Try some prerendered or painted clouds images with alpha (TGA/DDS...) and blend them on your skydome - translate textures coords and you'll get clouds that changes form with time.
space warp
space warp
Have a look at this link:
http://freespace.virgin.net/hugo.elias/models/m_clouds.htm
.sehkteeah erthyahr gahro
Mythar
Mythar
I did have a look at hugo's page, been reading almost all the google hits on clouds, noise, etc.

I was hopeing to make some clouds that do not look "tiled".

So far I had to use a 256x256 noise "base" texture and tile it 16 times, getting a resolution of 4096x4096, to get something with a resolution that was fine enuf.

But makeing a 256x256 animated noise on the cpu, is just way too slow.

I could use 2 textures and blend them, but im not sure of how to make the end result not look tiled ?

Side question : Im useing the PerezFunction to color my GradientSkyDome, I was wondering how to add an Alpha value to the color, so that I can fade in a background star map ?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.