GithubHelp home page GithubHelp logo

Comments (20)

russell-taylor avatar russell-taylor commented on August 16, 2024

I think this is related to a known issue (known to me, not yet recorded on a Github issue) with the second rendering pass. You can work around the issue by setting the overSampling factor in the server RenderManager configuration file to be larger, which will cause more pixels to be drawn in the first pass which provides more detail for the second pass. The issue is that this should become blur rather than aliasing even when it occurs.

Distortion correction can cause dilation of parts of the Unity image before rendering to the screen, which is a separate source of aliasing from the Unity rendering itself.

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

Do you mean the "renderOverfillFactor" setting? I tried upping that from 1.5 to 5.0 but all that seemed to do was kill the framerate with no obvious improvement in aliasing effects. :-(

from osvr-rendermanager.

russell-taylor avatar russell-taylor commented on August 16, 2024

No, there is another one named renderOversampleFactor that is available on newer RenderManager versions that increases the rendering resolution without increasing the virtual screen size. renderOverfillFactor increases the screen size to help keep texture clamping from happening with distortion correction and time warp. And setting it to 5 will be rendering 25X as many pixels, so I'm sure it will kill your frame rate.

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

Ah, ok thanks. I will try that. Is it supported in the current published Unity OSVR Plugin Asset (v1.7) or do I need to get stuff from git hub to try it?

BTW. For what it's worth, here's results of my experiments with "renderOverfillFactor"

image

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

Ah ha.. setting "renderOversampleFactor" to 2.0 has definitely reduced aliasing artifacts but seems to be quite costly to frame rate:
image

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

Hmmm...perhaps move the "definitely" to a "maybe" as I upped the "renderOversampleFactor" to 5.0 expecting something that looked much better, but all it did was kill the framerate (as you might expect):
image

from osvr-rendermanager.

DuFF14 avatar DuFF14 commented on August 16, 2024

I'm trying to figure out when AA from the Unity quality setting fits into the rendering pipeline. There doesn't seem to be any visual difference turning it on or off when using Rendermanager. However, using AA as an Image Effect (script attached to each VRSurface), I think there is some anti-aliasing that is visible even on the RenderManager path (lines look a little more blurry than jagged). Maybe we are asking RenderManager to Present before Unity has applied AA from the Quality setting, but after Image/Postprocess effects?

@ChrisDenham Your scene looks like a good test case, could you test with AA as an Image Effect attached to VRSurface? It is available in the Unity Standard Assets package.

Either way, there are two parts to this -- AA in Unity (quality setting or image effect), and AA in RenderManager, where aliasing is introduced by distortion correction regardless of any AA done in Unity. Is it worth doing AA in Unity at all if we always need to do it again in RenderManager?

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

@DuFF14 OK, I'll try that tomorrow. That's a good point about whether its worth doing the AA in Unity, and come to think of it, maybe we want quality settings for rendering preview image to be as low as possible to have the best chance of hitting required framerate when adding in rendering for VR stereo views, distortion and compositing etc. I suppose that's why other systems use the composed VR image for the preview mirror?

from osvr-rendermanager.

DuFF14 avatar DuFF14 commented on August 16, 2024

The preview window will be a RenderManager feature eventually, not an extra camera in Unity. Other features have higher priority at the moment. Until then, I'd keep it off or not fullscreen if its keeping you from hitting your target framerate.

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

@DuFF14 I've tried adding the Antialiasing image effect to the VRSurface and it does help a bit (the DLAA technique seems to work best) but I'm still getting nowhere near the quality I need:

image

from osvr-rendermanager.

russell-taylor avatar russell-taylor commented on August 16, 2024

An oversampling factor of 5 is indeed going to kill the frame rate (rendering 25x as many pixels). Something like 2-3 is what I'd expect to be needed.

However, there is still an open issue in RenderManager to turn the resulting jaggies into blur when the oversampling is not sufficient. I've looked into it a bit, but it probably has to do with the texture-blending configuration used by the shader program.

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

HURRAHHH! I think I've fixed it :-)
image

The problem seems to be that the antiAliasing level needs to be set on the RenderTexture made in VREye.cs (as it defaults to 1) So to get the above result, all I had to do was hard code setting that to 8 here:

                        //render manager
                        if (Viewer.DisplayController.UseRenderManager)
                        {
                            surface.SetViewport(Viewer.DisplayController.RenderManager.GetEyeViewport((int)EyeIndex));

                            //create a RenderTexture for this eye's camera to render into
                            RenderTexture renderTexture = new RenderTexture(surface.Viewport.Width, surface.Viewport.Height, 24, RenderTextureFormat.Default);
                            renderTexture.antiAliasing = 8;
                            surface.SetRenderTexture(renderTexture);
                        }


from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

Presumably the renderTexture.antiAliasing value should be inherited from the Unity Quality settings?

from osvr-rendermanager.

DuFF14 avatar DuFF14 commented on August 16, 2024

Great find! I was under the assumption it was inheriting the quality setting. The non-hardcoded solution would be:

renderTexture.antiAliasing = QualitySettings.antiAliasing;

Can you open a pull request in the OSVR-Unity repo?

I think we can leave this issue open since RM distortion correction is still be adding aliasing, but hopefully this is good enough in Unity that it's less of an issue.

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

@DuFF14 Ok, will do. Thanks.

from osvr-rendermanager.

DuFF14 avatar DuFF14 commented on August 16, 2024

It actually doesn't really do much for me, testing in OSVRDemo2.unity scene and looking at the top edge of a wall. I wouldn't have noticed that it had any effect. But if it makes your more complex scene look better, that's awesome. I'll find a better test scene for AA.

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

Yeah, I guess it's most noticeable light/dark boundaries of objects, Some of my scenes have tiled walls and the grout edges look really awful without AA.

from osvr-rendermanager.

ChrisDenham avatar ChrisDenham commented on August 16, 2024

@DuFF14 just wondering if you were already using image effects or rendermanager oversampling? As that might be why you are not seeing noticable improvement with my change. Otherwise i wonder if it implies that for some reason your system does not require my change to get the AA in VR? For me, the difference is very obvious and essential. I find VR without AA is a very bad experience.

from osvr-rendermanager.

DuFF14 avatar DuFF14 commented on August 16, 2024

Nope, I just needed a more complex scene to look at. I do see the improvement.

from osvr-rendermanager.

russell-taylor avatar russell-taylor commented on August 16, 2024

The Direct3D aliasing was fixed in the recent pull request, so closing this issue.

from osvr-rendermanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.