- Home /
Shader to paint at coords?
Hi, Is it possible to write a shader to create wound marks on a character at a certain position. Like the bullet decals but through a shader. In the forums someone suggested that, so i'm looking for an efficient way to paint wounds over skinned meshes. I've tried a couple of ways but not efficient at all. Decals are a bad idea over a character. Baking meshes are quite slow. I don't have a clue about shaders, so anyone can iluminate this a bit?
Thanks guys!
Answer by komodor · May 06, 2015 at 12:57 PM
generally it's possible
theoretically (i can't prepare the shader right now):
along with the properties you already have on your shader you'll need properties for wound textures of the wounds and properties for the actual wound positions
you have to Raycast the position where wound will be and RaycastHit.textureCoord (or other RaycastHit.textureCoordN) will tell you UV coordinates on the texture and you can send them to the shader and use it to place the wound
Great! Thanks komodor.
I will not ask for a shader example, but for someone with no experience at all with shaders, do you think this is a too much advanced job? Or with some advices it could be done? I want the best performance solution, but only if I can get it working in a near future... ;)
I'm thinking in just paint blood by zones, limiting the wound positions to head, torso, and one for each arm and leg. $$anonymous$$aybe 6 predefined areas with a blood wound texture.
Some time ago I tried modifying a shader I found in the web to do almost the same thing, but there was a limit with the detail textures you can use. And with the new standard shader I don't know how to solve that. Any idea/advice?
Thanks
it's very simple - i am shader noob so i use shaderforge and i can write just the code i can't make by dragging nodes
edit: actually not so simple you need to learn lot's of things however with shaderforge i was able to understand the stuff needed for this ... in our 2d game we are using similar technique to make something like bumpmap without normals
Hey,
I know about shaderforge, but unfortunately i don't have that money to spend now. I'll have to keep loocking for a way to get this...
Thanks!