sidebar features
sidebar content

Go Back   Blender Artists Forums > Game Engine > Game Engine Resources

Reply
 
Thread Tools
Magnum Opus Magnum Opus is offline
Member
 
Join Date: Aug 2007
Posts: 427
Many people seem to have questions about making liquid effects for their games. Like many have said before me: No, you can't use Blender's liquid feature in the GE. But this doesn't mean that you are limited to a flat blue-colored plane for your character to drown in.

Professional games will have dynamic shaders and reflections to make realistic looking water (as much as it pains me to say so, Bio-Shock is probably the best example of realtime water right now). I made two quick examples, complete with plenty of bugs and other problems, of ways to fake water in your game, requiring very little skill, competence, or attention.

http://www.box.net/shared/kp8hucfvow

The .blend has 2 scenes. In the first scene, the arrow keys control the boat, and in the second scene, the space bar makes it rain.

So, the problems with these...
Well, one of the first problems I encountered with these would be with one of Blender's own bugs. Added dynamic objects aparently realy like to be rigid bodies, so if a rain drop hits at a wierd angle, the ripple goes up in the air. This can be fixed with Python, but I left it the way it is in the .blend. Continuing with the rain scene, it's probably not the best idea to have each individual raindrop a dynamic object. Alpha-mapped Halo planes with a rain texture would probably be the best way to go in a real game, but that would mean the ripples wouldn't be placed dynamicly where the drops land (but would overcome the rigid body bug).

In the boat scene, the waves in the water are made by an armature. So Blender is still calculating it as a flat plane, and the boat won't move up and down with the waves. I personally don't know how to fix this even with Python, except by making the waves seperate objects that move up and down. Another problem with this comes from lighting. There are no lights in either scenes in the example, but if your game has lights, the wavy water looks checkered.

The biggest problem with water is the framerate. If you watch the fps in each scene, you can see that the framerate drops quickly once you get a lot of effects going. Since water is very complex, the more realistic you make it, the more fps you're going to lose. If you want water in your game, you need to decide how important it is (a lake in a wakeboarding game versus a puddle in a shooter). You'll need to cut complexity on either side to balance it out and keep up the fps.

Other than that, convincing water is pretty easy to make if you know how to get started. Texture effects and GLSL shaders would be the next step in realism. If there are any other problems that I didn't catch or didn't mention, or if there is a better way to do this (besides textures and shaders), feel free to yell at me. I'm not counting this as a tutorial, by the way, so I put this thread in Support and Discussion. Many thanks (For what? I don't know. I just thought I'd be polite.)
............................................
This post was brought to you by the letter M.
#1   Old 22-Jan-08, 05:20   
Reply With Quote


blackhawk0900's Avatar
blackhawk0900 blackhawk0900 is offline
Member
 
Join Date: Aug 2007
Location: canada, B.C
Posts: 200
this is great work man im really impressed. we could sure use something like this in noobs 2.0. for a river or something.
............................................
The hawk is in the house
noobs 2.0
#2   Old 22-Jan-08, 07:07   
Reply With Quote
Magnum Opus Magnum Opus is offline
Member
 
Join Date: Aug 2007
Posts: 427
One thing I forgot to mention earlier was that I used two scripts on the boat scene. It just makes the empty that adds the ripples snap to the boats position. I just had it parented at first, but since the ripples aren't symetrical, being brighter on one side, it would make a spiral when the boat turned. It's more realistic to keep the bright side facing the same direction, where the sun would be.

Thanks for the comment, by the way. I was going to make the boat have a 3d wake, but that would have to change shape and size depending on the boats speed, which would take more time than I wanted to spend on this.

If anyone has a question on something I didn't talk explain well enough, go ahead and post. If I can't answer your question, there are plenty of other people here who can. Thanks again, blackhawk0900, glad someone can use this.
............................................
This post was brought to you by the letter M.
#3   Old 22-Jan-08, 08:36   
Reply With Quote
goldentaiji's Avatar
goldentaiji goldentaiji is offline
Member
 
Join Date: Jan 2004
Location: Virginia
Posts: 1,432
Umm... you forgot to pack all your textures....

