-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
options - (optional) An object with properties to initialize the renderer.
-
advancedLighting :
BooleanWhether to use exact lighting and enable caustics. This option slows down the rendering process, so do not enable unless you need to. Default is false.
-
alpha :
BooleanWhether to enable transparency in the image. Default is false.
-
BVHAcceleration :
BooleanWhether to use BVH Accelerated raycasting. Requires three-mesh-bvh and Three.js r123 or later. Default is true.
-
canvas :
HTMLCanvasElementThe canvas to use for displaying the rendered image.
-
downloadInterval :
IntegerHow many samples per pixel completed before downloading an in-progress image. Default is null.
-
fps :
NumberHow often you want the image to update using the automatic frame limiting feature.
-
lightSamples :
IntegerHow many direct light samples to take per ambient light sample. This option helps generate softer shadows in less time, but also darkens the image as a side effect.
-
maxSamples :
IntegerHow many samples per pixel before completing the render and downloading the image. Default is null.
-
nextFrame :
FunctionA function to invoke after reaching the desired amount of samples and downloading the resulting image. This option is ignored when
maxSamplesis undefined. -
pixelBatchSize :
IntegerHow many pixels to render between each screen update. This option is ignored when
fpsis defined. Default is the number of pixels on screen. -
recursiveLighting :
BooleanWhether to enable recursive direct light bouncing. This option fixes refractive material shadows and adds reflected light, but also generates refraction-related noise. Default is false.
-
renderMode :
MonteRay.DepthRenderMode,MonteRay.RandomRenderMode,MonteRay.LinearRenderMode,MonteRay.CenterRenderModeWhat order to render the pixels on the screen. Default is MonteRay.DepthRenderMode.
The current version of MonteRay.
These specify the order to render the pixels to render certain parts of the image first. Any can be used in the renderMode option when initializing a MonteRay.PathtracingRenderer.
.domElement : HTMLCanvasElement
Save the resulting rendered image by downloading at the current resolution.
.render ( scene : Scene, camera : Camera ) : null
.setPixelRatio ( ratio : Number ) : null
.setSize ( width: Integer, height : Integer ) : null
Example:
new MonteRay.Color(1, 0.47843137254901963, 0, 1);Example:
new MonteRay.Color(0x007aff);Example:
new MonteRay.Color("#007aff");Example:
new MonteRay.Color("red");Example:
new MonteRay.Color("rgb(0, 122, 255)");
new MonteRay.Color("rgba(0, 122, 255, 1)");
new MonteRay.Color("hsl(211, 100%, 50%)");
new MonteRay.Color("hsla(211, 100%, 50%, 1)");The red channel value between 0 and 1. Default is 1.
The green channel value between 0 and 1. Default is 1.
The blue channel value between 0 and 1. Default is 1.
The alpha or transparency channel value between 0 and 1. Default is 1.
.add ( color : MonteRay.Color ) : this
Same as .add but includes the alpha channel in the operation.
.addColors ( color1 : MonteRay.Color, color2 : MonteRay.Color ) : this
Same as .addColors but includes the alpha channel in the operation.
.addScalar ( s : Float ) : this
Same as .addScalar but includes the alpha channel in the operation.
.clone ( ) : MonteRay.Color
.copy ( color : MonteRay.Color ) : this
.equals ( color : MonteRay.Color ) : this
Same as .equals but includes the alpha channel in the operation.
.fromArray ( array : Array, offset : Integer ) : this
.fromBufferAttribute ( attribute : THREE.BufferAttribute, index : Integer ) : this
.lerp ( color : MonteRay.Color, amount : Float ) : this
Same as .lerp but includes the alpha channel in the operation.
.lerpColors ( color1 : MonteRay.Color, color2 : MonteRay.Color, amount : Float ) : this
Same as .lerpColors but includes the alpha channel in the operation.
.multiply ( color : MonteRay.Color ) : this
Same as .multiply but includes the alpha channel in the operation.
.multiplyScalar ( s : Float ) : this
Same as .multiplyScalar but includes the alpha channel in the operation.
Multiplies this color's RGB values by s.
Same as .divideScalar but includes the alpha channel in the operation.
.set ( value : Color_Hex_or_String ) : this
Same as .set but includes the alpha channel in the operation.
hex can be a six digit hexadecimal (0x007aff), or an eight digit hexadecimal (0x007affff) in format rrggbbaa.
.setRGB ( r : Float, g : Float, b : Float ) : this
Same as .setRGB but includes the alpha channel in the operation.
.setScalar ( s : Float ) : this
Same as .setScalar but includes the alpha channel in the operation.
.sub ( color : MonteRay.Color ) : this
Same as .sub but includes the alpha channel in the operation.
.toArray ( array : Array, offset : Integer ) : this
Sets each value of this color to a pseudo-random value between 0 and 1, excluding 1.
Same as .random but includes the alpha channel in the operation.
Inverts this color's RGB values.
Same as .invert but includes the alpha channel in the operation.
Makes sure this color's RGB values are between min's and max's RGB values.
Same as .clamp but includes the alpha channel in the operation.
Makes sure this color's RGB values are between min and max.
Same as .clampScalar but includes the alpha channel in the operation.
Clamps color values to the visible spectrum.
Makes sure this color's RGB values are no greater than v.
Same as .min but includes the alpha channel in the operation.
Makes sure this color's RGB values are no smaller than v.
Same as .max but includes the alpha channel in the operation.
Returns the greatest value out of this color's R, G, and B.
Same as .maxVal but includes the alpha channel in the operation.
Sets the value of the red channel.
Sets the value of the green channel.
Sets the value of the blue channel.
Sets the value of the alpha channel.
Sets the value of the specified component channel in order RGBA.
Gets the value of the specified component channel in order RGBA.