Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

WebGL Terrain, ocean, fog

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 build
Octocat-spinner-32 doc
Octocat-spinner-32 gfx
Octocat-spinner-32 lib
Octocat-spinner-32 shaders
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .jshintrc
Octocat-spinner-32 README.rst
Octocat-spinner-32 build.json

WebGL Terrain Rendering Experiment

This is an experiment in rendering terrain using WebGL. It is using CDLOD [1]_ for handling level of details. The demo does also include reflective water using oblique view frustums [2]_ for clipping. The code is quite hacky (an experiment that got out of hand), and is probably not suitable for use in any real world application. It does not do any streaming at the moment, so it requires all the data to reside in one big texture. I might build on this experiment in the future.


Most of the relevant code is in src/engine/terrain.js Note that that code does currently not handle nodes whose distance is bigger than the max distance and there are probably more rough edges too.


CDLOD does work well using WebGL. It results in smooth level of detail changes. The main drawback is that it requires quite a lot of draw calls.

Docutils System Messages

System Message: ERROR/3 (<string>, line 4); backlink

Unknown target name: "1".

System Message: ERROR/3 (<string>, line 4); backlink

Unknown target name: "2".
Something went wrong with that request. Please try again.