@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.
38 lines (37 loc) • 1.47 kB
TypeScript
import { Texture, Vector4 } from "three";
import { type Renderer } from "./Renderer.js";
/**
* This component is automatically added by the {@link Renderer} component if the object has lightmap uvs AND we have a lightmap.
*
* @category Rendering
* @group Components
*/
export declare class RendererLightmap {
get lightmap(): Texture | null;
set lightmap(tex: Texture | null);
private lightmapIndex;
private lightmapScaleOffset;
private readonly renderer;
private _isApplied;
private get context();
private get gameObject();
private lightmapTexture;
constructor(renderer: Renderer);
init(lightmapIndex: number, lightmapScaleOffset: Vector4, lightmapTexture: Texture): void;
updateLightmapUniforms(_material: any): void;
/**
* Apply the lightmap to the object using MaterialPropertyBlock instead of cloning materials.
* The lightmap texture and its per-object UV transform are set as overrides via PropertyBlock.
* Three.js reads material.lightMap to determine shader defines and upload uniforms,
* and uses texture.offset/repeat to compute lightMapTransform in the vertex shader.
*/
applyLightmap(): void;
/** Update the lightMap override on all property blocks (e.g. after LOD swap) */
private updatePropertyBlockTexture;
/**
* Remove the lightmap from the object
*/
onUnset(): void;
private ensureLightmapUvs;
private setLightmapDebugMaterial;
}