Fluid Improvements
by Melv May · 07/11/2002 (10:29 am) · 78 comments
Download Code File
If you've not already seen it then you can see it here:
Shoreline#1
Shoreline#2
Shoreline#3
Shoreline#4
Shoreline#5
Dev Snapshot
Forum Thread
Some major improvements are:-
- Takes advantage of multiple texturing units on cards. Will reconfigure surface/environment/fog rendering for 2 TMU's or 4 TMU's automagically.
- No longer need to exit editor to change waterblock textures for surface/environment.
- Can move waterblock and apply alpha-map on the fly using the editor.
- Shallow/Depth alpha configurable.
- Water Surface Distortion function.
- Surface Parallax.
- Fluid Flow control.
- Seperate fluid Environment map for over/under surface
Please note that this superceeds the previous code snipit Improved Fluid Rendering and includes all of it's functionality except the underwater distortion texture.
You can also find some textures which I used in the "Dev Snapshot" here:
Wash#1
Wash#2
Enjoy everyone,
- Melv.
[EDIT] 27/08/2002
Completely revamped engine to include features listed above.
[EDIT] 31/08/2002
Removed some WIP code that was left in and was causing a texture manager error. Thanks to Chris Wilson for kindly pointing it out.
[EDIT] 8/9/2002
Fixed bug causing disconnect when *any* texture resources are not found.
[EDIT] 1/2/2003
Moved hosting web-site.
If you've not already seen it then you can see it here:
Shoreline#1
Shoreline#2
Shoreline#3
Shoreline#4
Shoreline#5
Dev Snapshot
Forum Thread
Some major improvements are:-
- Takes advantage of multiple texturing units on cards. Will reconfigure surface/environment/fog rendering for 2 TMU's or 4 TMU's automagically.
- No longer need to exit editor to change waterblock textures for surface/environment.
- Can move waterblock and apply alpha-map on the fly using the editor.
- Shallow/Depth alpha configurable.
- Water Surface Distortion function.
- Surface Parallax.
- Fluid Flow control.
- Seperate fluid Environment map for over/under surface
Please note that this superceeds the previous code snipit Improved Fluid Rendering and includes all of it's functionality except the underwater distortion texture.
You can also find some textures which I used in the "Dev Snapshot" here:
Wash#1
Wash#2
Enjoy everyone,
- Melv.
[EDIT] 27/08/2002
Completely revamped engine to include features listed above.
[EDIT] 31/08/2002
Removed some WIP code that was left in and was causing a texture manager error. Thanks to Chris Wilson for kindly pointing it out.
[EDIT] 8/9/2002
Fixed bug causing disconnect when *any* texture resources are not found.
[EDIT] 1/2/2003
Moved hosting web-site.
About the author
#22
http://www.elfstoneonline.com/torque/fluids.htm
Maybe you use PC byte order in the creation of the alpha maps and textures? Cause changing some of the values in WaterBlock::CalculateDepthMap (like mFluidColour, mMinColour, mMaxColour, etc) I get some (horrible but closer to the expected) results.
='( I want cool water effects like the PC guys!!!
07/14/2002 (4:28 am)
Well, now it doesn't crash, but it doesn't look right either. Im using a Mac with GeForce 2 MX card (that i think supports double pass multitexturing). I have checked it both in MacOS X and MacOS 9.http://www.elfstoneonline.com/torque/fluids.htm
Maybe you use PC byte order in the creation of the alpha maps and textures? Cause changing some of the values in WaterBlock::CalculateDepthMap (like mFluidColour, mMinColour, mMaxColour, etc) I get some (horrible but closer to the expected) results.
='( I want cool water effects like the PC guys!!!
#23
Does any one else have problems using the in game texture editor, especially after modifying code, it completly locks up the computer, no keyboard/mouse, but at least iTunes keeps playing :) Hurrah for Unix!
--mafoo
07/23/2002 (10:45 am)
Same thing on my Dual 1Ghz with GeForce 4 MX.Does any one else have problems using the in game texture editor, especially after modifying code, it completly locks up the computer, no keyboard/mouse, but at least iTunes keeps playing :) Hurrah for Unix!
--mafoo
#24
Awesome job, Melv! The water looks even better than it does in Halo! :)
07/23/2002 (4:58 pm)
The GF2 does not support double pass multi-texturing. You have to have a GF3+ or a Radeon 8500+ to get that, I believe.Awesome job, Melv! The water looks even better than it does in Halo! :)
#25
07/24/2002 (5:50 am)
Nice was looking for something like this!
#26
I *am* working on this, just busy as usual.
It certainly works much better now including minor fixes like making sure the environment map is the same as the skybox when reflected, before it was rotated 180deg!
Sorry it's taking so long guys but I should be up for a new release soon. 8)
- Melv.
07/24/2002 (11:12 pm)
Just to let you know...I *am* working on this, just busy as usual.
It certainly works much better now including minor fixes like making sure the environment map is the same as the skybox when reflected, before it was rotated 180deg!
Sorry it's taking so long guys but I should be up for a new release soon. 8)
- Melv.
#27
Just wondering if you were planning on posting your updated fluid version before you started on your foliage project.
Maybe you're still trying to recover from that party ;) I'm not going to get much done on the computer this week anyway. I don't have a roommate anymore, so I'm turning that room into a LAN computer office with a mini-bar :) Once I get that damn cigarette stench out, clean, and repaint. When I'm setup, I'll post a screenshot link.
-Sabrecyd
08/05/2002 (9:11 am)
Hey Melv,Just wondering if you were planning on posting your updated fluid version before you started on your foliage project.
Maybe you're still trying to recover from that party ;) I'm not going to get much done on the computer this week anyway. I don't have a roommate anymore, so I'm turning that room into a LAN computer office with a mini-bar :) Once I get that damn cigarette stench out, clean, and repaint. When I'm setup, I'll post a screenshot link.
-Sabrecyd
#28
I can work on both! ;)
Seriously though, I find if I mingle projects a little I get better ideas and more solid results.
I still intend to release it sometime this week.
- Melv.
08/05/2002 (11:29 am)
Sabrecyd,I can work on both! ;)
Seriously though, I find if I mingle projects a little I get better ideas and more solid results.
I still intend to release it sometime this week.
- Melv.
#29
08/05/2002 (11:43 am)
Oh yeah, you have off all week to play around with stuff don't you - oops, should say that a little more quietly...don't want the girlfriend to hear. She'd probably just want to waste time going out to eat or something ;)
#31
08/17/2002 (5:10 am)
Anyone had problems with use getEyeTransformations using this? I noticed that if I deleted the waterblock the eye transformations return to normal lol.
#32
Does the standard waterblock have the same effect?
Also, when you say they return to normal, what exactly is abnormal? Are you getting trashed transforms or something?
- Melv.
08/17/2002 (8:43 am)
getEyeTransform has *nothing* to do with the waterBlocks so I find it difficult to believe that this changes anything. Also, don't forget that all I'm doing is rendering the water differenty. I've not hacked up the engine or rearranged the way it interacts at all, it's all exactly the same.Does the standard waterblock have the same effect?
Also, when you say they return to normal, what exactly is abnormal? Are you getting trashed transforms or something?
- Melv.
#33
Well, i'm not sure about the old waterblock but by wierd eyetransformations I get something like this: I used an item to know the prob)
I got my eyetransformation, and then I set an item to it's location. The z part of it was right, but then the item was like 3 meteres from my head lol.
So I took the waterblock out, saved, rejoined and it worked fine :/
08/17/2002 (4:11 pm)
(sorry I wrote this post at like 6 in the monring lol) Well, i'm not sure about the old waterblock but by wierd eyetransformations I get something like this: I used an item to know the prob)
I got my eyetransformation, and then I set an item to it's location. The z part of it was right, but then the item was like 3 meteres from my head lol.
So I took the waterblock out, saved, rejoined and it worked fine :/
#34
08/17/2002 (4:14 pm)
Hmm ... on second thought ... maybe it's because the game isnt liking how water can be stretched infinitly and its messing up the eyetransform ... darnit I wish I knew enough to even really ask for help lol
#35
- Melv.
08/17/2002 (4:20 pm)
Try a general post in the forum Trevor. I'd be glad to help if I know how.- Melv.
#36
Melv May said:
Features now working:-
- Seperate deep fluid / shore textures.
- Distortion control.
- Seperate over / under fluid environmap textures.
- Flow control (for flowing fluids).
- Much simpler shore gradient control.
- Surface / Shore texture tessellation control.
- Surface Parallax control.
- Shoreline depth control.
- Min/Max shoreline alpha control.
- Multi-texture support (upto 4 tmus').
Wow! Those are really neat. Do they require a higher end video card like a GeForce3?
08/26/2002 (9:12 am)
I moved back over here to try to keep some sort of order. ;-) hope ya don't mind.Melv May said:
Features now working:-
- Seperate deep fluid / shore textures.
- Distortion control.
- Seperate over / under fluid environmap textures.
- Flow control (for flowing fluids).
- Much simpler shore gradient control.
- Surface / Shore texture tessellation control.
- Surface Parallax control.
- Shoreline depth control.
- Min/Max shoreline alpha control.
- Multi-texture support (upto 4 tmus').
Wow! Those are really neat. Do they require a higher end video card like a GeForce3?
#37
The kind of things I could do with a shader system is sickening but for the moment we will have to put up with distorting the surface using the CPU rather than the GPU. :(
All you need is multi-texture support which just about covers most decent cards. I take advantage of upto 4 tmus so if you have a geForce4 etc then you will get much better performance.
- Melv.
08/26/2002 (10:11 am)
Not really, I'm not using shaders or anything fancy because we don't have a system for it yet.The kind of things I could do with a shader system is sickening but for the moment we will have to put up with distorting the surface using the CPU rather than the GPU. :(
All you need is multi-texture support which just about covers most decent cards. I take advantage of upto 4 tmus so if you have a geForce4 etc then you will get much better performance.
- Melv.
#38
It just looks sooooo much nicer than the current system. lol.
08/26/2002 (10:15 am)
Ahh... I've got a Radeon 7200, which is multi-texture. So, I wouldn't see much of a performance hit?It just looks sooooo much nicer than the current system. lol.
#39
Nice work thus far, melv's stuff is now becoming a reguluar in games lol.
08/26/2002 (10:20 am)
hey melv, I know your REALLY good with math, so you know what I wouldnt mind seeing as an addon sometime: some sort of a wave/ripple effect on the surface of the water when you walk through it, and the size and speed determined by how fast you walk/hit the water.Nice work thus far, melv's stuff is now becoming a reguluar in games lol.
#40
In terms of performance, it's pretty much the same as the current release. Yes, I am adding more texturing but the benefit of doing it using multi-texturing balances out the performance.
I can *guarantee* that I will release it in the next few days. Latest tuesday, as I cannot do much more without shaders.
I will try to get it done tonight though, we shall see. ;)
- Melv.
08/26/2002 (10:21 am)
Eric,In terms of performance, it's pretty much the same as the current release. Yes, I am adding more texturing but the benefit of doing it using multi-texturing balances out the performance.
I can *guarantee* that I will release it in the next few days. Latest tuesday, as I cannot do much more without shaders.
I will try to get it done tonight though, we shall see. ;)
- Melv.

Associate Melv May
You do need to tweak it to get it looking correct. Most cases can be sorted with the correct settings although you may have difficulty getting steep terrain and shallow terrain working together.
It's certainly not a stick it in a leave it effect so I'm looking at an algorithm that will automagically work with few settings today.
Again, pleased to see you running with it. ;)
- Melv.