LEARNING EXAMPLE
Render a camera view into a caller-owned target
draft illustrativeOrigin: original-example · review: draft · snapshot: 3ba1c69afc74a97f-7fcd0798fd6ea455
Example
using Sandbox;
using Sandbox.Rendering;
// Illustrative draft: the target must be created and owned by the caller.
// The reference does not claim this is compile- or runtime-verified.
public static class SecondaryViewRenderingExample
{
public static bool Render(CameraComponent camera, Texture target, ViewSetup setup)
{
if (camera is null || target is null)
return false;
return camera.RenderToTexture(target, setup);
}
}
The camera submits one render-to-texture operation and returns its declared success value.
Constraints and verification
- Target creation, render-phase scheduling, recursion limits, fog and history binding are deliberately outside this small example.
- The snapshot does not establish installed-build game-callability or runtime behaviour.
- Evidence hash:
8df5ceb0d4735f1d5d7167e172fefce4f423db19a940e56f97d6ebf3838ea4d8 - Compile/runtime verification: illustrative
Linked API declarations
type:Sandbox.CameraComponentmethod:Sandbox.CameraComponent:RenderToTexture(Sandbox.Texture,Sandbox.Rendering.ViewSetup)type:Sandbox.Rendering.ViewSetup