OfflineRenderer
public static class OfflineRendererDraws a scene into a Texture, with no window, no graphics context and no control.
This is render-to-texture as an operation a caller performs, rather than as a second pass inside a frame — and the difference is the whole design. A live nested render needs a second target on three graphics backends and a rule about a scene sampling a texture the same frame drew it, which is a week's work in the frame path and a class of ordering bug that only shows on one driver. Handing back an image the caller owns needs neither, and it is what almost every use of "render to texture" in a desktop application actually wants:
- a thumbnail or preview of a model, generated once and cached;
- a scene shown on a surface inside another scene — a screen, a monitor, a mirror-ish panel — refreshed as often as it needs to be rather than every frame;
- a picture to save, print or send, at a size that has nothing to do with the window;
- a scene rendered on a server, in a test, or from a command line, where there is no window at all.
It runs on the CPU renderer, always, on every platform. That is a deliberate choice rather than a limitation to apologise for: it is the one backend that needs no context, so this works headless, in a unit test, on a build server and inside a background thread, and it gives the same pixels everywhere. What it costs is speed and the things that renderer cannot do — see RenderInfo.Features for the list, which is per-pixel lighting, most of the maps, and anti-aliasing.
Fields
| Member | Description |
|---|---|
| The largest image this will draw, in pixels, unless |
Methods
| Member | Description |
|---|---|
| Draws
returns A texture holding the finished image, ready to put on a |
| Draws
returns The picture, and the count of what the budget left out — |
| Draws |
| Draws
returns A texture holding the finished image. |