Clouds again

Started by
14 comments, last by The_Fallen 20 years, 11 months ago
An alternative is to use terragen to make a height map. You can get some pretty nice looking ''clouds'' by saving the height map as an image and using it as a texture(and it even wraps around).
Advertisement
quote:Original post by ApochPiQ
I misunderstood the original question...

Here's my suggestion. Start with the initial, basic texture that "looks" the biggest (i.e. is not scaled). Give it an alpha of 1. Reduce the texture by 50%, tile it to cover the same space as the first texture, and layer it on top with an alpha of 0.25. Repeat for the next 2, increasing alpha by 0.25 each time. Change the alpha increment if you need more than 4 octaves.


That's what I'm currently doing. But the result looks like this:
http://freespace.virgin.net/hugo.elias/models/cldmap1.gif
and not like this:
http://freespace.virgin.net/hugo.elias/models/cldmap2.gif

For that I need some function like this in the paper:


    function CloudExpCurve(v)  c = v - CloudCover  if c < 0 then c=0   CloudDensity = 255 - ((CloudSharpness c) * 255)    return CloudDensityend function  


So I think I have to do it in software...

[edited by - The_Fallen on May 27, 2003 10:23:41 AM]
Back on the net... I''ve been tired coz of the school... just another month, and I''m free!

OK, on topic.Well, not much to say... I''ve been using the same function, and this has worked quite well for me, so go into the software:
-by making the four perlin noise images. use the link I gave you
-tile them -some loop will do
- add those tiled and non-tiled images together (pixel by pixel)
- and make clouds with the function you''ve already have

This does take you some time, to calculate four images, tile them and add them, but at the end you only have one...

I''ll probably post some code if I have time... the project I''m on is taking quite a lot of my time.
Look at this topic, it discussed noise based clouds and proper lighting:

http://www.gamedev.net/community/forums/topic.asp?whichpage=5&pagesize=20&topic_id=86024
quote:Original post by blue_knight
Look at this topic, it discussed noise based clouds and proper lighting:

http://www.gamedev.net/community/forums/topic.asp?whichpage=5&pagesize=20&topic_id=86024

Actually the techniques I described in that thread will not work on a GF2, since they require texture shaders for the exponentiation lookup. Those are available on GF3+ only.

OK, here is an idea. Just an idea, it will probably not work out that smooth, but it just crossed my mind. The GF2 has a per-pixel texture lookup facility, but it''s well hidden: in the indexed (paletted) texture hardware. You could abuse that to do the exponentiation on the GPU: load the exponent lookup table into the palette of an indexed texture. Compute your perlin noise octaves as you did before, but render them into a texture. Now comes the problematic part (and this is why this method is probably going to fail): you need to convert the perlin noise (still RGB) into an indexed texture. Ie: RGB = 1 becomes index = 1, etc. That''s trivial on the CPU, but I doubt there is hardware support for this available. You will probably need to readback the texture, and reupload as indices. If you readback as luminance, you don''t even need to do any conversions. But the readout is going to be slow, no matter what.

Once you managed to get an indexed texture, just render it with the exponentiation table in the palette.

Other drawback of this method: the dynamic range is horrible, you''ll probably get a lot of artifacts with high frequency clouds. But well, the GF2 is very limited, when it comes to per-pixel effects.

I guess the best method (for a GF2) is to compute your entire clouds on the CPU, project them either onto a sky-box or a sky-plane, and render that.
@ YannL: Hmm, sounds interesting. But how to readback a texture? Sorry, I''ve never done that and I didn''t know, that it is possible...

I''m going to buy a new graphics adapter in summer (NV35 I think), so it won''t be a problem then. But I would really like to implement something right now...

This topic is closed to new replies.

Advertisement