add blood on adjacent texels/triangles of a ...

Community Forums/General Help/add blood on adjacent texels/triangles of a ...

RemiD(Posted 2015) [#1]
Hello, :)

Let's say that i have an unwelded, texelsfilled, uvmapped, humanoid mesh so that the texels size is uniform on all triangles and the texture is ready to color. Good.

Let's say that i want to add (procedurally) bloodstains/wounds on some parts of the mesh, and because the mesh is skinned and will be animated, i suppose that it is better to add the bloodstains/wounds directly on the texels of the texture.

Let's say that i know how to identify the picked/collided texel after a linepick/collision.

How can i identify the texels which are adjacent/nearenough to this texel knowing that the triangles of the mesh have been unwelded ?

The idea i have for now is to compare the vertices positions of the picked triangle with the vertices positions of the others triangles and then check if the picked triangle shares 2 vertices (not necessarily the same vertices but having the same position) with another triangle, so that i know what is the shared edge by the 2 triangles.
But then how am i supposed to calculate which texels are near enough the picked texel knowing that the triangles may not be aside on the texture and may not have the same orientation ?

The idea is to add bloodstains/wounds on humanoid zombies in order to have different characters.

Your thoughts ?

Thanks,


Kryzon(Posted 2015) [#2]
You can use a second UV channel with the character mapped in a convenient way for you to apply these blood decals.

You can use this 2nd UV set with a texture layer on top of the diffuse texure, and this top layer is used exclusively for the blood, blended with the bottom layer with alpha blending.

In order to render the blood decals you can use stencil tests to make sure the decal is only drawn on the parts of the texture that you want to.


RemiD(Posted 2015) [#3]
Yes i may use the second UV set in order to automatically unweld, texelsfill, uvmap the triangles of the mesh so that there will be a uniform texel size on all triangles, but the problem remains to know how to identify the adjacent/nearenough texels around a chosen texel...

Also if i use the second UV set, do you know if this will alter the skinning (influences of some joints over some vertices) of a skinned animated mesh ?

This seems complicated, i don't know if i will focus on this for now but i appreciate to read ideas on how to do that.