docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class WaterSurface

    Water surface component.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    WaterSurface
    Implements
    IVersionable<WaterSurface.Version>
    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.didStart
    MonoBehaviour.didAwake
    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.CompareTag(TagHandle)
    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, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    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, IVersionable<WaterSurface.Version>

    Fields

    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
    [Range(0.001, 100)]
    [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

    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.

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

    ambientScattering

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

    Declaration
    [Range(0, 1)]
    [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

    causticsDirectionalShadow

    When enabled, the water caustics will take into account the directional light's shadow.

    Declaration
    public bool causticsDirectionalShadow
    Field Value
    Type Description
    bool

    causticsDirectionalShadowDimmer

    Sets the water caustics dimmer value for the directional shadow.

    Declaration
    [Range(0, 1)]
    public float causticsDirectionalShadowDimmer
    Field Value
    Type Description
    float

    causticsIntensity

    Sets the intensity of the under-water caustics.

    Declaration
    [Min(0)]
    [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
    [Min(0)]
    [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

    causticsTilingFactor

    Sets a tiling factor for the water caustics.

    Declaration
    [Min(0.001)]
    public float causticsTilingFactor
    Field Value
    Type Description
    float

    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

    currentDebugMultiplier

    Sets a multiplier for the arrow density in the current debug mode.

    Declaration
    public float currentDebugMultiplier
    Field Value
    Type Description
    float

    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

    debugMode

    Sets the debug mode for a given water surface.

    Declaration
    public WaterDebugMode debugMode
    Field Value
    Type Description
    WaterDebugMode

    decalLayerMask

    Specifies the decal layers that affect the water surface.

    Declaration
    [SerializeField]
    [Obsolete("Use renderingLayerMask instead @from(2023.1) (UnityUpgradable) -> renderingLayerMask")]
    public RenderingLayerMask decalLayerMask
    Field Value
    Type Description
    RenderingLayerMask

    deformation

    Specifies if the water surfaces supports local deformations.

    Declaration
    public bool deformation
    Field Value
    Type Description
    bool

    deformationAreaOffset

    Specified the offset of the deformation area in meters.

    Declaration
    [Tooltip("Specified the offset of the deformation area in meters.")]
    public Vector2 deformationAreaOffset
    Field Value
    Type Description
    Vector2

    deformationAreaSize

    Specified the size of the deformation area in meters.

    Declaration
    [Tooltip("Specified the size of the deformation area in meters.")]
    public Vector2 deformationAreaSize
    Field Value
    Type Description
    Vector2

    deformationRes

    Specifies the resolution of the deformation texture used to represent the deformation area.

    Declaration
    [Tooltip("Specifies the resolution of the deformation texture used to represent the deformation area.")]
    public WaterSurface.WaterDeformationResolution deformationRes
    Field Value
    Type Description
    WaterSurface.WaterDeformationResolution

    directLightBodyScattering

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

    Declaration
    [Range(0, 1)]
    [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
    [Range(0, 1)]
    [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
    [Range(0, 1)]
    [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
    public float endSmoothness
    Field Value
    Type Description
    float

    foam

    Specifies if the water surfaces support foam rendering.

    Declaration
    public bool foam
    Field Value
    Type Description
    bool

    foamAreaOffset

    Specifies the offset of the foam area in meters.

    Declaration
    [Tooltip("Specifies the offset of the foam area in meters.")]
    public Vector2 foamAreaOffset
    Field Value
    Type Description
    Vector2

    foamAreaSize

    Specifies the size of the foam area in meters.

    Declaration
    [Tooltip("Specifies the size of the foam area in meters.")]
    public Vector2 foamAreaSize
    Field Value
    Type Description
    Vector2

    foamColor

    Set the foam color.

    Declaration
    public Color foamColor
    Field Value
    Type Description
    Color

    foamCurrentInfluence

    Specifies the influence of current on foam.

    Declaration
    [Range(0, 1)]
    public float foamCurrentInfluence
    Field Value
    Type Description
    float

    foamPersistenceMultiplier

    Specifies the foam persistence multiplier. A higher value will lead to the foam remaining visible longer.

    Declaration
    [Range(0, 1)]
    public float foamPersistenceMultiplier
    Field Value
    Type Description
    float

    foamResolution

    Specifies the resolution of the foam texture.

    Declaration
    [Tooltip("Specifies the resolution of the foam texture.")]
    public WaterSurface.WaterFoamResolution foamResolution
    Field Value
    Type Description
    WaterSurface.WaterFoamResolution

    foamSmoothness

    Controls the surface foam smoothness.

    Declaration
    [Range(0, 1)]
    public float foamSmoothness
    Field Value
    Type Description
    float

    foamTextureTiling

    Set the per meter tiling for the foam texture.

    Declaration
    [Min(0)]
    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
    [Range(0, 1)]
    [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
    public float largeBand0FadeDistance
    Field Value
    Type Description
    float

    largeBand0FadeMode

    Declaration
    public WaterSurface.FadeMode largeBand0FadeMode
    Field Value
    Type Description
    WaterSurface.FadeMode

    largeBand0FadeStart

    Declaration
    public float largeBand0FadeStart
    Field Value
    Type Description
    float

    largeBand0FadeToggle

    Declaration
    [SerializeField]
    [Obsolete("Use largeBand0FadeMode instead @from(2023.1)")]
    public bool largeBand0FadeToggle
    Field Value
    Type Description
    bool

    largeBand0Multiplier

    Declaration
    [Range(0, 1)]
    public float largeBand0Multiplier
    Field Value
    Type Description
    float

    largeBand1FadeDistance

    Declaration
    public float largeBand1FadeDistance
    Field Value
    Type Description
    float

    largeBand1FadeMode

    Declaration
    public WaterSurface.FadeMode largeBand1FadeMode
    Field Value
    Type Description
    WaterSurface.FadeMode

    largeBand1FadeStart

    Declaration
    public float largeBand1FadeStart
    Field Value
    Type Description
    float

    largeBand1FadeToggle

    Declaration
    [SerializeField]
    [Obsolete("Use largeBand1FadeMode instead @from(2023.1)")]
    public bool largeBand1FadeToggle
    Field Value
    Type Description
    bool

    largeBand1Multiplier

    Declaration
    [Range(0, 1)]
    public float largeBand1Multiplier
    Field Value
    Type Description
    float

    largeChaos

    Declaration
    [Range(0, 1)]
    public float largeChaos
    Field Value
    Type Description
    float

    largeCurrentMap

    Declaration
    public Texture largeCurrentMap
    Field Value
    Type Description
    Texture

    largeCurrentMapInfluence

    Declaration
    [Range(0, 1)]
    public float largeCurrentMapInfluence
    Field Value
    Type Description
    float

    largeCurrentRegionExtent

    Declaration
    public Vector2 largeCurrentRegionExtent
    Field Value
    Type Description
    Vector2

    largeCurrentRegionOffset

    Declaration
    public Vector2 largeCurrentRegionOffset
    Field Value
    Type Description
    Vector2

    largeCurrentSpeedValue

    Declaration
    public float largeCurrentSpeedValue
    Field Value
    Type Description
    float

    largeOrientationValue

    Declaration
    public float largeOrientationValue
    Field Value
    Type Description
    float

    largeWindSpeed

    Declaration
    [Range(0, 250)]
    public float largeWindSpeed
    Field Value
    Type Description
    float

    lightLayerMask

    Specifies the light layers that affect the water surface.

    Declaration
    [SerializeField]
    [Obsolete("Use renderingLayerMask instead @from(2023.1) (UnityUpgradable) -> renderingLayerMask")]
    public RenderingLayerMask lightLayerMask
    Field Value
    Type Description
    RenderingLayerMask

    maxRefractionDistance

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

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

    maxTessellationFactor

    Sets the maximum tessellation factor for the water surface.

    Declaration
    [Range(0, 10)]
    [Tooltip("Sets the maximum tessellation factor for the water surface.")]
    public float maxTessellationFactor
    Field Value
    Type Description
    float

    maximumHeightOverride

    Specifies a maximum wave height that overrides the simulation to support scattering properly for deformers.

    Declaration
    [Min(0)]
    [Tooltip("Specifies a maximum wave height that overrides the simulation to support scattering properly for deformers.")]
    public float maximumHeightOverride
    Field Value
    Type Description
    float

    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.

    Declaration
    public List<MeshRenderer> meshRenderers
    Field Value
    Type Description
    List<MeshRenderer>

    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

    renderingLayerMask

    Specifies the rendering layers that affect the water surface.

    Declaration
    [Tooltip("Specifies the rendering layers that affect the water surface.")]
    public RenderingLayerMask renderingLayerMask
    Field Value
    Type Description
    RenderingLayerMask

    repetitionSize

    Declaration
    [Range(250, 5000)]
    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
    [Range(0, 1)]
    public float ripplesChaos
    Field Value
    Type Description
    float

    ripplesCurrentMap

    Declaration
    public Texture ripplesCurrentMap
    Field Value
    Type Description
    Texture

    ripplesCurrentMapInfluence

    Declaration
    [Range(0, 1)]
    public float ripplesCurrentMapInfluence
    Field Value
    Type Description
    float

    ripplesCurrentRegionExtent

    Declaration
    public Vector2 ripplesCurrentRegionExtent
    Field Value
    Type Description
    Vector2

    ripplesCurrentRegionOffset

    Declaration
    public Vector2 ripplesCurrentRegionOffset
    Field Value
    Type Description
    Vector2

    ripplesCurrentSpeedValue

    Declaration
    public float ripplesCurrentSpeedValue
    Field Value
    Type Description
    float

    ripplesFadeDistance

    Declaration
    public float ripplesFadeDistance
    Field Value
    Type Description
    float

    ripplesFadeMode

    Declaration
    public WaterSurface.FadeMode ripplesFadeMode
    Field Value
    Type Description
    WaterSurface.FadeMode

    ripplesFadeStart

    Declaration
    public float ripplesFadeStart
    Field Value
    Type Description
    float

    ripplesFadeToggle

    Declaration
    [SerializeField]
    [Obsolete("Use ripplesFadeMode instead @from(2023.1)")]
    public bool ripplesFadeToggle
    Field Value
    Type Description
    bool

    ripplesMotionMode

    Declaration
    public WaterPropertyOverrideMode ripplesMotionMode
    Field Value
    Type Description
    WaterPropertyOverrideMode

    ripplesOrientationValue

    Declaration
    public float ripplesOrientationValue
    Field Value
    Type Description
    float

    ripplesWindSpeed

    Declaration
    [Range(0, 15)]
    public float ripplesWindSpeed
    Field Value
    Type Description
    float

    scatteringColor

    Sets the color that is used to simulate the water light scattering.

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

    scriptInteractions

    When enabled, the Water System allows you to make height requests from a C# script.

    Declaration
    [Tooltip("When enabled, the Water System allows you to make height requests from a C# script.")]
    [FormerlySerializedAs("cpuSimulation")]
    public bool scriptInteractions
    Field Value
    Type Description
    bool

    simulationFoam

    When enabled, the water surface will receive foam from the simulation on the crest of the waves.

    Declaration
    public bool simulationFoam
    Field Value
    Type Description
    bool

    simulationFoamAmount

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

    Declaration
    [Range(0, 1)]
    public float simulationFoamAmount
    Field Value
    Type Description
    float

    simulationFoamMask

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

    Declaration
    public Texture2D simulationFoamMask
    Field Value
    Type Description
    Texture2D

    simulationFoamMaskExtent

    Sets the extent of the foam mask in meters.

    Declaration
    public Vector2 simulationFoamMaskExtent
    Field Value
    Type Description
    Vector2

    simulationFoamMaskOffset

    Sets the offset of the foam mask in meters.

    Declaration
    public Vector2 simulationFoamMaskOffset
    Field Value
    Type Description
    Vector2

    simulationFoamWindCurve

    Controls the simulation foam amount depending on the wind speed.

    Declaration
    public AnimationCurve simulationFoamWindCurve
    Field Value
    Type Description
    AnimationCurve

    smoothnessFadeDistance

    Declaration
    public float smoothnessFadeDistance
    Field Value
    Type Description
    float

    smoothnessFadeStart

    Declaration
    public float smoothnessFadeStart
    Field Value
    Type Description
    float

    startSmoothness

    Declaration
    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

    tessellation

    Use hardware tessellation when rendering the water surface

    Declaration
    [Tooltip("When enabled, HDRP activates tessellation for this Water Surface.\nThis improves the visual quality but may have a significant performance cost depending on the platform.")]
    public bool tessellation
    Field Value
    Type Description
    bool

    tessellationFactorFadeRange

    Sets the range at which the tessellation factor reaches zero.

    Declaration
    [Min(0)]
    [Tooltip("Sets the range at which the tessellation factor reaches zero.")]
    public float tessellationFactorFadeRange
    Field Value
    Type Description
    float

    tessellationFactorFadeStart

    Sets the distance at which the tessellation factor start to lower.

    Declaration
    [Min(0)]
    [Tooltip(" Sets the distance at which the tessellation factor start to lower.")]
    public float tessellationFactorFadeStart
    Field Value
    Type Description
    float

    timeMultiplier

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

    Declaration
    [Range(0, 10)]
    public float timeMultiplier
    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
    public bool underWater
    Field Value
    Type Description
    bool

    underWaterAmbientProbeContribution

    Sets the contribution of the ambient probe luminance when multiplied by the underwater scattering color.

    Declaration
    [Obsolete("Will be removed in the next version.")]
    public float underWaterAmbientProbeContribution
    Field Value
    Type Description
    float

    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.

    Declaration
    public bool underWaterRefraction
    Field Value
    Type Description
    bool

    underWaterScatteringColor

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

    Declaration
    [ColorUsage(false)]
    [Obsolete("Will be removed in the next version.")]
    public Color underWaterScatteringColor
    Field Value
    Type Description
    Color

    underWaterScatteringColorMode

    Sets how the underwater scattering color is specified.

    Declaration
    [Obsolete("Will be removed in the next version.")]
    public WaterSurface.UnderWaterScatteringColorMode underWaterScatteringColorMode
    Field Value
    Type Description
    WaterSurface.UnderWaterScatteringColorMode

    virtualPlaneDistance

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

    Declaration
    [Min(0.001)]
    public float virtualPlaneDistance
    Field Value
    Type Description
    float

    volumeBounds

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

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

    volumeDepth

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

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

    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.

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

    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.

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

    waterCurrentDebugMode

    Sets the water current debug mode for a given water surface.

    Declaration
    public WaterCurrentDebugMode waterCurrentDebugMode
    Field Value
    Type Description
    WaterCurrentDebugMode

    waterFoamDebugMode

    Sets the water foam debug mode for a given water surface.

    Declaration
    public WaterFoamDebugMode waterFoamDebugMode
    Field Value
    Type Description
    WaterFoamDebugMode

    waterMask

    Sets the texture used to attenuate or suppress the swell, agitation and ripples water frequencies.

    Declaration
    public Texture waterMask
    Field Value
    Type Description
    Texture

    waterMaskDebugMode

    Sets the water mask debug mode for a given water surface.

    Declaration
    public WaterMaskDebugMode waterMaskDebugMode
    Field Value
    Type Description
    WaterMaskDebugMode

    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

    waterMaskRemap

    Sets the remapped range of the water mask.

    Declaration
    [Tooltip("Sets the remapped range of the water mask.")]
    public Vector2 waterMaskRemap
    Field Value
    Type Description
    Vector2

    Properties

    simulationStart

    Used to sync different water surfaces simulation time, for example across network.

    Declaration
    public DateTime simulationStart { get; set; }
    Property Value
    Type Description
    DateTime

    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.

    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.

    Declaration
    public Texture GetCausticsBuffer(out float regionSize)
    Parameters
    Type Name Description
    float regionSize

    Output parameter that returns the size of the caustics region.

    Returns
    Type Description
    Texture

    A monochrome texture that holds the caustics simulation of the water surface.

    GetDeformationBuffer()

    Function that returns the deformation buffer for the water surface. If the feature is disabled or the resource is not available the function returns null.

    Declaration
    public Texture GetDeformationBuffer()
    Returns
    Type Description
    Texture

    A single channgel texture that holds the surface deformation of the water surface.

    See Also
    deformationAreaSize
    deformationAreaOffset

    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.

    Declaration
    public Texture GetFoamBuffer(out Vector2 foamArea)
    Parameters
    Type Name Description
    Vector2 foamArea

    Output parameter that returns the size of the foam region.

    Returns
    Type Description
    Texture

    An RG texture that holds the surface foam (red channel) and deep foam (green channel) of the water surface.

    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.

    Declaration
    public bool ProjectPointOnWaterSurface(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 position, error, etc.

    Returns
    Type Description
    bool

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

    SetGlobalTextures()

    Function that globally binds the textures and constant buffer for use by external systems such as VFX Graph As the binding is done globally, only one surface can be bound during a frame

    Declaration
    public void SetGlobalTextures()

    Implements

    IVersionable<TVersion>
    In This Article
    Back to top
    Copyright © 2024 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)