- Home /
Custom vertex data on a Sprite
Is it possible to add more vertex data to the mesh of sprite while using the SpriteRenderer?
I see you can get the sprite.vertices
, and sprite.triangles
. Why not sprite.mesh
? And OverrideGeometry
only accepts those two.
What if I want to add per-vertex colors?
Any way to achieve this with things like AdditionalVertexStreams
or ComputeBuffer
?
if you want vertex, then use skinnedmeshrenderer.sharedmesh
@NoDumbQuestion I was talking specifically about achieving this with the SpriteRenderer
. From more research, it does not seem to be possible as it's made to serve a very specific purpose. Eh, can always write a custom mesh renderer.
Sprite verticles == meshrenderer.mesh but it is 2D Vector. if you want to change sprite texture then you have to change texture.pixels.
And the only kind of alternative custom vertex for sprite I can think of is SVG file format.
Unity not directly support Vector Graphics. But you can always try to buy one from assetstore