Base interface for classes that implement a pipeline for rendering frames.
A render stage implements a frame pipeline that has the following characteristics:
Logarithmic Z-buffering is used, in order to allow 3D scenes to span arbitrary depth ranges.
Opaque geometry is rendered to a separate render target, using alpha-to-coverage or alpha-cutoff.
Transparent geometry is rendered to a separate render target, using order-independent transparency.
The sky background is rendered in a separate step.
Shadows are generated by using cascaded shadow-mapping.
To render a full frame, the following sequence must be performed:
Call BeginShadow1 or skip to 5.
The Callback method may be used to inject additional render work into an existing render stage.
Begins rendering of a new frame.
The color buffer of the render target at index 1 (see RenderTargets.Get) of the current set of render targets (see IGraphicsContext.GetRenderTarget) is used as final output for the pixels of the rendered frame. The depth/stencil buffer at index 0 is used by the steps of the render stage.
GPU resources that are required by the render stage for rendering frames should be created in the IGraphicsComponent.GraphicsAttach method or in this method. If an exception is thrown by this method, the render stage will remain at the state 1 (see remarks).
If a graphics subsystem error has occurred.
Begins to render the frame background.
The frame background will be visible where no opaque geometry is present, i.e. all pixels with a maximum depth value. When this render step starts, the ModelRenderer.FlushState method of Models is called.
Begins to render opaque geometry.
When this render step starts, the IBeginEnd.Begin method of Models is called and ModelRenderer.Mode is set to ModelRendererMode.Default. When it ends, the ModelRenderer.FlushQueue method is called (passing
Begins to render the cascaded shadow maps.
Begins to render the given shadow cascade.
Begins to render transparent geometry.
When this render step ends, the ModelRenderer.FlushQueue method is called (passing
Returns a IRenderStage object that wraps
this and invokes the given callback in at the end of each render step.
Ends the current render step.
For each call to one of the
Begin* methods, the End method must be called once.
Tells the render stage that BeginShadow1 will not be called when rendering subsequent frames.
Implementations may use this hint to release GPU resources, for example.
Returns the IResourceCache object of this render stage.
Returns the IGraphicsContext object of this render stage.
Returns the render stage flags.
- See also
Returns the Renderer object of this render stage.
Returns the Graphics object of this render stage.
Returns the ModelRenderer object of this render stage.