O876 Raycaster

A Raycasting Framework for building HTML 5 Games

Basic Raycasting

The primary task of a Raycasting Engine is to render 3D simplified environnement. It is said that Raycasting is a 2.5D algorithm because the 3D environnement is rendered from a 2D map and there are only perpendicular walls only flat floor and ceiling, and so on... A lot of limitations that are not present in real 3D engines.

But this simplicity has its own advantages :

  • fast level design.
  • No need of complex geometry understanding.
  • runs on slow computers.
  • fast assets downloading.

Let's have a look at what features are available in this engine...

Door management

There are several type of doors, the only difference is the way they open : They can slide to any direction (left, right, top, bottom), there are even double panel sliding doors as well.

Double panel door
Top sliding door

Secret door management

Just like the game wolfenstein 3D, walls can be pushed to reveal secret areas.

This wall has been pushed, and reveals a hidden zone !

Sprite management

Animated sprites with composite effect (alpha, opacity...). Each sprite can have several overlays so rendering "haze" effects is possible.

Sprites from Blight Magic
Sprites from Blight Magic
Sprites from Blight Magic

Floor and ceiling textures

Floor and ceiling can have textures, just like walls.

Without floor and ceiling textures
With floor and ceiling textures (looks better)

Outdoor environnement / sky texture

Wall, ceiling, and floor textures can be replaced by a sky texture.

Sky is visible outside
Red sky
Sky is visible through the ceilling
Dark sky and landscape

Animated wall textures

Walls can have animated textures.

Pixelated fireplace

Dynamic texture modification

Wall, floor and ceiling textures can be modified, allowing programmer to draw anything on it (like drawing on a canvas and using canvas context methods). This ability is used for static lighting (lighten walls that are near light emmiting sources).

Ketchup on the wall !
Candles may affect wall textures
Light emmitting objects cast light and shadows on both floor and ceiling

Audio system

It can't be heared here but the (rudimentary) audio system handles distances (close sounds are louder than distant ones). And it handles crossfade background soundtrack.

Using VR Glasses

The framework has the ability to switch between normal rendering and VR Rendering.

You should try it out with this kind of cardboard glasses.

VR Glasses
city : normal
city : vr-rendering
mansion : normal
mansion : vr-rendering