Skip to content
SiteEmail

cohtml.ViewRendererRP

Renderer implementation for Cohtml View when using Render Pipeline–based rendering using CommandBuffers and render pipeline targets.

Inherits from cohtml.ViewRenderer, IDisposable

Name
ViewRendererRP(CohtmlView view)
virtual override voidDrawFrameOnScreen()
Draws the view into the active render target. Must be implemented by derived renderer implementations.
virtual override voidDispose()
Releases all resources allocated by this renderer, including materials, compute shaders, and command buffers.
Name
virtual override voidApplyCompositorTextures()
Renders all composition textures associated with the current CohtmlView onto the given render target. Used for the Surface Partitioning feature.
Name
CommandBufferCommandBuffer
Gets or sets the CommandBuffer used internally to render the View into the active Render Pipeline target.
RenderTargetIdentifierCameraRenderTarget
Gets or sets the current camera render target into which the view is drawn. This value is updated per-frame depending on the active rendering context.

Public Functions inherited from cohtml.ViewRenderer

Name
voidUpdateSize(uint width, uint height)
intGetCohtmlOriginY()
Returns the Y-axis origin convention used by Cohtml for texture UV coordinates.
intGetUnityOriginY()
Returns the Y-axis origin convention used by Unity for texture UV coordinates.
RenderTextureCreateRenderTexture(string name, int width, int height, UnityEngine.Experimental.Rendering.GraphicsFormat format, int depth =0, bool enableRandomWrite =false)
Creates and initializes a new RenderTexture with the specified dimensions and graphics format.
ShaderGetViewShader(CohtmlView view)
voidUpdateFlipKeyword(Material material, bool isFlipped)
voidSetInWorldMaterial(Material material, RenderTexture texture, bool isTransparent)
voidApplyTransparencyBlendModes(Material material, bool isTransparent)
Applies the appropriate blend mode and depth writing (ZWrite) settings to a given material based on whether it should be rendered as transparent or opaque. This updates the hidden _SrcBlend and _DstBlend shader properties used in the material’s shader. Transparent mode: SrcBlend = 5 (SrcAlpha), DstBlend = 10 (OneMinusSrcAlpha). Opaque mode: SrcBlend = 1 (One), DstBlend = 0 (Zero).

Protected Functions inherited from cohtml.ViewRenderer

Name
ViewRenderer(CohtmlView view)
Initializes the renderer with the specified view. Sets up optional partitioning resources, compute shaders, and filtering materials depending on the current view configuration.
MeshSetupQuad()
Creates a 1×1 quad mesh with UVs for fullscreen or partitioned UI rendering.

Public Properties inherited from cohtml.ViewRenderer

Name
CohtmlViewView

Public Attributes inherited from cohtml.ViewRenderer

Name
const stringTextureName
const stringMaterialName
const stringBackgroundName
const stringGlobalBackdropOutputName
const stringGlobalBackdropMaskName
const stringIntermediateName
const stringCameraCopyName
IGlobalBackdropFilterGlobalBackdropFilter
readonly intCameraCopy
readonly intMainTexId
readonly intOverlayTexId
readonly intUVOffsetId
readonly intUVScaleId
readonly intSrcBlendId
readonly intDstBlendId
readonly intZWriteId
readonly intTopLeft
readonly intBottomLeft

Protected Attributes inherited from cohtml.ViewRenderer

Name
const stringCohtmlViewName
Meshm_QuadMesh
Matrix4x4m_PixelMatrix
MaterialPropertyBlockm_MaterialPropertyBlock
ViewRendererRP(
CohtmlView view
)
virtual override void DrawFrameOnScreen()

Draws the view into the active render target. Must be implemented by derived renderer implementations.

Reimplements: cohtml.ViewRenderer.DrawFrameOnScreen

Depending on configuration, this may:

  • Apply composition textures (UISurfacePartitioning)
  • Execute C# backend rendering specific operations
  • Apply global backdrop filter feature
  • Render the final view texture onto the target
virtual override void Dispose()

Releases all resources allocated by this renderer, including materials, compute shaders, and command buffers.

Reimplements: cohtml.ViewRenderer.Dispose

virtual override void ApplyCompositorTextures()

Renders all composition textures associated with the current CohtmlView onto the given render target. Used for the Surface Partitioning feature.

Reimplements: cohtml.ViewRenderer.ApplyCompositorTextures

CommandBuffer CommandBuffer;

Gets or sets the CommandBuffer used internally to render the View into the active Render Pipeline target.

RenderTargetIdentifier CameraRenderTarget;

Gets or sets the current camera render target into which the view is drawn. This value is updated per-frame depending on the active rendering context.