gl-disjoint-skybox
Draws a disjoint skybox into a 3D scene.
Install
npm install gl-disjoint-skybox
Example
var debugCubemap = ;var createSkybox = ; var textures = ;var skybox = ; var view = mat4;var projection = mat4; mat4;mat4; skybox;
API
var createSkybox = ;
Constructor
var skybox = createSkybox(gl, textures)
Returns a skybox object ready for rendering.
Takes a WebGL context gl
and a disjoint cubemap textures
structured so:
pos: x: gl-texture2d texture y: gl-texture2d texture z: gl-texture2d texture neg: x: gl-texture2d texture y: gl-texture2d texture z: gl-texture2d texture
See gl-texture2d for more information about the required texture objects.
Methods
skybox.draw(camera)
Takes an object camera
that has view
and projection
fields defined:
view: gl-mat4 view matrix projection: gl-mat4 projection matrix