![]() |
![]() |
![]() |
![]() |
Shaders on web fixes:
Our shaders on the web platform can render now all our effects:
- Bump mapping (normal maps). As shown by demos:
-
ClipPlane X3D node, useful to clip part of 3D/2D content when rendering. The node can be instantiated using Pascal class
TClipPlaneNodeor by writing X3D file like this:12345678#X3D V3.2 utf8PROFILE InterchangeClipPlane {plane 1 0 0 -100}Inline { url "my_model.gltf" }Save this as
my_cut_model.x3dvand open (using our Castle Model Viewer, or from Pascal load it using ourTCastleScene). In effect, you will seemy_model.gltfbut cut by a 3D plane. To be precise, the plane equation isAx+By+Cz+D=0with the(A,B,C,D)values given by theClipPlane.planevector above. The points we render are ones that satisfyAx+By+Cz+D>=0, so they are in half-space determined by the plane. -
Fog.
- Example in eye_of_beholder (source code).
TCastleTerrainshader.- Used by terrain example (source code).
- Note: Water used in this demo doesn’t work on web yet — we need to fix our FBO on web.
- Shader effects using
varying, like “time to shader” in Castle Model Viewer (Mobile) on web.
The above features failed to work in the past due to a bug in ANGLE, 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 and reproduction of the bug, with details why/how ANGLE processes some shaders incorrectly.
-
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 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 (source code).
Unholy Society demo on web:
We have updated The Unholy Society web demo. 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 to make it possible to continue improving the engine!




Start the discussion at Castle Game Engine Forum