@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.
29 lines (28 loc) • 1.29 kB
TypeScript
import type { EffectComposer } from "postprocessing";
import { Camera, Object3D, WebGLRenderer, WebGLRenderTarget } from "three";
import type { EffectComposer as ThreeEffectComposer } from "three/examples/jsm/postprocessing/EffectComposer";
/**
* A RenderTexture can be used to render a scene to a texture automatically by assigning it to the `Camera` component's `targetTexture` property.
* You can then assign the `RenderTexture.texture` to materials to be displayed
* @example Create a new RenderTexture and assign it to a camera and material
* ```typescript
* // create new RenderTexture with a resolution
* const rt = new RenderTexture(256, 256);
* // assign to a camera
* myCameraComponent.targetTexture = rt;
* // assign to a material
* myMaterial.map = rt.texture;
* ```
*/
export declare class RenderTexture extends WebGLRenderTarget {
/**
* Render the scene to the texture
* @param scene The scene to render
* @param camera The camera to render from
* @param renderer The renderer or effectcomposer to use
*/
render(scene: Object3D, camera: Camera, renderer: WebGLRenderer | EffectComposer | ThreeEffectComposer): void;
private static _userSet;
private onBeforeRender;
private onAfterRender;
}