#[URP] Projecting a Color onto Everything in View of Camera

1 messages · Page 1 of 1 (latest)

quick harbor
#

I'm trying to highlight everything in view of a camera. I've been trying a lot of different ways, including lights, runtime mesh generation, and decal projection, but everything seems to cause me a problem. Decals seem to be the closest but I have a few problems. One is that the decal seems to "pierce" any objects and project on everything in view. The other is that it appears to only work in Orthographic, and I need it to be in perspective.

How can I "Cast" a color from a camera and tint everything it can see within a certain range? Stuff hidden behind a wall or another object shouldn't be included. If Decals aren't the way to do this, I'm open to whatever else anyone can suggest.

odd timber
#

Decals would be the easiest solution as in your picture it solves one of the larger issues and it's projecting it upon multiple different meshes. Otherwise you'll need to resolve that issue yourself if you aren't going to use the decal projectors that unity provides.

quick harbor
#

I would certainly love to use Decals if possible, but I don't know how to make it stop at the first thing it hits and not go through to the next one

#

Also I'd need to figure out how to get it to be Perspective instead of Orthographic

odd timber
#

Right, you'd have to modify the depth value dynamically then if it is spilling onto a surface behind it. Maybe clarify on what you're doing a bit more because casting a single color in the frustum of your camera sounds to me like something you can do with post-processing.

#

Maybe can even do something using the depth map itself with PP

quick harbor
hollow bridge
#

I have a similar sounding requirement and I use a spotlight parented to the camera with a light cookie and tinting. The light cookie is for projecting a decal without using the decal projector due to it not supporting occlusion.

lament linden
#

The techniques a shadow casting spotlight uses seem exactly like what's needed, which is a perspective camera's depth texture projected in world space