No announcement yet.

Use Vertex Colours as a Direction Vector?

  • Filter
  • Time
  • Show
Clear All
new posts

    Use Vertex Colours as a Direction Vector?

    I have a mesh that has a Gradient painted between it's vertices, and I want to use the 'Direction' of that Gradient as a world-space direction vector in the material. Is that actually possible, or is there a better way to do it?

    Basically the mesh is supposed to simulate 'flames' coming out of the jet engines of a vehicle. Currently I simply scale the mesh in the particle system as and when I need to, but it requires having a particle system per-engine on the vehicle, and therefore is pretty inefficient. It would be much easier for me to have one property I can modify in the material which just 'Stretches' it out, depending on the direction it's facing.

    Even if I can't use vertex colours (which I don't think I can), is there a way I can simply get the general direction that the mesh is facing, purely through the material? Here's the vertex colours for reference. Regardless of the orientation of this mesh, I want it to 'Stretch' the vertices based on how close to white they are, and in the 'Direction' of that gradient in WS. In this case, it would be the negative-X axis.

    The only way I can think of doing this at the moment is literally modifying the vertex normal's to face that direction, and using that, but there must be a better way.

    Click image for larger version

Name:	wot.JPG
Views:	1
Size:	22.1 KB
ID:	1161729
    Last edited by TheJamsh; 09-22-2015, 05:37 PM.

    This has been pestering me for months and now i go and solve it within 2 minutes of posting. I can actually use the Vertex Normal and it becomes pretty easy, plus since this is an additive emissive material and because the mesh will always start off flat, modifying the normals produces no ill-effects... perfect, no more particles needed.


      Your attachment seems broken. Can you reupload your picture, I am interested in this too.


        Even better, have a video