making water


(Wezelkrozum) #1

Is there a way of making water that reflect 50% (mirror) and is 50%transparant. And that the water moves in waves?

  1. reflect 50% (mirror)
  2. transparant 50%
  3. waves

i hope somebody can give me the shaderscript.


(-SSF-Sage) #2

For the waves and trans it works. I think the reflect doesn’t work in et afaik. If you mean like if player go to near the water it can mirror you. Atleast without a lot of work.


(Flippy) #3

Yes it can be done. It’s not too hard, it just requires some nifty shader work which I can’t remember off the top of my head…
Do a search for water mirror or something and you will find lots of things about it.

Note that this could greatly decrease the performance of your map, because, depending on the size of the water, a huge part of your map might be drawn twice (once for real and once for the reflection)!

EDIT:
On second thought, I’m not sure if you can get it to wave aswell… It might not be possible to have mirror + waves… but mirror only is possible.


(Wezelkrozum) #4

ok thanks,

i want the shader for it.
only a mirror (reflections) and transparant will be good


(Flippy) #5

Like I told you, search for it…


(Wezelkrozum) #6

i was trying to make a transparant shader but he isn’t transparant. is the shader wrong?

the shader:


textures/liquids_sd/sea_bright_na2
{
	nocompress
	qer_editorimage textures/liquids_sd/sea_bright_na2.tga
	qer_trans .5
	q3map_globaltexture
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm water
	surfaceparm nomarks
	cull disable
	nopicmip
	nofog

	waterfogvars ( 0.11 0.13 0.15 ) 0.2
	{ 
		fog on
		map textures/liquids_sd/siwa_water.tga
		blendFunc blend
		alphaFunc GE128
		depthWrite
		rgbgen identity
		tcmod scale 0.5 0.5
		tcmod scroll -.02 .001
		}

		{ 
		fog on
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.3 0.02 0 0.25 
		tcmod scale 0.01 0.01
		tcmod scroll -.001 -.0002
	}
	{ 
		fog on
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.1 0.03 0 0.4
		tcmod scale 1 1
		tcmod scroll -.005 -.001
	}
	{
		fog on
		map textures/liquids_sd/siwa_shimshim1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.4 0.02 0 0.3
		tcmod transform 0 1.5 1 1.5 2 1
		tcmod scroll .005 -.001
	}
}


(]UBC[ McNite) #7

Mirroring water is going to kill your FPS. There was a map once with a small mirror in it, and it had serious performance issues.


(Darkfrost) #8

Mirrors are used in loads of maps :smiley:


(]UBC[ McNite) #9

yes in small rooms inside of buildings. Try them in an open area…


(Darkfrost) #10

Like as the skybox? :smiley:


(carnage) #11

i think McNite is right if you try mirror something like a large volume of water then you are pretty sure to hit fps issues. You could end up drawing double the amount of tris before the reflection

one idea i had a while ago but never tried was to use some kind of environment map then render a semi transparent water texture on top to give the impression of reflection without the fps cost of actually rendering a true reflection.

to try something like this it might be good idea to start your shader as if it were a skybox (minus the lighting commands) then add a water texture on the end


(TNR360) #12

make the upper area of the map first… take screen shots and blend them into the water texture

make the texture semi transperent and have waves and voila realistic water

but there is not a realtime reflection, if done correctly as long as there isnt alot of detail around and with sufficient photoshop skills it may look very realistic in the end


(Wezelkrozum) #13

bla bla bla… bad fps … bad, big area … good, small room…

can somebody give me the shader script?


(Flippy) #14

Dude, I’ve told you 3 times now, SEARCH FOR IT!
Do you think we can come up with the shader you need ourselves? No we can’t! We also need to search for it! So why can’t you do it yourself? We told you what you need to know…


(TNR360) #15

What the fuck?

you’re welcome? :roll:


(aaa3) #16

actually the fake reflection is a good idea… now im the third who suggesting that :smiley:


(DC9) #17

http://www.splashdamage.com/forums/viewtopic.php?t=8390

http://www.splashdamage.com/forums/viewtopic.php?t=13907&highlight=reflecting+water


(TNR360) #18

maybe instead of a fake reflection, one that isnt realtime… like prerendered into map without geometry being duplicated


(Flippy) #19

Faking a reflection won’t work, for the simple reason that it will have to be a picture pasted on a surface. A reflection is not a picture painted on a surface.
If you move towards a plain of water that is reflecting something, you will notice that the reflection changes as you move. In ET this works the same if you are using a real reflection.
If you simply use a texture that has reflections on it and paste it on the water you will notice that it doens’t move and it will lose all reality…

Another issue you’ll run into with reflecting water is that there is something I don’t know the english word for (lol)…
When you look at a window for example. Something that reflects but is not completely opaque (it is transparent, like water).
If you look at it straight on, you won’t see any reflections.
However, if you look at it from the side, you will see much more reflections.
You cannot create this behaviour in ET afaik, and this will also make your water reflection much more fake.
If you stand on a puddle of water and look straight down for example, you won’t see yourself reflected… in ET you will.