if(!m_AllocationSuccess)// texture failed to find space in the atlas
{
m_TextureList.Sort();// sort the texture list largest to smallest for better packing
m_TextureList.Clear();
foreach(varpairinm_DecalSets)
{
pair.Value.AddToTextureList(refm_TextureList);
}
m_TextureList.Sort();
// texture list now contains all decal textures sorted from largest to smallest for optimal packing
// try again
if(!instance.m_AllocationSuccess)// still failed to allocate, decal atlas size needs to increase
if(!m_AllocationSuccess)// still failed to allocate, decal atlas size needs to increase
{
Debug.LogWarning("Decal texture atlas out of space, decals on transparent geometry might not render correctly, atlas size can be changed in HDRenderPipelineAsset");
DecalSystem.instance.UpdateCachedMaterialData(cmd);// textures, alpha or fade distances could've changed
DecalSystem.instance.CreateDrawData();// prepare data is separate from draw
DecalSystem.instance.UpdateCachedMaterialData();// textures, alpha or fade distances could've changed
DecalSystem.instance.UpdateTextureAtlas(cmd);// as this is only used for transparent pass, would've been nice not to have to do this if no transparent renderers are visible
DecalSystem.instance.CreateDrawData();// prepare data is separate from draw