Water - working / not working


(Leslie Judge) #1

JK2/SP

Why is that my water is changing between working (behaving like water has to) and non-working (like a simple non-solid brush) from compile to compile? I had this with q3map2 2.3.33 and laters, now with 2.3.36. I can’t say anything before 2.3.33 because I didn’t have water in my level before that.

More interesting that I have a pool in the middle and an other one around it (a ring). The ring is made from 32 brushes and always works as it has to be. The middle is made from only one 32 sided brush and that’s which is changing its behaviour.


(Old_Fellow) #2

How are textured each faces?


(Leslie Judge) #3

Top and bottom with the water shader, others with caulk_nonsolid.


(Old_Fellow) #4

There sits your problem. Contents properties are given by the first brush face in the map file. Texturing the top and the bottom faces doesn’t work anytime.
Open your map file in a text editor and look if the brush definition looks like this:

// brush 1
{
( 72 576 -8 ) ( 200 576 -8 ) ( 72 448 -8 ) liquids/clear_ripple1 0 0 0 0.500000 0.500000 0 281 0
( 80 576 -8 ) ( 80 448 -8 ) ( 80 448 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 29 0
( 208 576 -8 ) ( 80 576 -8 ) ( 80 576 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 29 0
( 208 448 -8 ) ( 208 576 -8 ) ( 208 576 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 29 0
( 80 448 -8 ) ( 208 448 -8 ) ( 208 448 -16 ) liquids/clear_ripple1 0 0 0 0.500000 0.500000 0 29 0
( 216 576 -80 ) ( 88 576 -80 ) ( 88 448 -80 ) common/caulk 0 0 0 0.500000 0.500000 0 29 0
}
}

This brush definition with two faces textured with a water shader give you functional water, because the first face has surfaceparm water.

But this brush definition give you an impenetrable block, you know why now:

// brush 1
{
( 72 576 -8 ) ( 200 576 -8 ) ( 72 448 -8 ) common/caulk 0 0 0 0.500000 0.500000 0 281 0
( 80 576 -8 ) ( 80 448 -8 ) ( 80 448 -16 ) liquids/clear_ripple1 0 0 0 0.500000 0.500000 0 29 0
( 208 576 -8 ) ( 80 576 -8 ) ( 80 576 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 29 0
( 208 448 -8 ) ( 208 576 -8 ) ( 208 576 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 29 0
( 80 448 -8 ) ( 208 448 -8 ) ( 208 448 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 29 0
( 216 576 -80 ) ( 88 576 -80 ) ( 88 448 -80 ) liquids/clear_ripple1 0 0 0 0.500000 0.500000 0 29 0
}
}

To avoid that kind of problem, make a water shader and put it in common.shader.

textures/common/water_caulk
{
qer_trans 0.5
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm trans
surfaceparm water
}

Create an image named water_caulk.tga and put it in textures/common.

Now, when making water brushes, select the whole brush and apply water_caulk on it, then texture the visible face only with the water shader.

// brush 1
{
( 72 576 -8 ) ( 200 576 -8 ) ( 72 448 -8 ) common/water_caulk 0 0 0 0.500000 0.500000 0 281 0
( 80 576 -8 ) ( 80 448 -8 ) ( 80 448 -16 ) liquids/clear_ripple1 0 0 0 0.500000 0.500000 0 29 0
( 208 576 -8 ) ( 80 576 -8 ) ( 80 576 -16 ) common/water_caulk 0 0 0 0.500000 0.500000 0 29 0
( 208 448 -8 ) ( 208 576 -8 ) ( 208 576 -16 ) common/water_caulk 0 0 0 0.500000 0.500000 0 29 0
( 80 448 -8 ) ( 208 448 -8 ) ( 208 448 -16 ) common/water_caulk 0 0 0 0.500000 0.500000 0 29 0
( 216 576 -80 ) ( 88 576 -80 ) ( 88 448 -80 ) common/water_caulk 0 0 0 0.500000 0.500000 0 29 0
}
}

Your water will ever works and no more ugly overdraw where textured faces meet.
This apply to all contents properties (lava, fog, slime…). Each needs its shader (lava_caulk, slime_caulk…)


(Leslie Judge) #5

OK, thanks, I understand what you say.

However, I made the map for Jedi Outcast as mentioned, and every liquid and fog tutorials for it (and people who are mapping for that game) say only the top and bottom with water/fog shader. That means the sides shouldn’t have a shader with surfaceparm water, right?

I know the game uses q3 engine but it’s a modified one and the shader handling is modified also. I’m going to try what you said, and check the map file when my water doesn’t work just to be sure.


(U.S.S. Speed) #6

Damn cool tips there!!

I had the same problem, and a lot of thankies. :banana:


(Leslie Judge) #7

OK, that water_caulk has been tested and failed to solve the problem. I compiled a map using that shader with q3map 2.3.36. Water works in the outer ring but not works in the inner circle. After a few recompile water works in the center as well, but the next time not. Interesting.


(U.S.S. Speed) #8

I found out why…

textures/common/water_caulk
{
qer_trans 0.5
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm trans
surfaceparm water
}

Water doesn’t use surfaceparm nonsolid
If it the water_caulk that come first in the brush listing, your brush will be… No solid. Which is that you can pass throw.

So, erase the surfaceparm nonsolid
The surfaceparm water is enough to give the brush the info you want.

textures/common/water_caulk
{
qer_trans 0.5
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm trans
surfaceparm water
}


(Old_Fellow) #9

You found nothing, this shader works since years now.
Before arguing, make a test box, fill it with a brush textured on its 6 faces with water_caulk, and sank in it.
Look in your liquids.shader, you’ll see that the majority of the water shaders are using nonsolid.
If Leslie Judge have a water problem, it don’t come from the shader but probably by the brushwork.


(U.S.S. Speed) #10

Sorry, based myself on EF shader, and none where using nonsolid.


(Leslie Judge) #11

I tried this with a more simpler nearly box shaped water brush and the result was the same. Then tried with box shaped. That seems to work fine but I can’t use box shape water brush in a circle. Since my outer ring of water is 32 not box shaped but 6 sided brushes (and those always behave as they have to) I can cut up my inner brush into smaller 6 sided brushes instead of one big 32 sided brush.