Jump to content

Multiple issues with SSAO


dsman
 Share

Recommended Posts

(This post is continuation of earlier post : http://www.html5gamedevs.com/topic/22734-lighting-how-achieve-this-kind-of-result-from-lighting )

There are many issues with SSAO. 

1. It adds lots of aliasing on edges. Not sure how to get rid of this. 

2. It reduces FPS to 30-40 . Our scene is static. (Even camera position is going to be static. It will just arc-rotate ). Is there any way it can not to calculate it every frame ?

3. There are some shadow-like effect. So the way we rotate camera some lighter and darker areas change.  ( Rotation view 1 : http://prntscr.com/b8lxmf  , Rotation view 2 : http://prntscr.com/b8lyuc   ) 

4. I had been tweaking SSAO setting for hours and hours. But unable to get the perfect result. Either it is too blur  or it shows too much of noise and grain in whole screen and draws some glow/shadow areas on entire plane surface (like shown in #3 ) 

 

In  all screenshot above, the scene doesn't have any light. All meshes are given emissive color. 

Link to comment
Share on other sites

Also why is SSAO so slow ? Potential frame rate without SSAO is 200 something. My scene/model  is very light.  Adding so many lights or shadow , PBR and reflections isn't dropping frame rate much. But as soon as you add SSAO , no matter what setting it drops to 30-40 even on a desktop with decent GPU (Nvidia GT 7xx  1 GB) . 

The application made with threejs , screenshot of which I mentioned in earlier post ( http://www.html5gamedevs.com/topic/22734-lighting-how-achieve-this-kind-of-result-from-lighting ) , is working smoothly with 60 fps on same machine. Which is said to be having SSAO , as mentioned by @Deltakosh in that thread. 

 

 

Link to comment
Share on other sites

Hey dsman,

Sure, I'm uploading the files (.ts and .js files for the SSAO rendering pipeline and the associated .fx shader files). The problem is that I completely removed the horizontal and vertical standard blur post-processes and replaced it by a smarter blur post-process (bilateral blur) largely used for SSAO : breaking changes

According to the performances, what is your ratio when you create the rendering pipeline ?

Link to comment
Share on other sites

10 hours ago, Luaacro said:

I would say if this version is really better compared to the current one then the current one should be replaced.
Regarding the breaking change. This could be added to the release notes of the next BJS version. Maybe with some hints how to migrate to the new version.

 

Link to comment
Share on other sites

Exact, I had a discussion with @Deltakosh and I'll update it really soon. I'll also update the doc page of SSAO to explain the breaking changes. For you, only the blur post-processes have changed, they no more exist. To help you to configure SSAO, you should use the editor with your scene : http://editor.babylonjs.com

Documentation : http://doc.babylonjs.com/extensions

Post-processes such as SSAO are in the scene (select the scene in the scene graph on the right)

Link to comment
Share on other sites

@Luaacro  I appreciate your effort to share the files . 

Can you please check 4 issues I mentioned in original post. And tell me if new blurring technique will help solve any of them. Mainly the performance. 

Additionally I have some more queries about SSAO  

I don't understand theory of 3D graphic much. I read somewhere that mesh can be pushed to RenderTarget. So can this be somehow used to apply SSAO on only some selected meshes and hence make it faster a bit somehow ?

Also I read somewhere that we can have smaller Depth Render target than current scene area. Can this be somehow used to force SSAO to  compute less pixel ( by sacrificing quality)  and hence make it faster ?

 

Link to comment
Share on other sites

Well I changed the ratio to 0.7 and combined ratio to 1. Now there's significant improvement to FPS.  Almost tolerable for mobile device , if not desirable.  But few other issues with SSAO effect which I mentioned in original post above are still there (Even after figuring out best combination of value of fallout , strength , blur values etc). 

I am not sure if this will go away with new blurring method. 

 

Although, I would wish if we can set it for only few meshes. ( I know its post process . But if somehow it can be achieved. )

Link to comment
Share on other sites

@dsman sure everything is possible with Babylon.js :)

To setup only few meshes with SSAO, you only have to set the property ".disableDepthWrite" to "true" of each material affected to the meshes you don't want to render in the depth pass (used by the SSAO rendering pipeline)

Also, for more performances and enough good results it is more advised to use a ssaoRatio set to 0.5

Computing the depth renderer in a lower resolution isn't possible today, but @Deltakosh who wrote the depth renderer may be able to answer you and maybe find a solution, as everything is possible with Babylon.js :)

Link to comment
Share on other sites

  • 2 weeks later...

@Luaacro  the SSAO has got lot lot better in this rewritten code logic. Very well done there. Special thanks for that. All above issues that I have mentioned has gone now.

 

Just that it is slower and reduces fps by multi fold. But probably that is global limitation and nothing to do with your logic or babylon. I saw an app built in threejs (mentioned here : http://www.html5gamedevs.com/topic/22734-lighting-how-achieve-this-kind-of-result-from-lighting )  which was blazing fast even with SSAO . So may be they are doing on selected meshes.  

 

At ssaoRatio = 0.5 it shows some noise on screen . It appears like the display screen has got some dirt and strains. So we use 0.75.

 

 

What are other parameters that can affect the speed of SSAO ? Does the properties like radius, fall of, strength affect it ? 

 

Link to comment
Share on other sites

@Deltakosh  Can we have option to compute depth renderer  at lower resolution ?

 

I don't understand the deep theory of SSAO implementation but I somehow believe the lesser resolution of depth renderer won't affect the quality of SSAO but will improve the compute speed and fps greatly. 

Link to comment
Share on other sites

Hello ! 

I experienced the same kind of FPS drop trying to use SSAO, 

On 30 mai 2016 at 9:59 PM, Luaacro said:

To setup only few meshes with SSAO, you only have to set the property ".disableDepthWrite" to "true" of each material affected to the meshes you don't want to render in the depth pass (used by the SSAO rendering pipeline)

I've been looking for this piece of information =) would be cool to add it in your tutorial !

I'm using a high dpi display (retina macbookpro) I don't know if the performance drop comes from that ... just an idea =)

Link to comment
Share on other sites

@Luaacro 

Isn't there any way to get rid of aliasing that happens when we enable SSAO ? Following are screenshots with and without SSAO. Look at the aliased edges on kitchen cabinets, glass window, dining table  in the screenshot with SSAO. There's no aliasing in the screenshot without SSAO. 

 

With SSAO  ( http://prntscr.com/bgmzgw ) 

d2e9347efc5b4415a112bb60b5e1c119.png

 

 

Without SSAO ( http://prntscr.com/bgmz1k ) 

 

0fc484289e8f49c4ae6eb6a8011069d3.png

 

 

Link to comment
Share on other sites

@dsman The aliasing is not related to SSAO. The problem is that with WebGL you no longer have anti-aliasing if you render into a texture ... which is the case with post processing. That means as soon as you use any post processing you lose the hardware anti-aliasing.
You could enable the FXAA post process to reduce the aliasing a bit but the result will not be as good as without any post processing.

I wrote a custom anti aliasing post processing pipeline for our app to solve this issue and get high quality anti aliasing.
Its similar to the ThreeJs one: http://threejs.org/examples/#webgl_postprocessing_msaa_unbiased
... but without the bugs :D

Link to comment
Share on other sites

@meteoritool, I got exactly the same issue with retina display. To avoid, you should divide your final ratios (except combineRatio) by devicePixelRatio which is equal to 2.0

@dsman, I'll definitely write a tuto in the doc to help in setting SSAO. For now, I'll create a preview URL for the preview version of the Babylon.js Editor which includes the latest SSAO implementation, I'll let you know where to find it :)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...