It’s good but isn’t there a way to have it blend with Unity shadows instead of it’s current multiply effect? Here’s what Unity’s shader looks like that’s packaged with the shadow projector:
EDIT: full code in post below…
I think what I might be looking for is an ‘additive’ shader, but I’m not sure.
What do you mean blend with Unity’s shadows? Do you mean when a real Unity shadow and the projection overlap, they appear as the same color?
No, that’s impossible. The closest you could get would be to fade out the projector when in the shadow, but even that’s not really possible without a lot of work. You’d need to copy a reference to the shadow map or screen space shadow texture using a command buffer, then sample that in the projector shader to hide it when intersecting the shadow. Won’t look the same as the shadow, but it at least won’t overlap.
The better solution is to not use Unity’s projectors at all, and instead inject the “shadow blob” into the shadow maps themselves. If you’re targeting desktop, you can use something like deferred decals during the shadow collection pass. Otherwise you’re targeting mobile, or just want to do something simpler, you can place a shadow casting only circle mesh just above the ground using a ray cast.
The last option is if you only need the projected blob shadow to cast onto the “ground”, and you only need one blob shadow, you can do it in a custom ground shader that you pass the blob texture and projection to and mix it with the shadow in there. If you need multiple shadows, you can render them into a render texture and have the custom ground shader sample that.
Also, Projectors are terrible and you should never use them if you can avoid it.
@bgolus A ‘deferred decal’…hmm…I’ll definitely look that up, I’ve never even heard of it before.
Would that be something like this:
?
The second solution is what I’m gonna use, I can’t believe I didn’t think of it sooner, just putting a sphere’s Lighting setting in it’s Mesh Renderer to Shadows Only:
There aren’t really many characters to render, so it’s not gonna matter the whole performance hit if there is one.
Better yet, a capsule like this works well because it mimics the main directional light that’s always present in outside scenes:
I’ll just have to make like a scraggily object in probuilder to cast the shadow.
To solve the problem I just made this strange modern artish thing combined with a capsule collider, and just set them both to Shadows Only with the mesh renderer. x__x Thanks for the help!
And of course it looked like something suggestive, so I had to change it again. Well, thanks it really helps out.