2D Toolkit Forum
2D Toolkit => Support => Topic started by: brownboot on June 13, 2014, 01:55:46 pm
-
I have tk2dSprites in my 3d environment that I am billboarding. I need to set their normals to Vector3.up (they pop back and forth a lot as the camera rotates around and I'd rather it approximate ambient lighting; ghetto example: http://tinyurl.com/oojpphc (http://tinyurl.com/oojpphc)). I have a script that works for a MeshFilter but from the documentation I couldn't figure out how to do the same thing targeting the tk2dSprite component and need some pointers... thanks!
-
You'll need to modify the code.
tk2dBaseSprite.SetPositions sets up the vertex positions and normals. You can hardcode whatever you like there.
Alternatively... you could simply override the shader and hard code it in there.
-
Thanks for the pointers! Got me where I needed to be:
(http://dicewrenchdesigns.com/wp-content/uploads/2014/06/daynightcycle2.gif)
For newbie-posterity this is what I added at line 423 of the BaseSprite code: normals = Vector3.up ;