Quantcast
Channel: Questions in topic: "drawcall"
Viewing all articles
Browse latest Browse all 33

override the draw function

$
0
0
Hello, I'm trying to override the function that unity calls for drawing GameObject's to the screen. I want this so I can change values in the shader just before the object is drawn. Right now I have this: void Update () { renderer.sharedMaterial.SetVector("center", new Vector4(transform.position.x, transform.position.y, 0, 0)); } But since Update() is called for all GameObject's before any are drawn, only the last updated GameObject has the correct value for "center" Any help would be appreciated,

Viewing all articles
Browse latest Browse all 33

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>