I’ve been googling and trying various combinations of settings here, and I can’t make it work, but it seems like something that should be so trivial to accomplish, I’m sure I’m missing something.
I’ve got an actor which casts a ‘fake shadow’ using a render texture target and decal on a boom arm projected to the floor. The reason for doing this is so the shadow can be used to gauge jump/landing position; it always appears directly below the player, and will show up even when standing in shade. This is a pretty old 3D platformer trick.
This works fine in 99% of cases. But, I’ve got some objects in my game world which are unlit (because they use a special cel shader model) and I cannot project the decal correctly on to these, and I need to.
Via experimentation, I’ve discovered that the reason for this seems to be that when dealing with emissives, decals (DBuffer or GBuffer) only work additively; i.e. they can only lighten the scene. Since the decal in question is a shadow, obviously, that’s not really ever going to be desired behavior. No matter what blend mode I try; translucent, stain, alphacomposite, DBuffer color, I always get something between “it’s not there” and “it’s a slightly whiter area” depending on the color beneath it. Is there no way to have a decal darken an unlit (or emissive, as I have tried and gotten the same results setting my unlit materials to be lit and simply fully emissive) material? Surely if the results of the decal are written to a separate buffer, it’s just a question of how that buffer is composited with the other rendering passes, right? There must be a way to tell it “use the dbuffer opacity channel to lerp between the scene texture and the decal texture, don’t do any other adding or multiplying”, right?
EDIT: a picture for clarity. On the left, you can see the stencil shadow rendering as intended on a standard material, but on the right it’s disappeared as the engine tries to render it over an unlit “cel” material.