Torque 3D - Script Manual: WaterObject Class Reference

TorqueScript

Main   Class List   Namespace List   Online

WaterObject Class Reference
[Water]

Abstract base class for representing a body of water. More...

Inheritance diagram for WaterObject:

List of all members.

Public Attributes

WaterObject

ColorI baseColor
 Changes color of water fog.
float density
 Affects buoyancy of an object, thus affecting the Z velocity of a player (jumping, falling, etc.
bool emissive
 When true the water colors don't react to changes to environment lighting.
float foamAmbientLerp
Point2F foamDir [2]
float foamMaxDepth
float foamOpacity [2]
float foamRippleInfluence
float foamSpeed [2]
filename foamTex
 Diffuse texture for foam in shallow water (advanced lighting only).
Point2F foamTexScale [2]
 applied to the surface.
float fresnelBias
 Extent of fresnel affecting reflection fogging.
float fresnelPower
 Measures intensity of affect on reflection based on fogging.
string liquidType
 Liquid type of WaterBlock, such as water, ocean, lava Currently only Water is defined and used.
float overallFoamOpacity
float overallRippleMagnitude
 Master variable affecting entire surface.
float overallWaveMagnitude
 Master variable affecting entire body of water's undulation.
Point2F rippleDir [3]
 Modifies the direction of ripples on the surface.
float rippleMagnitude [3]
 Intensifies the vertext modification of the surface.
float rippleSpeed [3]
 Modifies speed of surface ripples.
filename rippleTex
 Normal map used to simulate small surface ripples.
Point2F rippleTexScale [3]
 Intensifies the affect of the normal map applied to the surface.
ColorF specularColor
 Color used for specularity on the water surface ( sun only ).
float specularPower
 Power used for specularity on the water surface ( sun only ).
float viscosity
 Affects drag force applied to an object submerged in this container.
Point2F waveDir [3]
 Direction waves flow toward shores.
float waveMagnitude [3]
 Height of water undulation.
float waveSpeed [3]
 Speed of water undulation.
Basic Lighting

float clarity
 Relative opacity or transparency of the water surface.
ColorI underwaterColor
 Changes the color shading of objects beneath the water surface.
Reflect

string cubemap
 Cubemap used instead of reflection texture if fullReflect is off.
bool fullReflect
 Enables dynamic reflection rendering.
float reflectDetailAdjust
 scale up or down the detail level for objects rendered in a reflection
float reflectivity
 Overall scalar to the reflectivity of the water surface.
int reflectMaxRateMs
 Affects the sort time of reflected objects.
bool reflectNormalUp
 always use z up as the reflection normal
float reflectPriority
 Affects the sort order of reflected objects.
int reflectTexSize
 The texture size used for reflections (square).
bool useOcclusionQuery
 turn off reflection rendering when occluded (delayed).
Misc

float depthGradientMax
 Depth in world units, the max range of the color gradient texture.
filename depthGradientTex
 1D texture defining the base water color by depth
Distortion

float distortEndDist
 Max distance that distortion algorithm is performed. The lower, the more distorted the effect.
float distortFullDepth
 Determines the scaling down of distortion in shallow water.
float distortStartDist
 Determines start of distortion effect where water surface intersects the camera near plane.
Sound

SFXAmbience soundAmbience
 Ambient sound environment when listener is submerged.
Underwater Fogging

float waterFogDensity
 Intensity of underwater fogging.
float waterFogDensityOffset
 Delta, or limit, applied to waterFogDensity.
float wetDarkening
 The refract color intensity scaled at wetDepth.
float wetDepth
 The depth in world units at which full darkening will be received, giving a wet look to objects underwater.

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.
static bool wireframe
 If true, will render the wireframe of the WaterObject.

Detailed Description

Abstract base class for representing a body of water.

WaterObject is abstract and may not be created. It defines functionality shared by its derived classes.

WaterObject exposes many fields for controlling it visual quality.

WaterObject surface rendering has the following general features:

  • Waves represented by vertex undulation and user paramaters.
  • Ripples represented by a normal map and user parameters.
  • Refraction of underwater objects.
  • Dynamic planar reflection or static cubemap reflection.
  • Paramable water fog and color shift.

It will, however, look significantly different depending on the LightingManager that is active. With Basic Lighting, we do not have a prepass texture to lookup per-pixel depth and therefore cannot use our rendering techniques that depend on it.

In particular, the following field groups are not used under Basic Lighting:

  • Underwater Fogging
  • Misc
  • Distortion
  • And foam related fields under the WaterObject group.

WaterObject also defines several fields for gameplay use and objects that support buoyancy.


Member Data Documentation

Changes color of water fog.

Relative opacity or transparency of the water surface.

Cubemap used instead of reflection texture if fullReflect is off.

Affects buoyancy of an object, thus affecting the Z velocity of a player (jumping, falling, etc.

Depth in world units, the max range of the color gradient texture.

1D texture defining the base water color by depth

Max distance that distortion algorithm is performed. The lower, the more distorted the effect.

Determines the scaling down of distortion in shallow water.

Determines start of distortion effect where water surface intersects the camera near plane.

When true the water colors don't react to changes to environment lighting.

Diffuse texture for foam in shallow water (advanced lighting only).

applied to the surface.

Extent of fresnel affecting reflection fogging.

Measures intensity of affect on reflection based on fogging.

Enables dynamic reflection rendering.

Liquid type of WaterBlock, such as water, ocean, lava Currently only Water is defined and used.

Master variable affecting entire surface.

Master variable affecting entire body of water's undulation.

scale up or down the detail level for objects rendered in a reflection

Overall scalar to the reflectivity of the water surface.

Affects the sort time of reflected objects.

always use z up as the reflection normal

Affects the sort order of reflected objects.

The texture size used for reflections (square).

Modifies the direction of ripples on the surface.

Intensifies the vertext modification of the surface.

Modifies speed of surface ripples.

Normal map used to simulate small surface ripples.

Intensifies the affect of the normal map applied to the surface.

Ambient sound environment when listener is submerged.

Color used for specularity on the water surface ( sun only ).

Power used for specularity on the water surface ( sun only ).

Changes the color shading of objects beneath the water surface.

turn off reflection rendering when occluded (delayed).

Affects drag force applied to an object submerged in this container.

Intensity of underwater fogging.

Delta, or limit, applied to waterFogDensity.

Direction waves flow toward shores.

Height of water undulation.

Speed of water undulation.

The refract color intensity scaled at wetDepth.

The depth in world units at which full darkening will be received, giving a wet look to objects underwater.



Copyright © GarageGames, LLC. All Rights Reserved.