Forum Discussion
SiggiG
12 years agoProtege
Deferred rendering and AA in Unity
Hello!
Has any of you been using deferred rendering in Unity with the Rift? I'm having troubles getting image-based anti-aliasing to work properly, it looks almost as bad as having no AA at all.
Either the lens distortion shader isn't working properly with the AA shader or the flaws in image-based AA are just much more visible through the Rift?
Has any of you been using deferred rendering in Unity with the Rift? I'm having troubles getting image-based anti-aliasing to work properly, it looks almost as bad as having no AA at all.
Either the lens distortion shader isn't working properly with the AA shader or the flaws in image-based AA are just much more visible through the Rift?
8 Replies
Replies have been turned off for this discussion
- SiggiGProtegeGoing through the new docs and these two bits explain what I'm seeing :) Thanks!
since we are not going to be rendering with Deferred Lighting
mode (only with Forward-Lighting).Unity does not currently support setting anti-aliasing on render targets. This impacts the overall
resolution of the rendering since the lens correction pass 'stretches' the image, causing artifacts
that can be corrected by rendering into a larger buffer first and then down-sampling to the final
buffer. - cyberealityGrand Champion@SiggiG: Yeah, sorry for the delay. Been really busy the past few days. From what I understand we aren't using deferred rendering in the demos specifically because of problems like this. There may be solution, I'm not sure. I will look deeper into the issue when I have a chance. Thanks.
- owenwpExpert ProtegeProbably the best solution here is to integrate image-based antialiasing into the distortion shader itself, so that you are re-sampling and filtering at the same time without data loss. FXAA is probably not ideal for the non-uniform sampling due to distortion but there should be some other good image reconstruction filter floating around that works. Maybe just use anisotropic filtering with manually computed gradients? Experimentation needed.
- owenwpExpert ProtegeAfter trying the SDK in my project, there seem to be two things breaking deferred rendering with the Oculus SDK:
-The post process that performs the optical correction uses a custom blit operation that calls opengl instead of the standard Graphics.Blit method. This turns the screen black and white for some reason. I don't have a rift yet so I can't be totally sure if there is some other reason it was done this way, but it should not be necessary.
-The camera class computes a custom projection matrix which breaks unity's screen space to world transform, making point lights and shadows appear in the wrong place. As far as I can see this is only done to apply the IPD offset, but that should be just as easily done by simply moving the camera transform.
I have tried my own fixes to these issues and I will see how they work once my dev kit arrives. In any case it should be easy for Oculus to fix. - AntonHonored GuestIf you want something that will give you a huge image quality in Deferred mode, try applying the camera-motion blur image effect (DX11 reconstruction is the best), and turning the max velocity of it down. Because the oculus headset is _always_ moving ever so slightly, the resultant effect is almost akin to temporal anti-aliasing.
In my tests thus far in our project, it doesn't seem to introduce any problems in terms of motion-sickness, as the effect is still fairly light. Only downside is that its a touch expensive. Considering one is only doing a 1280x800 frame though, not too bad. - heshamProtegeI added this to another thread here but it is relevant :)
To enable deferred lighting I turned it on for CameraLeft and CameraRight then edited the OvrCamera (script) file to add at line 221:
if(camera.actualRenderingPath == RenderingPath.DeferredLighting) {
flipImage = false;
}
The shadows flicker and shimmer with every head movement and are moving with my motion instead of being fixed with the geometry itself, but at least it isn't flipped. - cyberealityGrand ChampionYou should be able to use image based AA with deferred rendering after applying this fix:
viewtopic.php?f=37&t=102#p1397
However, there are still more issues with deferred lighting (shadows, etc.) that we are still looking into. - burning01ExplorerHas anyone managed to come up with a newer solution for this using the latest oculus build?
Using forward rendering and both unity and oculus manager set to AA x8 then adding a standard FXAA to each eye I get a decent effect.
However forward rendering just really doesn't work well for my game.
Most of the information on this site or on the net that I could find is old.
I have an SMAA script for unity that is supposed to work with deferred but I keep getting a black screen when adding to the cameras, I know this stuff has been spoken about in various places but I haven't seen any up to date information it.
So does anyone have a decent up to date solution for using deferred rendering, Anti-aliasing and the Oculus?
it can obviously be done as seen here http://blogs.unity3d.com/2015/02/16/pollen-vr-developing-high-end-visuals-with-unity-5/
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 2 years ago
- 9 months ago
- 2 years ago