Skip to main content

AtlasSettings

A class in Root.Township, Alta.Utilities.Atlas.

Settings asset listing which shaders can be atlased, their atlas type, and the blit shaders that bake each into diffuse, normal and emission atlases.

Constructors​

MemberWhat it is
AtlasSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private static AtlasSettings instanceBacking field for Instance.
private const string settingsPathProject path of the settings asset, Assets/Atlases/Settings.asset.
private AtlasSettings.ShaderBlits[] supportedShadersThe supported shaders with their blit shaders and atlas type.

Properties​

MemberWhat it is
static AtlasSettings Instance { get; }The settings object. In this build it creates a new empty instance on first use rather than loading the asset.
IEnumerable<Shader> SupportedShaders { get; }Every listed shader. Fills in a missing entry name from the last part of the shader name.

Methods​

MemberWhat it is
bool GetBlitMaterials(Shader shader, out Material diffuseBlit, out Material normalBlit, out Material emissionBlit)Creates new diffuse, normal and emission blit materials for a supported shader. Returns false if the shader is not listed.
bool IsShaderSupported(Shader shader, out AtlasType type)Whether the shader is in the list, and its atlas type (Common if not).