Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
avatar image
0
Question by Pure Phase · Apr 30, 2010 at 02:20 PM · fpscamerasblur

How to use 2 Cameras in FPS

Right, I'm not sure if this is possible so please, if I'm barking up the wrong tree let me know :)

I want some objects on my screen to blur whilst others stay as normal. So I think I read somewhere that you can create 2 cameras, one with a blur effect on and culling anything in the scene that you dont want to blur.

Is this right?

So I've duplicated my main camera and made it so that it just sees the objects I want to blur. But I can't work out how to look through both cameras at the same time. Is this possible?

Thanks

Edit - I have got the two cameras at different depths. However I only seem to see through whichever one is higher, and not two at the same time. i.e. I see either the objects that are blurry or the objects that aren't

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by taoa · Apr 30, 2010 at 02:59 PM

-=PRO ONLY SOLUTION=-

By "I've duplicated my main camera and made it so that it just sees the objects I want to blur" I assume you mean you've put all the objects you want blurred in a 'Blur' layer. I also suppose you have set your 'Blur' camera to render Nothing except objects of the 'Blur' layer, and your main camera to render Everything except the same objects.

So you're properly set :)

Now the 'tricky' bit (not so tricky, you'll see ;) ):

You cannot get both cameras to render freely. One will be render all over the other camera's own render, depending on the order in which they render (decided by the 'depth' property of the cameras, the lower the sooner). The trick is, to your 'Blur' camera, attach a little script that will create at start (and every time the screen resolution gets changed) a RenderTexture of the screen resolution size, and assign it to the camera's targetTexture property. Set the camera's clear colour to fully transparent (and I suggest black for the rest), and then to the MAIN camera, attach a script (if there isn't one already) inside which you'll implement the OnRenderImage function which will render full screen the Blur camera's target texture with you blur effect on.

And you're done.

Except you'll probably have some occlusion issues because of the non blurred objects not rendered in your blur camera.

I'll let you sort this out, it's getting complicated ^_^

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 Pure Phase · Apr 30, 2010 at 03:29 PM 0
Share

Cool, I don't totally understand this yet but I will have a go at working it out in an hour or so and hopefully I will figure it out. Thanks for your help :)

avatar image
0

Answer by Pure Phase · Apr 30, 2010 at 02:51 PM

OK I have worked this out now, you need to set clear flags to depth only.

However, this has not produced the effect that I thought it would. I wanted it to only blur the things it could see, but it just blurs everything. Is there another way of doing this at all?

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

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.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Audio Sounds Blurring Together 0 Answers

Respawn Player / enable new camera 0 Answers

how to use motion blur just for background (unity pro) 0 Answers

Trouble with Occlusion Culling 0 Answers

Building as UWP for PC runs very slowly when PC Standalone runs very smoothly. 2 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