• 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
2
Question by jceipek · Aug 06, 2013 at 01:38 PM · 4.2

Antialiasing + FastBloom incompatible on Windows?

EDIT 2:

Tracked down the problem for real this time -- looks like a Unity bug (or a bug with the default Unity Assets on Windows) Steps to replicate:

  1. Create a new Unity Project

  2. Add a sphere to the default scene so that the camera can see it

  3. Import Unity Pro Image Effects

  4. Add FastBloom to the camera

  5. Enable 2X Multi Sampling as the Antialiasing Method in Quality Settings

Result: the camera view is flipped so that up is down and down is up.

EDIT:

The problem is actually related to FastBloom -- the image from the camera is flipped as a result of the fast bloom filter. I've tried adding the filter to a camera in a new scene in the same project, and the effect still persists -- the camera image is flipped upside-down when the fast bloom filter is enabled on Windows. I tried to replicate it in a separate project but couldn't. I suspect that the FastBloom resources that got included differ on Windows and OSX, but I don't know for sure yet.


I'm seeing some odd behavior with ScreenPointToRay on Windows -- it looks like the coordinates it uses for projection are inverted on the y-axis (the code works fine on OS X). Is this a bug in Unity 4.2? Does anyone have a workaround better than making a custom Windows build that displays an inverted mouse pointer and hides the real one?

 public Camera m_standard_camera; // Asssigned in the editor
 private Ray m_pointer_ray
 
 
 void Update () {
     // ........

     // On Click:
     m_pointer_ray = m_standard_camera.ScreenPointToRay(Input.mousePosition);
     GameObject under_cursor = FindObjectUnderCursor(100.0f);
     // Now under_cursor is not the object under the mouse (on Windows),
     // but the one opposite it on the y-axis. It works fine on OS X 10.7+

     // ........
 }
 
 private GameObject FindObjectUnderCursor (float cast_distance) {
     RaycastHit hit;
     GameObject hit_object = null;
     Debug.DrawRay(m_pointer_ray.origin, m_pointer_ray.direction * cast_distance, Color.yellow, 1.0f);
     if (Physics.Raycast(m_pointer_ray.origin, m_pointer_ray.direction, out hit, cast_distance)) {
         hit_object = hit.collider.gameObject;
     }
     return hit_object;
 }
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 robertbu · Aug 06, 2013 at 02:17 PM 0
Share

I could not spot an error, so I tested this code in the editor on Windows. It works fine. The only potential issue I see is that you return hit_object even if the Raycast() fails, so you could be returning an uninitialized variable. There is a form of Raycast() that takes a Ray, so you don't have to break it apart into position and direction.

avatar image jceipek · Aug 06, 2013 at 02:24 PM 0
Share

@robertbu $$anonymous$$y code checks for the result of under_cursor being null, so that's not the issue. I'll see if I can reproduce the problem in a different scenario tonight -- the full project uses the Oculus Rift and switches between the active cameras. The code sample I posted is only supposed to run when the Rift is disconnected, but maybe there's a logic error somewhere else that's causing a problem. Thanks for the tip about Raycast().

avatar image devin8 · Sep 18, 2013 at 03:56 AM 0
Share

Yep, I can confirm this issue exists. I simply added fastbloom to my camera and changed default quality levels to beautiful or fantastic and the screen would flip upside down.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Andy-Korth · Aug 18, 2015 at 03:16 PM

FastBloom needs to be modified to take into account the flipped Y in DirectX. Assuming you're seeing the problem on windows.

See http://docs.unity3d.com/Manual/SL-PlatformDifferences.html for instructions.

However, if you’re processing more than one RenderTexture together in your Image Effect, most likely they will come out at different vertical orientations (only in Direct3D-like platforms, and only when anti-aliasing is used). You need to manually “flip” the screen texture upside down in your vertex shader

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
0

Answer by kristoof · Jul 15, 2014 at 09:50 AM

if you are using forward renderer try deferred :)

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

MonoDevelop Won't Compile. Unity 4.2 2 Answers

Issue with NavMeshAgent behavior in 4.2 1 Answer

Shot instantiation 0 Answers

Is anybody having an issue with legacy particle system in 4.2? 0 Answers

Invisible object cast shadows. 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