Shore water shader?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
redfella
Posts: 441
Joined: Mon May 12, 2003 7:00 am

Post by redfella »

Is this for rtcw? If it is, there should be a shader like that (ala the shoreline in beach).
black & white blanket logic
redfella
Posts: 441
Joined: Mon May 12, 2003 7:00 am

Post by redfella »

Well take it from there anyways.... :S ;)
black & white blanket logic
TempSonicClang
Posts: 47
Joined: Thu Feb 17, 2005 5:58 pm

Post by TempSonicClang »

Kaz, maybe you should make a Far Cry level. :) The water in that game is AWESOME.
The number 1 cause of death in games is panic.

Add 870 posts to what it says my total is (SonicClang is my real profile)
ydnar
Posts: 36
Joined: Fri Dec 15, 2000 8:00 am

Post by ydnar »

I was doing this with implicit vertex alpha/color when we were working on what would eventually be the ocean shader for Battery (in Enemy Territory). It could be done using q3map_alphaMod volume brushes to set explicit vertex alpha and do additional foam/edge passes in shallow water:

http://akiba.shaderlab.com/samples/ocean_2003-01-30/
TempSonicClang
Posts: 47
Joined: Thu Feb 17, 2005 5:58 pm

Post by TempSonicClang »

The clouds over head opened up, the sun shone through and a voice spoke to them... and it was ydnar... :D
The number 1 cause of death in games is panic.

Add 870 posts to what it says my total is (SonicClang is my real profile)
User avatar
seremtan
Posts: 36013
Joined: Wed Nov 19, 2003 8:00 am

Post by seremtan »

The outermost vertexes of the land should all sit on the same plane on the z-axis. That way the water vertexes can match up to them to make the alphamod work.

If you had, say, a strip of beach right around the edge, with a strip of water running alongside it, you could blend the two then put an surf shader overlay over both of them to disguise the blend and use alphamod vol brushes on the seaward wide. I guess the surf shader could be scrolling but with alpha fade and a tcMod to make the surf fade away as it rolls up the beach. It would need a shallow sloped beach though to look natural.

I've been thinking about doing something like this myself, and this was the best thing I could think of. Hope it makes sense.
Vexar
Posts: 18
Joined: Sat Aug 05, 2000 7:00 am

If you have the Medal of Honor Spearhead DEMO

Post by Vexar »

I needed an effect like this for Subpen level I did for the demo, it included one texture for ocean or water, I used three shaders one for clear, one for the transistion, and then one for opaque using a simple gray scale ramp texture. Open up .pk3 demo files look for the water.shader, please recreate this with your own source, as it is illegal to use this as is.

I pulled out the shader below, Ydnar can speak to these commands working with Q3map2 but I am pretty sure they will, this system gave me pretty good control and might be less overhead during runtime. It gave me the ability to control with brushes where the water was shallow, and where it wasn't.


textures/water/subpen_clear
{
qer_editorimage textures/water/subpen_clear.tga
qer_keyword natural
qer_keyword liquid
qer_keyword subpen
qer_keyword add-on
qer_keyword ocean
surfaceParm water
surfaceparm trans
surfaceParm noimpact
{
map textures/water/noise.tga
tcMod transform 1 0 0 1 0 0
tcMod scroll 0.01 -0.13
nextbundle
map textures/water/noise2.tga
blendfunc add
tcMod transform 1 0 0 1 0 0
tcMod scroll 0.12 0
}

{
map textures/water/subpen_waves.tga
blendfunc blend
alphagen const 0.5
tcMod scroll 0 0.01
}
{
map textures/water/water_shadows.tga
tcMod scroll 0 0.07
nextbundle
map textures/water/water_shadows2.tga
blendfunc filter
tcMod scroll 0.07 -0.07
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
depthFunc equal
}
}

textures/water/subpen_transition
{
qer_editorimage textures/water/subpen_transition.tga
qer_keyword natural
qer_keyword liquid
qer_keyword subpen
qer_keyword add-on
qer_keyword ocean
surfaceParm water
surfaceparm trans
surfaceParm noimpact
{
map textures/water/clear_transition.tga
blendfunc blend
// tcmod scale 0.3 0.3
tcmod transform 0.85 0 0 0.85 0.1 0.1
}
{
map textures/water/noise.tga
tcMod transform 1 0 0 1 0 0
tcMod scroll 0.01 -0.13
nextbundle
map textures/water/noise2.tga
blendfunc add
tcMod transform 1 0 0 1 0 0
tcMod scroll 0.12 0
}

{
map textures/water/subpen_waves.tga
blendfunc blend
alphagen const 0.5
tcMod scroll 0 0.01
}
{
map textures/water/water_shadows.tga
tcMod scroll 0 0.07
// tcmod transform 0.1 0 0 0.1 1 0
nextbundle
map textures/water/water_shadows2.tga
blendfunc filter
tcMod scroll 0.07 -0.07
// tcmod transform 0.1 0 0 0.1 1 0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
depthFunc equal
}
}

textures/water/subpen_opaque
{
qer_editorimage textures/water/subpen_opaque.tga
qer_keyword natural
qer_keyword liquid
qer_keyword subpen
qer_keyword add-on
qer_keyword ocean
surfaceParm water
surfaceparm trans
surfaceParm noimpact
{
map textures/water/opaque.tga
blendfunc blend
}
{
map textures/water/noise.tga
tcMod transform 1 0 0 1 0 0
tcMod scroll 0.01 -0.13
nextbundle
map textures/water/noise2.tga
blendfunc add
tcMod transform 1 0 0 1 0 0
tcMod scroll 0.12 0
}

{
map textures/water/subpen_waves.tga
blendfunc blend
alphagen const 0.5
tcMod scroll 0 0.01
}
{
map textures/water/water_shadows.tga
tcMod scroll 0 0.07
nextbundle
map textures/water/water_shadows2.tga
blendfunc filter
tcMod scroll 0.07 -0.07
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
depthFunc equal
}
}

The purpose is for a large body of the water btw, not the foam.
Last edited by Vexar on Sun Mar 13, 2005 1:24 am, edited 1 time in total.
Vexar
Posts: 18
Joined: Sat Aug 05, 2000 7:00 am

You can still download the old demo from EA site...

Post by Vexar »

Do a search google search for Spearhead Demo
Vexar
Posts: 18
Joined: Sat Aug 05, 2000 7:00 am

Yes...

Post by Vexar »

With out the textures it's not going to help that much... we also tagged the textures visually so we could see the water direction flow in the editor as they need to be aligned properly so the transision is seamless. Sorry about the 56k, that sucks. I can't post the textures as it would be aganist the law, sorry about that too.
Post Reply