Skip to content

Commit

Permalink
feat(Sky): add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Sep 15, 2023
1 parent a4475db commit 110e4a8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default defineConfig({
{ text: 'Backdrop', link: '/guide/staging/backdrop' },
{ text: 'Environment', link: '/guide/staging/environment' },
{ text: 'useEnvironment', link: '/guide/staging/use-environment' },
{ text: 'Sky', link: '/guide/staging/sky' },
{ text: 'Stars', link: '/guide/staging/stars' },
{ text: 'Smoke', link: '/guide/staging/smoke' },
{ text: 'Contact Shadows', link: '/guide/staging/contact-shadows' },
Expand Down
31 changes: 31 additions & 0 deletions docs/guide/staging/sky.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Sky

![Sky](/cientos/sky.png)

`<Sky />` is a wrapper for the [Three.js `Sky` add-on](https://threejs.org/examples/?q=sky#webgl_shaders_sky).

## Usage

```vue{2,8}
<script setup lang="ts">
import { Sky } from '@tresjs/cientos'
</script>
<template>
<TresCanvas>
<TresPerspectiveCamera :position="[0, 100, 2000]" />
<Sky />
</TresCanvas>
</template>
```

## Props

| Prop | Description | Default |
| :------------------ | :---------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `elevation` | The sun's elevation from the horizon, in degrees | `0.6` |
| `azimuth` | The sun's [azimuth angle](https://en.wikipedia.org/wiki/Solar_azimuth_angle), in degrees – its horizontal coordinate on the horizon | `180` |
| `mie-coefficient` | [Mie scattering](https://en.wikipedia.org/wiki/Mie_scattering) amount | `0.005` |
| <nobr>`mie-directional-g`</nobr> | [Mie scattering](https://en.wikipedia.org/wiki/Mie_scattering) direction | `0.7` |
| `rayleigh` | [Rayleigh scattering](https://en.wikipedia.org/wiki/Rayleigh_scattering) | `3` |
| `turbidity` | Haziness | `3.4` |
Binary file added docs/public/cientos/sky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 110e4a8

Please sign in to comment.