Page 1 of 2

sea effect in DP

Posted: Sat Feb 08, 2014 2:42 am
by Nahuel
i wanna to get some effect to a beach in a "coast" map. I am using DP : what do you think about to get waves and a nice "beach" effect in q3bsp? I can use some custom functions in qc if this beach effect requires some qc modification. Do you have some ideas to get a beach in dp with q3bsp?

Re: sea effect in DP

Posted: Sat Feb 08, 2014 3:52 am
by ceriux
id just have a plane laying partially over your water and beach. have it animated/alpha'd.

Re: sea effect in DP

Posted: Sat Feb 08, 2014 11:12 am
by frag.machine
mp_beach in Return to Castle Wolfenstein MP comes to mind. Maybe checking it can give you a hint ?

Re: sea effect in DP

Posted: Sat Feb 08, 2014 3:26 pm
by Seven
Hi Nahuel,

You could maybe make use of hipnotics up/down moving water feature.
Intersected with a slope (which is the sand).
I do not know if this is possible.
When the water goes upwards then, the surface would become bigger in the slope direction.
When the water goes downwards then, the surface would become smaller in the slope direction.
Like on a real beach.
If it helps: the water area can also reach below the sand area. But player cannot "sink" in sand (which is solid).

For the splashes / foam, you could use several particle effects around the edges between slope and water.
Just an idea...

Or use 2 different floating speed water areas (beach = fast and deep water = slow) like this:
(watch start of clip):
http://www.youtube.com/watch?v=no7JsOy87vs

Re: sea effect in DP

Posted: Sat Feb 08, 2014 3:32 pm
by goldenboy
Good question; I also have one level that includes a seashore.

I'm not at the point where I'm doing the surf yet, but I have been thinking about it.

My ideas so far have involved either overlaying a shader to make it seem like waves hitting the beach, or to actually create an animated mesh of waves.

It depends how big the waves need to be, and on the shape of the waves. If it's just smaller waves that don't break, a shader with a normal map might do. For larger, breaking waves, I guess an animated mesh and particle effects would be needed.

Those are my 2 ideas on how to do it, anyway. I'm interested to know about other ways.

Re: sea effect in DP

Posted: Sat Feb 08, 2014 9:08 pm
by Spike
reminds me of the film Truman Show.
if you swim out in the water, what's to stop the player from swimming into the skybox? or rather, that the water does not actually extend to the horizon, which is visible closer to shore.

I would say that most water shaders that consider distance from shore add some froth or so in the shallow water, based upon the refraction depth map and its distance from the water surface. use some texture with x+y for one axis and depth on the other and you can probably cover the edge of the shore fairly nicely. then you just need to raise the sea up and down slightly somehow and you've got waves.
I really wouldn't recommend doing huge crashing waves. that sort of thing requires lots of particle effects and stuff too.
if you were going to model it properly, you'd have different parts of the water surface move up and down separately. this makes the refraction/reflection images a real nightmare though. its easier to keep your geometry flat and implement whatever waves via a few scrolling textures in glsl. don't forget some specular on the wavecrests!
the key thing is that shallow areas = shallow waves, which means you don't reveal dodgy areas where your geometry wasn't drawn properly. combined with surf, you'll essentually mask off anywhere that's slightly close to shore and have no issues with black areas because of that.

but yeah, you will need some custom glsl for an actual beach scene.

Re: sea effect in DP

Posted: Sun Feb 09, 2014 12:24 am
by Spiney
How about Q3 patch meshes with texture panning (using the non-tiling flag, which name is escaping me) + up/down vertex shader.

Re: sea effect in DP

Posted: Sun Feb 09, 2014 3:30 pm
by goldenboy
if you swim out in the water, what's to stop the player from swimming into the skybox?
I've been thinking about this. I'll just have my protagonist refuse to swim in the ocean. This is actually quite realistic. Swimming at an unknown beach with full gear on and carrying weapons etc. is probably suicide (currents...) unless you're specially trained for it.

If the player forces her in with explosives or something, she will drown. Stupid player is stupid.

It's not Quake! :wink:

Re: sea effect in DP

Posted: Sun Feb 09, 2014 3:51 pm
by Spiney
Sharks. With lazerbeams :mrgreen:

Re: sea effect in DP

Posted: Sun Feb 09, 2014 5:35 pm
by goldenboy
Personally I also liked how in Far Cry 1, if you swam towards the sea a helicopter would magically appear and gun you down. :mrgreen:

Re: sea effect in DP

Posted: Sun Feb 09, 2014 9:58 pm
by frag.machine
goldenboy wrote:
if you swim out in the water, what's to stop the player from swimming into the skybox?
I've been thinking about this. I'll just have my protagonist refuse to swim in the ocean. This is actually quite realistic. Swimming at an unknown beach with full gear on and carrying weapons etc. is probably suicide (currents...) unless you're specially trained for it.

If the player forces her in with explosives or something, she will drown. Stupid player is stupid.

It's not Quake! :wink:
Corridor-style gameplay ?... :|

Re: sea effect in DP

Posted: Sun Feb 09, 2014 10:12 pm
by goldenboy
frag.machine wrote:
goldenboy wrote:
if you swim out in the water, what's to stop the player from swimming into the skybox?
I've been thinking about this. I'll just have my protagonist refuse to swim in the ocean. This is actually quite realistic. Swimming at an unknown beach with full gear on and carrying weapons etc. is probably suicide (currents...) unless you're specially trained for it.

If the player forces her in with explosives or something, she will drown. Stupid player is stupid.

It's not Quake! :wink:
Corridor-style gameplay ?... :|

Uh, no?

Not being able to enter the only ocean in the game does not constitute corridor style gameplay. The outdoor area in question is thousands of qu across, most of them explorable, and contains several bodies of water, all of which will be swimmable -- with the exception of the "ocean".

Re: sea effect in DP

Posted: Sun Feb 09, 2014 10:59 pm
by frag.machine
phew... :D

Re: sea effect in DP

Posted: Sun Feb 09, 2014 11:23 pm
by scar3crow
Are you viewing it from above? Looking at it head-on? Can you walk down to it?

If viewing from above, you can just have a water bob like in Hipnotic against a slope with exaggerated changes to give the illusion of depth.

If looking head on, I recommend a rocky coast line with a shader to give the impression of movement, but also particle emitters behind the rocks to give the impression of spray.

Going into it or at least walking down very close is a whole other matter.

Re: sea effect in DP

Posted: Mon Feb 10, 2014 12:01 am
by leileilol
It's all about trying to blend in with an infinite sea skybox. Usually a big alpha blended color blend texture to the skybox can work the illusion. For Q3 one would make this water use the blend texture scaled up to hit all edges of the water bounds, with a shader that has a second stage under it used as the wave texture.



Sometimes skyrooms can help - Q3MAP2 has support for that and it's kind of a neat illusion. This is recommended if you wanted passing clouds in your sky while trying to do the sea illusion, though I am not certain if Darkplaces can handle that weird hack.