Class WaterSurface
Water surface component.
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class WaterSurface : MonoBehaviour, IVersionable<WaterSurface.Version>, ISerializationCallbackReceiver
Fields
Name | Description |
---|---|
absorptionDistance | Controls the approximative distance in meters that the camera can perceive through a water surface. This distance can vary widely depending on the intensity of the light the object receives. |
absorptionDistanceMultiplier | Sets the multiplier for the Absorption Distance when the camera is underwater. A value of 2.0 means you will see twice as far underwater. |
ambientScattering | Controls the intensity of the ambient scattering term. This can be adjusted for artistic purposes. |
caustics | When enabled, the water surface will render caustics. |
causticsBand | Controls which band is used for the caustics evaluation. |
causticsDirectionalShadow | When enabled, the water caustics will take into account the directional light's shadow. |
causticsDirectionalShadowDimmer | Sets the water caustics dimmer value for the directional shadow. |
causticsIntensity | Sets the intensity of the under-water caustics. |
causticsPlaneBlendDistance | Sets the vertical blending distance for the water caustics. |
causticsResolution | Specifies the resolution at which the water caustics are rendered (simulation only). |
causticsTilingFactor | Sets a tiling factor for the water caustics. |
colorPyramidOffset | Sets the offset used to evaluated the underwater refraction. Higher values produce blurrier results but introduce aliasing artifacts. |
cpuEvaluateRipples | Specifies if the CPU simulation should evaluate the ripples as part of the simulation. Including ripples will allow a higher visual fidelity but the cost of the simulation will increase. |
cpuFullResolution | Specifies if the CPU simulation should be evaluated at full or half resolution. When in full resolution, the visual fidelity will be higher but the cost of the simulation will increase. |
cpuSimulation | When enabled, HDRP will evaluate the water simulation on the CPU for C# script requests. Enabling this will significantly increase the CPU cost of the feature. |
currentDebugMultiplier | Sets a multiplier for the arrow density in the current debug mode. |
customMaterial | Sets a custom material that will be used to render the water surface. If set to None a default material is used. |
debugMode | Sets the debug mode for a given water surface. |
decalLayerMask | Specifies the decal layers that affect the water surface. |
deformation | Specifies if the water surfaces supports local deformations. |
deformationAreaOffset | Specified the offset of the deformation area in meters. |
deformationAreaSize | Specified the size of the deformation area in meters. |
deformationRes | Specifies the resolution of the deformation texture used to represent the deformation area. |
directLightBodyScattering | Controls the intensity of the direct light scattering on the body of the waves. The effect is more perceivable at grazing angles. |
directLightTipScattering | Controls the intensity of the direct light scattering on the tip of the waves. The effect is more perceivable at grazing angles. |
displacementScattering | Controls the intensity of the displacement based scattering. The bigger horizontal displacement, the more the water receives scattering. This can be adjusted for artistic purposes. |
endSmoothness | |
foam | Specifies if the water surfaces support foam rendering. |
foamAreaOffset | Specifies the offset of the foam area in meters. |
foamAreaSize | Specifies the size of the foam area in meters. |
foamColor | Set the foam color. |
foamPersistenceMultiplier | Specifies the foam persistence multiplier. A higher value will lead to the foam remaining visible longer. |
foamResolution | Specifies the resolution of the foam texture. |
foamSmoothness | Controls the surface foam smoothness. |
foamTextureTiling | Set the per meter tiling for the foam texture. |
geometryType | Specifies the type of geometry used to render the water surface. |
heightScattering | Controls the intensity of the height based scattering. The higher the vertical displacement, the more the water receives scattering. This can be adjusted for artistic purposes. |
largeBand0FadeDistance | |
largeBand0FadeMode | |
largeBand0FadeStart | |
largeBand0FadeToggle | |
largeBand0Multiplier | |
largeBand1FadeDistance | |
largeBand1FadeMode | |
largeBand1FadeStart | |
largeBand1FadeToggle | |
largeBand1Multiplier | |
largeChaos | |
largeCurrentMap | |
largeCurrentMapInfluence | |
largeCurrentRegionExtent | |
largeCurrentRegionOffset | |
largeCurrentSpeedValue | |
largeOrientationValue | |
largeWindSpeed | |
lightLayerMask | Specifies the light layers that affect the water surface. |
maxRefractionDistance | Controls the maximum distance in meters used to clamp the underwater refraction depth. Higher value increases the distortion amount. |
maximumHeightOverride | Specifies a maximum wave height that overrides the simulation to support scattering properly for deformers. |
meshRenderers | Sets the geometry to use when rendering in quad and custom geometry type mode. The vertical position of the vertices will be overridden to keep the surface of water leveled. |
refractionColor | Sets the color that is used to simulate the under-water refraction. |
renderingLayerMask | Specifies the rendering layers that affect the water surface. |
repetitionSize | |
ripples | When enabled, the water system allows you to simulate and render a ripples simulation for finer details. |
ripplesChaos | |
ripplesCurrentMap | |
ripplesCurrentMapInfluence | |
ripplesCurrentRegionExtent | |
ripplesCurrentRegionOffset | |
ripplesCurrentSpeedValue | |
ripplesFadeDistance | |
ripplesFadeMode | |
ripplesFadeStart | |
ripplesFadeToggle | |
ripplesMotionMode | |
ripplesOrientationValue | |
ripplesWindSpeed | |
scatteringColor | Sets the color that is used to simulate the water light scattering. |
simulationFoam | When enabled, the water surface will receive foam from the simulation on the crest of the waves. |
simulationFoamAmount | Controls the simulation foam amount. Higher values generate larger foam patches. Foam presence is highly dependent on the wind speed and choppiness values. |
simulationFoamMask | Set the texture used to attenuate or suppress the simulation foam. |
simulationFoamMaskExtent | Sets the extent of the foam mask in meters. |
simulationFoamMaskOffset | Sets the offset of the foam mask in meters. |
simulationFoamWindCurve | Controls the simulation foam amount depending on the wind speed. |
smoothnessFadeDistance | |
smoothnessFadeStart | |
startSmoothness | |
surfaceType | Specifies the nature of the water body that the water system needs to simulate. |
timeMultiplier | Sets the speed of the water simulation. This allows to slow down the waves' speed or to accelerate it. |
underWater | When enabled, HDRP will apply a fog and color shift to the final image when the camera is under the surface. This feature has a cost even when the camera is above the water surface. |
underWaterAmbientProbeContribution | Sets the contribution of the ambient probe luminance when multiplied by the underwater scattering color. |
underWaterRefraction | Determines if water surface should refract light when looking at objects from underwater. This simulates the correct behavior of water but may introduce visual artifacts as it relies on screen space refraction. |
underWaterScatteringColor | Sets the color that is used to simulate the scattering when the camera is under-water. |
underWaterScatteringColorMode | Sets how the underwater scattering color is specified. |
virtualPlaneDistance | Sets the distance at which the simulated caustics are projected. High values generate sharper caustics but can cause artifacts. |
volumeBounds | Sets a box collider that will be used to define the volume where the underwater effect is applied for non infinite surfaces. |
volumeDepth | Sets maximum depth at which the underwater effect is evaluated for infinite surfaces. |
volumeHeight | Sets the maximum height at which the underwater effect is evaluated for infinite surfaces. This allows to cover the underwater scenario when deformers are higher than waves or ripples. |
volumePrority | Sets a priority value that is used to define which surface should be considered for underwater rendering in the case of multiple overlapping surfaces. |
waterCurrentDebugMode | Sets the water current debug mode for a given water surface. |
waterFoamDebugMode | Sets the water foam debug mode for a given water surface. |
waterMask | Sets the texture used to attenuate or suppress the swell, agitation and ripples water frequencies. |
waterMaskDebugMode | Sets the water mask debug mode for a given water surface. |
waterMaskExtent | Sets the extent of the water mask in meters. |
waterMaskOffset | Sets the offset of the water mask in meters. |
waterMaskRemap | Sets the remapped range of the water mask. |
Properties
Name | Description |
---|---|
simulationStart | Used to sync different water surfaces simulation time, for example across network. |
Methods
Name | Description |
---|---|
FillWaterSearchData(ref WaterSimSearchData) | Function that fills a WaterSimSearchData with the data of the current water surface. |
GetCausticsBuffer(out float) | Function that returns the caustics buffer for the water surface. If the feature is disabled or the resource is not available the function returns null. |
GetFoamBuffer(out Vector2) | Function that returns the foam buffer for the water surface. If the feature is disabled or the resource is not available the function returns null. |
GetSimulationResolutionCPU() | Function that returns the water surface CPU simulation resolution. |
ProjectPointOnWaterSurface(WaterSearchParameters, out WaterSearchResult) | Function that attempts to evaluate the projection of a given world space position onto the water surface. This requires the HDRP asset and the water surface to have script interactions enabled. |