- Home /
How do I set a shader property in MonoBehaviour?
I asked this question over at StackOverflow, everyone who answered seemed to think I was doing everything correctly, and couldn't see what I was doing wrong exactly. Posting this here in case someone here knows.
Answer by Glurth · Jun 20, 2019 at 08:02 PM
I suspect the issue is due to the fact that you are using renderer.material
(this accessor generates a new material instance), rather than renderer.sharedMaterial
.
hmm, rereading the docs, I'm not so sure about this anymore. :(
Based on my understanding of the documentation, this shouldn't work. However, it seems to fix it! I've only tested it in Unity playmode and not on my actual Hololens yet, but it seems to work!
Your answer
Follow this Question
Related Questions
Unity Advanced Shader Help 0 Answers
viewDir changes with o.Normal 1 Answer
Scene Depth Node, find depth value from x/y position of camera frame 1 Answer
How to adapt this shader into a transparent one (alpha blend) 0 Answers
Quad vertex color shader 0 Answers