Urho.RenderSurface Class

Color or depth-stencil surface that can be rendered into.

See Also: RenderSurface

Syntax

public class RenderSurface : RefCounted

Remarks

Auxiliary Views

Auxiliary views are viewports assigned to a RenderSurface by calling its SetViewport method. By default these will be rendered on each frame that the texture containing the surface is visible, and can be typically used to implement for example camera displays or reflections. The texture in question must have been created in rendertarget mode, see SetSize method.

The viewport is not assigned directly to the texture because of cube map support: a renderable cube map has 6 render surfaces, and done this way, a different camera could be assigned to each.

A "backup texture" can be assigned to the rendertarget texture: because it is illegal to sample a texture that is also being simultaneously rendered to (in cases where the texture becomes "recursively" visible in the auxiliary view), the backup texture can be used to specify which texture should be used in place instead.

Rendering detailed auxiliary views can easily have a large performance impact. Some things you can do for optimization with the auxiliary view camera:

  • Set the far clip distance as small as possible.
  • Use viewmasks on the camera and the scene objects to only render some of the objects in the auxiliary view.
  • Use the camera’s ViewOverrideFlags property to disable shadows, to disable occlusion, or force the lowest material quality.

The surface can also be configured to always update its viewports, or to only update when manually requested. See RenderSurface.UpdatedMode. For example an editor widget showing a rendered texture might use either of those modes. Call RenderSurface.QueueUpdate to request a manual update of the surface on the current frame.

Requirements

Namespace: Urho
Assembly: Urho (in Urho.dll)
Assembly Versions: 1.0.0.0

The members of Urho.RenderSurface are listed below.

See Also: RefCounted

Public Constructors

Constructs a new instance of Urho.RenderSurface, given a raw pointer to an unmanaged object

Protected Constructors

Empty constructor, chain to this constructor when you provide your own constructor that sets the handle field.

Public Properties

[read-only]
AutoResolveBoolean. Return multisampling autoresolve mode.
[read-only]
HeightInt32. Return height.
LinkedDepthStencilRenderSurface. Return linked depth buffer. Or Set linked depth-stencil surface.
LinkedRenderTargetRenderSurface. Return linked color buffer. Or Set linked color rendertarget.
[read-only]
MultiSampleInt32. Return multisampling level.
NumViewportsUInt32. Return number of viewports. Or Set number of viewports.
[read-only]
ParentTextureTexture. Return parent texture.
[read-only]
ReadOnlyViewIntPtr. eturn Direct3D11 read-only depth-stencil view. May be null if not applicable. Not valid on OpenGL.
[read-only]
RenderTargetViewIntPtr. Return Direct3D11 rendertarget or depth-stencil view. Not valid on OpenGL.
ResolveDirtyBoolean. Get or Set or clear the need resolve flag. Called internally by Graphics.
[read-only]
SurfaceIntPtr. Return Direct3D9 surface.
UpdateModeRenderSurfaceUpdateMode. Return viewport update mode. Or Set viewport update mode. Default is to update when visible.
[read-only]
UpdateQueuedBoolean. Return viewport update mode.
[read-only]
UsageTextureUsage. Return usage.
[read-only]
WidthInt32. Return width.

Public Methods

GetViewport(UInt32) : Viewport
Return viewport by index.
QueueUpdate()
Queue manual update of the viewport(s).
Release()
Release renderbuffer if any.
ResetUpdateQueued()
Reset update queued flag. Called internally.
SetViewport(UInt32, Viewport)
Set viewport.