Specular Occlusion?

Hello. I’ve only been using Unity for a few months. I used to use Unreal, and I stopped using it for a few reasons. But Unity didn’t have the same quality in terms of graphics compared to Unreal. I thought it was because of dark surfaces not being reflected well.

I could not find any information on the forums about this and developed this method.

6276461--823727--UnityCapture.gif

Here’s my question. What I have done seems right, but is it? Or is there an easier solution I haven’t seen?

Thanks in advance.

6 Likes

I’m not sure about your method (though seems right, judging by the first GIF). I usually bake bent normals for my geometry in Substance Designer and use them for this purpose.

The last screenshot looks really good, not worse than Unreal, to my mind.

I don’t know how to make the situation better. Finally, I did a few tries. As such, the glare on the dark surfaces has decreased considerably. For more realistic scenes I hope unity does something. Imgur: The magic of the Internet

Unity Default Lit

Unity Specular Occlusion Edit

Unreal

Shader Edit

3 Likes

Unity has already done something for specular occlusion. It’s called “Specular Occlusion Mode” and you can find it in the advanced tab of your shader:

As I previously said, you’re supposed to provide a bent normal map to your shader, plugging it into the respective input. You can also add an AO map which is supposed make the occlusion effect even stronger.

Furthermore, you can enable SSR to ground your objects better.

Unfortunately, these things do not make the scene better.(AO, SSR, Bent Normal) Also SSR, AO, Bloom off in unreal and unity. these things have a cost and i love bake light and maybe i won’t use ao. I can only use bent normal for moving objects.

What do you think should I do to make my scene look as good as unreal?

Yep, they do, but in order to match your offline render reference, you have to enable at least SSR. Preferably the new one (PBR Accumulation). The reflection on the floor is the most obvious thing that both Unity and Unreal lack in comparison to Blender. Because of this your objects “float” above the surface. They are just a bit more shadowed in Unreal, but the general lack of connection to the surface is the same.

Are you sure that you’ve correctly baked your bent normals? They work perfectly for me, adding all the specular occlusion I need. I’ve been struggling with the same problem for a while too, but bent normals + a bit of AO completely solved it for me, so it’s very strange that they don’t work in your case. I do bake lighting as well and I understand that once you’ve baked it you don’t need any fake AO, but nevertheless, I’ve found it useful to add a bit of AO just for the sake of specular occlusion. And I’m not talking about the realtime ambient occlusion that you enable as an override in your HDRP volume. I use an AO map that comes with a material (which you put in the green channel in the Mask Map) and then I mix it in Shader Graph with an AO Map baked in Substance Designer for the whole object. Then I tune it to look realistic and aesthetically pleasing (usually this means low values) and in conjunction with Bent Normals it gives very good results.

Why can’t you use it with static objects as well?

1 Like

Because moving objects cannot be baked! :slight_smile:

You constantly ask me to use bent normal. bent normal only concerns the owner object. What will do the reflection blocking between the table and the floor? I can’t create bent normal of the whole map!

I did not see bent normal being used in Unity’s last released scene! Also, reflection leak is present in this scene!

unfortunately ao, ssr or something else doesn’t solve this. I will try what you say. I don’t think anything will change. Thanks for your interest.

Hey,

Exposure-based AO is a technique I’ve already seen and used in the past, so what you’ve done in your shader works as intended. Is it correct? One might say nothing is truly correct in rasterization… So as long as you’re happy with the results and it doesn’t introduce artefacts or unwanted behaviours when you start modulating the exposure (especially when it goes negative).

What’s your reflection probe setup in your unity scene however? Did you place any local reflection probe in the room? If you didn’t place any, the reflection of the sky will leak inside the room and greatly overpower any baked occlusion in the lightmaps. Judging by the amount of blue light/reflection leaking on the ceiling beams, it seems there is none or it requires some adjustments.

Regarding the HDRP template, it only uses baked reflection probes (and no SSR for now), so you will indeed see some reflection leaking here and there, especially if you start placing the camera in really odd places that aren’t meant to be accessible by the player.

This word broke my heart. :slight_smile:

Unity Default Lit.
(I also turned off “sky reflection” in hdrp default settings.)

The question I’m looking for the answer is this.

Same scene same materials same light same reflection probes Same post precess. but unity somehow looks bad compared to unreal. When I compared the two scenes, I came to the following conclusion. Unreal controls the reflection of dark surfaces very well. I found the above method for Unity and asked if this was true. I think I got the result I wanted. I just wanted to consult on the accuracy of this. Because I’m interested in level design. not a shader programmer. :slight_smile:

2 Likes

i don’t think you can do anything else to match UE4 lightmap here. If i’m not mistaken UE4 volumetric lightmap also bake static bent normal for the whole scene for specular and directional occlusion which unity doesn’t

1 Like

Yes, I’ve been thinking about that lately. It was the first time I saw a different lightmap in Unreal, I didn’t understand why. I realized when I switched to Unity, this colorful lightmap has a meaning. it carries different information on each channel. :slight_smile:

I think I got the answer to my question more than enough. Thanks to all who answered and interested.

2 Likes

@CihanGurbuz i totally forgot this thing exist, btw try it GitHub - Fewes/BakerBoy: A single-component, GPU-based universal ambient occlusion and bent normal baker for Unity. The successor to my BNAO respository

also @CihanGurbuz - have a look at Bakery (Bakery - GPU Lightmapper | Level Design | Unity Asset Store)

It seems still superior to Unity’s own baking solutions - especially since it introduced the volume texture baking in its recent updates. That should give you nicer shading on movable objects that are in partial shadows. Look through the videos and release notes for example.

1 Like

oh right, bakery have new volumetric lightmap now

yes, I knew about this add-on, but I didn’t see that in the description.

  • Supports directional baking (bump/specular) with 4 modes:

I can’t pay $ 55 for this plugin right now. :slight_smile: The solution I found is giving good results for now. Thank you for reminding me of this.

this solution just generates a bent normal map of the object. What I need is to bake all the objects together. The solution I have already found gives good results for now.
Thanks. :slight_smile:

6720421--773071--1208x903 2.gif

3 Likes

Hi @CihanGurbuz - as this thread is quite long and complex - could you summarize the solution you landed on? Is it essentially the graph you posted at the top? If you could post the actual file to help others that would be amazing.

Which solution if i may ask? i’m also interested in scene specular occlusion

The idea is you feed a tweaked baked GI to the specular mask input.

2 Likes

Ah, just as the shader graph screenshot he posted above then?