water reflaction


(nikita) #1

is it possable to make a water texture to reflect what above it? and if it do, how do i do it?


(kamikazee) #2

I fear you can’t.


(Ifurita) #3

Actually, you probably could. You can create mirrors in ET and I imagine that if you gave it a sine function and some other stuff, you could get a nice reflective water texture. I’ve seen it done somewhere else, but it would effectively double everything you’re drawing, which wouldn’t be such a hot idea


(Marko) #4

If you take a quick look at MLB Egypt, you have a little underground lake in the last section of the map with a reflective water surface… Be aware though that it doubles the complexity of the scene you are rendering and therefore avoid using it on large outdoor areas :smiley:


(nUllSkillZ) #5

reflections


(kamikazee) #6

Hehe, I thought they disallowed it for performance issues but that stuff looks good.

A rippling mirror… Someone wants to try one?


(carnage) #7

i got an idea how to make a rippeling mirror but my computer is broken and im not able to test it right now
il get some comands for someone else to try it though

tcMod turb 1 1 1 1

apply that in the shader pass with the .tga that is used for the mirror texture. play around with the numbers. not sure if it will work or not though and i have a feeling that if it does work the amount of processing it will have to do for a mirror is gona be way too much

when making your tga try differnt levels of transparency as well. 100% will probably look realy good for a dark moonlit map but 50% might be beter for a sunny day map

if anyone is feeling adventurious then how about getting q3map2 and setting up alpha trans brushowrk water surface shader to control the levels of transparency making it very clear where the water is shalow and almost total transparent where the water is deep. This i think will have no performace hit compared to a standar mirror shader since the processing is pretty much identical

EDIT// a mirro always comes out as 1:1 resolution. does anyone know a shader comand that will make the mirror apear less sharp or lower resolution, make the water look less calm


(nikita) #8

as quote for carnage
the tcmode turb is an unkown general command


(Shaderman) #9

Pay attention to the capitalization and spelling.


(nikita) #10

i kinda used portal like mirror as suggested somewhere on siwa water and what happened is the water act like texture bug when texture override the other and creat a bug,
i cant take a screenshot cause the bug only apear when i move not stand still.

textures/liquids_sd/siwa_water_2
{
qer_editorimage textures/liquids_sd/siwa_water.tga
qer_trans .5
q3map_globaltexture
cull disable
nocompress
nofog
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm trans
surfaceparm water
waterfogvars ( 0.11 0.13 0.15 ) 0.2
nopicmip
surfaceparm nolightmap
portal
{
map textures/liquids_sd/siwa_water.tga
blendFunc blend
alphaFunc GE128
rgbgen identity
tcmod scale 0.5 0.5
tcmod scroll -.02 .001
fog on
blendfunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
depthWrite
}
{
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
	fog on
}

}


(Shaderman) #11

Please use the code tags when posting scripts or shaders.

This shader name already exists because you copied the whole thing. You should rename that shader to something unique like textures/nikita/water. I don’t know if this copy & paste shader will ever work though.


(carnage) #12

before i can make a truly effective shader i need to knwo how q3 renders a mirror

there are two ways i can see it working
-the mirror is the first set of the frame then renders the rest of the scene as normal
-the frame is rendered then when a mirros is to be rendered the scene point of view from the mirror is writen to a seperate set of video momory then applied to the mirror triangle

if the second then there is a posability that the image can be manipulated before being placed on a trianlge alowing things like TCturb to be done making ripples


(nikita) #13

well now the problem is the water are solid again, and dont have water impect cullosion act like a wall, how do i fix it?


(psyco_mario) #14

i think there is a nonsolid sharder param or somithing, did you remember this?


(nikita) #15

yep well i kinda fixed thats the result, but its kinda fps eater


(kamakazibond) #16

nikita, could you post a example shader that you used to fix it??

I am having the same Z fighting problem as you were


(Loffy) #17

I want to splash with my military boots into that small pool before running ahead shouting “Fire in the holeee!”


(=SC=Beef) #18

radar has a sort of shiny reflective puddle, admitidly it doesnt reflect anything really, but you could allways try it


(Graham) #19

For me, that shader ain’t working. It’s killing FPS and it isn’t reflecting.


(Shaderman) #20

Not sure, but I think you need to place a misc_portal_surface above the surface which you can find here

http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=6243