• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by PykXell · Nov 16, 2019 at 06:51 PM · materialmaterialsemissionhdremissive

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

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)).

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Thromshall · Dec 13, 2019 at 01:30 AM 1
Share

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.

avatar image J-D16 · Jul 01, 2020 at 01:16 AM 0
Share

Changing the exposure weigh did the trick for me mymat.SetFloat("_EmissiveExposureWeight", myValue);

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

137 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why does Default-Material have black emission enabled? 0 Answers

Cannot access updated Emission Color value 0 Answers

Certain colors of emissive material causing white outlines on objects 1 Answer

Instantiate object with Emissive Material 2 Answers

Unity HDRP, Objects not using emission 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges