# SceneElement

Class · extends [`AsyncElement`](https://api.playcanvas.com/web-components/classes/AsyncElement.md) · category: Application

Source: https://github.com/playcanvas/web-components/blob/252f001881302c266c8d727044408c32be2bb5e7/src/scene.ts#L30

The SceneElement interface provides properties and methods for manipulating
[`<pc-scene>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-scene/) elements.
The SceneElement interface also inherits the properties and methods of the
[HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement) interface.

The scene element is the ancestor of every entity element, so the pointer events `<pc-app>`
dispatches on entities bubble through it, and it receives its own `pointerenter` and
`pointerleave` as the pointer moves onto and off its entities as a whole. A listener here is a
delegated listener for the whole scene: read `event.target` to find the entity element hit.

**elementSummary** The `<pc-scene>` element holds the entity hierarchy the application renders,
along with scene-wide fog, exposure, Gaussian splat, clustered lighting and gravity settings.
Must be a direct child of `<pc-app>`.

## Accessors

### exposure

```ts
get exposure(): number
set exposure(value: number)
```

Gets the exposure of the scene.

### fog

```ts
get fog(): "none" | "linear" | "exp" | "exp2"
set fog(value: "none" | "linear" | "exp" | "exp2")
```

Gets the fog type of the scene.

### fogColor

```ts
get fogColor(): Color
set fogColor(value: Color)
```

Gets the fog color of the scene.

### fogDensity

```ts
get fogDensity(): number
set fogDensity(value: number)
```

Gets the fog density of the scene.

### fogEnd

```ts
get fogEnd(): number
set fogEnd(value: number)
```

Gets the fog end distance of the scene.

### fogStart

```ts
get fogStart(): number
set fogStart(value: number)
```

Gets the fog start distance of the scene.

### gravity

```ts
get gravity(): Vec3
set gravity(value: Vec3)
```

Gets the gravity of the scene.

### gsplatDither

```ts
get gsplatDither(): "bayer2" | "bayer4" | "bayer8" | "bayer16" | "bluenoise" | "ignnoise"
set gsplatDither(value: "bayer2" | "bayer4" | "bayer8" | "bayer16" | "bluenoise" | "ignnoise")
```

Gets the noise pattern stochastic Gaussian splats dither their coverage against.

### gsplatSplatBudget

```ts
get gsplatSplatBudget(): number
set gsplatSplatBudget(value: number)
```

Gets the number of splats rendered across the scene.

### gsplatSplatBudgetMode

```ts
get gsplatSplatBudgetMode(): "target" | "limit"
set gsplatSplatBudgetMode(value: "target" | "limit")
```

Gets how the splat budget is used for streamed Gaussian splats.

### gsplatStochastic

```ts
get gsplatStochastic(): boolean
set gsplatStochastic(value: boolean)
```

Gets whether Gaussian splats render with stochastic alpha on WebGPU: drawn unsorted, with
dithered coverage and depth writes, rather than sorted and alpha blended.

### gsplatUseFog

```ts
get gsplatUseFog(): boolean
set gsplatUseFog(value: boolean)
```

Gets whether the scene fog applies to Gaussian splats.

### gsplatUseTonemap

```ts
get gsplatUseTonemap(): boolean
set gsplatUseTonemap(value: boolean)
```

Gets whether the camera's tonemapping and the scene's exposure apply to Gaussian splats.

### lightingMaxLights

```ts
get lightingMaxLights(): number
set lightingMaxLights(value: number)
```

Gets the maximum number of lights clustered lighting uses in a frame.

### scene

```ts
get scene(): Scene | null
```

The PlayCanvas scene instance. `null` until the containing application has been created —
await [whenReady](https://api.playcanvas.com/web-components/functions/whenReady.md) or the element's `ready()` promise before accessing it.

## Inherited from [AsyncElement](https://api.playcanvas.com/web-components/classes/AsyncElement.md)

- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `protected _onReady(): void`
- `protected _resetReady(): void`
- `ready(): Promise<SceneElement>`
