Skip to content

feat: adapt to core v5 changes 2 in MR 1043 #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,17 @@
"docs:preview": "vitepress preview"
},
"peerDependencies": {
"@tresjs/core": ">=4.0",
"@tresjs/core": ">=5.0",
"three": ">=0.169",
"vue": ">=3.4"
},
"dependencies": {
"@tresjs/cientos": "5.0.0-next.2",
"@vueuse/core": "^12.5.0",
"postprocessing": "^6.37.2"
},
"devDependencies": {
"@release-it/conventional-changelog": "^10.0.0",
"@tresjs/core": "5.0.0-next.5",
"@tresjs/core": "https://pkg.pr.new/@tresjs/core@1044",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: This should be changed back.

"@tresjs/eslint-config": "^1.4.0",
"@tresjs/leches": "https://pkg.pr.new/@tresjs/leches@9ad0cd3",
"@types/three": "^0.172.0",
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@tresjs/cientos": "5.0.0-next.2",
"@tresjs/core": "5.0.0-next.5",
"@tresjs/core": "https://pkg.pr.new/@tresjs/core@a5468fc",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: This should be changed back.

"@tresjs/post-processing": "workspace:*",
"vue-router": "^4.5.0"
},
Expand Down
2 changes: 1 addition & 1 deletion playground/src/pages/postprocessing/on-demand.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function onRender() {
const canvas = ref<InstanceType<typeof TresCanvas>>()

function onControlChange() {
canvas.value?.context?.invalidate()
canvas.value?.context?.renderer.invalidate()
}
</script>

Expand Down
1,329 changes: 673 additions & 656 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions src/core/pmndrs/EffectComposerPmndrs.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import type { EffectComposer } from 'postprocessing'
import type { InjectionKey, ShallowRef } from 'vue'
import { useLoop, useTresContext } from '@tresjs/core'
import { useTresContext } from '@tresjs/core'
import { DepthDownsamplingPass, EffectComposer as EffectComposerImpl, NormalPass, RenderPass } from 'postprocessing'

import { HalfFloatType } from 'three'
Expand Down Expand Up @@ -105,9 +105,7 @@ watch(() => [sizes.width.value, sizes.height.value], ([width, height]) => {
immediate: true,
})

const { render } = useLoop()

render((notifySuccess) => {
renderer.replaceRenderFunction((notifySuccess) => {
if (props.enabled && renderer.instance && effectComposer.value && sizes.width.value && sizes.height.value) {
const currentAutoClear = renderer.instance.autoClear
renderer.instance.autoClear = props.autoClear
Expand Down
2 changes: 1 addition & 1 deletion src/core/pmndrs/GlitchPmndrs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ defineExpose({ pass, effect })
const { invalidate } = useTres()

const { onBeforeRender } = useLoop()
onBeforeRender((/* { invalidate } */) => invalidate())
onBeforeRender(() => invalidate())

watchEffect(() => {
const getMode = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/pmndrs/NoisePmndrs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defineExpose({ pass, effect })
const { invalidate } = useTres()

const { onBeforeRender } = useLoop()
onBeforeRender((/* { invalidate } */) => invalidate())
onBeforeRender(() => invalidate())

makePropWatchers(
[
Expand Down
6 changes: 2 additions & 4 deletions src/core/three/EffectComposer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { useLoop, useTresContext } from '@tresjs/core'
import { useTresContext } from '@tresjs/core'
import { useDevicePixelRatio } from '@vueuse/core'
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js'
Expand Down Expand Up @@ -53,9 +53,7 @@ if (!props.withoutRenderPass) {
})
}

const { render } = useLoop()

render((notifySuccess) => {
renderer.replaceRenderFunction((notifySuccess) => {
if (effectComposer.value && props.enabled) {
effectComposer.value.render()
notifySuccess()
Expand Down