About your rain drop problem, that's pretty much easily fixed, unless they broke that function in the GE for the newest release. All you would have to do is make the dynamic rain object a "ghost" and it'll be able to trigger collisions, but it'll just go right through the water without bouncing.
............................................
Blender3dTutor
http://blender3dtutor.com
Blender Aquarius
http://goldentaiji.googlepages.com/blenderaquarius-main
#4   Old 22-Jan-08, 14:35   
Reply With Quote
yournamehere's Avatar
yournamehere yournamehere is offline
Member
 
Join Date: Nov 2007
Location: Location: Location
Posts: 1,249
I think you should look into more solutions on the realtime water. Right now, I'm working on a raceboat template in my free time, so I'm gonna look into solutions that people have done.

EDIT: Here, I found this paper on realtime water. It obviously includes allot of algorithms and code ( in C unfortunately), but it presents an interesting solution. It's simple, yet accurate, and allows for smoke and water. However, since I am not experienced in code, I'm not sure how it would be implemented, but it's pretty fun to read.

http://www.dgp.toronto.edu/people/st.../pdf/GDC03.pdf

EDIT: http://projects.n-o-e.dk/GPU_water_s.../gpu-water.pdf
EDIT: http://graphics.cs.lth.se/theses/projects/projgrid/
EDIT: http://www.sgi.com/products/software...oceanbump.html
(animated bump maps, that just makes sense to me.)

Just read a little and you'll find similarities in all the equations used, (and simpler solutions that use animated bump maps.)

EDIT: (this looks very interesting. I might actually use this since I can understand it much better) http://freespace.virgin.net/hugo.eli...cs/x_water.htm

Last edited by yournamehere; 22-Jan-08 at 23:41.
#5   Old 22-Jan-08, 23:25   
Reply With Quote
Zeglr Ecklefish's Avatar
Zeglr Ecklefish Zeglr Ecklefish is offline
Member
 
Join Date: Sep 2007
Posts: 37
Render monkey has a nice example water glsl shader that could be quite easily implemented in blender.
#6   Old 23-Jan-08, 04:28   
Reply With Quote
Matt_Goles's Avatar
Matt_Goles Matt_Goles is offline
Member
 
Join Date: Jun 2007
Location: Ontario, Canada eh!
Posts: 637
Ive' figured out a way to make a nice lake with tide-like movement without using any FPS. This won't work for streams though...

I've upped the polycount a bit for this but it works just fine at a lower amount. be sure to subdivide your water a couple of times before fratical subdividing it, and make the water as circular as possible. corners cause problems.

http://www.savefile.com/files/1336889
............................................
FANBLENDS-- For Everything Fan made. JOIN TODAY! <- (Please note that these links are not endorsed by or affiliated with BlenderArtists. All content at such sites is beyond their control.)
#7   Old 24-Jan-08, 04:33   
Reply With Quote
OTO OTO is offline
Moderator
 
Join Date: Mar 2002
Posts: 3,859
It looks more like mercury?!
But it's quite nice!
Thanks.
#8   Old 24-Jan-08, 06:33   
Reply With Quote
black reaper black reaper is offline
Member
 
Join Date: May 2007
Posts: 515
maybe the easiest way to make wave on blender. then for the eye candy effect i'm not sure the framerate won't suffer so I let it this way its pretty easy to implement. It's an old file I was using hope you enjoy it.


http://www.savefile.com/files/1337110
#9   Old 24-Jan-08, 07:10   
Reply With Quote
Magnum Opus Magnum Opus is offline
Member
 
Join Date: Aug 2007
Posts: 427
Sorry, I thought I packed the textures. Like I said before, I'm sure there are plenty of ways to do this better, shaders are probably the best. My graphics card doesn't support GLSL, so I don't use them. Apreciate the comments!
............................................
This post was brought to you by the letter M.
#10   Old 25-Jan-08, 04:38   
Reply With Quote
yournamehere's Avatar
yournamehere yournamehere is offline
Member
 
Join Date: Nov 2007
Location: Location: Location
Posts: 1,249
I like black reaper's technique. How would a boat react to that. I tried it with a cube, and the cube sat on it like it was a plane (of course it's just use of shaders), but is there a way to have a boat react to those waves?
#11   Old 26-Jan-08, 00:44   
Reply With Quote
black reaper black reaper is offline
Member
 
