Skip to content

Real-time screen-space global illumination project made for BabylonJS

License

Notifications You must be signed in to change notification settings

zuuhr/GlobalIlumination-BabylonJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebGPU real-time screen-space global illumination for BabylonJS

SSGIBabylonJS

Principal elements

1. Screen-space ambient occlusion

Result_SSAO

2. Screen-space directonal occlusion

Result_SSDO

3. Two-pass bilateral gaussian blur

Blur

4. Screen-space shadows

Result_SSS

Features

Temporal reprojection

Every frame, the final SSAO + SSDO combination will be weighted with previous frames. In order to avoid ghosting, there is a shift on weight percentages when the camera is moving, giving eventually more weight to the historic values when static.

Jittering

Radious: Every frame, the projected circle where samples are evaluated gets the radious scaled by a random scalar read from a noise texture.

Angle: Every frame, if the number of evaluated samples is smaller than all KERNEL_SIZE samples. A jittering along evenly divided circunference sections will be applied.

Pixel rejection on skybox pixels

This is an optimization that reduces computation costs if large areas of the screen are skybox.

Acknowledgements

I’m very grateful for Jorge Felix-López Moreno’s help throughout my work, especially on answering my questions on rendering!