Creating layers of clouds?

Post your scripting questions / solutions here

Moderator: Moderators

Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Creating layers of clouds?

Post by Bjarne BZR »

Im trying to make the effect of multiple layers of clouds, but I have trouble making a suitable shader...

This is my best try so far:

Code: Select all

textures/sky/vemork_clouds
{
	qer_editorimage textures/sky/talonclouds.tga
	qer_trans .4
	qer_keyword utility
	qer_keyword sky
	surfaceparm nolightmap
	surfaceparm noimpact
	surfaceparm sky
	{
		map textures/sky/talonclouds.tga 
		blendFunc add
		tcMod scroll .05 .03
		tcMod scale 1 1
	}
}
It creates a scrolling, transparent cloudlayer where I can hardly see the clouds and the brush is visible ( but transparent ) where there are no clouds as well.

The example above is stolen from shaders that ad a scrolling cloud texture to another skytexture ( I guess thats the blendFunc add ). Its not working that well "alone" right now...

What I want:
-The clouds to be a little transparent ( about 80% solid? ).
-The areas of the brush where there are no clouds to be totally invisible.
Admin .MAP Forums
Image
Head above heels.
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post by Angex »

Try looking at the africanights sky texture, that has clouds floating about, and I think they pass over one another, but I never really looked that close.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

I have, and I have no trouble adding a scrolling cloud texture to another texture...

I need to have the clouds as a separate texture that is invisible where there are no clouds, and a little transparent where there are clouds. A bit like a semi transparent fence mask...
Admin .MAP Forums
Image
Head above heels.
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

Using taloncloud as the sky and the scrolling layer isn't a good idea. Use taloncloud for the scrolling layer only. Should be more visible that way.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

First of all 'blendfunc add' means additive blending so the output is never darker than the input. Useful for fire and explosions but probably not what you need for clouds (blendfunc blend should do).

I think you have to make a cloud layer texture with an alpha channel for the transparency. I don't think you can make semi-transparent textures in game (only in the editor with qer_trans :?).
Image
rOger
Major
Posts: 290
Joined: Wed Feb 05, 2003 8:56 pm
Location: Sweden

Post by rOger »

Se if this works for you.

http://www.samurajdata.se/~ra/moh/rasky.pk3


It's just the shader, textures and env.
Looking for a good game? Play GO the ancient asian game of strategy.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

rOger... that sky is exelent! Great sky textute!

But... let me explain what I want:

I do NOT want a sky... I want a SEPARATE cloud texture. This texture should only contain the clouds, nothing else.

And jv: I guessed that textures/sky/talonclouds.tga had one of these mysterious alfa channels because it was transparent in the skies it was used on... maby it does not. I really have no idea of how this stuff works.

So my question ( chrystal clear this time I hope ) is:

- How can I produce a standalone cloud texture ( not a sky texure ) that is 100% transparent ( invisible ) where there are no clouds, and with clouds that are transparent ( Say 50% )?

- Can I use textures/sky/talonclouds.tga or must I make a new one with this magical thing called an alfa channel?

- What should the shader look like?

I'm in the dark here people! :wink:
Admin .MAP Forums
Image
Head above heels.
rOger
Major
Posts: 290
Joined: Wed Feb 05, 2003 8:56 pm
Location: Sweden

Post by rOger »

Try the below shader and this texture

It does contain an alfa channel, but beyond that I have no idea (almost) how it works, but it does. :-)

Code: Select all

textures/ratex/racloud
{
	qer_keyword masked
	qer_editorimage textures/ratex/cloud.tga
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nomarks
	surfaceparm noimpact
	surfaceparm nolightmap
	cull none
	{
		map textures/ratex/cloud.tga
		blendFunc blend
		alphaGen dot .7 .7 // alter this to change transparency
		depthWrite
		tcMod scroll .035 .015
	}
}

Or this one for multi layered clouds.

Code: Select all

textures/ratex/racloud
{
	qer_keyword masked
	qer_editorimage textures/ratex/cloud.tga
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nomarks
	surfaceparm noimpact
	surfaceparm nolightmap
	cull none
	{
		map textures/ratex/cloud.tga
		blendFunc blend
		alphaGen dot .7 .7
		depthWrite
		tcMod scroll .035 .015
	}
	{
		map textures/ratex/cloud.tga
		blendFunc blend
		alphaGen dot .5 .5
		depthWrite
		tcMod scroll 0.005 0
		tcMod scale 2 2
	}
}
Looking for a good game? Play GO the ancient asian game of strategy.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

i only knew how to make clouds in 3ds max :lol:
Live to map, not map to live.
-mohaa_rox, .map
moderator
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Thanx rOger!

That worked a lot better. I now use this:

Code: Select all

textures/sky/vemork_clouds
{ 
   qer_keyword masked 
   qer_editorimage textures/ratex/cloud.tga 
   surfaceparm trans 
   surfaceparm nonsolid 
   surfaceparm nomarks 
   surfaceparm noimpact 
   surfaceparm nolightmap 
   cull none 
   { 
      map textures/ratex/cloud.tga 
      blendFunc blend 
      alphaGen dot 0.7 0.7 
      depthWrite 
      tcMod scroll 0.035 0.015
      tcMod scale 1 1
   } 
//   { 
//      map textures/ratex/cloud.tga 
//      blendFunc blend 
//      alphaGen dot 0.5 0.5 
//      depthWrite 
//      tcMod scroll 0.009 0.004
//      tcMod scale 1 1 
//   } 
} 
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Wow rOger great stuff 8-)

A clone of your textures/ratex/racloud shader has just found use as a chopper window ;)
Image
rOger
Major
Posts: 290
Joined: Wed Feb 05, 2003 8:56 pm
Location: Sweden

Post by rOger »

I ... ehhh? as a window? on a chopper? This is not during WW2 is it. :-)
Looking for a good game? Play GO the ancient asian game of strategy.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

No it's for my (flyable) chopper for the modern warfare mod :)
Image
rOger
Major
Posts: 290
Joined: Wed Feb 05, 2003 8:56 pm
Location: Sweden

Post by rOger »

I'm honoured to contribute!
Looking for a good game? Play GO the ancient asian game of strategy.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Thought I'd let you see the results:
Image

It does not look spectacular but it is, considering 3 things:

1) It has a distinct 3d effect as you feel the low clouds getting nearer as you climb a hill.
2) It is affected by the farplane and farplane_color settings, blending the sky into the evvironment in a more natural way.
3) The skybox is a skycaulk, but still its not boringly flat...

The approach has one disadvantage that I've run into so far:
You have to hide its edges as they will look ugly if seen. I had to bend the cloudlayer downwasrs to hide it from the player. ( Not a biggie if you are aware of it ).

BIG thanx to you all!

*********edit**********
Just to be clear: the clouds are not IN the skytexture, but a separate brush under it: like this

Code: Select all

--------------- <-Skybox brush

*************** <-Transparent cloud brush

\__/\_/+-<\_/\/ <-Ground ( with a downed ASCII aircraft :D )
Admin .MAP Forums
Image
Head above heels.
Post Reply