mojo-html5-gl icon indicating copy to clipboard operation
mojo-html5-gl copied to clipboard

An experimental patch for mojo, that replaces the standard 2d-context with WebGL (abandoned)

This patch is deprecated!

There won’t be no updates, no bugfixes, no compatibility with new Monkey versions.

How to add WebGL support for mojo now?

I made new implementation of WebGL support for mojo in my Monkey fork - mungo. It’s a better implementation which gives ~10 time better performance than this patch and works in IE11. Here is a small demo.

Now you can use these two methods to enable WebGL acceleration for your mojo projects:

1. Download and install mungo

The fastest way to use new WebGL implementation for mojo is to download and install mungo.

2. Create custom HTML5 target

If you don’t want to use mungo you can add WebGL support for mojo by following this short manual:

  1. Create a new HTML5 target based on the standard HTML5 monkey target.
  2. Rename directory of the new target. For example: html5_webgl
  3. There, replace files in modules/native folder by files from mungo
  4. Rename new target in TARGET.MONKEY file. For example: #TARGET_NAME="Html5 WebGL Game"
  5. Copy-paste code from mojo.html5.webgl.js file into template/main.js file after //${TRANSCODE_END} line
  6. Add #HTML5_WEBGL_ENABLED=True in template/CONFIG.MONKEY file

Mojo HTML5 GL

An experimental patch for mojo, that replaces the standard 2d-context with WebGL.

Features

  • It does not require code changes
  • High SetBlend performance for images
  • High SetColor performance for images
  • #MOJO_IMAGE_FILTERING_ENABLED support
  • Chrome Frame support
  • It works in browsers that do not support WebGL (2d-context used)
  • Small file size - 12KB only!

Usage

Note

  • For V65 and V66 versions use version v1.21
  • For versions V64 and below use v1.11

Demo