zakorgy / voxel-editor

A GPU rendered voxel editor
Apache License 2.0
45 stars 9 forks source link

Add better shadow #10

Open zakorgy opened 3 years ago

zakorgy commented 3 years ago

The current shadow implementation uses shadow mapping (render the screen from the lights view to a deth buffer, and use that depth to calucalte shadow), but is a bit hacky in the shader. There are many more ways it can be improved:

zakorgy commented 3 years ago

The global light with orthographic projection for light and shadow was added in https://github.com/zakorgy/voxel-editor/pull/17 Also sampler2DShadow was replaced with sampler2D in that PR, because it produces a better result