# Web: bump mapping, clip planes, fog, terrain, occlusion culling; also Unholy Society demo on web updated

**URL:** https://forum.castle-engine.io/t/web-bump-mapping-clip-planes-fog-terrain-occlusion-culling-also-unholy-society-demo-on-web-updated/2157
**Category:** News
**Created:** [May 31, 2026, 1:44am UTC](https://forum.castle-engine.io/t/web-bump-mapping-clip-planes-fog-terrain-occlusion-culling-also-unholy-society-demo-on-web-updated/2157 "2026-05-31T01:44:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [May 31, 2026, 1:44am UTC](https://forum.castle-engine.io/t/web-bump-mapping-clip-planes-fog-terrain-occlusion-culling-also-unholy-society-demo-on-web-updated/2157/1 "2026-05-31T01:44:08Z")

</div>

| [![Unholy Society - web build - wedding](https://forum.castle-engine.io/uploads/default/original/2X/c/c1db589b9e91f0cadd5d583a8fbe053a440fa61d.png)](https://castle-engine.io/wp/wp-content/uploads/2026/05/unholy_screenshot_wedding.png "Unholy Society - web build - wedding") |
| [![Steep parallax mapping](https://forum.castle-engine.io/uploads/default/original/2X/0/0451e9d1954975dbb4ee0a394ee9a9d79fe4636d.png)](https://castle-engine.io/wp/wp-content/uploads/2026/05/steep_parallax.png "Steep parallax mapping") |
| [![Occlusion culling - web build](https://forum.castle-engine.io/uploads/default/original/2X/4/40eb43f001ce109077e492d89a021a3c6314c866.png)](https://castle-engine.io/wp/wp-content/uploads/2026/05/occlusion_culling.png "Occlusion culling - web build") |
| [![Explore impressive castle - web build](https://forum.castle-engine.io/uploads/default/original/2X/a/a259bbadf19583dabd39111164d7367dbfed0774.png)](https://castle-engine.io/wp/wp-content/uploads/2026/05/explore_castle.png "Explore impressive castle - web build") |

**Shaders on web fixes:**

Our shaders on the [web](https://castle-engine.io/web) platform can render now all our effects:

1. [Bump mapping (normal maps)](https://castle-engine.io/bump_mapping). As shown by demos:
  - [bump\_mapping](https://castle-engine.io/web-demos/examples/viewport_and_scenes/bump_mapping/) ([source code](https://github.com/castle-engine/castle-engine/tree/master/examples/viewport_and_scenes/bump_mapping)).

  - [creature\_behaviors](https://castle-engine.io/web-demos/examples/creature_behaviors/) ([source code](https://github.com/castle-engine/castle-engine/tree/master/examples/creature_behaviors)).

  - [third\_person\_navigation](https://castle-engine.io/web-demos/examples/third_person_navigation/) ([source code](https://github.com/castle-engine/castle-engine/tree/master/examples/third_person_navigation)).

  - [game\_3d\_sound](https://castle-engine.io/web-demos/examples/audio/game_3d_sound/) ([source code](https://github.com/castle-engine/castle-engine/tree/master/examples/audio/game_3d_sound)).

2. [ClipPlane X3D node](https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/rendering.html#ClipPlane), useful to clip part of 3D/2D content when rendering. The node can be instantiated using Pascal class `TClipPlaneNode` or by writing X3D file like this:

3. [Fog](https://castle-engine.io/fog).

4. `TCastleTerrain` shader.
  - Used by [terrain example](https://castle-engine.io/web-demos/examples/terrain/) ([source code](https://github.com/castle-engine/castle-engine/tree/master/examples/terrain)).
  - Note: Water used in this demo doesn’t work on web yet — we need to fix our FBO on web.

5. [Shader effects](https://castle-engine.io/shaders) using `varying`, like _“time to shader”_ in [Castle Model Viewer (Mobile) on web](https://castle-engine.io/web-demos/castle-model-viewer-mobile/).

The above features failed to work in the past due to a bug in [ANGLE](http://angleproject.org/), library used to processes shaders (and optionally render) in both _Firefox_ and _Chromium_-based browsers (I test with _Vivaldi_).

- There’s a real bug in the latest Firefox that was affecting us — and it is workarounded now in our engine, so our games rock in Firefox. See [my Firefox bugreport](https://bugzilla.mozilla.org/show_bug.cgi?id=2039887) and [reproduction of the bug, with details why/how ANGLE processes some shaders incorrectly](https://github.com/michaliskambi/firefox-webgl-angle-varying-bug).

- The ANGLE version in the latest Vivaldi is already OK (there was a period when it also exhibited issues).

**Occlusion culling on web:**

We have fixed how [occlusion culling](https://castle-engine.io/occlusion_culling) works on the web. We needed to account for the fact that occlusion queries on the web can run for multiple frames.

See the running demo here: [occlusion\_culling](https://castle-engine.io/web-demos/examples/viewport_and_scenes/occlusion_culling/) ([source code](https://github.com/castle-engine/castle-engine/tree/master/examples/viewport_and_scenes/occlusion_culling)).

**Unholy Society demo on web:**

We have updated [The Unholy Society web demo](https://michalis.xyz/unholy/). We fixed audio, comic bubbles size, _“pope call”_ animation (using `ClipPlane`, see above). Overall, at this point the complete game works on the web and yes, you can just play it for free here 🙂

Note that the web version doesn’t support persistent savegames (reloading the page will reset the game state), which is of course something we plan to fix soon.

Enjoy and [please support us on Patreon](https://www.patreon.com/c/castleengine) to make it possible to continue improving the engine!

---

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [May 31, 2026, 1:44am UTC](https://forum.castle-engine.io/t/web-bump-mapping-clip-planes-fog-terrain-occlusion-culling-also-unholy-society-demo-on-web-updated/2157/2 "2026-05-31T01:44:35Z")

</div>


