- Home /
URP: Rendering a scene differently inside a bubble
Hi there!
I'm pretty new to anything at all in the graphical department (and maybe I'm dipping my toes too far in right now), but I'm trying to make it so that my scene renders with a muted colorspace (let's say just grayscale for now) outside of this bubble, but anything the bubble is directly touching gets rendered in color.
I'm effectively trying to represent where a force field of sorts touches the world. Currently, I just have a little spherical shell illuminating itself near its collisions.
I've tried multiple things already to get this effect working, but none have quite given me what I'm looking for, or I've just gotten lost trying to achieve.
For one, I've tried using simple custom passes on the forward renderer, making the force field solid and then excluding and re-including everything else in different steps based upon depth. This didn't quite give the effect I wanted (as it included things that strictly weren't in the bubble, and sometimes caused issues where something would pop through a wall.
For two, I've tried (and failed to) write a shader that would do some level of color masking based on the sphere's location (but I figure it'd not only be considerably ineffective to have that run on every displayed material every frame, and it didn't seem there was a super effective way to do that). My second guess in this area is kind of the inverse of what I'm doing on this force field's shader, but I have feelings that it would act not just on the force field's presence itself.
For a third thought, I see the HDRP has examples of something really quite similar with custom pass volumes. However, it seems there's quite a bit going code-wise there (and the HDRP's exclusion of OGL and OGLES devices causes issue).