• 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 parsa_dragon93 · May 13, 2013 at 02:18 PM · effect

light effect like BF3

i'm not even sure what to call this i've seen a lot of names for this bokeh lens flare , Dirt effect ? anyone got a tutorial how to do this in unity pro ? i don't want ready to use and worthless packages! real tutorials or atleast give me an idea how to do this ? plz response this is important for me!!

Comment
Add comment · Show 2
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 create3dgames · May 14, 2013 at 09:50 PM 0
Share

Unity Pro comes with sun shaft/god ray abilties.

avatar image parsa_dragon93 · May 15, 2013 at 07:25 AM 0
Share

yep i know but thats not what i'm looking for! Wim looking for thisW

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by HeavyPepper · May 13, 2013 at 03:41 PM

That is a pretty broad question but yes the effect is called bokeh and the BF effect simulates light glare on the camera. To get a similar effect you'll need a simple semi-transparent GUI Texture and some very basic script.

  1. Using Photoshop start by creating your GUI Texture with the bokeh effect. A series of semi-transparent, slightly blurred circles work well. Ensure they're set with a transparency and save your final image with an alpha channel.

  2. In Unity place your GUI Texture in the scene and apply a transparency shader. You should see the bokeh texture on screen and be able to see through it.

  3. With script we want the bokeh to only show when a light source is in view. You could do this by placing a script on the GUI Texture which checks for items with a specific tag. If "tag" is visible, turn on bokeh. Alternatively you could attach your script to the light itself, so when visible the GUI Texture is enabled. Example:

    function OnBecameVisible() { guiTexture.enabled = true; }

    function OnBecameInVisible() { guiTexture.enabled = false; }

Comment
Add comment · Show 2 · 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 parsa_dragon93 · May 14, 2013 at 09:02 PM 0
Share

yep i've made it ! looks like thats the easiest way to do that and it looks pretty good! but i was wondering if i can make it a little complicated ! u see in BT3 it looks like some GUI textures are only visible when the light is in a special area of the screen! how can i do this?

avatar image HeavyPepper · May 16, 2013 at 08:00 PM 0
Share

Look into Camera.WorldToScreenPoint which converts a GameObjects world coordinates to screen coordinates. You could then determine what side of the screen your light source is on. If you split your bokeh effect into two GUI textures you can then enable the GUI texture on the opposite side of the screen from the light source. For example, if your light is on screen and on the left side, enable the right side bokeh effect.

http://docs.unity3d.com/Documentation/ScriptReference/Camera.WorldToScreenPoint.html

avatar image
0

Answer by MarkD · Mar 25, 2014 at 05:27 PM

You can create a simple similar looking effect by placing a plane in front of the camera, which contains a texture with desired 'dirt', then you could use a particle shader such as multiply altough that would give a very static effect. There are youtube tutorials how to get better results with this technique.

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.

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

17 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

Related Questions

Can you use a camera effect that only applies to a certain layer? 1 Answer

slipering effect 1 Answer

BloomAndFlares Monodevelop compile error 0 Answers

Special effects on player's camera with alpha video?? 1 Answer

GUI under a character 1 Answer


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