Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flickering jagged edges for objects in opaque device #1327

Closed
raedbenz opened this issue Nov 9, 2017 · 15 comments
Closed

Flickering jagged edges for objects in opaque device #1327

raedbenz opened this issue Nov 9, 2017 · 15 comments

Comments

@raedbenz
Copy link

raedbenz commented Nov 9, 2017

Hello,

I am using Unity 2017.2.0f3 MRTP to build my app that runs on Lenovo Explorer HMD. The issue is that on every object we get the effect of flicker and jagged edges. I am running with opaque display settings Ultra.
I then tried the toolkit examples scenes e.g. GrabMechanics, and applied the Mixed Reality Toolkit project & scene settings to it, and still getting the same issue. Also noticed the further u get the more obvious the jagged edges become.
I did a bit of googling and in unity forums they suggest filckering jagged edges is due to small value of near clipping. recommended is about 0.3.
However, the near clipping value that can be set from inspector on the MixedRealityCameraManager script, it keeps showing 0.1 although in script code is 0.3 for opaque devices. Moreover it seems at run time the value also is 0.1 (i am printing the value of CameraCache.Main.nearClipPlane).
Also tried different values for anti aliasing with no luck.
The villa in the portal runs fine.

Can anyone one point me to a sample code that you know it works fine, so I can test it, maybe is something with my dev environment.

Any suggestions please?
Thanks

@raedbenz raedbenz changed the title Flickering jagged edges for objects in HMD Flickering jagged edges for objects in opaque device Nov 9, 2017
@raedbenz
Copy link
Author

Tried it with MRTP4 and 842c4a1 commit. still same issue..please advice urgently.

@StephenHodgson
Copy link
Contributor

StephenHodgson commented Nov 10, 2017

Please provide a screenshot of the behavior.

You can update the clipping plane on the MixedRealityCameraParent.

Also please provide definitive steps to reproduce. This could either be an issue with your graphics card, environment setup, or even a bug in the Unity Editor itself.

@raedbenz
Copy link
Author

raedbenz commented Nov 10, 2017

Hi, as i said in my first post, i am trying to change clipping plane other than 0.1 but at run time is still 0.1.
I am not sure is the graphics card as the villa house of the MR portal looks fine. I have a GTX1050TI.
What is the best way to take a screenshot while app running ?

Here are the steps:
1- Open unity MRTP4 and add a scene from toolkit examples. i have tried GrabMechanics & InteractiveExample.
2- apply project and scene settings.
3- Select MixedRealityCameraParent --> MixedRealityCamera and set near clipping under opaque display settings to 0.3
4- Go to Build settings and add scene
5- Open MRTK Build Window and click "Build SLN, Build, APPX"
6- run powershell script

fff
n2
n1

Thanks

@StephenHodgson
Copy link
Contributor

Also, there was an issue with the editor not serializing the correct info when choosing the clipping plane for occluded devices but was fixed in #1259

@raedbenz
Copy link
Author

raedbenz commented Nov 10, 2017

In my case issue #1259 is still reproducible.
Thanks

@StephenHodgson
Copy link
Contributor

StephenHodgson commented Nov 10, 2017

I can assure you #1259 is most definitely fixed. Try using the latest maser branch.
Serialization is updated appropriately when applying changes to the prefab or when saving the scene before entering play mode.

image

image

@StephenHodgson
Copy link
Contributor

I suggest posting this question in the Windows Mixed Reality Forum to see if the Unity engineers have any advice. I'm thinking this could be an issue with the latest MRTP release but I'm unsure. I don't have the same issues here on my end. A screenshot of your issue would def help to know what I'm looking for.

@raedbenz
Copy link
Author

raedbenz commented Nov 10, 2017

Ok I 'll post it there as well.
The near clipping value is a very strange issue.
As I mentioned in my first post. When I go to MixedRealityCamera the value shown is 0.1, although if I open the script it says 0.3. Then when I run the app and print CameraCache.Main.nearClipPlane the value is 0.1. The issue I am facing is when running on IHMD not play mode, that's why I asked how to get screenshot at runtime.
Thanks

@StephenHodgson
Copy link
Contributor

Yeah that's definitely a separate issue. Can you open one specifically for that please?

@StephenHodgson
Copy link
Contributor

As for a screenshot you should be able to mirror the mixed reality portal and get something with the shipping tool.

@raedbenz
Copy link
Author

raedbenz commented Nov 11, 2017

Here is a bunch of screenshots. Here you can see jagged edges, in video you can see also the flicker of jagged edges. To download video and sample app click here.
villa2-portal
nc0 1-portal-aa4x
nc0 3-portal-aa8x
nc0 3-unity-noaa
nearclippin0 3-portal-noantialiasing
nc0 1-unity-noaa
nc0 1-portal-noaa

@raedbenz
Copy link
Author

@markgrossnickle
Copy link

@raedbenz Your solution at the bottom of this thread worked perfectly for me: https://forum.unity.com/threads/flickering-jagged-edges-for-objects-in-immersive-mixed-reality.504067/

I didn't realize there was a MSAA property on Unity Cameras and could not figure out why anti-aliasing was not working for me. Also the XRDevice eyeTextureResolutionScale was helpful as well in regards to textures and sprites.

I think we should add both MSAA and eyeTextureResolutionScale to MixedRealityCameraManager. Enabling MSAA by default for Opaque as well as eyeTextureResolutionScale to 2.0. My only hesitation is that instead of people coming here and trying to figure out why they are getting jagged edges we may get people coming and trying to figure out why they have low FPS.

@jackrohit001
Copy link

Hi all
@raedbenz I am also facing same problem, But when i checked MSAA it resolved my problem but main problem is in .appx file, When i am playing same Game in mixed reality portal it is showing Jagginess :(
Please help

@raedbenz
Copy link
Author

When you say it resolved the problem, where did you check that, is it inside unity game window?
it is also worth check your graphic card settings, for instance in NVidia control panel you can allow each app to take control of antialiasing behavior.
Have you tried creating a test app and print out the msaa & eyeTextureResolutionScale values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants