Water transparency/clarity question
by deepscratch · in Torque Game Engine Advanced · 12/16/2008 (1:25 pm) · 7 replies
Hi all,
how can I get water to render like swimming pool or bath clear? (want to see underwater objects better when standing dockside)
ta.
how can I get water to render like swimming pool or bath clear? (want to see underwater objects better when standing dockside)
ta.
About the author
email me at medan121@gmail.com
Recent Threads
#2
Also - Adjust the clarity. Higher values make the water clearer. A value of 1 is a good starting point.
12/17/2008 (7:42 am)
@Deepscratch:Also - Adjust the clarity. Higher values make the water clearer. A value of 1 is a good starting point.
#3
how/where would I find the water type settings? it is in fact a lake.
@Jaimi,
that seems to work ok.
12/17/2008 (8:20 am)
@Mike,how/where would I find the water type settings? it is in fact a lake.
@Jaimi,
that seems to work ok.
#4
If you don't have a LakeWater material already, lets create one. Open up ScriptsAndAssets/data/water/materials.cs, and add a new material:
// Main 2.0 water surface
new CustomMaterial( LakeWater )
{
texture[0] = "noise01";
texture[1] = "$reflectbuff";
texture[2] = "$backbuff";
texture[3] = "$fog";
texture[4] = "$cubemap";
cubemap = Sky_Day_Blur02;
shader = WaterCubeReflectRefract;
specular = "0.75 0.75 0.75 1.0";
specularPower = 48.0;
fallback = WaterFallback1_1;
version = 2.0;
};
Note that the only change from the default water material, is that I changed the "noise02" (which is super-turbulent) to "noise01", which is even less so. These normal maps are the same directory as the materials.cs file. You could also use noise03, which is much less turbulent.
Now that you've created the material, go into the editor, and use the inspector to change the material on your waterblock to LakeWater, and then save your mission. (The change didn't take effect on me until I saved, and reloaded).
12/17/2008 (8:35 am)
@Deepscratch:If you don't have a LakeWater material already, lets create one. Open up ScriptsAndAssets/data/water/materials.cs, and add a new material:
// Main 2.0 water surface
new CustomMaterial( LakeWater )
{
texture[0] = "noise01";
texture[1] = "$reflectbuff";
texture[2] = "$backbuff";
texture[3] = "$fog";
texture[4] = "$cubemap";
cubemap = Sky_Day_Blur02;
shader = WaterCubeReflectRefract;
specular = "0.75 0.75 0.75 1.0";
specularPower = 48.0;
fallback = WaterFallback1_1;
version = 2.0;
};
Note that the only change from the default water material, is that I changed the "noise02" (which is super-turbulent) to "noise01", which is even less so. These normal maps are the same directory as the materials.cs file. You could also use noise03, which is much less turbulent.
Now that you've created the material, go into the editor, and use the inspector to change the material on your waterblock to LakeWater, and then save your mission. (The change didn't take effect on me until I saved, and reloaded).
#5
thank you very very much,
not only has that helped this problem,
but enlightened me to the materials and shaders system a whole lot more.
cheers.
now to work out how to get that cool ripple effect when one walks or swims in the water...
12/17/2008 (1:11 pm)
@jaimi,thank you very very much,
not only has that helped this problem,
but enlightened me to the materials and shaders system a whole lot more.
cheers.
now to work out how to get that cool ripple effect when one walks or swims in the water...
#6
First, you need to get this - it has most of the particles set up for you already:
www.garagegames.com/products/104/
Then, you need to add the aligned particles resource, if you haven't already:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=15494
First, I created a modified version of the wake emitter from the env pack, and named my modified version "SmallWakeEmitter". I then create a modified version of the MillSplashEmitter, and named mine "MillSplashTinyEmitter". (as you can tell by the naming, I mostly just made the effects smaller).
Once you do that, go to your player.cs file -- the one that contains your playerdata datablock. (Depending on which starter game you used, this can be in different places and named different things - I based my start on T3D, so my player.cs is in ScriptsAndAssets/Server/Scripts/Players, and my base player datablock is playerdata.) Modify the splashemitters in the datablock like this:
splashEmitter[0] = MillSplashTinyEmitter;//PlayerFoamDropletsEmitter;
splashEmitter[1] = SmallWakeEmitter;//PlayerFoamEmitter;
splashEmitter[2] = SmallWakeEmitter;//PlayerBubbleEmitter;
Now, you should have wakes and splashes when you walk in the water. My Swimming was from the Torque Motion Pack - and I needed to modify it for "treading water" when you were still (look at the code where it is deciding to emit the particles if you are in the water).
12/17/2008 (1:28 pm)
Quote:now to work out how to get that cool ripple effect when one walks or swims in the water...
First, you need to get this - it has most of the particles set up for you already:
www.garagegames.com/products/104/
Then, you need to add the aligned particles resource, if you haven't already:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=15494
First, I created a modified version of the wake emitter from the env pack, and named my modified version "SmallWakeEmitter". I then create a modified version of the MillSplashEmitter, and named mine "MillSplashTinyEmitter". (as you can tell by the naming, I mostly just made the effects smaller).
Once you do that, go to your player.cs file -- the one that contains your playerdata datablock. (Depending on which starter game you used, this can be in different places and named different things - I based my start on T3D, so my player.cs is in ScriptsAndAssets/Server/Scripts/Players, and my base player datablock is playerdata.) Modify the splashemitters in the datablock like this:
splashEmitter[0] = MillSplashTinyEmitter;//PlayerFoamDropletsEmitter;
splashEmitter[1] = SmallWakeEmitter;//PlayerFoamEmitter;
splashEmitter[2] = SmallWakeEmitter;//PlayerBubbleEmitter;
Now, you should have wakes and splashes when you walk in the water. My Swimming was from the Torque Motion Pack - and I needed to modify it for "treading water" when you were still (look at the code where it is deciding to emit the particles if you are in the water).
#7
I did the particle alignment, purchased the pack, copied those datablocks to player.cs, changed the names to ID them to player, ran game, no errors in console, but, the effects dont show.
what could I be doing wrong?
12/18/2008 (12:35 pm)
Hi Jaimi,I did the particle alignment, purchased the pack, copied those datablocks to player.cs, changed the names to ID them to player, ran game, no errors in console, but, the effects dont show.
what could I be doing wrong?
Torque Owner Mike Rowley
Mike Rowley