• 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 /
avatar image
0
Question by Azrapse · Nov 30, 2016 at 08:31 AM · cameraculling masklens-flare

Lens Flares are rendered regardless of culling mask?

I have two layers: OuterSpace and Surface. At the OuterSpace layer I have objects that represent planets, stars, moons, and a sun with a lens flare component. At the Surface layer I have objects that represent stuff you find on the surface of a planet like rocks, trees, the ground, characters. Some of these objects have also lens flare components. Think on these two layers as two different, but simultaneous, realities being simulated in the game at the same time.

Then I have two cameras: Camera A has a culling mask so that it only render objects at the OuterSpace layer. This camera is rendered first. Depth -100. Camera B, has a culling mask so that it renders only objects at the Surface layer. This camera is rendered second. Depth -1. Both cameras are synchronized so that Camera A always has the same rotation as Camera B. The effect is that the player sees both surface objects and outer space objects on the sky. Like an astronaut walking on an asteroid or space station.

My problem is that both camera A and camera B are displaying all the lens flares, regardless of what layer their objects actually are at. So when the player looks at the sky, they can see the sun and its lens flare, as seen from camera A, but also they can see the sun's lens flare as seen from camera B at the same time.

Why cameras render lens flare components regardless of the culling mask?

How can I make Camera A render only some particular lens flares, while Camera B renders only some different particular lens flares, if not by using layers and culling masks?

I have searched for this, but only found this unanswered question.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Exsecratus · Feb 17, 2017 at 05:11 AM

Old post, but better late than never.

Every Camera has a "Flare Layer" you can easily uncheck it. ;-) alt text


flarelayer.jpg (94.2 kB)
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 Azrapse · Feb 17, 2017 at 09:07 AM 0
Share

Thanks, but that is not what I want. I want camera A that is in layer A to render flares from objects in A, while camera B that is in layer B to render only flares in objects that are in layer B.

With your solution, I would get one camera to render flares in all layers, and the other camera not to render any flare.

The problem is that cameras (with active Flare Layer) render all flares. Even those that are in objects that aren't being rendered by that camera because of layer culling mask.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

79 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Particle shaders not visible when using multiple cameras 0 Answers

How can you hide Canvas objects using Camera Culling Mask? 1 Answer

Pause camera / Use last camera image on buffer 0 Answers

Camera culling problem 3D 0 Answers

Camera culling without layer mask 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges