docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Adjusting emissive intensity at runtime

    For High Definition Render Pipeline (HDRP) non-Shader Graph shaders, such as the Lit, Unlit, and Decal shaders, changing the _EmissiveIntensity property does not have any effect at runtime. This is because _EmissiveIntensity is not an independent property. The shader only uses _EmissiveIntensity to serialize the property in the UI and stores the final result in the _EmissiveColor property. To edit the intensity of emissive materials, set the _EmissiveColor and multiply it by the intensity you want.

    using UnityEngine;
    
    public class EditEmissiveIntensityExample : MonoBehaviour
    {
        public GameObject m_EmissiveObject;
    
        void Start()
        {
            float emissiveIntensity = 10;
            Color emissiveColor = Color.green;
            m_EmissiveObject.GetComponent<Renderer>().material.SetColor("_EmissiveColor", emissiveColor * emissiveIntensity);
        }
    }
    
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)