Game Development Community

Water Rendering Question

by Robert Blanchet Jr. · in Torque Game Engine · 07/26/2002 (11:01 pm) · 6 replies

Hopefully someone will come to my rescue on this one :/

Is there a simple way to temporarily stop the engine from culling the water from the scene, and essentially just turning it into fog, after a certain distance?

The reason I ask is because I'm continueing work on my map view code and noticed that the engine is replacing all water with a dense fog because of the height at which I set the camera at to view the terrain.

You can see this happening in the pic here

This is the water world mission. As you can see the water was culled from the scene and replaced with fog.

What I need is a way to temporarily stop that from happening. Any clues?

Thanks in advance.

#1
07/27/2002 (9:19 am)
What is the fog distance with respect to the view distance?
#2
07/27/2002 (9:35 am)
In the renderWorld function I'm setting the visibile distance to 99999.0f via
gClientSceneGraph->setVisibleDistance(99999.0f);

I'm not adjusting the fog distance and didn't know that I could. Should I try this as well and see what happens?
#3
07/27/2002 (10:09 am)
I set the visible distance value back down to default values and set the height of the camera close to the terrain and the water is still showing up as fog, which shouldn't happen since I'm so close to the terrain.. so there is something else wrong :/
#4
07/27/2002 (11:09 am)
Ok, the engine isn't replacing the water with fog. This fog was placed there in the mission editor as a fog volume, to add thickness or density to the water I suppose.

I checked this by nulling all of the fog volumes in gClientSceneGraph which then removed the fog from my view.

This means the engine isn't rendering the water at all for whatever reason.

How I'm rendering this view is placing a call to gClientSceneGraph->renderScene() within renderWorld. Maybe I have to do an extra step to get water working?

I'm also setting a renderMask which I pass to renderScene. I was told this mask stops certain object types from being rendered. This mask is
const U32 renderMask = (StaticObjectType    | DecalManagerObjectType | 
						CameraObjectType    | StaticShapeObjectType  | 
			            PlayerObjectType    | ItemObjectType         | 
						VehicleObjectType   | ProjectileObjectType   | 
						ExplosionObjectType | CorpseObjectType       | 
						DebrisObjectType    | StaticTSObjectType);

Unless water falls under one of those types I don't understand why it wouldn't be rendering.
#5
07/27/2002 (11:10 am)
i have a map with no fog if thats what you are tring to do

www.planetquake.com/noescape/dev1/ss2.jpg




new Sky(Sky) {
position = "336 136 0";
rotation = "1 0 0 0";
scale = "1 1 1";
cloudHeightPer[0] = "0";
cloudHeightPer[1] = "0";
cloudHeightPer[2] = "0";
cloudSpeed1 = "0.0001";
cloudSpeed2 = "0.0002";
cloudSpeed3 = "0.0003";
visibleDistance = "5000";
useSkyTextures = "1";
renderBottomTexture = "0";
SkySolidColor = "0.113000 0.148000 0.215000 0.000000";
fogDistance = "250";
fogColor = "0.000000 0.000000 0.000000 0.000000";
fogVolume1 = "-1 1.76284e+014 3396.58";
fogVolume2 = "-1 0.118186 0.0824615";
fogVolume3 = "-1 -0.118186 0.0578767";
materialList = "~/data/darkskies/sky_sunset.dml";
windVelocity = "1 0 0";
windEffectPrecipitation = "0";
fogVolumeColor1 = "128.000000 128.000000 128.000000 -0.082462";
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
fogVolumeColor3 = "128.000000 128.000000 128.000000 -0.118186";
locked = "true";
};
#6
07/27/2002 (11:20 am)
Ahh, I figured it out. The renderMask will render only those things listed. I had it backwards :)

This is what I need :)