DirectX12 - Screen Space Reflection Artefacts

Started by
5 comments, last by Aaron Smith 7 years ago

Hello Everyone

I am currently looking into screen space reflections and seemed to have made some progress and now stumbled into some artefacts.

I was wondering if anything screams out that is wrong with these images?

I get the artefact under the car where its slightly not touching and im assuming the reflection goes under car and its sampling incorrectly, but I cant figure out a way to either fade it out or ignore this type of artefact. Would it involve comparing the reflection direction with the normal at that pixel sampled?
http://imgur.com/a/qGA5r

http://imgur.com/a/96lTv

The other issue is when the camera is looking down towards the normals of the surface and the reflections seem to stretch and look nasty :) I am guessing I need to not perform the reflection if the angle between the eye to pos and the normal is close together?

I am happy to throw any code up that may be useful

Thanks

PS. I do know the models are just placeholders and the wheels are the wrong way round haha The scene will be built properly once the reflections are fixed

Advertisement

Generally the SSR would be scaled by AO which would leave the area under the car dark.

edit 1: On the 2nd question, scale the SSR down as the angle between the surface normal and the direction to the camera approaches zero. A lot of modern engines here would blend towards an environment cubemap in the same way that they would if the SSR ray never collided with the scene.

edit 2: (Just realized hours later what was bugging me about it) Regarding the initial artifact, you want to fade out the SSR when the sampling point's depth is closer to the camera than the reflection point, rather than comparing the angle between the normal and view vector.

Hi Digitalfragment

Thank you so much for replying I will have a look at these today and try get them done :)

Ye I would of likes to got the environment map working but as it would get 0 marks I can't do it atm

I do have to also do ssao so that will be next :) I tried a crude way to get shadows but the result was crude as when you sample the depth you have no idea if the area is blocked behind so I get just blocks of shadow

Thank you

Hi all, here is my current progress



I still have to do the advice you gave today but I will be doing these this evening

What is "jitter" that i have seen in some code examples , i want to add it if it benefits the result?

Jittering is taking the raycast vector and modifying it slightly randomly per pixel to help break down any noticeable aliasing in the sampling result. It's a technique also used in SSAO, shadow maps and temporal AA.

ahh i see so i need to get a random value into my shader then and in the examples i see values such as 4 or 5 would this be the reflectionDir * jitter * randValue ?

Hi all, Just wanted to add another question here as i am working on this today, so far my reflections are with a full smooth surface but now I would like to implement rough surfaces. with my understanding I am heading towards multiple rays being fired off and an average of them would be the result.

I keep seeing BRDF come up so am assuming this is something I need to use. Is there any decent tutorials or guides on this relating to c++ code?

Thanks

This topic is closed to new replies.

Advertisement