Class: RenderContext

RenderContext

RenderContext constructor

new RenderContext(options)

Parameters:
Name Type Description
options Configuration properties for the Planet :
  • shadersPath : Shaders directory path ( "../shaders/" as default)
  • tileErrorTreshold : Tile error treshold (4 as default)
  • lighting : Lighting ? (false as default))
  • continuousRendering : Have to continuously render ? (false as default)

Methods


requestFrame()

Request a frame

deactivate()

Deactivate render context

activate()

Activate render context

frame()

Frame of the application

updateViewDependentProperties()

Update properies that depends on the view matrix

getXYRelativeToCanvas(event)

Get mouse coordinates relative to the canvas element
Parameters:
Name Type Description
event
Returns:
Coordinates

computePixelSizeVector(mv)

Compute the pixel size vector
Parameters:
Name Type Description
mv
Returns:
pixelSizeVector

getPixelFrom3D(x, y, z)

Get pixel from 3D TODO: move it to Planet/Sky too ?
Parameters:
Name Type Description
x
y
z
Returns:
Point as array of 2 float
Type
Array

createNonPowerOfTwoTextureFromImage(image, invertY)

Create a non power of two texture from an image
Parameters:
Name Type Description
image
invertY
Returns:
Texture