Erkaman / planar_proj_shadows

Demo of Planar Projected Shadows in regl

Home Page:https://erkaman.github.io/planar_proj_shadows/planar_proj_shadows.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

planar_proj_shadows

Demo of Planar Projected Shadows implemented with regl.

Demo here

Implementation Details

This is an implementation of Planar Projected Shadows, described in the excellent book Real-Time Shadows.

Basically, if we only want a plane to receive shadows, we do not need any Shadow Maps or Shadow Volumes. Instead, we simply define a projection matrix P that project onto that plane. To then render the shadows, we render the shadow casting geometry, but instead of rendering them normally, (in vertex shader)we project them onto the plane using the matrix P, and(in fragment shader) we render the geometry in black.

But note that the trick only works when casting shadows onto a plane.

Build

First install all dependencies by doing

npm install

To then run the demo, do

npm run start

About

Demo of Planar Projected Shadows in regl

https://erkaman.github.io/planar_proj_shadows/planar_proj_shadows.html

License:MIT License


Languages

Language:JavaScript 98.1%Language:HTML 1.9%