#Im using a small atlas right now 256x256

1 messages ยท Page 1 of 1 (latest)

torn steeple
#

Well. There are some methods you could use. There are Material Property Blocks. Use it in situations where you want to draw multiple objects with the same material, but slightly different properties. For example, if you want to slightly change the color of each mesh drawn.

Other way (i use often) is to write a shader, which changes the offset of the mesh based of the meshs vertex colors.
I use this for a Texture with like 40 different street-signs/shields.

I have my main sign as prefab, painted the vertices white and did a prefab variant for every other sign i need where i slightly change the vertex colors so the shader uses a different offset depending on the vertex color.

#

blushie this leads in like 50 different looking signs, with a single material, just by painting the vertex colors of the prefab variants.

errant skiff
#

ah.. interesting about the vertex color solution

#

I thought about offsetting the uvs by shader params... but that would still change all my other objects that shares the same material.. but using the vertex color data would solve that. Should have thought of that ๐Ÿ™‚

torn steeple
#

Yeah its great ^^ not easy to think about all the possibilities unity offers ^^

errant skiff
#

yeah ๐Ÿ™‚ would you think that is feasible for animating stuff aswell.. like the torches?

#

right now I can use an animator, either to change the mesh itself.. or by animating the uv. But I have never tried animating the vertex color

torn steeple
#

You could write a second shader or just toggle a bool in your main shader that switches changing the offset between A) vertex colors or B) Time

#

Shader programming is lovely ๐Ÿ˜„ it offers sooo many stuff ๐Ÿ˜„

errant skiff
#

yea, sure does ๐Ÿ™‚ I am a bit concerned about branching my shader though. I probably just write a new shader for the animations

torn steeple
#

branching is a **little ** performance heavy, but still better as using 10 materials ๐Ÿ˜„

#

nice visuals btw ๐Ÿ˜„

errant skiff
#

thanks, I'm a sucker for large pixels.. but argh.. I am having difficulty choosing between the vertex color uv data idea versus just exporting each separate object as a unique mesh. There is something straight forward about having each object represented as a mesh that I like.. But having less meshes is also very desirable. Any tips to go about setting the vertex colors... would you write a small script or use third party? feels like it should be pretty straight forward just to alter the mesh vertex color data and not rely on some large package

#

I guess I would also be forced to only being able to offset by 256.. which is a bit of a limitation

torn steeple
#

You can easily use unitys polybrush to paint vertices. Just create prefab variants, paint the whole model with one click, and thats it ^^

errant skiff
#

Thanks for rubber-ducking ๐Ÿฆ†