- Home /
HDRP Emissive Color Change during Runtime
Hi. I am facing some issues regarding the changing of the emission color of my material during runtime using HDRP. I am using Unity 2019.2.12f and HDRP 6.9.2.
What I would hope to do for my project would be to change the emission color while having the "Use Emission Intensity" property enabled. (I would like to adjust the emission intensity via Luminance rather than HDR) However, when I tried to adjust the "_EmissiveColorLDR" property the inspector records the change but it is not updating in the Game view. The Color only changes when I update the color value manually again in the inspector during runtime.
The only time I got results is by changing the "_EmissiveColor" property, but that uses HDR rather than Luminance to affect the emission intensity.
Code:
void ChangeEmissionColor()
{
mat.SetColor("_EmissiveColorLDR", color);
mat.SetFloat("_EmissiveIntensity", intensity;
}
Link to Image: https://imgur.com/gallery/Pub850a
Edit: Fixed Image Link
Answer by PykXell · Nov 20, 2019 at 08:05 AM
After doing some testing, I found that how the _EmissiveColor (HDR Color) is the same as _EmissiveColorLDR _EmissiveIntensity (Color Intensity (in Luminence)).
How does this answer your own question though? How does one go about setting the intensity correctly? I'm attempting to toggle the emissive color on and off, but while on it needs to use the intensity. Nothing changes unless I change it in the editor.
Changing the exposure weigh did the trick for me mymat.SetFloat("_EmissiveExposureWeight", myValue);