So I'm trying to make grass from 3d motive tutorial. After lots of messing with coord system I finally made it work... kinda... I don't know why but they are rendered with vertex colour. I painted the terrain with detail painting. If I change the tint colour of grass in the terrain settings only the value changes anything and it changes 'opacity' of vertex colours. I painted mesh with red like in tutorial so I could make it move depending on vertex colour. Any one knows how to fix it ? Any idea how to make it move with vertex colour ? ;p (I just didn't google it yet. Maybe some one here did something like that ?)
Replies
Although, all of the grass vertex animations I've seen use the UVs to control which parts of the grass are affected, and you could probably use your vertex colours to control the direction or something. Could be pretty cool.
If you haven't written such a shader before, I think that a similar shader is included in the built-in shader source (although those might be using Shaderlab, rather than the more standard -- and more understandable in my opinion -- standard vertex and fragment shaders).
If you get really stuck I can look at whipping one up when I've got some time.
I... have never done that, but it would be pretty handy if I could do that on non-terrain objects too... I'll have to check that out!
Whether you're using vertex colours, or UVs, and what they do, is really dependent on how the shader is written. If you're not getting the result you're looking for, I think there's a good chance the shader's just expecting different information to what you're providing. Maybe posting the shader code could help.
- I painted vertices in max
- imported as fbx to unity
- painted terrain with detail mesh painting
- all detail mesh is tinted with vertex colours ( == grass is red ;])
As far as I know there is a plugin for Unity to vertex paint but I wasn't talking about it ;p I'm sorry if its hard to understand me sometimes. My eng is bit rusty.
I will try to write the shader when I'm done with this issue ;p
Thats how it looks.
What you see in your Unity scene is what your shader gives you. If your vertex colours are influencing the output in your shader, that's what you'll see. If you switch the grass to use another material and a different shader (say, ordinary diffuse for example), you probably won't see the red any more -- but then you'll probably lose your grass blowing animation too.
Does that make sense?