Shooting an image on to a surface

I am wondering if I can shoot an image on to a surface? The ‘Character Damage Demo’ (https://playcanvas.com/project/702588/overview/character-damage-demo), seem to be using mouse position in a ‘raycasting way’ while printing a noise-structure rim around the punctured holes.

[@yaustar: Elaborating further upon my last engine github/developer-thread {https://github.com/playcanvas/engine/issues/2538}; al though I have been using shader chunks previously, the ‘Character Damage Demo’ puzzles me with the 10 shader chunks … it is quite a large project structure (for me to grasp easily, at least) ]

I am searching for a solution, where the character model doesn’t get punctured. Can I ‘stamp’ a model with images like the ‘struct_noise.png’? - the image has to be fully stamped on, without a transparent puncture in the middle.

Hi @Thomas_Due_Nielsen,

Check the following thread, it contains helpful advice and a public example project.

It’s not exactly what you ask, as it doesn’t paint images but colors. Though you can work your way to update it for images with some shader work:

1 Like

ok, will look into it :+1:

Hi again - I have now looked in to it, as well as finding your tutorial at https://pirron.one/playingincanvas/texture-masks-using-shader (really good for round planet-shapes btw). The mapping of a sphere is quite robust/straight forward as opposed to a character.

From there I tried out a ton of Blender UV-mapping techniques, including mark-seaming and ‘Minimize stretch’.
Note: Please read my github-branch of the issue here ’ Feature request: black or at least dark light within light cookies’ (https://github.com/playcanvas/engine/issues/2538 - yes also written above, but just for safety if you missed it). And who knows, maybe you have a different technique to make black light (inverse camera colorbuffer rendering or the like?)