Grey out part of the scene from rendering

If interested, see Edit at the bottom

Hey,

I can think of where to start from with this…

The user can place a point on the terrain, then give a radius, and everything outside of that circle is greyed out. Terrain, object, all.

The idea is that, inside the circle, everything is rendered normally but outside the circle, everything is grey.

Considering that the camera is also able to move around (in all directions) that means I cannot just use some kind of plane with a transparent grey texture at the distance…Also, I cannot just put a thick fog at the distance since it would move away with the camera approaching the edge of the circle.

I thought of particle system but it sounds really expensive since the terrain is really long.

I just need something to start with. Maybe Unity has something like this that I do not know about…

Any tips? Thanks already.

EDIT: Ok, I do not have the answer yet as I have had not time to really try but I thought of a possible solution.

The problem I had is that the camera is moving and the fake fog should be staying where it is so fog or object attached to the camera wont do.

But One thing I can do is use a simple distance script and render all of my object in grey by accessing their renderer and turn them all to grey. It would take time but the application can have a stop, it is not a game.

All I need is to render my terrain “normally” in the radius and apply a grey texture anywhere else.

I could use a for loop iterating over the whole terrain and if the position is outside the radius, I could apply a decal on top.

Well, I will try it, if someone would know right on how to do that, it would fasten my process.

Thanks

This is a fairly late reply (funnily enough did see it in the advanced question section eventually), have you thought about trying to use subtractive rendering?
You could create a plane parallel to the ground covering the scene and then use the method in this answer (Subtractive Rendering? - Questions & Answers - Unity Discussions) to cut a circular hole in the plane at the position you need it.
In addition you could make sure the plane covering the rest of the scene always is rendered above everything else - (maybe using two cameras or this technique? Rendering Order - Questions & Answers - Unity Discussions)

Here’s an example - you can move the circle with WASD, move the camera with Q/E and make the circle radius bigger or smaller with G/H.
It’s pretty rough but you get the idea. Hope I understood correctly what you are trying to do :slight_smile:

Ok I got my solution and it is actually so dumb that it did not occur to me before.

All I do is setting my main light down to get the whole world dark and then I use a spot light directed to the ground with a cookie to make the edges sharper.

I wanted to add a pic of the result but I am not allowed as the question has already exceeded the amount of space or else. So trust me…