Sebavan Posted March 19, 2018 Share Posted March 19, 2018 Hello, Thanks to Webgl 2, we have been able to introduce two new kind of shadows: PCF (improved version of poisson sampling) and PCSS (contact hardening shadows). They are only available on Webgl 2 and will fallback to poisson sampling on other devices. Here is a quick shot at how contact hardening tries to simulate real life by getting softer when the blocker is further away from the receiver: https://playground.babylonjs.com/#ZT8BKT#2 And a real use in a scene with self shadows: https://www.babylonjs-playground.com/#EYEPRI#3 As usual, the doc have been upgraded: https://doc.babylonjs.com/babylon101/shadows#percentage-closer-filtering-webgl2-only And to properly setup self shadow: https://doc.babylonjs.com/babylon101/shadows#self-shadow Hope you ll enjoy it. jerome, tomer, inteja and 6 others 9 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 19, 2018 Share Posted March 19, 2018 topissime ! Quote Link to comment Share on other sites More sharing options...
Hersir Posted March 19, 2018 Share Posted March 19, 2018 @Sebavan Thanks for great work. Tested example with helmet on my mac mini, have 60 FPS on Safari but thats Webgl1, but on chrome and firefox (webgl2) get 4 fps. Expected? Hardware issue? Device: Graphic: Intel Iris 1536 MB CPU: 3 GHz Intel Core i7 Memory: 16 GB 1600 MHz DDR3 Browsers: Chrome: 65.0.3325.162 Firefox Quantum : 59.0.1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted March 19, 2018 Author Share Posted March 19, 2018 Could be explained by only using an integrated GPU cause in PCSS, it requires 98 taps on the depth texture per pixels. Could you try this: https://playground.babylonjs.com/#ZT8BKT#3 I used the lowest quality and it should run faster ? Quote Link to comment Share on other sites More sharing options...
Hersir Posted March 20, 2018 Share Posted March 20, 2018 @Sebavan This has 10 fps. (Test on MacBook pro with similar specs) Quote Link to comment Share on other sites More sharing options...
Sebavan Posted March 20, 2018 Author Share Posted March 20, 2018 As expected, this requires a big GPU to benefit from it, I guess we could add the fallback to the scene optimizer to ensure it works cross plat. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.