Skip to content

Commit f79cb28

Browse files
alvarosabuTinoooo
andauthored
feat: update core to v4 (#109)
* chore: new linter * feat: update to v4, `useLoop` and remove disable render * feat: render emit and advance playgroudn for render modes * chore: remove render event on TresCanvas * chore: fix lint * chore(ci): updated node version to 20 on lint action * chore: release v1.0.0-next.0 * chore: changed file structure in playground a bit, updated dependency * fix: bloom effect in playground * chore: remove empty templates * test to make linter happy * tiny eslint fix * linting dependency test * restored eslint dependency version --------- Co-authored-by: Tino Koch <[email protected]>
1 parent b7810ba commit f79cb28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+10451
-7657
lines changed

.eslintignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-20.04
1212
strategy:
1313
matrix:
14-
node-version: [16]
14+
node-version: [20]
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11

22

3+
## [1.0.0-next.0](https://github.com/Tresjs/post-processing/compare/0.7.1...1.0.0-next.0) (2024-05-21)
4+
5+
6+
### Features
7+
8+
* export useEffect composable ([#105](https://github.com/Tresjs/post-processing/issues/105)) ([b7810ba](https://github.com/Tresjs/post-processing/commit/b7810ba2864e70516c95b9866c2ea5d02a8f9b9d))
9+
* render emit and advance playgroudn for render modes ([5d256fc](https://github.com/Tresjs/post-processing/commit/5d256fcc5e40582e0f87c8cc1ec46fbd9a007435))
10+
* update to v4, `useLoop` and remove disable render ([544fb39](https://github.com/Tresjs/post-processing/commit/544fb39be3af7f71ddf994f14789215351cec569))
11+
312
## [0.7.1](https://github.com/Tresjs/post-processing/compare/0.7.0...0.7.1) (2024-03-18)
413

514

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ Project maintainers are responsible for clarifying the standards of acceptable b
2828

2929
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
3030

31-
## Scope
31+
## Scope
3232

3333
This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
3434

35-
## Enforcement
35+
## Enforcement
3636

3737
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team by DM at [TresJS Discord](https://discord.gg/UCr96AQmWn). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
3838

3939
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
4040

41-
## Attribution
41+
## Attribution
4242

4343
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default defineConfig({
2828
content: '/og-banner.png',
2929
},
3030
],
31-
['script', { defer: 'true', 'data-site': 'OWBUVCJK', src: 'https://cdn.usefathom.com/script.js' }],
31+
['script', { 'defer': 'true', 'data-site': 'OWBUVCJK', 'src': 'https://cdn.usefathom.com/script.js' }],
3232
],
3333
themeConfig: {
3434
logo: '/logo.svg',

docs/.vitepress/config.ts.timestamp-1700208814950-61916cb6f3fe3.mjs

Lines changed: 0 additions & 67 deletions
This file was deleted.

docs/.vitepress/theme/TresLayout.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup>
2-
// eslint-disable-next-line import/no-named-as-default
32
import DefaultTheme from 'vitepress/theme'
43
import LoveVueThreeJS from './components/LoveVueThreeJS.vue'
54
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script setup lang="ts">
22
import { useGLTF } from '@tresjs/cientos'
33
4-
const { nodes }
4+
const { nodes }
55
= await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb', { draco: true })
66
const model = nodes.Cube
77
</script>
88

99
<template>
1010
<primitive :object="model" />
11-
</template>
11+
</template>

docs/.vitepress/theme/components/BloomDemo.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
22
import { Color } from 'three'
3-
import { reactive, ref } from 'vue'
3+
import { reactive } from 'vue'
44
import { TresCanvas } from '@tresjs/core'
55
import { BlendFunction } from 'postprocessing'
6-
import { EffectComposer, Bloom } from '@tresjs/post-processing'
6+
import { Bloom, EffectComposer } from '@tresjs/post-processing'
77
88
import { useRouteDisposal } from '../composables/useRouteDisposal'
99

docs/.vitepress/theme/components/DepthOfFieldDemo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ref } from 'vue'
33
import { gsap } from 'gsap'
44
import { TresCanvas } from '@tresjs/core'
5-
import { EffectComposer, DepthOfField } from '@tresjs/post-processing'
5+
import { DepthOfField, EffectComposer } from '@tresjs/post-processing'
66
77
import { useRouteDisposal } from '../composables/useRouteDisposal'
88

docs/.vitepress/theme/components/DocsDemo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
style="aspect-ratio: 16/9; height: auto; margin: 2rem 0; border-radius: 8px; overflow:hidden;"
99
>
1010
<Suspense>
11-
<slot />
11+
<slot></slot>
1212
</Suspense>
13-
</div>
13+
</div>
1414
</ClientOnly>
15-
</template>
15+
</template>

docs/.vitepress/theme/components/LoveVueThreeJS.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
///<reference types="vite-svg-loader" />
2+
/// <reference types="vite-svg-loader" />
33
import { gsap } from 'gsap'
44
import { onMounted, ref } from 'vue'
55
import Triangle from '../assets/triangle.svg'

docs/.vitepress/theme/components/NoiseDemo.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { TresCanvas } from '@tresjs/core'
3-
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
3+
import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three'
44
import { EffectComposer, Noise } from '@tresjs/post-processing'
55
import { OrbitControls } from '@tresjs/cientos'
66
import { BlendFunction } from 'postprocessing'
@@ -35,4 +35,4 @@ const { effectComposer } = useRouteDisposal()
3535
</EffectComposer>
3636
</Suspense>
3737
</TresCanvas>
38-
</template>
38+
</template>

docs/.vitepress/theme/components/OutlineDemo.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Intersection, Object3D } from 'three'
44
import { NoToneMapping } from 'three'
55
import { TresCanvas } from '@tresjs/core'
66
import { OrbitControls } from '@tresjs/cientos'
7-
import { Outline, EffectComposer } from '@tresjs/post-processing'
7+
import { EffectComposer, Outline } from '@tresjs/post-processing'
88
import { KernelSize } from 'postprocessing'
99
1010
import { TresLeches, useControls } from '@tresjs/leches'
@@ -23,9 +23,8 @@ const { effectComposer } = useRouteDisposal()
2323
const outlinedObjects = ref<Object3D[]>([])
2424
2525
const toggleMeshSelectionState = ({ object }: Intersection) => {
26-
if (outlinedObjects.value.some(({ uuid }) => uuid === object.uuid))
27-
outlinedObjects.value = outlinedObjects.value.filter(({ uuid }) => uuid !== object.uuid)
28-
else outlinedObjects.value = [...outlinedObjects.value, object]
26+
if (outlinedObjects.value.some(({ uuid }) => uuid === object.uuid)) { outlinedObjects.value = outlinedObjects.value.filter(({ uuid }) => uuid !== object.uuid) }
27+
else { outlinedObjects.value = [...outlinedObjects.value, object] }
2928
}
3029
3130
const { edgeStrength, pulseSpeed, visibleEdgeColor, blur, kernelSize } = useControls({
@@ -59,7 +58,6 @@ useRouteDisposal(effectComposer)
5958
<TresLeches />
6059
<TresCanvas
6160
v-bind="gl"
62-
:disable-render="true"
6361
>
6462
<TresPerspectiveCamera
6563
:position="[1, 3, 3]"

docs/.vitepress/theme/components/PixelationDemo.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { TresCanvas } from '@tresjs/core'
33
import { OrbitControls } from '@tresjs/cientos'
44
import { EffectComposer, Pixelation } from '@tresjs/post-processing'
55
6-
import { ref } from 'vue'
76
import { useRouteDisposal } from '../composables/useRouteDisposal'
87
98
// Need to dispose of the effect composer when the route changes because Vitepress doesnt unmount the components
@@ -15,7 +14,6 @@ const { effectComposer } = useRouteDisposal()
1514
clear-color="#121212"
1615
:alpha="false"
1716
:shadows="true"
18-
:disable-render="true"
1917
>
2018
<TresPerspectiveCamera
2119
:position="[3, 2, 4]"
@@ -54,4 +52,3 @@ const { effectComposer } = useRouteDisposal()
5452
</Suspense>
5553
</TresCanvas>
5654
</template>
57-

docs/.vitepress/theme/components/VignetteDemo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import { TresCanvas } from '@tresjs/core'
3-
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
3+
import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three'
44
import { OrbitControls } from '@tresjs/cientos'
5-
import { EffectComposer, Vignette, DepthOfField } from '@tresjs/post-processing'
5+
import { DepthOfField, EffectComposer, Vignette } from '@tresjs/post-processing'
66
77
import { useRouteDisposal } from '../composables/useRouteDisposal'
88
@@ -42,4 +42,4 @@ const { effectComposer } = useRouteDisposal()
4242
</EffectComposer>
4343
<TresAmbientLight :intensity="1" />
4444
</TresCanvas>
45-
</template>
45+
</template>

docs/.vitepress/theme/composables/useRouteDisposal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export function useRouteDisposal() {
1414
return {
1515
effectComposer,
1616
}
17-
}
17+
}

docs/.vitepress/theme/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@
6060

6161
.VPNavBarTitle .logo {
6262
height: 16px !important;
63-
}
63+
}

docs/guide/effects/bloom.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Bloom is an effect that simulates the way that bright objects in the real world
1010

1111
```vue
1212
<script setup lang="ts">
13-
import { EffectComposer, Bloom } from '@tresjs/post-processing'
13+
import { Bloom, EffectComposer } from '@tresjs/post-processing'
1414
</script>
1515
1616
<template>
@@ -30,12 +30,12 @@ import { EffectComposer, Bloom } from '@tresjs/post-processing'
3030

3131
| Prop | Description | Default |
3232
| -------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
33-
| `blendFunction` | The blend function of this effect. This prop is not reactive. |  [BlendFunction.SCREEN](https://github.com/pmndrs/postprocessing/blob/c3ce388be247916437a314f17748a75329d65df1/src/enums/BlendFunction.js#L40) |
33+
| `blendFunction` | The blend function of this effect. This prop is not reactive. | [BlendFunction.SCREEN](https://github.com/pmndrs/postprocessing/blob/c3ce388be247916437a314f17748a75329d65df1/src/enums/BlendFunction.js#L40) |
3434
| `intensity` | The intensity of the bloom effect. | `1` |
3535
| `kernelSize` | The kernel size. | `KernelSize.LARGE` |
3636
| `luminanceThreshold` | The luminance threshold. Raise this value to mask out darker elements in the scene. Range is [0, 1]. | `0.9` |
3737
| `luminanceSmoothing` | Controls the smoothness of the luminance threshold. Range is [0, 1]. | `0.025` |
3838
| `mipMapBlur` | Enables mip map blur (UnrealBloom). This prop is not reactive. | `false` |
3939

4040
## Further Reading
41-
see [postprocessing docs](https://pmndrs.github.io/postprocessing/public/docs/class/src/effects/BloomEffect.js~BloomEffect.html)
41+
see [postprocessing docs](https://pmndrs.github.io/postprocessing/public/docs/class/src/effects/BloomEffect.js~BloomEffect.html)

0 commit comments

Comments
 (0)