@wolffo/three-fire
Version:
Modern TypeScript volumetric fire effect for Three.js and React Three Fiber with WebGPU support.
58 lines • 1.67 kB
TypeScript
/**
* @fileoverview TSL (Three.js Shading Language) implementation of volumetric fire shader
*
* Uses WebGPU-compatible node-based shaders with Perlin noise (mx_noise_float).
* This is the TSL equivalent of the GLSL FireShader.
*/
import { Color, Matrix4, Vector3, Texture } from 'three';
type TSLNode = any;
/**
* Configuration for fire uniforms
*/
export interface FireTSLConfig {
fireTex: Texture;
color?: Color | number;
noiseScale?: [number, number, number, number];
magnitude?: number;
lacunarity?: number;
gain?: number;
}
/**
* Uniforms interface for the TSL fire shader
* Using TSLNode type for flexibility with Three.js TSL type system
*/
export interface FireTSLUniforms {
fireTex: Texture;
color: TSLNode;
time: TSLNode & {
value: number;
};
seed: TSLNode & {
value: number;
};
invModelMatrix: TSLNode & {
value: Matrix4;
};
scale: TSLNode & {
value: Vector3;
};
noiseScale: TSLNode;
magnitude: TSLNode & {
value: number;
};
lacunarity: TSLNode;
gain: TSLNode & {
value: number;
};
}
export declare const createFireUniforms: (config: FireTSLConfig) => FireTSLUniforms;
/**
* Creates the main fire fragment node for ray marching
*
* @param uniforms - Fire shader uniforms
* @param iterations - Number of ray marching iterations (default: 20)
* @returns TSL node for the fragment shader
*/
export declare const createFireFragmentNode: (uniforms: FireTSLUniforms, iterations?: number) => import("three/tsl").ShaderNodeObject<import("three/tsl").VarNode>;
export {};
//# sourceMappingURL=FireShaderTSL.d.ts.map