Assuming a model has UV's already setup, is there a way to "create" procedurally or otherwise, in Unity3d, a gradient material without using a texture?
Here's an example of a gradient ramp: http://www.secondpicture.com/tutorials/3d/gradient_ramp_parameters.png
Or do I need to create a texture, import it and apply it to the model?
asked Mar 09 '11 at 01:13 PM
You can create a material procedurally without textures by writing your own shaders. That way, you'll be working primarily with vertex positions, normals, uvs, colors and calling different arithmetic functions that are interpolated across the surface.
For example, you could do the ramp along your uv.x or uv.y. Just interpolate a color using the value from the uv map.
Or even more simple, depending on your needs, just set the Mesh.colors to the colors instead and use a shader that makes use of colors (I think the built in ones do, but I am not 100% sure - try it out!). Otherwise you can check out this shader.
Here, each color represents a vertex in your mesh. This color is interpolated across the surface of the neighboring triangles automatically, just like texture coordinates or normals.
Editing the example from Mesh.colors could yield:
I tested this with a particle material and it seems to work fine.