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 /
avatar image
0
Question by Deadcow_ · Oct 23, 2014 at 07:02 AM · 2dlens

Lens Flares in 2d game

I'm experimenting with lighting in my 2d platformer and Lens Flare effect looks delicious, but I had never worked with it before and now failed to get it to work. For now I just placed it somewhere in the midway between background layer and gameplay layer as you can see here (in a future I'd place it between background layers): alt text

Great, it shining in a scene just as planned, and in 2d mode it looks fine alt text

But in the Game window there is no Flare at all...

2014-10-23 10-44-03 unity - station level 1.unity - train - pc, mac & linux standalone .png (165.8 kB)
2014-10-23 10-44-17 unity - station level 1.unity - train - pc, mac & linux standalone .png (153.4 kB)
Comment
Add comment · Show 4
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 Deadcow_ · Oct 23, 2014 at 07:03 AM 0
Share

alt text That how it looks in the game.

2014-10-23 10-44-33.png (13.4 kB)
avatar image alexanderflink · Oct 23, 2014 at 08:40 AM 0
Share

Sorry, it might be against forum rules to ask unrelated questions, but I really would like to know how you have managed to get that pixel perfect 2D look. Are your sprites scaled 1:1 and then zoomed in with orthographic scale in unity?

avatar image Deadcow_ · Oct 23, 2014 at 09:06 AM 0
Share

In our game we use sprites with 16 pixel per units, orthographic camera and asset called "Pixel Perfect", which changes camera size to nice pixel-perfect scale. Also as you may see in Scene view we use nice ProGrids with 0.0625 scale value, which give us one-pixel grid.

So, all work lies on Pixel Perfect asset

avatar image alexanderflink · Oct 23, 2014 at 09:09 AM 0
Share

Ah, thank you so much! :)

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Cruz.Guinho · Mar 11, 2015 at 12:40 PM

Do you forgot to add the "Flare Layer" component in your camera?

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 Deadcow_ · Mar 11, 2015 at 01:16 PM 0
Share

oh, stupid me! I don't even know about this Flare Layer component, thanks alot!

avatar image
0

Answer by g8minhquan · Oct 23, 2014 at 09:50 AM

I would check these:

  • z depth of the main camera & the flare object. It can be behind the camera

  • Make sure main camera's culling mask = "Everything"

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 Deadcow_ · Oct 23, 2014 at 10:34 AM 0
Share

unfortunately I had checked both, camera is in 0 on Z axis, flare is z=3 (but I also tried -3), culling mask is Everything

avatar image Deadcow_ · Oct 26, 2014 at 05:34 PM 0
Share

strangely enough... still can't get it to work :(

avatar image
0

Answer by Fatsludge · Jun 04, 2016 at 09:35 AM

Sorry for the late reply. I had the same issue, and I solved it just by changing camera projection from perspective to ortographic

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

31 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

Related Questions

Assets/Scripts/PlayerController.cs(32,49): error CS0126: An object of a type convertible to `float' is required for the return statement 1 Answer

2D Animation does not start 1 Answer

Animation won't play more than once 1 Answer

Move Object With Angle In 2D 1 Answer

How to make LineRenderer in GameObject Facing? 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