Join Date: May 2007
Posts: 515
It's more advanced technique and I'm just beginning glsl shader. In fact I'm learning hlsl so I won't be able to do it in the future. but I know ogre has a good water shader. maybe you could inspired yourself for doing it for your game.I cannot doing it for the monemt I too occupied making my own game engine using direct x
#12   Old 26-Jan-08, 05:24   
Reply With Quote
jplur's Avatar
jplur jplur is offline
Member
 
Join Date: Apr 2007
Location: Brooklyn baby!
Posts: 454
Hey guys,

Iv'e been working on something similar for my game project:

http://www.parker-portfolio.com/port...r/water2.blend

It looks pretty good, but slows down my load time a lot.

But yeah, great to see other people working on animated water
............................................
Blengband
Terra Sirenum
Space Explorer
Blendserve online game demo
#13   Old 01-Feb-08, 05:23   
Reply With Quote
The Red Hand's Avatar
The Red Hand The Red Hand is offline
Member
 
Join Date: Aug 2007
Location: Two Words: Manhattan Project.
Posts: 995
Maybe I'm just being ignorant, but I don't see how you do it...
............................................
I don't flame, I rebuttal.
#14   Old 01-Feb-08, 21:08   
Reply With Quote
Olm-Z's Avatar
Olm-Z Olm-Z is offline
Member
 
Join Date: Apr 2006
Location: Bxl - Be
Posts: 280
hummm... he seems to use some pose mode of bones in actions ... but I'm not sure about how to do it straight away ... I didn't knew you could reproduce de effects of bones on a mesh in a repeated way.. !
maybe a better explaining of the trick could be interresting ? I see this could be used fot lots on other "morphing" anims of landscape related fluxes, like rain or even... Borealis auroras ....
#15   Old 01-Feb-08, 23:23   
Reply With Quote
black reaper black reaper is offline
Member
 
Join Date: May 2007
Posts: 515
the movemet is not smooth even if its really nice. I think glsl shader is the best way to make realistic water effects and it don't use much cpu. I'll look some information about glsl water effect. ( real time ripples )
#16   Old 02-Feb-08, 01:33   
Reply With Quote
jplur's Avatar
jplur jplur is offline
Member
 
Join Date: Apr 2007
Location: Brooklyn baby!
Posts: 454
Olm-z said:
Quote:
I didn't knew you could reproduce de effects of bones on a mesh in a repeated way.. !
maybe a better explaining of the trick could be interresting ?
ha yeah sorry..

The armatures deform a mesh with named vertex groups, so you can duplicate a mesh object but have it still react to the original armature. (then I removed doubles so it was all one mesh)

black reaper said:
Quote:
the movemet is not smooth even if its really nice. I think glsl shader is the best way to make realistic water effects and it don't use much cpu. I'll look some information about glsl water effect. ( real time ripples )
Yes my waves could be smoother but thats my fault for not being patient with the animation cycle. But yes, please let us know anything you find out about GLSL shaders. I am looking for something that has simple ripples, and doesn't need dynamic lighting.
............................................
Blengband
Terra Sirenum
Space Explorer
Blendserve online game demo
#17   Old 02-Feb-08, 21:33   
Reply With Quote
Remmy Remmy is offline
Member
 
Join Date: Dec 2007
Posts: 201
Have you guys looked at Lumina? It's a GLSL shader dev environment (cross platform) that even has a blender exporter I believe.
#18   Old 02-Feb-08, 22:55   
Reply With Quote
black reaper black reaper is offline
Member
 
Join Date: May 2007
Posts: 515
if you want simple ripple you should just change the value of my script it should work
#19   Old 02-Feb-08, 23:05   
Reply With Quote
S_Cross S_Cross is offline
Member
 
Join Date: Apr 2007
Posts: 438
Here's a pretty good way to do water, clouds, fog, etc. It just uses a UV scrolling script and it's easy on the framerates. (I don't know who wrote the script). It's kinda dark but who cares. I used 2 planes for the water. Push the spacebar to make the first layer disappear and reappear. I also added moving clouds with the same script, but they aren't shown in the pic.

This isn't a very good example, and it needs to be tweaked. But I've made some fairly realistic looking water using this method before.
*


http://www.4shared.com/file/37227412...ified=88cef7e8
Attached Images
File Type: jpg water001.jpg (25.3 KB, 68 views)
#20   Old 08-Feb-08, 15:14   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 18:52.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists