make3d
    Preparing search index...

    Class Renderer

    Hierarchy

    • WebGLRenderer
      • Renderer
    Index

    Constructors

    Properties

    autoClear: boolean

    Defines whether the renderer should automatically clear its output before rendering.

    true
    
    autoClearColor: boolean

    If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.

    true
    
    autoClearDepth: boolean

    If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.

    true
    
    autoClearStencil: boolean

    If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.

    true
    
    camera: Camera = ...
    capabilities: WebGLCapabilities
    children: RendererChild[] = []
    clippingPlanes: Plane[]
    []
    
    compile: (
        scene: Object3D,
        camera: Camera,
        targetScene?: Scene<Object3DEventMap>,
    ) => Set<Material>

    Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering. If you want to add a 3D object to an existing scene, use the third optional parameter for applying the target scene. Note that the (target) scene's lighting should be configured before calling this method.

    compileAsync: (
        scene: Object3D,
        camera: Camera,
        targetScene?: Scene<Object3DEventMap>,
    ) => Promise<Object3D<Object3DEventMap>>

    Asynchronous version of compile(). The method returns a Promise that resolves when the given scene can be rendered without unnecessary stalling due to shader compilation. This method makes use of the KHR_parallel_shader_compile WebGL extension.

    debug: WebGLDebug

    Debug configurations.

    { checkShaderErrors: true }
    
    domElement: HTMLCanvasElement

    A Canvas where the renderer draws its output. This is automatically created by the renderer in the constructor (if not provided already); you just need to add it to your page.

    document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' )
    
    extensions: WebGLExtensions
    info: WebGLInfo
    localClippingEnabled: boolean
    false
    
    now: number = ...
    ocean?: Ocean
    properties: WebGLProperties
    renderLists: WebGLRenderLists
    scene: Scene<Object3DEventMap> = ...
    shadowMap: WebGLShadowMap
    shadowMapCullFace: CullFace

    Use WebGLShadowMap#cullFace .shadowMap.cullFace instead.

    shadowMapEnabled: boolean

    Use WebGLShadowMap#enabled .shadowMap.enabled instead.

    shadowMapType: ShadowMapType

    Use WebGLShadowMap#type .shadowMap.type instead.

    skybox?: Skybox
    sortObjects: boolean

    Defines whether the renderer should sort objects. Default is true.

    true
    
    state: WebGLState
    stats?: Stats
    toneMapping: ToneMapping
    THREE.NoToneMapping
    
    toneMappingExposure: number
    1
    
    transmissionResolutionScale: number

    The normalized resolution scale for the transmission render target, measured in percentage of viewport dimensions. Lowering this value can result in significant improvements to MeshPhysicalMaterial transmission performance. Default is 1.

    vr: boolean

    Use .xr instead.

    xr: WebXRManager
    backgroundColor: number = 0x44ccf0

    Accessors

    • get coordinateSystem(): 2000

      Returns 2000

    • get outputColorSpace(): string

      Color space used for output to HTMLCanvasElement. Supported values are SRGBColorSpace and LinearSRGBColorSpace.

      Returns string

      THREE.SRGBColorSpace.
      
    • set outputColorSpace(colorSpace: string): void

      Parameters

      • colorSpace: string

      Returns void

    Methods

    • Parameters

      • callback: () => void

      Returns void

      Use WebGLRenderer#setAnimationLoop .setAnimationLoop() instead.

    • Tells the renderer to clear its color, depth or stencil drawing buffer(s). Arguments default to true

      Parameters

      • Optionalcolor: boolean
      • Optionaldepth: boolean
      • Optionalstencil: boolean

      Returns void

    • Returns void

    • Returns void

    • Returns void

    • Parameters

      • renderTarget: WebGLRenderTarget
      • color: boolean
      • depth: boolean
      • stencil: boolean

      Returns void

    • Copies a region of the currently bound framebuffer into the selected mipmap level of the selected texture. This region is defined by the size of the destination texture's mip level, offset by the input position.

      Parameters

      • texture: Texture

        Specifies the destination texture.

      • Optionalposition: Vector2

        Specifies the pixel offset from which to copy out of the framebuffer.

      • Optionallevel: number

        Specifies the destination mipmap level of the texture.

      Returns void

    • Copies the pixels of a texture in the bounds [srcRegion]Box3 in the destination texture starting from the given position. 2D Texture, 3D Textures, or a mix of the two can be used as source and destination texture arguments for copying between layers of 3d textures

      The depthTexture and texture property of render targets are supported as well.

      When using render target textures as srcTexture and dstTexture, you must make sure both render targets are initialized e.g. via .initRenderTarget().

      Parameters

      • srcTexture: Texture

        Specifies the source texture.

      • dstTexture: Texture

        Specifies the destination texture.

      • OptionalsrcRegion: Box3 | Box2

        Specifies the bounds

      • OptionaldstPosition: Vector2 | Vector3

        Specifies the pixel offset into the dstTexture where the copy will occur.

      • OptionalsrcLevel: number

        Specifies the source mipmap level of the texture.

      • OptionaldstLevel: number

        Specifies the destination mipmap level of the texture.

      Returns void

    • Returns void

    • Parameters

      • boolean: any

      Returns any

      Use .setScissorTest() instead.

    • Returns void

    • Returns void

    • Returns the current active cube face.

      Returns number

    • Returns the current active mipmap level.

      Returns number

    • Returns a float with the current clear alpha. Ranges from 0 to 1.

      Returns number

    • Returns a THREE.Color instance with the current clear color.

      Parameters

      • target: Color

      Returns Color

    • Return the WebGL context.

      Returns WebGLRenderingContext | WebGL2RenderingContext

    • Returns any

    • Returns WebGLRenderTarget<Texture<unknown>>

      Use WebGLRenderer#getRenderTarget .getRenderTarget() instead.

    • Parameters

      • target: Vector4

      Returns Vector4

    • Parameters

      • target: Vector2

      Returns Vector2

    • Returns number

      Use WebGLCapabilities#getMaxAnisotropy .capabilities.getMaxAnisotropy() instead.

    • Returns number

    • Returns string

      Use WebGLCapabilities#precision .capabilities.precision instead.

    • Returns the current render target. If no render target is set, null is returned.

      Returns WebGLRenderTarget<Texture<unknown>>

    • Copies the scissor area into target.

      Parameters

      • target: Vector4

      Returns Vector4

    • Returns true if scissor test is enabled; returns false otherwise.

      Returns boolean

    • Parameters

      • target: Vector2

      Returns Vector2

    • Copies the viewport into target.

      Parameters

      • target: Vector4

      Returns Vector4

    • Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data can be copied into it using WebGLRenderer.copyTextureToTexture before it has been rendered to.

      Parameters

      • target: WebGLRenderTarget

      Returns void

    • Initializes the given texture. Can be used to preload a texture rather than waiting until first render (which can cause noticeable lags due to decode and GPU upload overhead).

      Parameters

      • texture: Texture

        The texture to Initialize.

      Returns void

    • Parameters

      • renderTarget: WebGLRenderTarget<Texture<unknown>> | WebGLRenderTarget<Texture<unknown>[]>
      • x: number
      • y: number
      • width: number
      • height: number
      • buffer: TypedArray
      • OptionalactiveCubeFaceIndex: number
      • OptionaltextureIndex: number

      Returns void

    • Parameters

      • renderTarget: WebGLRenderTarget<Texture<unknown>> | WebGLRenderTarget<Texture<unknown>[]>
      • x: number
      • y: number
      • width: number
      • height: number
      • buffer: TypedArray
      • OptionalactiveCubeFaceIndex: number
      • OptionaltextureIndex: number

      Returns Promise<TypedArray>

    • Render a scene or an object using a camera. The render is done to a previously specified WebGLRenderTarget#renderTarget .renderTarget set by calling WebGLRenderer#setRenderTarget .setRenderTarget or to the canvas as usual.

      By default render buffers are cleared before rendering but you can prevent this by setting the property autoClear to false. If you want to prevent only certain buffers being cleared you can set either the autoClearColor, autoClearStencil or autoClearDepth properties to false. To forcibly clear one ore more buffers call .clear.

      Parameters

      • scene: Object3D
      • camera: Camera

      Returns void

    • Parameters

      • camera: Camera
      • scene: Scene
      • geometry: BufferGeometry
      • material: Material
      • object: Object3D
      • geometryGroup: any

      Returns void

    • Returns void

      Use WebGLState#reset .state.reset() instead.

    • Can be used to reset the internal WebGL state.

      Returns void

    • A build in function that can be used instead of requestAnimationFrame. For WebXR projects this function must be used.

      Parameters

      • callback: XRFrameRequestCallback

        The function will be called every available frame. If null is passed it will stop any already ongoing animation.

      Returns void

    • Parameters

      • alpha: number

      Returns void

    • Sets the clear color, using color for the color and alpha for the opacity.

      Parameters

      • color: ColorRepresentation
      • Optionalalpha: number

      Returns void

    • Parameters

      • width: number
      • height: number
      • pixelRatio: number

      Returns void

    • Sets the custom opaque sort function for the WebGLRenderLists. Pass null to use the default painterSortStable function.

      Parameters

      • method: (a: any, b: any) => number

      Returns void

    • Parameters

      • value: number

      Returns void

    • Sets the active render target.

      Parameters

      • renderTarget: WebGLRenderTarget<Texture<unknown>> | WebGLRenderTarget<Texture<unknown>[]>

        The WebGLRenderTarget renderTarget that needs to be activated. When null is given, the canvas is set as the active render target instead.

      • OptionalactiveCubeFace: number

        Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of WebGLCubeRenderTarget.

      • OptionalactiveMipmapLevel: number

        Specifies the active mipmap level.

      Returns void

    • Sets the scissor area from (x, y) to (x + width, y + height).

      Parameters

      • x: number | Vector4
      • Optionaly: number
      • Optionalwidth: number
      • Optionalheight: number

      Returns void

    • Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.

      Parameters

      • enable: boolean

      Returns void

    • Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0).

      Parameters

      • width: number
      • height: number
      • OptionalupdateStyle: boolean

      Returns void

    • Sets the custom transparent sort function for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.

      Parameters

      • method: (a: any, b: any) => number

      Returns void

    • Sets the viewport to render from (x, y) to (x + width, y + height). (x, y) is the lower-left corner of the region.

      Parameters

      • x: number | Vector4
      • Optionaly: number
      • Optionalwidth: number
      • Optionalheight: number

      Returns void

    • Returns any

      Use WebGLExtensions#get .extensions.get( 'EXT_blend_minmax' ) instead.

    • Returns any

      Use WebGLExtensions#get .extensions.get( 'WEBGL_compressed_texture_pvrtc' ) instead.

    • Returns any

      Use WebGLExtensions#get .extensions.get( 'WEBGL_compressed_texture_s3tc' ) instead.

    • Returns any

      Use WebGLExtensions#get .extensions.get( 'OES_texture_float' ) instead.

    • Returns any

      Use WebGLExtensions#get .extensions.get( 'OES_texture_half_float' ) instead.

    • Returns any

      Use WebGLExtensions#get .extensions.get( 'ANGLE_instanced_arrays' ) instead.

    • Returns any

      Use WebGLExtensions#get .extensions.get( 'OES_standard_derivatives' ) instead.

    • Returns any

      Use WebGLCapabilities#vertexTextures .capabilities.vertexTextures instead.