- Home /
Texturing custom 2d sprite
Hello 0/ Create programmatically custom sprite, but not understand how to properly texture my sprite. Shader or texture? Sampe of code is welcome! I attach additional images for example.
Since you're creating your own mesh you're going to want to make a shader that uses positions in world coords to handle those dots depending on how you actually generate your faces (If their warped or stretched causing your UVs to look bad). If you can create a shader that applies textures from world space you won't have to worry about how long your vertices are. (You essentially want a uniform scale of your faces)
Another "hack" is to just create a alpha mask in these current shapes and apply it to a regular plane and use that to drive your shapes. (I would say this would be easiest at the end of the day)
Thanks for the answer. Now I understand more. I will try to look for how to solve the problem with a shader, because the shapes will always be different and mask will not help
Your answer
Follow this Question
Related Questions
How do I fill a Texture2D with pixels and display a sprite with that texture using script? 1 Answer
Slicing sliced sprite via script 0 Answers
My sprite from sprite.create looks pixelated. 1 Answer
Updating Sprite texture leaves red outline 1 Answer
Can't create a 2D sprite with Sprite.Create when creating texture in code 1 Answer