I’d like to do some sort of ambient occlusion on the main plane.
I saw this example in ThreeJS, would it be possible to make it in BabylonJS too?
If so, where should you start?
I think that basically you should create a texture in which to write the z-buffer by taking the scene from below. Then create a shader that uses it to create the shadow and apply a blur effect on it.
Could this be added as a built in feature? I’ve tried using ssao2 for contact shadows but it was hard for me to get it to look good without messing up the ssao effect in the rest of the scene.
I think if it were integrated into Babylon
it would be nice to be able to define this type of shadow for any plane,
the top of a table, a front face of a wall, etc. Maybe with a flag that allows you to define the shadow texture as static without updating it in real time every time for the entire scene.
nice work , just thinking ahead , maybe it should also have means to just render it once , less processing for scenes where you know the assets would be static…
We’ve added it to our to-do list, but we may not be able to do it for version 7.0, as the release is close and we still have a number of things to finish.
In the above render, is there way to control the gamma of the gray area in the shadow? Just like the curve tool does in Photoshop.
Or in other words, is there a way to control the detail level of depth map? If I only want the shadow gradient visible for big details and ignoring fine details on the mesh surface, if there is a way to achieve it?
Just wondering is it possible we can add some post process or other ways to have extra control besides tweak the vDepth value only? I have been tryin to play different vDepth values but feels like if there are other ways to fine tune it would be great - visual result is not ideal. I was trying to add some post processes to the bottom camera but ended up it affected on render camera. Feels like I didnt do it the right (elegant) way for this post process idea.
You should pass an ImageProcessingConfiguration parameter to the ImageProcessingPostProcess constructor, else the whole scene will use the same image processing configuration than the bottom camera:
Note that your post-process(es) should update the alpha channel of the render target, as the effect is only based on the alpha channel and not on the r/g/b channels.
Gotcha. Makes sense. Thank you so much for all the info!! This is a much cooler effects to mimic ground occlusion. Love it! Really hope we can add this to the official release.
It’s still on our to-do list, but we have big changes planned for version 8.0, so it’s not a priority. If anyone wants to try it out, they’re more than welcome!