Search Issue Tracker

Fixed

Votes

0

Found in

5.0.2f1

Issue ID

698693

Regression

No

Material properties not updated at runtime until expanded in inspector

Shaders

-

How to reproduce:

1. Open attached project
2. Open scene material_test_scene.unity
3. Play scene
4. Press the Space Bar to create and assign a material to the cubes
- Notice that apparently only the Albedo is assigned properly
5. Select one of the cubes in the scene view
6. Expand the Material inspector
- Note how the cubes get updated with highlights

Comments (21)

  1. SergeantBiscuits

    Feb 06, 2022 00:42

    This was happening to me when I had the emission color set to pure black by default. Setting it to anything other than pure black avoids the issue. Pretty sure DBURDEN1 is correct; Unity disables the emission component because it figures "well the color is pure black, which doesn't actually do anything, so I'ma just disable the whole color!"

  2. GXMark

    Nov 07, 2021 01:08

    2020.3.22f1 still getting this issue. Setting the keywords but it does not update until opening a material inspector

  3. AlexHogan

    May 05, 2021 08:19

    I appear to be running into this in Unity 2021.1.3f1

  4. IvayloDev

    Feb 18, 2021 15:18

    Still not fixed (2019.4.11)

  5. HinxVietti_WITL

    Jan 26, 2021 03:38

    Problem still in
    2018.4.19 with tmpro 1.5.1
    2019.4.16 with tmpro 2.1.3

  6. UHDynamical

    Jun 25, 2020 17:05

    Nvm. It's just that the keyword for the _MetallicGlossMap texture is _METALLICSPECGLOSSMAP instead of _METALLICGLOSSMAP.

  7. UHDynamical

    Jun 25, 2020 16:54

    2019.4. The issue still exists.

  8. BlackOpsBen

    May 28, 2020 05:04

    I am experiencing this issue on 2019.3.13f1. I am glad to see I could find more people with this issue, but concerned that supposedly this bug was fixed.

  9. Wothanar

    Sep 09, 2019 19:53

    DBURDEN1 dosnt work to me the Material.EnableKeyword() . im using meshbaker plugin for a work and normals are not good via runtime and i need to set them via runtime after a runtime bake, any new how to solve this?

  10. RiseUpGames

    Jul 31, 2019 05:51

    Just came across this and thought I'd share my workaround (bug still exists in 2018.4.4). In my case I was changing a shader and later needing to restore the material back to its original shader. Setting the shader worked, but restoring it resulted in this bug.

    Workaround was to simply make a copy of the material before modifying the shader, and then using the copy to change the material back to its original state later when needed:

    Material originalMaterial = new Material(renderer.material);
    renderer.shader = newShader;

    .... // sometime later

    renderer.material = originalMaterial;

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.