- Home /
Leaving marks (savable to png) on texture
I am trying to figure out the best way to leave marks on a texture that can eventually be savedtopng.
The player gets to beat up a character, and leave various marks on the character's "face" -- anything from papercut to large black eye bruises.
Well, it would be interesting to know what kind of "face" do we talk about? A complex mesh that is UV-mapped, or something else?
Also how should your "marks" look like or where do they come from? Are they also small textures with alpha? Combining several textures "manually" in script is possible but you have to ask yourself if you want to implement functions that usually have it's place in image editing tools like photoshop.
The easiest way would be propably to render the texture in an orthographic camera, render the marks on top of that and read back the framebuffer into a texture.
For simplicity - a high poly sphere. I guess I am just trying to find a way to connect RaycastHit with the UV coordinate to "leave the mark" ... It seems applying a small texture with alpha vs just projecting points is the same thing? For the small texture, you just readpixels, then try applying it via the same raycast(?) projection?
Answer by NikSpace · Dec 13, 2011 at 08:39 AM
You can change the texture of the enemy's or the player's face based on the amount of health that is left.,You can change the texture of the enemy or players face based on the amount of health that is left.
Sorry, but my question has to do with how do you leave marks on the texture.