Chart3DSnapshot
public static class Chart3DSnapshotPublic entry point for converting a Chart into a 2D image.
Works in both edit mode and play mode, targets BRP/URP/HDRP, and never
mutates the caller's scene.
// One-off thumbnail for docs / asset generation:
Texture2D tex = Chart3DSnapshot.Render(chart, Chart3DSnapshotOptions.Hero);
System.IO.File.WriteAllBytes("thumb.png", tex.EncodeToPNG());
Methods
Section titled “Methods”
Render(Chart, in Chart3DSnapshotOptions)
Section titled “Render(Chart, in Chart3DSnapshotOptions)”public static Texture2D Render(Chart chart, in Chart3DSnapshotOptions opts)Render a chart into a fresh Texture2D. Readbacks to CPU
so the returned texture is usable in any UI context (ImGUI,
RawImage, UI Toolkit, inspector drawers). The caller owns and must destroy the returned texture.
Parameters
| Name | Type |
|---|---|
chart | ChartGuru.Chart |
opts | ChartGuru.Chart3DSnapshotOptions |
Returns
UnityEngine.Texture2D
RenderTo(Chart, RenderTexture, in Chart3DSnapshotOptions)
Section titled “RenderTo(Chart, RenderTexture, in Chart3DSnapshotOptions)”public static void RenderTo(Chart chart, RenderTexture target, in Chart3DSnapshotOptions opts)Render a chart directly into an existing RenderTexture
without CPU readback, supersampled by the options and filtered down to
the target’s size. Preferred path for live gallery tiles and inspector previews.
Parameters
| Name | Type |
|---|---|
chart | ChartGuru.Chart |
target | UnityEngine.RenderTexture |
opts | ChartGuru.Chart3DSnapshotOptions |
RenderOrbit(Chart, int, in Chart3DSnapshotOptions)
Section titled “RenderOrbit(Chart, int, in Chart3DSnapshotOptions)”public static Texture2D[] RenderOrbit(Chart chart, int frames, in Chart3DSnapshotOptions opts)Render N frames orbiting around the chart (useful for spritesheets / previews).
Parameters
| Name | Type |
|---|---|
chart | ChartGuru.Chart |
frames | System.Int32 |
opts | ChartGuru.Chart3DSnapshotOptions |
Returns
UnityEngine.Texture2D[]
EncodeToPng(Chart, in Chart3DSnapshotOptions)
Section titled “EncodeToPng(Chart, in Chart3DSnapshotOptions)”public static byte[] EncodeToPng(Chart chart, in Chart3DSnapshotOptions opts)Render to a PNG byte blob, ready for File.WriteAllBytes.
Parameters
| Name | Type |
|---|---|
chart | ChartGuru.Chart |
opts | ChartGuru.Chart3DSnapshotOptions |
Returns
System.Byte[]