Hey there. I’m looking to project a normal map onto a wall, so that I can move the image of the object (a stereo jack) across multiple surfaces, making it appear that the object is moving beneath the deforming surface.
I’ve done a little research with Projectors (from here), but I’m unsure of how to get that shader to work with normal maps, or integrate with the Standard Shader.
I’ve also looked into cookies for Spot lights, but these don’t seem to be able to use normal maps.
I’ve found a Decal Projector Component, but there doesn’t seem to be any documentation for it.
Can anybody suggest a way to project normal maps onto surfaces? I’m ready with maps…!
To do this with the forward rendering path would require using custom shaders in which you’re passing the decal’s texture and transform matrix to the objects’ materials. This is possible if you’ve got only a small handful of objects on screen, and very limited number of decals, but does require you know how to write shaders.
To do this with the deferred rendering path requires some form of deferred decals. There are several assets on the store to do this, as well as free examples posted elsewhere (including by Unity). https://www.google.com/search?q=unity+deferred+decals
Thanks so much, @bgolus ! Ideally there should be very few objects in this environment - it’s mostly an organic tunnel with objects pushing out through the membrane of the wall, then receding. A few of the smaller objects will need to travel across the walls, which is where I started thinking about Normal Maps and projectors…
Here’s an example of the visuals… (obviously an early test).
We are using HDRP, but I’m still not 100% certain that the Decals are our solution, as they need to traverse across the skin of the tunnel (maaaan, projectors would have been a huge help there).
I’m a moderately experience Unity dev, but without much experience writing shaders. I’m ready to give it a go - but any advice would be appreciated.
If you’re using the HDRP already, then Decal Projectors are what you want. They are the same thing as deferred decals, and have most of the benefits of legacy projectors with much lower cost and greater flexibility.