UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

45 lines (44 loc) 1.76 kB
import { Color, Fog as Fog3 } from "three"; import { Behaviour } from "./Component.js"; /** * Fog rendering mode */ declare enum FogMode { /** Linear fog increases uniformly with distance */ Linear = 1, /** Exponential fog increases exponentially with distance */ Exponential = 2, /** Exponential squared fog for denser falloff */ ExponentialSquared = 3 } /** * Adds distance-based fog effect to the scene. * When enabled, objects will fade into the fog color based on their distance from the camera. * * This component is automatically added to the scene when fog is enabled in the editor. * For setting fog from code you can simply use `scene.fog = new Fog3(color, near, far)` without adding this component. * * @summary Adds fog effect to the scene * @category Rendering * @group Components * @link https://threejs.org/docs/#Fog */ export declare class Fog extends Behaviour { /** * The underlying Three.js Fog object. You can modify its properties directly for more advanced control. * @remarks The Fog component provides convenient access to common fog properties like `near`, `far`, and `color`. Modifying those will update the underlying `fog` object accordingly. However, you can also access and modify the `fog` object directly for more advanced use cases, such as changing the fog mode or using a custom shader. * @link https://threejs.org/docs/#Fog for available properties and methods on the Fog object. */ get fog(): Fog3; get mode(): FogMode; set near(value: number); get near(): number; set far(value: number); get far(): number; set color(value: Color); get color(): Color; private _fog?; onEnable(): void; onDisable(): void; } export {};