GameDevTecnico / cubos

A still very barebones game engine focused on voxels and data-oriented programming
https://gamedevtecnico.github.io/cubos/
MIT License
83 stars 23 forks source link

Add shadow mapping with support for spot shadow casters #1287

Closed tomas7770 closed 1 month ago

tomas7770 commented 1 month ago

Description

Implements shadows for spot lights, including support for multiple lights and soft shadows.

Checklist

github-actions[bot] commented 1 month ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://GameDevTecnico.github.io/cubos/preview/pr-1287/ on branch gh-pages at 2024-07-25 18:31 UTC

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 186 lines in your changes missing coverage. Please review.

Project coverage is 35.95%. Comparing base (e20a16c) to head (74f960d).

Files Patch % Lines
...gine/src/render/shadow_atlas_rasterizer/plugin.cpp 0.00% 86 Missing :warning:
engine/src/render/shadow_atlas/plugin.cpp 0.00% 47 Missing :warning:
engine/src/render/deferred_shading/plugin.cpp 0.00% 25 Missing :warning:
engine/src/render/shadow_atlas/shadow_atlas.cpp 0.00% 15 Missing :warning:
core/src/gl/ogl_render_device.cpp 0.00% 4 Missing :warning:
.../cubos/engine/render/shadow_atlas/shadow_atlas.hpp 0.00% 4 Missing :warning:
engine/src/render/defaults/plugin.cpp 0.00% 3 Missing :warning:
...hadow_atlas_rasterizer/shadow_atlas_rasterizer.cpp 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1287 +/- ## ========================================== - Coverage 36.16% 35.95% -0.21% ========================================== Files 380 385 +5 Lines 30945 31124 +179 ========================================== Hits 11191 11191 - Misses 19754 19933 +179 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

diogomsmiranda commented 1 month ago

On another note, is there a way to test this functionality?

tomas7770 commented 1 month ago

On another note, is there a way to test this functionality?

I'm not sure how the testing framework works, but I figure the shadowAtlasPlugin should be testable. The rest probably has the risk of slightly different behavior on different GPUs.

RiscadoA commented 1 month ago

On another note, is there a way to test this functionality?

I'm not sure how the testing framework works, but I figure the shadowAtlasPlugin should be testable. The rest probably has the risk of slightly different behavior on different GPUs.

The CI can't handle GPU stuff properly, so yeah, it's not worth the hassle to write tests for these kind of stuff. Do ensure that we have good samples for these features though! If could add a new render sample focused on shadows, it would be great. Structure wise we should probably rename the previous render sample to render.main or something, and add new samples under it, such as render.shadows