@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
64 lines (63 loc) • 2.57 kB
TypeScript
/**
* applies a noise
*
* @remark
*
* This node is very powerful and can be used to affect many parts of a shader, or even generate forces in a particle system.
* It can also create fbm effects, where several layers of noise are added to each other, giving a fractal effect.
*
* Another very interesting use case is to use multiple noise nodes, where a first one is used to modify the input position of a second one.
* This is called domain warping and can help you create very complex effect quickly.
*
*
*
*/
import { TypedGlNode } from './_Base';
export declare enum NoiseName {
CLASSIC_PERLIN_2D = "Classic Perlin 2D",
CLASSIC_PERLIN_3D = "Classic Perlin 3D",
CLASSIC_PERLIN_4D = "Classic Perlin 4D",
NOISE_2D = "noise2D",
NOISE_3D = "noise3D",
NOISE_4D = "noise4D"
}
export declare const NOISE_NAMES: Array<NoiseName>;
export declare enum NoiseOutputType {
NoChange = 0,
Float = 1,
Vec2 = 2,
Vec3 = 3,
Vec4 = 4
}
declare enum NoiseGlNodeInputName {
AMP = "amp",
POSITION = "position",
FREQ = "freq",
OFFSET = "offset"
}
import { NodeParamsConfig } from '../utils/params/ParamsConfig';
import { ShadersCollectionController } from './code/utils/ShadersCollectionController';
import { GlType } from '../../poly/registers/nodes/types/Gl';
declare class NoiseGlParamsConfig extends NodeParamsConfig {
type: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
outputType: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
octaves: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
ampAttenuation: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
freqIncrease: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
}
export declare class NoiseGlNode extends TypedGlNode<NoiseGlParamsConfig> {
paramsConfig: NoiseGlParamsConfig;
static type(): GlType;
initializeNode(): void;
setNoiseName(noiseName: NoiseName): void;
setOutputType(outputType: NoiseOutputType): void;
protected _gl_input_name(index: number): NoiseGlNodeInputName;
paramDefaultValue(name: string): number;
private _expected_input_types;
private _expected_output_types;
setLines(shaders_collection_controller: ShadersCollectionController): void;
private fbmMethodName;
private fbmFunction;
private singleNoiseLine;
}
export {};