TinyGLRenderer is an experimental renderer for Three.js 3D graphic library. It utilize TinyGL.js, which implements a subset of OpenGL 1.1 API, for transform, lighting and primitive rasterization. The aim of this project is to develop an alternative render backend for Three.js that works with or without WebGL, as well as providing working examples to introduce the usage of TinyGL.js and promote its development.
To let TinyGLRenderer work with Three.js, first the tinyglrenderer.js
should be included together with the three.js
or three.min.js
:
<script type="text/javascript" src="three.js"></script>
<script type="text/javascript" src="tinyglrenderer.js"></script>
Then initialize the renderer instance just like that for Three.js's built-in ones:
var renderer = new THREE.TinyGLRenderer();
And now our TinyGLRenderer works as a compatible renderer for Three.js.
Canvas and Typed Arrays are required to make TinyGLRenderer work correctly.