Collectible Shadows

Design were having trouble with players judging where pickups were located, they kept missing them when attempting to collect. They wanted to have a shadow that was directly below the pickup at all times, regardless of light direction, so players could just walk over the shadow and guarantee collection of the pickup. We had already done something similar with the main character shadow. However that solution would be too expensive, as it uses a Scene Capture to capture depth which is then applied in a Decal Projector.
Instead I created a shader that repositions a translucent non depth checked plane below the cog. The shader is fed the distance to the ground and the angle of the surface via CPD values. This allows the shadow mesh to be positioned correctly and animated to properly represent the pickup shadows as if a light were shining directly down.
This method also had the advantage of showing a shadow, even if the pickup itself was entirely within a shadow already.

I did try another method that involved repositioning the verts during the shadow pass, but that method fell apart if the real light was at an extreme angle (some of our levels have completely horizontal lighting) and does not have the advantage of being visible even in an already shadowed area.

----

Junkster is an unreleased project from by Stormcloud Games. Currently stalled by lack of publisher but with some luck the product will release to the public, but as yet it is unknown when.
Wishlist on steam if you want to see it released: https://store.steampowered.com/app/1675860/Junkster/

Collectible shadows as planes instead of real shadows to prevent multiple shadows and so their placement can be directly below the collectible at all times, even if light is angled.

Collectible shadows as planes instead of real shadows to prevent multiple shadows and so their placement can be directly below the collectible at all times, even if light is angled.

Collectibles with shadows in typical usage in a level.

Collectibles with shadows in typical usage in a level.

All the available collectible types with their shadow, not obeying the sun direction.

Shows that as a collectible moves, its shadow placement can update to reflect its new conditions.

Collectible material highlighting the important part of the material that manipulates the shadow quad's verts into the correct position to represent a shadow.

Collectible material highlighting the important part of the material that manipulates the shadow quad's verts into the correct position to represent a shadow.

Different collectibles have different shadow shapes. Shape can be selected in the Material Instance via parameter.

Different collectibles have different shadow shapes. Shape can be selected in the Material Instance via parameter.

Special collectible shadows can use a flip book texture instead of single image. Flip books can play forward and backwards to reduce frame number and timing can be adjusted to match collectible VAT animation.

Special collectible shadows can use a flip book texture instead of single image. Flip books can play forward and backwards to reduce frame number and timing can be adjusted to match collectible VAT animation.

All collectible shadows in a typical game environment.

All collectible shadows in a typical game environment.