Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Material not updating

Discussion in 'General Graphics' started by vatara, Apr 5, 2015.

  1. vatara

    vatara

    Joined:
    Feb 26, 2010
    Posts:
    22
    I was inspired by this post of a CrazyBump-like tool made in Unity and decided to try making one myself.

    I'm generating the height/normal/etc maps using RenderTextures and assigning those to the material. The problem is, the material doesn't show these changes until I deselect/select the material or GameObject in the editor or make a manual change to the material in the editor.

    Once I have done this, the in-game changes work fine. I'm really not sure what is causing this, anyone have any ideas? I put the project up at: https://github.com/vatara/unity-texture-tool
     
  2. vatara

    vatara

    Joined:
    Feb 26, 2010
    Posts:
    22
    I found the solution in this thread: http://forum.unity3d.com/threads/creating-materials-at-runtime.316395/

    "That was exactly it. I had no textures assigned to the height/normal/metallic/occlusion maps, so that part of the shader wasn't getting enabled. To fix it, I just assigned empty(white/gray/black) textures to the material at compile time."