1. @threlte/core
  2. LightInstance

@threlte/core

LightInstance

This component lets you use any manually instantiated object that extends THREE.Light in threlte.

Import

Source

Github View Source Code

Package

NPM View Package

Related Docs


Example

<script>
  import { RectAreaLight } from 'three'
  import { RectAreaLightUniformsLib } from 'three/examples/jsm/lights/RectAreaLightUniformsLib'
  import { LightInstance } from '@threlte/core'

  RectAreaLightUniformsLib.init()

  export let intensity

  const light = new RectAreaLight(0xffffff, intensity, 10, 10)
</script>

<LightInstance {light} {intensity} position={{ x: 5, y: 5 }} />

Properties

// required
light: THREE.Light

// optional
viewportAware: boolean = false
position: Position | undefined = undefined
scale: Scale | undefined = undefined
rotation: Rotation | undefined = undefined
lookAt: LookAt | undefined = undefined
castShadow: boolean | undefined = undefined
receiveShadow: boolean | undefined = undefined
frustumCulled: boolean | undefined = undefined
renderOrder: number | undefined = undefined
visible: boolean | undefined = undefined
dispose: boolean | undefined = undefined
userData: Record<string, any> | undefined = undefined
color: THREE.ColorRepresentation | undefined = undefined
intensity: number | undefined = undefined

Bindings

inViewport: boolean

Events

viewportenter: undefined
viewportleave: undefined