UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

88 lines (87 loc) 6.19 kB
/** * Creates a WebGLRenderer * * @param * By default, a camera will create its own renderer, with sensible defaults. But there may be cases where you want to override those defaults. In those situation, simply create this node, and set the camera renderer param to it. * */ import { TypedRopNode } from './_Base'; import { RopType } from '../../poly/registers/nodes/types/Rop'; import { WebGLRenderer, ToneMapping, ShadowMapType } from 'three'; import { NodeParamsConfig } from '../utils/params/ParamsConfig'; export declare const DEFAULT_OUTPUT_COLOR_SPACE: "srgb"; export declare const DEFAULT_TONE_MAPPING: ToneMapping; export declare const SHADOW_MAP_TYPES: (0 | 2 | 1 | 3)[]; export declare const DEFAULT_SHADOW_MAP_TYPE: ShadowMapType; declare class WebGLRendererRopParamsConfig extends NodeParamsConfig { common: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FOLDER>; /** @param tone mapping */ toneMapping: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>; /** @param tone mapping exposure */ toneMappingExposure: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>; /** @param output color space */ outputColorSpace: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.STRING>; /** @param sort objects, which can be necessary when rendering transparent objects */ sortObjects: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param toggle to override the default pixel ratio, which is 1 for mobile devices, and Math.max(2, globalThis.devicePixelRatio) for other devices */ tpixelRatio: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param higher pixelRatio improves render sharpness but reduces performance */ pixelRatio: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>; shadow: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FOLDER>; /** @param toggle on to have shadow maps */ tshadowMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param toggle on to recompute the shadow maps on every frame. If all objects are static, you may want to turn this off */ shadowMapAutoUpdate: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param toggle on to trigger shadows update */ shadowMapNeedsUpdate: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param shadows type */ shadowMapType: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>; advanced: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FOLDER>; /** @param toggle on to have alpha on (change requires page reload) */ alpha: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param toggle on to have antialias on (change requires page reload) */ antialias: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param premultipliedAlpha */ premultipliedAlpha: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param stencil */ stencil: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param depth */ depth: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param localClippingEnabled */ localClippingEnabled: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param logarithmicDepthBuffer */ logarithmicDepthBuffer: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param preserveDrawingBuffer */ preserveDrawingBuffer: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param toggle on to set the precision */ tprecision: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param set the precision */ precision: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>; /** @param toggle on to set the power preferenc */ tpowerPreference: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>; /** @param set the precision */ powerPreference: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>; } export declare class WebGLRendererRopNode extends TypedRopNode<WebGLRendererRopParamsConfig> { paramsConfig: WebGLRendererRopParamsConfig; static type(): Readonly<RopType.WEBGL>; private _rendererByCanvas; createRenderer(canvas: HTMLCanvasElement, gl: WebGLRenderingContext): WebGLRenderer; cook(): void; private _updateRenderer; private _traverseSceneAndUpdateMaterials; static PARAM_CALLBACK_updateToneMapping(node: WebGLRendererRopNode): void; static PARAM_CALLBACK_updateToneMappingExposure(node: WebGLRendererRopNode): void; static PARAM_CALLBACK_updateOutputColorSpace(node: WebGLRendererRopNode): void; static PARAM_CALLBACK_updateShadow(node: WebGLRendererRopNode): void; static PARAM_CALLBACK_updateSortObjects(node: WebGLRendererRopNode): void; static PARAM_CALLBACK_updatePixelRatio(node: WebGLRendererRopNode): void; private _updateRendererToneMapping; private _updateRendererToneMappingExposure; private _updateRendererOutputColorSpace; private _updateRendererShadow; private _updateRendererSortObjects; private _updateRendererPixelRatio; setToneMapping(toneMapping: ToneMapping): void; } export {};