I’ve made myself a shader that dithers objects based on camera distance, with the goal of ensuring that if they’re occluding something the camera is trying to look at, they go translucent. Pretty easy/standard stuff. However, I’d like it if the full object was dithered in this case, not just the pixels in question. Is there a way to do this?
Some of my thoughts:
- I don’t want to use the object’s position, because the pivot may be in a totally unrelated spot
- I tried using the screen position, but it’s basically the same problem – only the pixels in the given spot are dithered, which makes sense.
- I’ve thought about trying to pass around globals, but didn’t really see a good way to do it.
- I can obviously do this differently – raycast and adjust the alpha – but I don’t currently have colliders on many of these things (tree leaves and whatnot) and, more importantly, I’m just curious if there is a way to do this.
Using shader graph / URP