Skip to content

Chart3DSnapshot

ClassChartGuruChartGuru.3D
public static class Chart3DSnapshot

Public 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());

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

NameType
chartChartGuru.Chart
optsChartGuru.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

NameType
chartChartGuru.Chart
targetUnityEngine.RenderTexture
optsChartGuru.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

NameType
chartChartGuru.Chart
framesSystem.Int32
optsChartGuru.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

NameType
chartChartGuru.Chart
optsChartGuru.Chart3DSnapshotOptions

Returns

System.Byte[]