Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / How do you do water effects?

Author
Message
Kequor
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: United States
Posted: 22nd May 2004 19:26
How do you do water effects?

Dont worry and keep a cool head.

DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 22nd May 2004 23:24
there are 2 ways: one is taking a look at the Skyjet (or something like that, jetski, can't remember right now) or looking at some code snippets. Currently there are 2 codes for making water (DBC)...someone correct me if i'm wrong...

:: Pentium 300 Mhz, old 8Mb video card, 64Mb RAM, 5 gb & 1.6 gb HD's, W98 SE, Sound Blaster AWE 32 ::
Kequor
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: United States
Posted: 23rd May 2004 07:50
What I ment was instructions on how to code one myself.

Dont worry and keep a cool head.

Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 23rd May 2004 12:58
just make an array of random angles between nought and threesixty degrees, then rotate through them and multiply the sine of the result by the wave height, heres an example (made in pro, but should work in classic)



Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 31st May 2004 23:40
Mentor you're a GOD! can I include your code in my website? It'll come in handy for other users!

:: Pentium 300 Mhz, 8Mb video card, 64Mb RAM, 5 gb & 1.6 gb HD's, W98SE, Sound Blaster AWE 32 ::
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 1st Jun 2004 15:16
sure, include away, (I am the god of snippets BTW)

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 1st Jun 2004 16:01
hehe you're right ok I'll add it later

:: Pentium 300 Mhz, 8Mb video card, 64Mb RAM, 5 gb & 1.6 gb HD's, W98SE, Sound Blaster AWE 32 ::
Dr Crazy
21
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 3rd Jun 2004 23:52
Well there is another way and you can still keep your FPS RATE up
Basically, make a cube of however big.
Then Texture it with a water texture (if you can get one).
Then just type the command "SCROLL OBJECT TEXTURE (Obj Num),0,0.2"

Here's an example:


However, if your making seas then use mentor's code. (It does cut FPS down a bit but its still good)

It depends whether you want quality or performance. If I had a choice, it would have to be performance. If you had the best graphics in the whole world, you could have the most poorest performance.

Who dares; wins.
wh1sp3r
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 5th Jun 2004 00:28
how water effect ? like shading or waves ?

PS: Real programmers aren't afraid of math!.

☺☺ AthlonXP 2500+, Ati Radeon 9600 128MB, dualDDR 512MB 400Mhz CL3.0, SB LIVE!, monitor 19" ☺☺
Kequor
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: United States
Posted: 5th Jun 2004 01:41
Underwater.

Dont worry and keep a cool head.

BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 5th Jun 2004 11:02
You could use color ambient light to make everything slightly more bluish-greenish and crank the fog up. Another method is positioning a plain that's textured blue with some transparency with a .png or using the texture method that draws all rgb(0,0,0) pixels transparent. Then crank all sounds down and add a sound that is a dull "sssssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwiiiiiiiiiiiiiiiiiiiiiiiisssssssssssssssssshhhhhhhhhhhhhhhhhhhhhhhhhh" to make it sound like there are currents floating through the water. Looping sounds of swimming strokes also helps.

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
New Creature Feature
20
Years of Service
User Offline
Joined: 27th May 2004
Location: Tennessee- USA
Posted: 8th Jun 2004 04:37
hopefully I did this right- last time I tried to post code it didn't and I had 2 messages in a row- is that what you folks call a `bump'?

Anyways.. I am totally fascinated with Mentor's water code. Hope you don't mind Mentor but as a major newbie I have been playing around with several variations of it. Only 2 have worked (kinda) so far.

I have an idea for another variation but it's not working at the moment. Using Mentor's existing water code, I have been trying to add bubbles.

The idea is to create spheres and place them randomly beneath the watery matrix. The spheres rise in random order and once they get about mid-level with the water level they remain for a random amount of time and then pop (delete or hide objects?). Even better would have them rise and fall with the water matrix level, or even slide `down hill' when the water level rises. But I haven't even been able to make the bubbles do what I want them to.

The neat feature I would like is to decide how long the bubbles stay. In soapy water they would hang out for a while then pop perhaps (if you touched them with an object maybe). If it were boiling lava/muck or water the bubbles would just keep rising and popping (I suppose) without hesitating.

So, Mentor, can you help me out here? I tried to do just the bubble part separate from your water code because I couldn't make the camera stay in the center of the water matrix. If the code doesn't follow in the code section I will sorrowfully have to have 2 messages in a row to post just the code.

Thanks
Alan


Therefore if any man be in Christ, he is a new creature: old things are passed away; behold, all things are become new. II Corinthians 5:17
New Creature Feature
20
Years of Service
User Offline
Joined: 27th May 2004
Location: Tennessee- USA
Posted: 8th Jun 2004 04:39
frustration: WHY CAN'T I GET CODE TO POST IN THE CODE SECTION?
sync on:sync rate 20
randomize 1
position camera 0,-180,0
rem make bubbles
for bub=1 to 20
make object sphere bub, .5
next bub

oy=0

do

rem create random x/y position variables for objects
ox=rnd(55)
oz=rnd(55)
for ob=1 to 20
position object ob, ox, oy, oz
next ob

rem make bubbles rise then pop them (hide them)
for ob=1 to 20
position object ob, ox, oy, oz
oy=oy+1
if oy=5 then hide object ob
next ob

rem show objects again
oy=0
for ob=1 to 20
show object ob
next ob

sync on
loop

sorry if that's what you call a bump-
Alan

Therefore if any man be in Christ, he is a new creature: old things are passed away; behold, all things are become new. II Corinthians 5:17
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 9th Jun 2004 00:32
all you need to do is to make an array that holds the x,y,z positions of say 50 spheres, then check for any being at the "ground height" (waters surface) then set its y back to the seafloor and give it a position around the player that is random, that way as the player moves the bubbles "follow" and you always see new bubbles riseing as you go about, I will post a working example tommorow (if I remember) since I deleted the stingray sub game.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 9th Jun 2004 22:43 Edited at: 9th Jun 2004 22:48
code as promised, under the sea at night with bubbles (no media required)if you wanted the bubbles to linger at the surface then you could use another array to hold their "lifespan" and then not reset them to the bottom of the sea before they have been floating on the surface for a while, easy enough to do, see the yellow pyramid in the button marked source at the bottom of this post?, click it! (this was made in pro, it may have a stray pro command or two, if you are using classic then you may need to find and alter the code for any commands that fail the compile).

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
New Creature Feature
20
Years of Service
User Offline
Joined: 27th May 2004
Location: Tennessee- USA
Posted: 10th Jun 2004 03:09
Thanks Mentor

I tried it in DBC and it didn't work, but I'm not familiar enough with it yet to start debugging. So I am now downloading the DB Pro trial- I think I'm going to buy it this week. I just can't stand anymore to be limited (though it's mostly because of my inexperience) with DBC if things are easier to do in DB Pro.

I appreciate your help. Hope you realize your user name seems rather appropriate and because of it people may ask you for help alot, but if you like the name you must like the responsibility that goes with it as well. That is a gift my friend. God bless you and keep up the good work!

Alan

Therefore if any man be in Christ, he is a new creature: old things are passed away; behold, all things are become new. II Corinthians 5:17
New Creature Feature
20
Years of Service
User Offline
Joined: 27th May 2004
Location: Tennessee- USA
Posted: 10th Jun 2004 05:52
Mentor, that's so cool- just checked it out. Now I'll try to get the camera above the water looking down.

Alan

Therefore if any man be in Christ, he is a new creature: old things are passed away; behold, all things are become new. II Corinthians 5:17

Login to post a reply

Server time is: 2025-05-26 06:05:52
Your offset time is: 2025-05-26 06:05:52