From 6658ec98b48fbd8aa6140ff3aa57b4e91468659f Mon Sep 17 00:00:00 2001 From: Bill Robinson Date: Wed, 18 Dec 2024 19:55:44 +0000 Subject: [PATCH] Emscripten fix --- README.md | 6 ------ src/ShadowLight.cpp | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 10d1974..fec57a3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/ShadowLight.cpp b/src/ShadowLight.cpp index 5c955d0..145549f 100644 --- a/src/ShadowLight.cpp +++ b/src/ShadowLight.cpp @@ -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(_numLayers)}, nullptr)); _shadowTexture->setMaxLevel(0); @@ -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);