This works (yay!)
void Update(){
gameTime += Time.deltaTime;
heatStage = (Mathf.Cos(gameTime / yearLengthDiv_PiMul2) + 1f) / 2f;
Shader.SetGlobalFloat("heatStage", heatStage);
}
This works
Texture2D hotMapTexture2D = TextureGenerator.TextureFromHeightMap(hotMap);
hotMapTexture2D.Apply();
meshRenderer.material.SetTexture("hotMap", hotMapTexture2D);
So to do some really tricky stuff, I want this to work, but it doesn’t:
Texture2D hotMapTexture2D = TextureGenerator.TextureFromHeightMap(hotMap);
hotMapTexture2D.Apply();
Shader.SetGlobalTexture("hotMap", hotMapTexture2D);
the texture appears to come in all 0.
I have unexposed the property in shader graph.
I noticed this makes the “Mode” unavailable for this node in shadergraph.
I tried
Texture2D hotMapTexture2D = TextureGenerator.TextureFromHeightMap(hotMap);
hotMapTexture2D.Apply();
var uerrtsec = UnityEngine.Rendering.RenderTextureSubElement.Color;
Shader.SetGlobalTexture("hotMap", hotMapTexture2D, uerrtsec);
and the four different variants of RenderTextureSubElement, but that seems to require a “rendertexture” and not a texture2D.
“hotmap” is really just a map of floats between 0 and 1, so perhaps I can convert it so some other type of texture, and then SetGlobalTexture?