M
M
MishkaVNorky2019-06-11 09:10:48
C++ / C#
MishkaVNorky, 2019-06-11 09:10:48

Unity shader. To transfer each variable, or one global?

Hello comrades, the question is to those who know, who studied this issue, gained experience.
Question for mobile devices.
Let's say there are 2-3 shaders, let's say they work depending on the weather in the game. Good / bad.
What is the best way to pass the SetInt weather value to everyone? Or pass the global value through Shader.SetGlobalInt(...) ?
So the question is, how much worse is Shader.SetGlobalInt? Or no difference in load at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ivanov, 2019-06-11
@keksmr

https://docs.unity3d.com/ScriptReference/Material....
https://docs.unity3d.com/ScriptReference/Shader.Se...
I would prefer a global variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question