Skip to content

Commit

Permalink
Emscripten fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wivlaro committed Dec 18, 2024
1 parent 90d3e0a commit 6658ec9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ Use glTF 2.0 exporter with .glb format for most optimal performance.

## TO DO

* Shadows
* Shadow caster/receiver drawables
* Shadow light
* Shader - Clearer Enable/disable for shadow/animation/vertex colour
* Shader - Add vertex colour support
* Shader - Enable/disable for texture
* Desktop/Web - Add mouse capture within game
* Add sky box
* Try faster Freetype lib where available
Expand Down
4 changes: 4 additions & 0 deletions src/ShadowLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ ShadowLight::ShadowLight(Object3D& parent, Range1D zPlanes, int numShadowLevels,
{
Range2Di viewport = {{0, 0}, shadowMapSize};
_shadowTexture.emplace();
#ifndef MAGNUM_TARGET_WEBGL
_shadowTexture->setLabel("Shadow texture");
#endif
// shadowTexture.setStorage(1, Magnum::TextureFormat::DepthComponent, shadowFramebuffer.viewport().size());
_shadowTexture->setImage(0, TextureFormat::DepthComponent, ImageView3D(GL::PixelFormat::DepthComponent, PixelType::Float, {viewport.size(), static_cast<int>(_numLayers)}, nullptr));
_shadowTexture->setMaxLevel(0);
Expand All @@ -45,7 +47,9 @@ ShadowLight::ShadowLight(Object3D& parent, Range1D zPlanes, int numShadowLevels,
for (auto i = 0u; i < _numLayers; i++) {
auto& layer = arrayAppend(_layers, InPlaceInit, viewport);
auto& shadowFramebuffer = layer.shadowFramebuffer;
#ifndef MAGNUM_TARGET_WEBGL
shadowFramebuffer.setLabel("Shadow framebuffer " + std::to_string(i));
#endif
shadowFramebuffer.bind();
shadowFramebuffer.attachTextureLayer(Framebuffer::BufferAttachment::Depth, *_shadowTexture, 0, i);
shadowFramebuffer.mapForDraw(Framebuffer::DrawAttachment::None);
Expand Down

0 comments on commit 6658ec9

Please sign in to comment.