PreviewRenderUtilities
public static class PreviewRenderUtilitiesCentralized render texture management and utilities for preview generation.
Methods
Section titled “Methods”
RenderCameraToTexture(Camera, int)
Section titled “RenderCameraToTexture(Camera, int)”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.
CreateStandardDescriptor(int, int)
Section titled “CreateStandardDescriptor(int, int)”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.
RenderTextureToTexture2D(RenderTexture)
Section titled “RenderTextureToTexture2D(RenderTexture)”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.
ExtractAlphaFromLuminance(Texture2D)
Section titled “ExtractAlphaFromLuminance(Texture2D)”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 |