Skip to content

PreviewRenderUtilities

ClassAssetInventoryAssetInventory.Editor
public static class PreviewRenderUtilities

Centralized render texture management and utilities for preview generation.

public static Texture2D RenderCameraToTexture(Camera camera, int size)

Render camera to texture with proper MSAA and depth handling

Parameters

Name Type Description
camera UnityEngine.Camera
size System.Int32

Returns

UnityEngine.Texture2D — No return description is available.

public static RenderTextureDescriptor CreateStandardDescriptor(int width, int height)

Create render texture descriptor with standard preview settings

Parameters

Name Type Description
width System.Int32
height System.Int32

Returns

UnityEngine.RenderTextureDescriptor — No return description is available.

public static Texture2D RenderTextureToTexture2D(RenderTexture rt)

Convert render texture to Texture2D

Parameters

Name Type Description
rt UnityEngine.RenderTexture

Returns

UnityEngine.Texture2D — No return description is available.

public static void ExtractAlphaFromLuminance(Texture2D texture)

Extract alpha from luminance for transparent backgrounds with particles Particles don’t render correctly against Color.clear, so we render against black and extract alpha from brightness

Parameters

Name Type Description
texture UnityEngine.Texture2D