Skip to content

Commit

Permalink
docs: fixed broken docs, added new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Sep 28, 2024
1 parent dba4a70 commit b812099
Show file tree
Hide file tree
Showing 23 changed files with 1,218 additions and 1,206 deletions.
3 changes: 0 additions & 3 deletions docs/.eslintrc.json

This file was deleted.

27 changes: 17 additions & 10 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,21 @@ export default defineConfig({
items: [{ text: 'Introduction', link: '/guide/' }],
},
{
text: 'Effects',
text: 'Pmndrs',
items: [
{ text: 'Bloom', link: '/guide/effects/bloom' },
{ text: 'Depth of Field', link: '/guide/effects/depth-of-field' },
{ text: 'Glitch', link: '/guide/effects/glitch' },
{ text: 'Noise', link: '/guide/effects/noise' },
{ text: 'Outline', link: '/guide/effects/outline' },
{ text: 'Pixelation', link: '/guide/effects/pixelation' },
{ text: 'Vignette', link: '/guide/effects/vignette' },
{ text: 'Bloom', link: '/guide/pmndrs/bloom' },
{ text: 'Depth of Field', link: '/guide/pmndrs/depth-of-field' },
{ text: 'Glitch', link: '/guide/pmndrs/glitch' },
{ text: 'Noise', link: '/guide/pmndrs/noise' },
{ text: 'Outline', link: '/guide/pmndrs/outline' },
{ text: 'Pixelation', link: '/guide/pmndrs/pixelation' },
{ text: 'Vignette', link: '/guide/pmndrs/vignette' },
],
},
{
text: 'Three',
items: [

],
},
],
Expand All @@ -78,9 +84,10 @@ export default defineConfig({
},
resolve: {
alias: {
'@tresjs/post-processing': resolve(__dirname, '../../dist/tres-postprocessing.js'),
'@tresjs/post-processing/three': resolve(__dirname, '../../src/core/three'),
'@tresjs/post-processing/pmndrs': resolve(__dirname, '../../src/core/pmndrs'),
},
dedupe: ['three'],
dedupe: ['three', '@tresjs/core'],
},
},
vue: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BlendFunction } from 'postprocessing'
import { Color } from 'three'
import { reactive } from 'vue'
import { useRouteDisposal } from '../composables/useRouteDisposal'
import { useRouteDisposal } from '../../composables/useRouteDisposal'
const gl = {
clearColor: '#121212',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DepthOfField, EffectComposer } from '@tresjs/post-processing/pmndrs'
import { gsap } from 'gsap'
import { ref } from 'vue'
import { useRouteDisposal } from '../composables/useRouteDisposal'
import { useRouteDisposal } from '../../composables/useRouteDisposal'
const dofEffect = ref<InstanceType<typeof DepthOfField> | null>(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EffectComposer, Glitch } from '@tresjs/post-processing/pmndrs'
import { Color } from 'three'
import { useRouteDisposal } from '../composables/useRouteDisposal'
import { useRouteDisposal } from '../../composables/useRouteDisposal'
const gl = {
clearColor: '#121212',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EffectComposer, Noise } from '@tresjs/post-processing/pmndrs'
import { BlendFunction } from 'postprocessing'
import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three'
import { useRouteDisposal } from '../composables/useRouteDisposal'
import { useRouteDisposal } from '../../composables/useRouteDisposal'
const gl = {
clearColor: '#82DBC5',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { KernelSize } from 'postprocessing'
import { NoToneMapping } from 'three'
import { ref } from 'vue'
import { useRouteDisposal } from '../composables/useRouteDisposal'
import { useRouteDisposal } from '../../composables/useRouteDisposal'
import '@tresjs/leches/styles'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { OrbitControls } from '@tresjs/cientos'
import { TresCanvas } from '@tresjs/core'
import { EffectComposer, Pixelation } from '@tresjs/post-processing/pmndrs'
import { useRouteDisposal } from '../composables/useRouteDisposal'
import { useRouteDisposal } from '../../composables/useRouteDisposal'
// Need to dispose of the effect composer when the route changes because Vitepress doesnt unmount the components
const { effectComposer } = useRouteDisposal()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { TresCanvas } from '@tresjs/core'
import { DepthOfField, EffectComposer, Vignette } from '@tresjs/post-processing/pmndrs'
import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three'
import { useRouteDisposal } from '../composables/useRouteDisposal'
import { useRouteDisposal } from '../../composables/useRouteDisposal'
import BlenderCube from './BlenderCube.vue'
import BlenderCube from '../BlenderCube.vue'
const gl = {
clearColor: '#4f4f4f',
Expand All @@ -30,15 +30,8 @@ const { effectComposer } = useRouteDisposal()
<BlenderCube />
</Suspense>
<EffectComposer ref="effectComposer">
<DepthOfField
:focus-distance="0"
:focal-length="0.02"
:bokeh-scale="2"
/>
<Vignette
:darkness="0.9"
:offset="0.3"
/>
<DepthOfField :focus-distance="0" :focal-length="0.02" :bokeh-scale="2" />
<Vignette :darkness="0.9" :offset="0.3" />
</EffectComposer>
<TresAmbientLight :intensity="1" />
</TresCanvas>
Expand Down
16 changes: 8 additions & 8 deletions docs/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}

/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
BlenderCube: typeof import('./.vitepress/theme/components/BlenderCube.vue')['default']
BloomDemo: typeof import('./.vitepress/theme/components/BloomDemo.vue')['default']
DepthOfFieldDemo: typeof import('./.vitepress/theme/components/DepthOfFieldDemo.vue')['default']
BloomDemo: typeof import('./.vitepress/theme/components/pmdrs/BloomDemo.vue')['default']
DepthOfFieldDemo: typeof import('./.vitepress/theme/components/pmdrs/DepthOfFieldDemo.vue')['default']
DocsDemo: typeof import('./.vitepress/theme/components/DocsDemo.vue')['default']
GlitchDemo: typeof import('./.vitepress/theme/components/GlitchDemo.vue')['default']
GlitchDemo: typeof import('./.vitepress/theme/components/pmdrs/GlitchDemo.vue')['default']
LoveVueThreeJS: typeof import('./.vitepress/theme/components/LoveVueThreeJS.vue')['default']
NoiseDemo: typeof import('./.vitepress/theme/components/NoiseDemo.vue')['default']
OutlineDemo: typeof import('./.vitepress/theme/components/OutlineDemo.vue')['default']
PixelationDemo: typeof import('./.vitepress/theme/components/PixelationDemo.vue')['default']
NoiseDemo: typeof import('./.vitepress/theme/components/pmdrs/NoiseDemo.vue')['default']
OutlineDemo: typeof import('./.vitepress/theme/components/pmdrs/OutlineDemo.vue')['default']
PixelationDemo: typeof import('./.vitepress/theme/components/pmdrs/PixelationDemo.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
VignetteDemo: typeof import('./.vitepress/theme/components/VignetteDemo.vue')['default']
VignetteDemo: typeof import('./.vitepress/theme/components/pmdrs/VignetteDemo.vue')['default']
}
}
30 changes: 25 additions & 5 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> Post-processing, in simple terms, consist in applying visual effects to your 3D scenes after they have been rendered. It allows you to add beautiful effects such as depth-of-field, bloom, motion blur, and many more. These effects can greatly enhance the overall look and feel of your projects, making them more immersive and visually captivating.
The `post-processing` package leverages the excellent work done by the pmndrs [postprocessing](https://github.com/pmndrs/postprocessing) package , providing you with an easy-to-use, Vue-centric solution that makes the developer experience (DX) smoother and more delightful.
The `post-processing` package leverages both the excellent work done by the pmndrs [postprocessing](https://github.com/pmndrs/postprocessing) package and native [Three.js post-processing effects](https://threejs.org/examples/?q=postprocessing#webgl_postprocessing). Providing you with an easy-to-use, Vue-centric solution that makes the developer experience (DX) smoother and more delightful.

Because Post-processing, is not an easy task, fortunate now it is 😜.

Expand Down Expand Up @@ -32,19 +32,39 @@ pnpm add @tresjs/post-processing

## Basic Usage

```ts
import { Bloom, DepthOfField, EffectComposer } from '@tresjs/post-processing/pmndrs'
You can import post-processing effects from both pmndrs and native Three.js.

### Using native Three.js effects

```html
<script setup lang="ts">
import { EffectComposer, UnrealBloom, Glitch } from '@tresjs/post-processing/three'
</script>

<template>
<TresCanvas shadows alpha>
<TresPerspectiveCamera :args="[45," 1, 0.1, 1000] />
<EffectComposer>
<UnrealBloom />
<Glitch />
</EffectComposer>
</TresCanvas>
</template>
```

Now you can use the `EffectComposer` component in your scene.
### Using pmndrs effects

```html
<script setup lang="ts">
import { EffectComposer, Bloom, Glitch } from '@tresjs/post-processing/pmndrs'
</script>

<template>
<TresCanvas shadows alpha>
<TresPerspectiveCamera :args="[45," 1, 0.1, 1000] />
<EffectComposer>
<DepthOfField />
<Bloom />
<Glitch />
</EffectComposer>
</TresCanvas>
</template>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"preview": "vitepress preview"
},
"dependencies": {
"@tresjs/cientos": "^3.6.0",
"@tresjs/core": "^3.5.1",
"@tresjs/cientos": "^4.0.2",
"@tresjs/core": "^4.2.10",
"@tresjs/post-processing": "workspace:^",
"gsap": "^3.12.3"
},
"devDependencies": {
"@tresjs/leches": "^0.14.0",
"unocss": "^0.58.0",
"unplugin-vue-components": "^0.26.0",
"unocss": "^0.63.0",
"unplugin-vue-components": "^0.27.4",
"vite-svg-loader": "^5.1.0",
"vitepress": "1.0.0-rc.31"
"vitepress": "1.3.4"
}
}
4 changes: 0 additions & 4 deletions docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { templateCompilerOptions } from '@tresjs/core'
import Unocss from 'unocss/vite'
import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'
Expand All @@ -17,7 +16,4 @@ export default defineConfig({
dts: 'components.d.ts',
}),
],
vue: {
...templateCompilerOptions,
},
})
5 changes: 4 additions & 1 deletion playground/.eslintrc-auto-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
"onWatcherCleanup": true,
"useId": true,
"useModel": true,
"useTemplateRef": true
"useTemplateRef": true,
"DirectiveBinding": true,
"MaybeRef": true,
"MaybeRefOrGetter": true
}
}
2 changes: 1 addition & 1 deletion playground/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
Loading

0 comments on commit b812099

Please sign in to comment.