SSR hazy outlines

Is there any way to get rid of these hazy outlines and get a solid outline instead? Without going through this and losing a bunch of performance.

http://uupload.ir/files/6rkv_111.jpg

So you want better quality without increasing the quality?

You cam use the post process settings for ssr to increase quality without .usf file changes, but even then you would still increase the cost of it.

Well, because increasing the settings through the .usf doesn’t help the hazy line but makes it blurrier. Unless values are cranked up so much and frame rate is dropped to ~20.
What I’m wondering is why there’s a hazy effect on top of the meshes (bottom of the reflections)?

http://uupload.ir/files/nmb0_152.jpg

And as you can see increasing SSR quality makes it even worse.

http://uupload.ir/files/iyfv_333.jpg

http://uupload.ir/files/59i3_222.jpg

SSR shouldn’t look like that by default in such simple and clean scenario.

SSR always look just like that in simple and clean scenario. In real scene it’s not that noticeable. If you need super clean reflections for plane then use planar reflections. For SSR to be super sharp you would need to trace each pixels of ray from every pixels. That would need over thousands samples per pixel. For good performance you have budget of about 32-64samples.

This is a very old version of Cryengine and I’m not tweaking anything. Notice the SSR sharpness and quality. Notice the frame rate as well.

http://uupload.ir/files/65hr_61.jpg

Help me understand why the same can’t be done here without sacrificing so much performance?

To get sharper SSR, instead of increasing quality, establish your own settings by editing values in the shader files.

Your strategy should be increasing ray samples without increasing number of rays.
In ScreenSpaceReflections.usf, find a section that defines number of steps and rays for each quality preset, at about line #167(4.14)

Set desired quality level to something like


NumSteps=32 
NumRays=1

It gives pretty decent hard edge.

If you are still thinking that edges are too blurry at this point, you would either have to increase steps number further, or modify how step offset is calculated. By doing the latter though, you face a bunch of problems, and realistically you can balance between blur/noise and stepping artifacts, but can’t pull out quality out of thin air.

You could also play with disabling hzb. Potentially it will make reflections sharper, but will also incur a performance hit.(There is an exception here. If your project is not using hzb anywhere else, the performance hit might actually be less than cost of setting up hzb.)

What you are right about is that increasing ray number for SSR seems to actually degrades the quality instead of improving it. Perhaps ray offset could be improved a bit, but the main cause of the issue looks like default quality preset to me.
High ray numbers with low step counts make it worse.

Some images:
Default quality level 3
8 samples, 4 rays

Edited quality presset
32 samples 1 ray

Edited quality preset with slightly less sample jitter
32 samples 1 ray

@, Thanks for the very detailed and helpful response.
I’m now having much better SSR quality at much lower cost.
I’m only confused by “with slightly less sample jitter” not sure what you actually did there?

It relates to this phrase

It is a bit more involved, than changing few values though.

Oh I see. Well it’s already look so well with 32 Steps 1 Ray (Though I might keep it at 64 Steps 1 Ray since there’s no significant cost introduced at all).
You’re a really helpful member of the community and I’m glad to see you around here. :slight_smile:

@ > I’d like to second this. What a incredibly insightful reply. Thanks a lot for this!

How about temporal stability? When decreasing rays and increasing samples.

It is definitely worse.
On practice though it is scene-dependent, but commonly, within a set render time, high step count/ low ray number seems to be perceived better than medium step/medium ray count.
Overhead of setting up each individual ray is quite high. I had thoughts about trying to additionally scale number of steps by roughness, but did not have neither time nor practical need for that.

How do these settings affect something that has a roughness of .4/.3 or so?

The lower ray number is, the more noise you will have at higher roughness. Ray count of 1 essentially disables blurry reflections.
Step count’s effect does not depend on roughness.

Got it, thanks. :slight_smile:

Slightly off-topic:
What exactly are rays and samples in regards of SSR?
How exactly is SSR (on a concave surface for example) calculated? I mean SSR doesn’t render the scene like Planar Reflections does.

SSR(Screen-Space reflections) work on a principle of using what you already see on the screen for reflections.
It works roughly like this(some things are willingly changed and omitted a bit for simplicity of understanding):

  1. Takes a screen pixel.
  2. Calculates reflection vector for this pixel, using camera vector and world normal vector.
  3. Takes a certain step along this vector in world space, reads scene depth and compares if depth at this step is less than scene depth.
  4. If step depth is less than scene depth, it repeats previous step.
  5. If,however, scene depth is less than depth of a step position, it means that ray has intersected the scene.
  6. It reads the scene color at received intersection point, and this is basically your reflection color.
  7. Reflection color is than applied to the original pixel depending on some set of parameters, like roughness, view angle, etc.

In the context of the above, number of samples per ray is how many times it can repeat step 3, before stopping the search.

Now, you would like to have some sort of blurry reflections for surfaces with medium roughness. To get that, you can repeat the steps above, but slightly changing the angle of reflection vector.
This number of repeats is your number of rays.

In a gist, it is as simple as that.
More info here.