Comments (20)
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.
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.
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.
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"
from osvr-rendermanager.
Ah ha.. setting "renderOversampleFactor" to 2.0 has definitely reduced aliasing artifacts but seems to be quite costly to frame rate:
from osvr-rendermanager.
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):
from osvr-rendermanager.
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.
@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.
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.
@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:
from osvr-rendermanager.
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.
HURRAHHH! I think I've fixed it :-)
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.
Presumably the renderTexture.antiAliasing
value should be inherited from the Unity Quality settings?
from osvr-rendermanager.
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.
@DuFF14 Ok, will do. Thanks.
from osvr-rendermanager.
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.
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.
@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.
Nope, I just needed a more complex scene to look at. I do see the improvement.
from osvr-rendermanager.
The Direct3D aliasing was fixed in the recent pull request, so closing this issue.
from osvr-rendermanager.
Related Issues (20)
- ATW not operating as expected with example programs on DK2/GeForce 1080 HOT 10
- AMD sub-module no longer uses NDA s.d.k? HOT 2
- ATW: "bubbles" of missed vsyncs in D3D11 ATW implementation HOT 1
- expose an interface for detecting HDMI will be better... HOT 3
- distortion mesh with multiple video inputs HOT 10
- D3D11 backend appears to hard-depend on SDL in code, but not in build system HOT 1
- OSVR-Unity Android crash traces to RenderManagerOpenGL::checkShaderError HOT 2
- Direct Mode w/ DK1 results in [NVAPI_RESOURCE_NOT_ACQUIRED] after 12 seconds of rendering HOT 3
- Overfill factor and distortion correction HOT 2
- Check the distortion correction texture lookups HOT 1
- Why have the OpenGL rendering examples stopped working? HOT 4
- Why is there a band of black at the top of the display?
- Direct mode doesn't work with mobile Nvidia GPUs HOT 8
- cmake policy warning FindOpenGL
- When there is only one eye, don't offset it
- OpenGL state is not restored when using a single eye
- Rendering broken on a mac HOT 1
- Shared-context apps fail to get an OpenGL context when run on a mac HOT 2
- Add synchronization primitive to indicate to the app when buffer is complete
- Another source for Windows precompiled binaries ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osvr-rendermanager.