Suppose I wanted to make a game where the player can shoot at objects and see bullet holes in them. It would be easy to use picking to find the 3D coordinates of the shot, but how do I paste my bullet hole texture there? If I have a quad at (0, 0, 0) which is x by y units big, and it is not rotated or scales, it would be easy to turn 3D coords into image coordinates on the quad, then render the bullet hole on the image with AWT or something. What if I have a complex shape like a sphere though? How do I turn 3D coords on the sphere into coordinates that I could use for splatting? And what is the “recommended” way to render these things? AWT?
Its all UV mapping, nothing special there.
But how though? code sample plz? (sorry, I’m new to jme3)
UV mapping is a general topic, :google: is your friend, our wiki also contains a lot of information on it. The terrain material uses texture splatting, so you can look there how its done exactly.
The advanced route is making shaders to render decals. Like this: http://www.popekim.com/2012/10/siggraph-2012-screen-space-decals-in.html