Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jun 10, 2013 at 11:47 AM by fafase for the following reason:

The question is answered, right answer was accepted

avatar image
3
Question by fafase · May 19, 2013 at 11:21 AM · cameraterrainrendering

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

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Chronos-L · May 19, 2013 at 11:29 AM 2
Share

Are you talking about the fog of war?

avatar image fafase · May 19, 2013 at 11:34 AM 0
Share

Actually yes something like this!!!. I see the page on wikipedia about fog of war but it's only half of it. From what I see, the camera is always above but in my case, the camera is still able to move in 3D. That means when the camera reaches the edges of the circle, it renders grey on one side and colorful on the other.

It would be like being in a normal environment and suddenly entering a totally grey world.

That sounds a little too far fetched so I might have to lower the requirement.

avatar image fafase · May 19, 2013 at 11:38 AM 0
Share

Actually, the application has nothing to do with war or even game. It is for a road and transportation institute. The idea is that the circle defines a zone where it is allowed or not allowed to build something. For instance, you have a monument and within 200m no building taller than 20m can be build. The user places the point on the monument, defines 200 for radius, now we have a colorful zone indicating where it is not allowed.

2 Replies

  • Sort: 
avatar image
1
Best Answer

Answer by fafase · Jun 10, 2013 at 11:47 AM

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...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by ByteSheep · May 25, 2013 at 11:21 AM

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 (http://answers.unity3d.com/questions/404637/subtractive-rendering.html) 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? http://answers.unity3d.com/questions/8220/rendering-order.html)

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 :)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fafase · May 26, 2013 at 01:33 PM 0
Share

That would be the closest way I could try for now. I need to see with the "customer" what he meant exactly. The perfect way would be to have all terrain and object greyed out but I doubt this is possible without deep manipulation.

The plane over the terrain is halfway only since the terrain may relief, it would be that either the plane is up high enough to be over all relief or some relief are getting through. One solution I thought of could be to duplicate the scene (terrain and objects) with a grey rendering, same transform only with a y of +0.1 and then apply the subtractive rendering on the position...may be a little far-fetched though. I will try and report anyway.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity terrain and odd frustum culling behavior 0 Answers

Far away details aren't rendered 2 Answers

I Have Glitch Problem Car Move At time car back light and num plate glitch 0 Answers

Is it possible to only render on one side of a plane? 4 Answers

ClearFlags don't seem to work when I manually call Render() on my cameras. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges