Page 1 of 1

Foggy Water?

Posted: Sat Apr 29, 2006 1:15 pm
by Billybob06
Is there such a thing? I have started looking at some effects in gtk and I made this haze type shader over my map, but when I put water into the map, it looks like the water stops the fog, how can I make a foggy water shader so it fades with the fog?

Image

Posted: Sat Apr 29, 2006 1:19 pm
by Billybob06
And another thing... Does anyone know how to get antialias into this game?

Posted: Sat Apr 29, 2006 1:41 pm
by seremtan
you can add fogparms to the water shader to make it murky

to add antialias, simply turn on antialiasing in your GFX card control menu thingy :smirk:

Posted: Sat Apr 29, 2006 4:19 pm
by Billybob06
nice one man.. cheers

Posted: Thu May 04, 2006 12:58 am
by Billybob06
ok guys.. I tried that shader with the fogparms and all that, but it didn't seem to work. I still just looks the same. Waht might I be doin wrong? and maybe someone could post an example... if it's no trouble of course.. cheers.

Posted: Thu May 04, 2006 12:17 pm
by Billybob06
Ok heres what I'v got. I used a ready made water shader for now, and simple added the fog parms. Heres the code...

Code: Select all

textures/liquids/sewerwater
	{
		qer_editorimage textures/liquids/pool3d_3c.tga
		qer_trans .5
		q3map_globaltexture
		surfaceparm trans
		surfaceparm nonsolid
		surfaceparm water
	
		cull disable
		deformVertexes wave 64 sin .5 .5 0 .5	
		
		{ 
			map textures/liquids/pool3d_5c.tga
			blendFunc GL_dst_color GL_one
			rgbgen identity
			tcmod scale .5 .5
			tcmod transform 1.5 0 1.5 1 1 2
			tcmod scroll -.05 .001
		}
	
		{ 
			map textures/liquids/pool3d_6c.tga
			blendFunc GL_dst_color GL_one
			rgbgen identity
			tcmod scale .5 .5
			tcmod transform 0 1.5 1 1.5 2 1
			tcmod scroll .025 -.001
		}

		{ 
			map textures/liquids/pool3d_3c.tga
			blendFunc GL_dst_color GL_one
			rgbgen identity
			tcmod scale .25 .5
			tcmod scroll .001 .025
		}
	
		{
			map $lightmap
			blendFunc GL_dst_color GL_zero
			rgbgen identity		
		}

		fogparms ( .76 .73 .54 ) 30000
	

}
I also took a screenshot of this in action. As you can see, im still having some graphic problems. Is there a way I can make this look good?

Image

If you notice, theres a graphic problem where the light runs out at the end of the tunnel. Its almost like the ambience from the fog, is ignored in the water.

Now im no genius when it comes to anything, so it could be something really basic.. please please can someone help because I'v been working on this for ages.

Posted: Thu May 04, 2006 11:09 pm
by d3mol!t!on
I seem to remember that making a seperate fog brush and placing it in the same volume as the water (or a little higher, to account for the water waving) worked when I tried something similar. Although I only had fog in the water, not in the whole map.

Posted: Fri May 05, 2006 12:59 pm
by Billybob06
I'll give it a try, any other suggestions?

Posted: Fri May 05, 2006 1:43 pm
by obsidian
  1. Remember, fog needs a "chimney" to work properly.
  2. You can't have any deformation effects on the water surface.
  3. Possibly, you may need to enclose the water with both fog brushes.

Posted: Fri May 05, 2006 2:27 pm
by Billybob06
Ok.. first off, I did get it working.. I used the shader above but remembered to include the surfaceparm for the fog and it worked. Then I started playing with the lighting and a few other things to get it looking better. When I compiled it, it worked. Then I changed something simple like a light.. and it stopped working, then it worked and stopped again and I can't get it to work at all now.

After reading your post obsidian, i thought it could have been the chimney thing, could you explain a little further please.

Posted: Fri May 05, 2006 2:36 pm
by obsidian
Fog volumes often have problems determining the "top" of the fog - that is, the side that you enter into the fog. So often times, the results are unpredictable, since the fog tries to determine a direction on it's own. It needs one surface to be open to the "air", so you construct a small hidden chimney somewhere in your map so your fog has 1 enterable surface.

Posted: Fri May 05, 2006 2:50 pm
by Billybob06
I don't get it.. I know im a pain in the arse, but could you please explain how I do that?

I have made a diagram of how the fog is set up in the level. The normal fog is working fine, but I cant get the fog in the water working. So where does this chimney go then?

Image

Posted: Fri May 05, 2006 5:21 pm
by Hipshot
Why don't you just give us the map?

Posted: Fri May 05, 2006 5:47 pm
by pjw
Billybob06 wrote:I don't get it
Fog in Q3 doesn't play nice and is easily confused. Basically, any fog volume should have one and only one face that's exposed, and the other five faces should be buried in geometry. Sometimes it's possible to mess around with multiple volumes with nodraw on touching faces and make it work, but it's always a mysterious crapshoot.

My suggestion (and to clarify what obsidian was saying): If you make a small vertical chimney somewhere extending up into the ceiling, and out of the fog volume, so there will be a small space with no fog at the very top of the level. (Unless you actually want part of the level with no fog; in that case make your single exposed face at whatever point you want the fog to start...).

Make sure that your fogwater is all buried in geometry except for one face, and make sure that your normal fog is all buried in geometry (and extends down through the water as well), execept for one face. Hopefully that will work.

*crosses fingers*

[Edited for retardedness.]

Posted: Fri May 05, 2006 5:54 pm
by obsidian
Try this, extend that fog volume down into the water, so that it overlaps the water brush. Then build the small chimney described above somewhere in the roof.

Posted: Fri May 05, 2006 11:55 pm
by Billybob06
very kind of you boys to help.. i think thats done it.. take a look.

Image

Posted: Sat May 06, 2006 1:54 am
by pjw
Don't you love that feeling when something finally works? :)
Glad we could help.