5.4.0

Smoke

Beautiful smoke, cloud, and fog effect using textures and transparency.

<Smoke /> is a component that renders a smoke in your scene. It is an abstraction that use a combination of textures, transparency and some calculation, to create a beautiful smoke - cloud - fog effect

Usage

Smoke component comes with a default texture abstraction it needs to be wrapped by a Suspense component

You can use <Smoke /> component without passing any props, but still if you want you can tweak the props to find the best setup for you

<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { Smoke } from '@tresjs/cientos'
</script>

<template>
  <TresCanvas>
    <TresPerspectiveCamera :position="[0, 3, 5]" />
    <Suspense>
      <Smoke />
    </Suspense>
    <TresAmbientLight />
  </TresCanvas>
</template>

Props

NameTypeDescriptionDefault
colorTresColorThe color of the smoke.'#ffffff'
opacitynumberThe strength of the opacity.0.5
speednumberThe rotation speed of the smoke.0.4
depthnumberThe base depth.0.3
segmentsnumberThe number of smoke to render.10
texturestringThe texture of the smoke.link
depthTestbooleanThe depthTest.false
spreadYnumberSpread on the Y axis.0.1
spreadXnumberSpread on the X axis.0.5
scalenumberscale1

Default texture