Capítulo 590 de 859
Can be used to create a flat, refractive surface like for special windows or water effects.
Note that this class can only be used with WebGLRenderer. When using WebGPURenderer, use viewportSharedTexture.
const geometry = new THREE.PlaneGeometry( 100, 100 );
const refractor = new Refractor( refractorGeometry, {
color: 0xcbcbcb,
textureWidth: 1024,
textureHeight: 1024
} );
scene.add( refractor );
Constructor
| Signature |
|---|
new Refractor( geometry : BufferGeometry, options : Refractor~Options ) |
Properties
| Property | Description |
|---|---|
.camera : PerspectiveCamera | The reflector's virtual camera. |
.isRefractor : boolean (readonly) | This flag can be used for type testing. |
Methods
| Method | Description |
|---|---|
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app. |
.getRenderTarget() : WebGLRenderTarget | Returns the reflector's internal render target. |