Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erkaman/planar_proj_shadows
Demo of Planar Projected Shadows in regl
https://github.com/erkaman/planar_proj_shadows
demo matrix opengl regl shadow shadows webgl
Last synced: 3 days ago
JSON representation
Demo of Planar Projected Shadows in regl
- Host: GitHub
- URL: https://github.com/erkaman/planar_proj_shadows
- Owner: Erkaman
- License: mit
- Created: 2017-03-11T11:39:35.000Z (over 7 years ago)
- Default Branch: gh-pages
- Last Pushed: 2017-03-11T20:12:30.000Z (over 7 years ago)
- Last Synced: 2024-08-12T03:04:38.667Z (3 months ago)
- Topics: demo, matrix, opengl, regl, shadow, shadows, webgl
- Language: JavaScript
- Homepage: https://erkaman.github.io/planar_proj_shadows/planar_proj_shadows.html
- Size: 167 KB
- Stars: 32
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# planar_proj_shadows
Demo of Planar Projected Shadows implemented with [regl](https://github.com/mikolalysenko/regl).
![](img.jpg)
[Demo here](https://erkaman.github.io/planar_proj_shadows/planar_proj_shadows.html)
# Implementation Details
This is an implementation of Planar Projected Shadows, described in
the excellent book [Real-Time
Shadows](https://www.amazon.com/Real-Time-Shadows-Elmar-Eisemann/dp/1568814380).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
```bash
npm install
```To then run the demo, do
```bash
npm run start
```