docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class WaterSurface

    Water surface component.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    WaterSurface
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.GetComponentIndex()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Rendering.HighDefinition
    Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
    Syntax
    [DisallowMultipleComponent]
    [ExecuteInEditMode]
    public class WaterSurface : MonoBehaviour

    Fields

    absorbtionDistanceMultiplier

    Sets the multiplier for the Absorption Distance when the camera is under water. A value of 2.0 means you will see twice as far underwater.

    Declaration
    [Tooltip("Sets the multiplier for the  Absorption Distance when the camera is under water. A value of 2.0 means you will see twice as far underwater.")]
    public float absorbtionDistanceMultiplier
    Field Value
    Type Description
    float

    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.

    Declaration
    [Tooltip("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.")]
    public float absorptionDistance
    Field Value
    Type Description
    float

    ambientScattering

    Controls the intensity of the ambient scattering term. This can be adjusted for artistic purposes.

    Declaration
    [Tooltip("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.")]
    public float ambientScattering
    Field Value
    Type Description
    float

    caustics

    When enabled, the water surface will render caustics.

    Declaration
    [Tooltip("When enabled, the water surface will render caustics.")]
    public bool caustics
    Field Value
    Type Description
    bool

    causticsBand

    Controls which band is used for the caustics evaluation.

    Declaration
    [Tooltip("Controls which band is used for the caustics evaluation.")]
    public int causticsBand
    Field Value
    Type Description
    int

    causticsIntensity

    Sets the intensity of the under-water caustics.

    Declaration
    [Tooltip("Sets the intensity of the under-water caustics.")]
    public float causticsIntensity
    Field Value
    Type Description
    float

    causticsPlaneBlendDistance

    Sets the vertical blending distance for the water caustics.

    Declaration
    [Tooltip("Sets the vertical blending distance for the water caustics.")]
    public float causticsPlaneBlendDistance
    Field Value
    Type Description
    float

    causticsResolution

    Specifies the resolution at which the water caustics are rendered (simulation only).

    Declaration
    [Tooltip("Specifies the resolution at which the water caustics are rendered (simulation only).")]
    public WaterSurface.WaterCausticsResolution causticsResolution
    Field Value
    Type Description
    WaterSurface.WaterCausticsResolution

    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.

    Declaration
    public bool cpuEvaluateRipples
    Field Value
    Type Description
    bool

    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.

    Declaration
    public bool cpuFullResolution
    Field Value
    Type Description
    bool

    cpuSimulation

    When enabled, HDRP will evaluate the water simulation on the CPU for C# script height requests. Enabling this will significantly increase the CPU cost of the feature.

    Declaration
    public bool cpuSimulation
    Field Value
    Type Description
    bool

    customMaterial

    Sets a custom material that will be used to render the water surface. If set to None a default material is used.

    Declaration
    public Material customMaterial
    Field Value
    Type Description
    Material

    decalLayerMask

    Specifies the decal layers that affect the water surface.

    Declaration
    [Tooltip("Specifies the decal layers that affect the water surface.")]
    public DecalLayerEnum decalLayerMask
    Field Value
    Type Description
    DecalLayerEnum

    directLightBodyScattering

    Controls the intensity of the direct light scattering on the body of the waves. The effect is more perceivable at grazing angles.

    Declaration
    [Tooltip("Controls the intensity of the direct light scattering on the body of the waves. The effect is more perceivable at grazing angles.")]
    public float directLightBodyScattering
    Field Value
    Type Description
    float

    directLightTipScattering

    Controls the intensity of the direct light scattering on the tip of the waves. The effect is more perceivable at grazing angles.

    Declaration
    [Tooltip("Controls the intensity of the direct light scattering on the tip of the waves. The effect is more perceivable at grazing angles.")]
    public float directLightTipScattering
    Field Value
    Type Description
    float

    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.

    Declaration
    [Tooltip("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.")]
    public float displacementScattering
    Field Value
    Type Description
    float

    endSmoothness

    Declaration
    [Tooltip("")]
    public float endSmoothness
    Field Value
    Type Description
    float

    foam

    Declaration
    [Tooltip("")]
    public bool foam
    Field Value
    Type Description
    bool

    foamMask

    Set the texture used to attenuate or suppress the simulation foam.

    Declaration
    public Texture2D foamMask
    Field Value
    Type Description
    Texture2D

    foamMaskExtent

    Sets the extent of the foam mask in meters.

    Declaration
    [Tooltip("Sets the extent of the foam mask in meters.")]
    public Vector2 foamMaskExtent
    Field Value
    Type Description
    Vector2

    foamMaskOffset

    Sets the offset of the foam mask in meters.

    Declaration
    [Tooltip("Sets the offset of the foam mask in meters.")]
    public Vector2 foamMaskOffset
    Field Value
    Type Description
    Vector2

    foamTexture

    Set the texture used to attenuate or suppress the simulation foam.

    Declaration
    [Tooltip("Set the texture used to attenuate or suppress the simulation foam.")]
    public Texture2D foamTexture
    Field Value
    Type Description
    Texture2D

    foamTextureTiling

    Set the per meter tiling for the foam texture.

    Declaration
    [Tooltip("Set the per meter tiling for the foam texture.")]
    public float foamTextureTiling
    Field Value
    Type Description
    float

    geometryType

    Specifies the type of geometry used to render the water surface.

    Declaration
    public WaterGeometryType geometryType
    Field Value
    Type Description
    WaterGeometryType

    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.

    Declaration
    [Tooltip("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.")]
    public float heightScattering
    Field Value
    Type Description
    float

    largeBand0FadeDistance

    Declaration
    [Tooltip("")]
    public float largeBand0FadeDistance
    Field Value
    Type Description
    float

    largeBand0FadeStart

    Declaration
    [Tooltip("")]
    public float largeBand0FadeStart
    Field Value
    Type Description
    float

    largeBand0FadeToggle

    Declaration
    public bool largeBand0FadeToggle
    Field Value
    Type Description
    bool

    largeBand0Multiplier

    Declaration
    public float largeBand0Multiplier
    Field Value
    Type Description
    float

    largeBand1FadeDistance

    Declaration
    [Tooltip("")]
    public float largeBand1FadeDistance
    Field Value
    Type Description
    float

    largeBand1FadeStart

    Declaration
    [Tooltip("")]
    public float largeBand1FadeStart
    Field Value
    Type Description
    float

    largeBand1FadeToggle

    Declaration
    [Tooltip("")]
    public bool largeBand1FadeToggle
    Field Value
    Type Description
    bool

    largeBand1Multiplier

    Declaration
    [Tooltip("")]
    public float largeBand1Multiplier
    Field Value
    Type Description
    float

    largeChaos

    Declaration
    public float largeChaos
    Field Value
    Type Description
    float

    largeCurrentOrientationValue

    Declaration
    public float largeCurrentOrientationValue
    Field Value
    Type Description
    float

    largeCurrentSpeedValue

    Declaration
    public float largeCurrentSpeedValue
    Field Value
    Type Description
    float

    largeWindOrientationValue

    Declaration
    public float largeWindOrientationValue
    Field Value
    Type Description
    float

    largeWindSpeed

    Declaration
    public float largeWindSpeed
    Field Value
    Type Description
    float

    lightLayerMask

    Specifies the light layers that affect the water surface.

    Declaration
    [Tooltip("Specifies the light layers that affect the water surface.")]
    public LightLayerEnum lightLayerMask
    Field Value
    Type Description
    LightLayerEnum

    maxRefractionDistance

    Controls the maximum distance in meters used to clamp the under water refraction depth. Higher value increases the distortion amount.

    Declaration
    [Tooltip("Controls the maximum distance in meters used to clamp the under water refraction depth. Higher value increases the distortion amount.")]
    public float maxRefractionDistance
    Field Value
    Type Description
    float

    mesh

    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.

    Declaration
    public Mesh mesh
    Field Value
    Type Description
    Mesh

    refractionColor

    Sets the color that is used to simulate the under-water refraction.

    Declaration
    [Tooltip("Sets the color that is used to simulate the under-water refraction.")]
    [ColorUsage(false)]
    public Color refractionColor
    Field Value
    Type Description
    Color

    repetitionSize

    Declaration
    [Tooltip("")]
    public float repetitionSize
    Field Value
    Type Description
    float

    ripples

    When enabled, the water system allows you to simulate and render a ripples simulation for finer details.

    Declaration
    public bool ripples
    Field Value
    Type Description
    bool

    ripplesChaos

    Declaration
    [Tooltip("")]
    public float ripplesChaos
    Field Value
    Type Description
    float

    ripplesCurrentMode

    Declaration
    [Tooltip("")]
    public WaterPropertyOverrideMode ripplesCurrentMode
    Field Value
    Type Description
    WaterPropertyOverrideMode

    ripplesCurrentOrientationValue

    Declaration
    [Tooltip("")]
    public float ripplesCurrentOrientationValue
    Field Value
    Type Description
    float

    ripplesCurrentSpeedValue

    Declaration
    [Tooltip("")]
    public float ripplesCurrentSpeedValue
    Field Value
    Type Description
    float

    ripplesFadeDistance

    Declaration
    [Tooltip("")]
    public float ripplesFadeDistance
    Field Value
    Type Description
    float

    ripplesFadeStart

    Declaration
    [Tooltip("")]
    public float ripplesFadeStart
    Field Value
    Type Description
    float

    ripplesFadeToggle

    Declaration
    [Tooltip("")]
    public bool ripplesFadeToggle
    Field Value
    Type Description
    bool

    ripplesWindOrientationMode

    Declaration
    [Tooltip("")]
    public WaterPropertyOverrideMode ripplesWindOrientationMode
    Field Value
    Type Description
    WaterPropertyOverrideMode

    ripplesWindOrientationValue

    Declaration
    [Tooltip("")]
    public float ripplesWindOrientationValue
    Field Value
    Type Description
    float

    ripplesWindSpeed

    Declaration
    [Tooltip("")]
    public float ripplesWindSpeed
    Field Value
    Type Description
    float

    scatteringColor

    Sets the color that is used to simulate the under-water scattering.

    Declaration
    [Tooltip("Sets the color that is used to simulate the under-water scattering.")]
    [ColorUsage(false)]
    public Color scatteringColor
    Field Value
    Type Description
    Color

    simulationFoamAmount

    Controls the simulation foam amount. Higher values generate larger foam patches. Foam presence is highly dependent on the wind speed and chopiness values.

    Declaration
    [Tooltip("Controls the simulation foam amount. Higher values generate larger foam patches. Foam presence is highly dependent on the wind speed and chopiness values.")]
    public float simulationFoamAmount
    Field Value
    Type Description
    float

    simulationFoamDrag

    Controls the life span of the surface foam. A higher value will cause the foam to persist longer and leave a trail.

    Declaration
    [Tooltip("Controls the life span of the surface foam. A higher value will cause the foam to persist longer and leave a trail.")]
    public float simulationFoamDrag
    Field Value
    Type Description
    float

    simulationFoamSmoothness

    Controls the simulation foam smoothness.

    Declaration
    [Tooltip("Controls the surface foam smoothness.")]
    public float simulationFoamSmoothness
    Field Value
    Type Description
    float

    smoothnessFadeDistance

    Declaration
    [Tooltip("")]
    public float smoothnessFadeDistance
    Field Value
    Type Description
    float

    smoothnessFadeStart

    Declaration
    [Tooltip("")]
    public float smoothnessFadeStart
    Field Value
    Type Description
    float

    startSmoothness

    Declaration
    [Tooltip("")]
    public float startSmoothness
    Field Value
    Type Description
    float

    surfaceType

    Specifies the nature of the water body that the water system needs to simulate.

    Declaration
    public WaterSurfaceType surfaceType
    Field Value
    Type Description
    WaterSurfaceType

    timeMultiplier

    Sets the speed of the water simulation. This allows to slow down the wave's speed or to accelerate it.

    Declaration
    public float timeMultiplier
    Field Value
    Type Description
    float

    transitionSize

    Sets a vertical distance to the water surface at which the blending between above and under water starts.

    Declaration
    [Tooltip("Sets a vertical distance to the water surface at which the blending between above and under water starts.")]
    public float transitionSize
    Field Value
    Type Description
    float

    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.

    Declaration
    [Tooltip("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.")]
    public bool underWater
    Field Value
    Type Description
    bool

    virtualPlaneDistance

    Sets the distance at which the simulated caustics are projected. High values generate sharper caustics but can cause artefacts.

    Declaration
    public float virtualPlaneDistance
    Field Value
    Type Description
    float

    volumeBounds

    Sets a box collider that will be used to define the volume where the under water effect is applied for non infinite surfaces.

    Declaration
    [Tooltip("Sets a box collider that will be used to define the volume where the under water effect is applied for non infinite surfaces.")]
    public BoxCollider volumeBounds
    Field Value
    Type Description
    BoxCollider

    volumeDepth

    Sets maximum depth at which the under water effect is evaluated for infinite surfaces.

    Declaration
    [Tooltip("Sets maximum depth at which the under water effect is evaluated for infinite surfaces.")]
    public float volumeDepth
    Field Value
    Type Description
    float

    volumePrority

    Sets a priority value that is used to define which surface should be considered for under water rendering in the case of multiple overlapping surfaces.

    Declaration
    [Tooltip("Sets a priority value that is used to define which surface should be considered for under water rendering in the case of multiple overlapping surfaces.")]
    public int volumePrority
    Field Value
    Type Description
    int

    waterMask

    Sets the texture used to attenuate or supress the swell, agiation and ripples water frequencies.

    Declaration
    public Texture2D waterMask
    Field Value
    Type Description
    Texture2D

    waterMaskExtent

    Sets the extent of the water mask in meters.

    Declaration
    [Tooltip("Sets the extent of the water mask in meters.")]
    public Vector2 waterMaskExtent
    Field Value
    Type Description
    Vector2

    waterMaskOffset

    Sets the offset of the water mask in meters.

    Declaration
    [Tooltip("Sets the offset of the water mask in meters.")]
    public Vector2 waterMaskOffset
    Field Value
    Type Description
    Vector2

    windFoamCurve

    Controls the foam amount depending on the wind speed.

    Declaration
    public AnimationCurve windFoamCurve
    Field Value
    Type Description
    AnimationCurve

    Methods

    FillWaterSearchData(ref WaterSimSearchData)

    Function that fills a WaterSimSearchData with the data of the current water surface.

    Declaration
    public bool FillWaterSearchData(ref WaterSimSearchData wsd)
    Parameters
    Type Name Description
    WaterSimSearchData wsd

    The water simulation search data to fill.

    Returns
    Type Description
    bool

    A boolean that defines if the function was able to fill the search data.

    FindWaterSurfaceHeight(WaterSearchParameters, out WaterSearchResult)

    Function that attempts to evaluate the water surface height at a given location.

    Declaration
    public bool FindWaterSurfaceHeight(WaterSearchParameters wsp, out WaterSearchResult wsr)
    Parameters
    Type Name Description
    WaterSearchParameters wsp

    The water simulation search parameters that defines the location we are targeting and additional parameters.

    WaterSearchResult wsr

    The water simulation search result that contains the result height, error, etc.

    Returns
    Type Description
    bool

    A boolean that defines if the function was able to execute the evaluation.

    GetSimulationResolutionCPU()

    Function that returns the water surface CPU simulation resolution.

    Declaration
    public WaterSimulationResolution GetSimulationResolutionCPU()
    Returns
    Type Description
    WaterSimulationResolution

    A value of time WaterSimulationResolution that defines the current water surface CPU simulation resolution.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)