@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
122 lines (121 loc) • 7.69 kB
TypeScript
/**
* Allows to create a shader with GLSL nodes to create the texture values.
*
*
*/
import { WebGLRenderer, WebGLRenderTarget, ShaderMaterial } from 'three';
import { Constructor, valueof } from '../../../types/GlobalTypes';
import { TypedCopNode } from './_Base';
import { GlNodeChildrenMap } from '../../poly/registers/nodes/Gl';
import { BaseGlNodeType } from '../gl/_Base';
import { NodeContext } from '../../poly/NodeContext';
import { NodeParamsConfig } from '../utils/params/ParamsConfig';
import { AssemblerName } from '../../poly/registers/assemblers/_BaseRegister';
import { TexturePersistedConfig } from '../gl/code/assemblers/textures/TexturePersistedConfig';
import { NodeCreateOptions } from '../utils/hierarchy/ChildrenController';
import { CopType } from '../../poly/registers/nodes/types/Cop';
import { TextureParamsController } from './utils/TextureParamsController';
import { GlAssemblerController } from '../gl/code/Controller';
import { ShaderAssemblerTexture } from '../gl/code/assemblers/textures/Texture';
declare const BuilderCopParamsConfig_base: {
new (...args: any[]): {
tcolorSpace: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
colorSpace: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.STRING>;
tmapping: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
mapping: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
twrap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
wrapS: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
wrapT: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
tminFilter: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
minFilter: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
tmagFilter: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
magFilter: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
tanisotropy: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
useRendererMaxAnisotropy: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
anisotropy: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
tflipY: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
flipY: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
ttransform: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
offset: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR2>;
repeat: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR2>;
rotation: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
center: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR2>;
tadvanced: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
tformat: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
format: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
ttype: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
type: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
};
} & {
new (...args: any[]): {
/** @param texture resolution */
resolution: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR2>;
/** @param use the main camera renderer. This can save memory, but can also lead to colors being affected by the renderer's output color space */
useCameraRenderer: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
/** @param use a data texture instead of a render target, which can be useful when using that texture as and envMap */
useDataTexture: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
/** @param force Render */
render: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BUTTON>;
};
} & typeof NodeParamsConfig;
declare class BuilderCopParamsConfig extends BuilderCopParamsConfig_base {
}
export declare class BuilderCopNode extends TypedCopNode<BuilderCopParamsConfig> {
paramsConfig: BuilderCopParamsConfig;
static type(): CopType;
readonly persisted_config: TexturePersistedConfig;
protected _assemblerController: GlAssemblerController<ShaderAssemblerTexture> | undefined;
usedAssembler(): Readonly<AssemblerName.GL_TEXTURE>;
protected _createAssemblerController(): GlAssemblerController<ShaderAssemblerTexture> | undefined;
assemblerController(): GlAssemblerController<ShaderAssemblerTexture> | undefined;
private _textureMesh;
private _fragmentShader;
private _uniforms;
readonly textureMaterial: ShaderMaterial;
private _textureScene;
private _textureCamera;
private _renderTarget;
private _dataTextureController;
private _rendererController;
readonly textureParamsController: TextureParamsController;
protected _childrenControllerContext: NodeContext;
initializeNode(): void;
createNode<S extends keyof GlNodeChildrenMap>(node_class: S, options?: NodeCreateOptions): GlNodeChildrenMap[S];
createNode<K extends valueof<GlNodeChildrenMap>>(node_class: Constructor<K>, options?: NodeCreateOptions): K;
children(): BaseGlNodeType[];
nodesByType<K extends keyof GlNodeChildrenMap>(type: K): GlNodeChildrenMap[K][];
childrenAllowed(): boolean;
sceneReadonly(): boolean;
private _cook_main_without_inputs_when_dirty_bound;
private _cook_main_without_inputs_when_dirty;
cook(): Promise<void>;
shaders_by_name(): {
fragment: string | undefined;
};
compileIfRequired(): void;
private compile;
callbackName(): string;
dispose(): void;
removeCallbacks(): void;
readonly boundRenderOnTarget: () => Promise<void>;
renderOnTargetWithoutUpdatingTextureFromParams(): Promise<void>;
private _renderOnTarget;
private _postRender;
private _prevTarget;
private _prevOutputColorSpace;
private _prevToneMapping;
private _saveRendererState;
private _prepareRenderer;
private _restoreRendererState;
private _renderer;
private _createRendererIfRequired;
private _resetRenderer;
renderer(): WebGLRenderer | undefined;
renderTarget(): Promise<WebGLRenderTarget<import("three").Texture>>;
private createRenderTargetIfRequired;
private _renderTargetResolutionValid;
private _createRenderTarget;
static PARAM_CALLBACK_render(node: BuilderCopNode): void;
static PARAM_CALLBACK_resetRenderer(node: BuilderCopNode): void;
}
export {};