Class CloudRenderer
Base class for cloud rendering.
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Syntax
public abstract class CloudRenderer
Fields
SupportDynamicSunLight
Determines if the clouds should be rendered when the sun light changes.
Declaration
public bool SupportDynamicSunLight
Field Value
Type | Description |
---|---|
Boolean |
Methods
Build()
Called on startup. Create resources used by the renderer (shaders, materials, etc).
Declaration
public abstract void Build()
Cleanup()
Called on cleanup. Release resources used by the renderer.
Declaration
public abstract void Cleanup()
GetSunLightCookieParameters(CloudSettings, ref CookieParameters)
Get the parameters for overriding the main directional light cookie for one frame.
Declaration
public virtual bool GetSunLightCookieParameters(CloudSettings settings, ref CookieParameters cookieParams)
Parameters
Type | Name | Description |
---|---|---|
CloudSettings | settings | Current cloud settings. |
CookieParameters | cookieParams | Overriden values for cookie parameters. |
Returns
Type | Description |
---|---|
Boolean | True if the cookie should be overriden and RenderSunLightCookie should be called. |
PreRenderClouds(BuiltinSkyParameters, Boolean)
Preprocess for rendering the clouds. Called before the DepthPrePass operations
Declaration
public virtual void PreRenderClouds(BuiltinSkyParameters builtinParams, bool renderForCubemap)
Parameters
Type | Name | Description |
---|---|---|
BuiltinSkyParameters | builtinParams | Engine parameters that you can use to render the clouds. |
Boolean | renderForCubemap | Pass in true if you want to render the clouds into a cubemap for lighting. This is useful when the cloud renderer needs a different implementation in this case. |
RenderClouds(BuiltinSkyParameters, Boolean)
Implements actual rendering of the clouds. HDRP calls this when rendering the clouds into a cubemap (for lighting) and also during main frame rendering.
Declaration
public abstract void RenderClouds(BuiltinSkyParameters builtinParams, bool renderForCubemap)
Parameters
Type | Name | Description |
---|---|---|
BuiltinSkyParameters | builtinParams | Engine parameters that you can use to render the clouds. |
Boolean | renderForCubemap | Pass in true if you want to render the clouds into a cubemap for lighting. This is useful when the cloud renderer needs a different implementation in this case. |
RenderSunLightCookie(BuiltinSunCookieParameters)
HDRP calls this function once every frame where GetSunLightCookieParameters returns true. Implement it if your CloudRenderer needs to render a texture to use for the light cookie (for example for cloud shadow rendering).
Declaration
public virtual void RenderSunLightCookie(BuiltinSunCookieParameters builtinParams)
Parameters
Type | Name | Description |
---|---|---|
BuiltinSunCookieParameters | builtinParams | Engine parameters that you can use to render the sun light cookie. |
RequiresPreRenderClouds(BuiltinSkyParameters)
Whether the PreRenderClouds step is required.
Declaration
public virtual bool RequiresPreRenderClouds(BuiltinSkyParameters builtinParams)
Parameters
Type | Name | Description |
---|---|---|
BuiltinSkyParameters | builtinParams | Engine parameters that you can use to render the clouds. |
Returns
Type | Description |
---|---|
Boolean | True if the PreRenderClouds step is required. |
Update(BuiltinSkyParameters)
HDRP calls this function once every frame. Implement it if your CloudRenderer needs to iterate independently of the user defined update frequency (see CloudSettings UpdateMode).
Declaration
protected virtual bool Update(BuiltinSkyParameters builtinParams)
Parameters
Type | Name | Description |
---|---|---|
BuiltinSkyParameters | builtinParams | Engine parameters that you can use to update the clouds. |
Returns
Type | Description |
---|---|
Boolean | True if the update determines that cloud lighting needs to be re-rendered. False otherwise. |