Started working on a quick-and-dirty Decals System.
Btw if you know any good papers, link them to me, because I mostly found
deferred decals which involve the G-Buffer, so aren’t possible in jme as of now.
What you see here is what I call Flat or Planar Decals. What I did is to generate a local coordinate system for any given triangle (which you get by raycasts). It’s actually not more than if you would manually place a quad there, however it’s acceptable for most cases (blood, bullet holes, …). The good thing is you could realise all of this with any given Material/Mesh, you’d just need a Control.
Fun-Fact: It’s non-trivial to find where ‘up’ is. In the given example I take the sphere-local y as up, so when the ball rotates, it looks like the decal is glued to it. If you, however, have something like rocks or other props in your environment, artists like to rotate and scale them so they fit. That is a case of global-Y sometimes, because you want to be able to read the newspapers, or say: You don’t want the blood to drip in the inverse direction of gravity.
Next up is adding actual decals in the demo and then the fun can start with real wrapping decals.