Skip to content

Outline

<Outline /> creates an inverted-hull outline using its parent's geometry. Supported parents are <TresMesh> and <TresSkinnedMesh>.

Usage

vue
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { OrbitControls, Outline } from '@tresjs/cientos'
</script>

<template>
  <TresCanvas clear-color="#4f4f4f">
    <TresPerspectiveCamera />
    <OrbitControls />
    <TresAmbientLight :intensity="3.14" />
    <TresPointLight :intensity="50" :position="[2, 2, 0]" />
    <TresMesh :position-x="-0.75">
      <TresBoxGeometry />
      <TresMeshPhongMaterial />
      <Outline :thickness="7.5" color="#82dbc5" />
    </TresMesh>
    <TresMesh :position-x="0.75">
      <TresSphereGeometry :args="[0.5]" />
      <TresMeshPhongMaterial />
      <Outline :thickness="7.5" color="#fbb03b" />
    </TresMesh>
  </TresCanvas>
</template>

Props

PropsDescriptionDefault
colorOutline color'black'
screenspaceWhether line thickness is independent of zoomfalse
opacityOutline opacity1
transparentOutline transparencyfalse
thicknessOutline thickness0.05
angleGeometry crease angle (0 is no crease). See BufferGeometryUtils.toCreasedNormalsMath.PI