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.

Newcomers DBPro Corner / making water

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 12th Aug 2012 08:57
using dbpro
wanting to add water to a game but i don't like using third party addons and know nothing about shaders. What is an easy way to relpicate just the surface or water.
so far i have played around with ghosted animated objects and get decent resluts but cant seem to get any of the reflection working properly at all,beeen using dbpro for a while but mostly 2d or menu building. any help would be greatly appreciated. please dont recomend a shader or plugin i refuse to use someone elses work i dont understand or cant properly modify

A child's dream never dies.
Kezzla
15
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 12th Aug 2012 11:07
I tend not to worry about reflection in my water. I have two options for you.

one is a semi tranparent plane with a scrolling water ripple texture on in.

the other is a matrix with water texture with a routine to ripple its surface. press f1 and go to the example programs and look at matrix example, it has a pretty good example there.

Sometimes I like to use words out of contents
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Aug 2012 14:17
Shaders really aren't that hard, check out the attached example from EVOLVED.

TheComet

Your mod has been erased by a signature, please reduce him [overall] to no larger than 120 kg please.

Attachments

Login to view attachments
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 12th Aug 2012 21:01
well its some good looking water for sure thecomet but dont know what an fx file is or really how to use it. just looking for a way with w/o 3d party soft with decent results mainly wanting refraction i can do basic water using matrixs

A child's dream never dies.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Aug 2012 02:23
TheComet pointed you to the best option, otherwise you can use cameras, which is a larger overhead than using a pixel/vertex shader...

But from what you want to achieve, you might want to look into camera tricks... but FX files aka shaders is not exactly 3rd party... it's not a plugin, more a result of your workflow...

Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 13th Aug 2012 03:27
Quote: " but dont know what an fx file is or really how to use it."

Right click on the fx file, choose "open with" and then select notepad. An fx file is just a text file with special code in it. There might be built-in DBPro shaders to render water, but that would be more "3rd party" than using your own fx shader!

Quote: "mainly wanting refraction"

Yeah, you'll need a shader of some sort.

Well, an interesting experiment might to create a new camera, render the camera's image to a texture (using the matrix1utils plugins probably), and then texture the water plane with that image. It might not look the best though.

Quote: "please dont recomend a shader or plugin i refuse to use someone elses work i dont understand or cant properly modify"

I think this is a bad mindset, because EVERYTHING in DBPro uses someone else's work. Do you understand the graphics pipeline? How polygons are rendered/culled? What about how lines are drawn from the line function? There's a lot to learn and if you try to learn all of it while working on another thing, you'll probably get bored and give up. I know I have.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 13th Aug 2012 17:34
Guess ill be using a shader or learn to write my own. I do relise everything is built on top of someone elses work when it comes to code and technology. thanks for ur input guys.Just wanted to see if there was a very easy way to do it versus using third party. but that fx file does indeed look fantastic

A child's dream never dies.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Aug 2012 21:51
I may have found a solution, using the aforementioned wavy matrix, you could apply a texture and also apply
Quote: "SET OBJECT SPECULAR Object Number, Color Value
"
I found this while fiddling with the RoomDemo, it might be in your Projects Folder

Burning Feet Man
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 28th Aug 2012 12:33
Thanks for your example TheComet, very cool!

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Login to post a reply

Server time is: 2024-03-29 09:33:08
Your offset time is: 2024-03-29 09:33:08