Shadow Map Normal Offset Bias

Discussion of proposed new features.

Re: Shadow Map Normal Offset Bias

PostPosted by Bananaft » 22 Mar 2016, 19:10

Aren't there already "Depth Slope Bias" aka slopeScaledBias parameter ?
User avatar
Bananaft
Active user
Active user
 
Posts: 154
Joined: 26 Nov 2014, 21:53

Re: Shadow Map Normal Offset Bias

PostPosted by Enhex » 22 Mar 2016, 22:21

Bananaft wrote:Aren't there already "Depth Slope Bias" aka slopeScaledBias parameter ?

It's kinda confusing, but slope scale bias is something else, it's about scaling the constant depth offset according to the angle of the slope, and that causes severe peter panning.

Image

I recommend watching the video, it explains the difference between constant & slope bias and normal offset bias:
http://www.dissidentlogic.com/old/video ... s_0001.wmv

Daniel Holbert also uploaded a tech demo on that website that works with Nvidia FX Composer.
User avatar
Enhex
Most active user
Most active user
 
Posts: 325
Joined: 31 Dec 2014, 12:23

Re: Shadow Map Normal Offset Bias

PostPosted by cadaver » 07 May 2016, 17:29

Normal offset shadow bias is in. See added normalOffset_ member in BiasParameters.

According to my tests this is most useful on desktops, as on mobile devices the shadow coordinate interpolation is rather low precision.
User avatar
cadaver
Urho3D author
Urho3D author
 
Posts: 1802
Joined: 16 Jan 2014, 14:52
Location: Finland

Re: Shadow Map Normal Offset Bias

PostPosted by 1vanK » 07 May 2016, 21:10

Oh, Slope Bias + Normal offset works perfect!

Some tests:

1) Without bias
Image
2) Constant bias
Image
3) Slope bias
Image
4) Normal offset
Image
5) SlopeBias + Normal offset
Image
User avatar
1vanK
Moderator
Moderator
 
Posts: 430
Joined: 26 Jun 2015, 19:16
Location: Internet

Re: Shadow Map Normal Offset Bias

PostPosted by rikorin » 08 May 2016, 03:53

Huge Thank You for this, it works amazing! No more detached shadows.
Though now it became apparent that physics objects are not touching the surface :)
How can I change the distance of contact for physics objects? (figured it out, have to change margin for the floor, not the object )
rikorin
Have some posts
Have some posts
 
Posts: 31
Joined: 07 Dec 2015, 10:00

Re: Shadow Map Normal Offset Bias

PostPosted by Enhex » 08 May 2016, 12:33

So glad it's been added!

rikorin wrote:Huge Thank You for this, it works amazing! No more detached shadows.
Though now it became apparent that physics objects are not touching the surface :)
How can I change the distance of contact for physics objects? (figured it out, have to change margin for the floor, not the object )


With Bullet physics you have a default collision margin that for most shapes extrudes outwards. You'll just have to take it into account when matching the size of the model and collision shape.
Good video about it: https://www.youtube.com/watch?v=BGAwRKPlpCw
Last edited by Enhex on 08 May 2016, 14:58, edited 1 time in total.
User avatar
Enhex
Most active user
Most active user
 
Posts: 325
Joined: 31 Dec 2014, 12:23

Re: Shadow Map Normal Offset Bias

PostPosted by rikorin » 08 May 2016, 13:35

Thanks for the video, you've probably saved me a lot of time and nerves in the future :3
And Bullet is really good.
rikorin
Have some posts
Have some posts
 
Posts: 31
Joined: 07 Dec 2015, 10:00


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 0 guests

cron