Skip to content
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

feat(app): Add the option for x and y in mouseparallax component #444

Merged
merged 5 commits into from
Jul 17, 2024

Conversation

JaimeTorrealba
Copy link
Member

Small PR for improving the mouse-parallax component

v4 branch is selected

Copy link

stackblitz bot commented Jul 10, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

@andretchen0 andretchen0 left a comment

Choose a reason for hiding this comment

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

Hey @JaimeTorrealba . Welcome back! This is a useful change!

@@ -10,9 +10,11 @@

You only need to import it and add it to your template as `<MouseParallax />`. Additionally, you can pass the following props:

`factor` is a number to increase the movement range of the camera. `ease` is a number that smoothes the movement. You can also disable the effect with the `disabled` prop.
`factor` is a number to increase the movement range of the camera. This could be an array of two values corresponding to the x and y values, in that order, ej. `:factor=[x,y]` .
Copy link
Contributor

Choose a reason for hiding this comment

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

Wording:

I'm guessing "ej." is for "ejemplo", right?

I think here we'd write, "in other words" or "that is to say" or "i.e.". Or maybe just leave it out altogether:

This could be an array of two values corresponding to the x and y values, in that order: `:factor=[x,y]`.


`local` is a boolean that enables movement based on the position of the mouse on the element rather than the window.
`ease` is a number that smooths the movement. This could be an array of two values corresponding to the x and y values, in that order, ej. `:ease=[x,y]` .
Copy link
Contributor

Choose a reason for hiding this comment

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

Wording:

Same as above. Maybe omit the "ej.":

This could be an array of two values corresponding to the x and y values, in that order: `:ease=[x,y]`.

<TresAmbientLight :intensity="1" />
</TresCanvas>
<TresCanvas v-bind="gl">
<!-- <TresCanvas v-bind="gl">
Copy link
Contributor

Choose a reason for hiding this comment

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

We sometimes have issues in Tres caused by comments.

Since handling comments isn't what this playground is showing, can we remove this comment?

src/core/abstractions/MouseParallax.vue Show resolved Hide resolved
src/core/abstractions/MouseParallax.vue Show resolved Hide resolved
const cursorX = computed(() => (x.value / width.value - 0.5) * factor.value)
const cursorY = computed(() => -(y.value / height.value - 0.5) * factor.value)
const _factor = Array.isArray(factor.value) ? factor.value : [factor.value, factor.value]
const _ease = Array.isArray(ease.value) ? ease.value : [ease.value, ease.value]
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the props factor and ease aren't reactive.

_factor and _ease will need a watch or some other way to detect prop changes. Or you could add a ternary here:

const cursorX = computed(() => (x.value / width.value - 0.5) * _factor[0])

Here's a demo showing that. This should alternate between zooming around with a value of [10, 10] and stopping with 0.

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

const factorOrFactors = shallowRef<number | [number, number]>([10, 10])
setInterval(() => {
  factorOrFactors.value = factorOrFactors.value === 0 ? [10, 10] : 0
},
  1000
)
</script>

<template>
  <TresCanvas>
    <TresPerspectiveCamera :position="[0, 0, 7.5]" />
    <TorusKnot>
      <TresMeshNormalMaterial />
    </TorusKnot>
    <MouseParallax :factor="factorOrFactors" :ease="3" />
  </TresCanvas>
</template>

Copy link
Member Author

@JaimeTorrealba JaimeTorrealba Jul 11, 2024

Choose a reason for hiding this comment

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

Good one, yes I've destroyed the reactivity with my last update, thanks for this one

Copy link
Contributor

@andretchen0 andretchen0 left a comment

Choose a reason for hiding this comment

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

Looks good!

I caught one thing that wasn't changed in this PR, but since we're looking at component, we might as well change it.

I won't block the PR though.

@@ -64,13 +64,24 @@ const { width, height } = local.value
: useWindowSize()

const cameraGroupRef = ref<Group>()
Copy link
Contributor

Choose a reason for hiding this comment

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

(Non-blocking)

Sorry, I missed this earlier. This should probably be a shallowRef.

shallowRef() is typically used for performance optimizations of large data structures, or integration with external state management systems.

https://vuejs.org/api/reactivity-advanced.html#shallowref

Since all Tres elements have a link to context – which includes Scene and all its descendants – it probably qualifies as a "large data structure."

@JaimeTorrealba JaimeTorrealba merged commit 12d5834 into v4 Jul 17, 2024
2 checks passed
alvarosabu added a commit that referenced this pull request Aug 20, 2024
* feat(AnimatedSprite): add AnimatedSprite, playground, docs

* chore(AnimatedSprite): fix linter errors

* chore(AnimatedSprite): update docs

* feat(AnimatedSprite): allow [numCols, numRows] as atlas prop

* docs(AnimatedSprite): reorder sections, improve clarity

* docs(AnimatedSprite): format type names

* docs(AnimatedSprite): update no-atlas example to use [cols, rows]

* chore(AnimatedSprite): run linter, remove console.log

* refactor(AnimatedSprite): create new animation frames if props.reversed is toggled

* docs(AtlasAnimationDefinitionParser): change 'delay' to 'duration'

* refactor(AtlasAnimationDefinitionParser): make parse function private to module

* refactor(AtlasAnimationDefinitionParser): use destructuring

* refactor(AtlasAnimationDefinitionParser): use destructuring

* refactor(AtlasAnimationDefinitionParser): rename returned value 'result'

* chore: run linter

* refactor(AtlasAnimationDefinitionParser): rename private error logging functions

* refactor(Atlas): rename private functions

* fix(Atlas): add missing argument to function call

* refactor(AnimatedSprite): merge FrameData types as single type

* refactor(AnimatedSprite): change callbacks to emits

* chore(AnimatedSprite): run linter

* chore(AnimatedSprite): format Atlas error message

* fix(AnimatedSprite): return nullFrame animation if requested animation not found

* refactor(AnimatedSprite): simplify component onLoop

* chore(AnimatedSprite): run lint --fix

* refactor(AnimatedSprite): add Atlasish type

* refactor(AnimatedSprite): remove onLoad prop

* feat(app)!: 227 Change the keyboardcontrols implementation

* docs(AnimatedSprite): update docs and demos

* docs(AnimatedSprite): update playground demo

* refactor(AnimatedSprite): remove TresSprite

* refactor(AnimatedSprite): rename prop, anchor -> center

* refactor(AnimatedSprite): remove asSprite prop, improve clarity

* docs(AnimatedSprite): update docs

* refactor(AnimatedSprite): update playground

* refactor(AnimatedSprite): rename 'page' -> 'atlas'

* refactor(AnimatedSprite): make definitions reactive

* feat(AnimatedSprite): change default fps

* docs(AnimatedSprite): mark props as 'not reactive'

* feat(AnimatedSprite): always emit last frame name on loop and on end

* docs(AnimatedSprite): correct and update docs/demos

* chore(AnimatedSprite): run linter

* docs(AnimatedSprite): improve wording

* feat: add arrow keys support

* refactor(AnimatedSprite): improve variable name

* refactor(AnimatedSprite): use degrees instead of radians in example

* chore(AnimatedSprite): fix linter errors

* refactor(app)!: 349 Remove directives from cientos

* docs(app): 227 Add documentation for new KeyboardControls

* feat(app): 227 Final details, ready to go

* refactor: move in the right position a piece of code

* chore: update core to `v4`

* chore: release v4.0.0-next.0

* fix(MeshReflectionMaterial)!: add features/docs, reorganize

* feat(AnimatedSprite): add asSprite prop

* feat(AnimatedSprite): dispose texture onUnmounted

* feat(AnimatedSprite): remove explicit click event

* feat(AnimatedSprite): remove unnecessary Suspense

* docs(AnimatedSprite): add asSprite control to demo

* docs(AnimatedSprite): update demo code line highlights

* docs(AnimatedSprite): update atlas path, image names

* refactor: defineExpose

* refactor: change value.value -> value.instance in defineExpose

* fix: uncomment section

* refactor(app): 160 Add Global audio, stats, statsGl

* refactor: remove extra semi-colon, lint issue

* chore: Fix Lint (console.logs should be disabled in playground)

* chore: update lint

* chore: fix lints

* chore: fix demos

* chore: fix lint

* feat(app): 421 Adapt components to use useLoop instead of useRenderLoop

* Revert "feat(app): 421 Adapt components to use useLoop instead of useRenderLoop"

This reverts commit 24e9812.

* feat(app): 421 Update components to use useLoop instead of useRenderLoop

* chore: update statsGl y stats

* fix lint

* chore: update useEnviroment

* chore: update fbo

* chore: lint

* feat: re-remove tweakpane (#425)

* feat(app)!: 313 re-uninstall tweakpane

* chore: fix lint

* docs: update enviroment and useEnviroment docs

* fix: remove hardcoded speed number, that setting at 0 doesn't stop the effect

* update lock

* chore: add Cylinder to v4 (#439)

* chore: add Cylinder to v4

* chore: fix playground link

* fix(Lensflare demo): add camera #435 (#441)

* feat: update to core v4.2

* chore(ci): update node version to 20 for linting

* chore: fix lints

* feat: 423 enable on demand render mode usage (#436)

* chore(deps): update deps to latest

* chore: on demand invalidation composable with prop change detection

* feat: on-demand orbit-controls

* feat: on-demand camera controls

* feat: invalidate also on autoRotate

* feat: on-demand map controls and refactor

* feat: on-demand transform controls

* feat: on-demand keyboard controls

* feat: on-demand keybaord controls

* chore: added demo suffix to control pages to avoid confusions

* feat: on-demand pointer lock controls

* feat: on-demand scroll controls

* feat: on-demand levioso

* feat: correct orbit controls auto rotate invalidation

* feat: on-demand text3d

* feat: on-demand mouse-parallax

* feat: on-demand fbo and size watcher refactor

* chore(playground): refactor to use useLoop and sub components

* chore: remove unused import for lint fix

* chore(playground): refactor lensflare demo to use useLoop

* feat: on-demand sampler

* feat: on-demand invaldiation on reflector prop change

* chore: added render activity graph and try to make on-demand work on AnimatedSprite

* chore: renamed positional audio demo

* chore: on-demand smoke

* feat: on-demand precipitation

* feat: on-dermand stars

* feat: on-demand Environment

* feat: on-demand sky

* feat: on-demand Ocean component

* chore: testing on-demand on fit

* feat: on-demand Wobble Material

* feat: on-demand invalidation holographic material

* feat: on-demand reflection material

* feat: on-demand custom shader material

* chore: rename bakeshadows demo

* chore: misc route

* chore: ci, update action setup

* docs: add migration guide from v3 in cientos (to do grammar check, ad… (#428)

* docs: add migration guide from v3 in cientos (to do grammar check, add img)

* docs: grammar corrections

* fix lint

* docs: rename migration-guide.md -> migrating-from-v3.md

* docs: update wording/formatting

---------

Co-authored-by: Peter <petermoldovia@yahoo.ca>

* fix(types): fixed types generics for `useGLTF` (#448)

* feat(app): Add the option for x and y in mouseparallax component (#444)

* feat(app): Add the option for x and y in mouseparallax component

* fix reactivity, grammar corrections

* change ref for shallowRef

* chore: release v4.0.0-next.1

* docs(SVG): set playground render-mode to on-demand

* refactor(HolographicMaterial): remove useOnDemandInvalidation, use invalidate

* refactor(CustomShaderMaterial): remove useOnDemandInvalidated, use invalidate

* refactor(MeshReflectionmaterial): remove useOnDemandInvalidated, use invalidate

* refactor: call invalidate on props update

* docs: add on-demand shapes playground demo

* fix: reimplement ContactShadows for v4 (#449)

* chore(deps): update deps to latest

* chore: on demand invalidation composable with prop change detection

* feat: on-demand orbit-controls

* feat: on-demand camera controls

* feat: invalidate also on autoRotate

* feat: on-demand map controls and refactor

* feat: on-demand transform controls

* feat: on-demand keyboard controls

* feat: on-demand keybaord controls

* chore: added demo suffix to control pages to avoid confusions

* feat: on-demand pointer lock controls

* feat: on-demand scroll controls

* feat: on-demand levioso

* feat: correct orbit controls auto rotate invalidation

* feat: on-demand text3d

* feat: on-demand mouse-parallax

* feat: on-demand fbo and size watcher refactor

* chore(playground): refactor to use useLoop and sub components

* chore: remove unused import for lint fix

* chore(playground): refactor lensflare demo to use useLoop

* feat: on-demand sampler

* feat: on-demand invaldiation on reflector prop change

* chore: added render activity graph and try to make on-demand work on AnimatedSprite

* chore: renamed positional audio demo

* chore: on-demand smoke

* feat: on-demand precipitation

* feat: on-dermand stars

* feat: on-demand Environment

* feat: on-demand sky

* feat: on-demand Ocean component

* chore: testing on-demand on fit

* feat: on-demand Wobble Material

* feat: on-demand invalidation holographic material

* feat: on-demand reflection material

* feat: on-demand custom shader material

* chore: rename bakeshadows demo

* chore: misc route

* chore: ci, update action setup

* chore: update Tres core

* fix: reimplement ContactShadows for v4 core

* docs: change link name

* fix(ContactShadows): add invalidate to updates

---------

Co-authored-by: alvarosabu <alvaro.saburido@gmail.com>

* feat(Sparkles): invalidate on update (#446)

* feat(Sparkles): invalidate on update

* chore: fix linter error

* refactor(Sparkles): remove renderMode predicate before invalidate

* chore: remove on demand composable (#452)

* chore: remove `useOnDemandInvalidation` on Levioso

* chore: remove composable `useOnDemandInvalidation`

* chore: remove composable from Ocean

* chore: remove composable on Precipitation

* chore: remove composable from sky

* chore: remove from Fit

* chore: remove from smoke

* chore: remove from orbit-controls

* chore: remove composable from Text3D

* chore: remove from mouse parallax

* chore: remove composable from Reflector

* chore: only needed fbo invalidation

* chore: remove composable from useSurfaceSampler

* chore: remove composable from all controls

* chore: add invalidation on loop

* chore: remove prop speed check on loop for Levioso

* chore: remove invalidateOnDemand on MapControls

* chore: remove `invalidateOnDemand` from Keyboard controls

* chore: add invalidate on fit method, remove watch props

* chore: invalidation refactor leftovers

* chore(types): fixes some type issues

* fix: update to core v4.2.2 to remove warning on invalidation

* chore: fix lint

* chore: release v4.0.0-rc.0

* feat(fbo): add autoRender flag as an option to useFBO (#458)

This PR adds an `autoRender` flag to `FBOOptions`.

This flag allows consumers of `useFBO` who want to take control of when
and where to render the render target instead of always rendering it
with the default scene and camera.

Co-authored-by: Alvaro Saburido <alvaro.saburido@gmail.com>

* chore: fix lint

* chore: release v4.0.0-rc.1

* docs: added recipe for tweakpane to migration guides

* chore(playground): added same scale as default

* chore: release v4.0.0-rc.2

* chore: linter fix

* chore: update deps to fix docs build

* fix: typescript issues (#459)

* fix: type assertion for props as params of `normalizeVectorFlexibleParam`

* fix: type assertion on camera and pointerlock controls

* refactor(BlurPass): fix TS errors

* refactor(SVG): fix TS errors

* refactor(Lensflare): fix TS errors

* refactor(Reflector): silence and explain TS error

* refactor(HolographicMaterial): add declaration for clock

* refactor(MeshWobbleMaterial): fix TS error

* fix(useProgress): remove extraneous, unused argument

* chore(types): fixed gradient type issue from core

* fix(types): controls types

* chore(types): fix loaders types

* chore(types): HTML

* chore(types): improve occlude type on HTML

* refactor(environment)!: properly type and return texture ref

BREAKING CHANGE: `useEnvironment` now returns a ref with the texture instead of an object { texture }

* chore(types): HTML, backdrop and Sparkles type issues

* chore(types): correct occlusion types without the refs

* fix(transform-controls): fps drops due prop watcher for invalidation

* chore: type issues on transform controls

---------

Co-authored-by: Peter <petermoldovia@yahoo.ca>

* fix: AnimatedSprite (#464)

* fix: remove explicit fallthrough attr attachment

* fix: remove infinite loop

* docs: move click from canvas to object

* docs: convert props table to HTML

* docs: rephrase

* chore: deps update

* chore: update deps

* ci: update lint action

* chore: fix lint

* chore: fix lint

* chore: lint issues

* chore: lint remove whitespaces

* chore: lint

---------

Co-authored-by: Peter <petermoldovia@yahoo.ca>
Co-authored-by: alvarosabu <alvaro.saburido@gmail.com>
Co-authored-by: Chau Tran <nartc7789@gmail.com>
alvarosabu added a commit that referenced this pull request Aug 29, 2024
…463)

* feat(AnimatedSprite): add AnimatedSprite, playground, docs

* chore(AnimatedSprite): fix linter errors

* chore(AnimatedSprite): update docs

* feat(AnimatedSprite): allow [numCols, numRows] as atlas prop

* docs(AnimatedSprite): reorder sections, improve clarity

* docs(AnimatedSprite): format type names

* docs(AnimatedSprite): update no-atlas example to use [cols, rows]

* chore(AnimatedSprite): run linter, remove console.log

* refactor(AnimatedSprite): create new animation frames if props.reversed is toggled

* docs(AtlasAnimationDefinitionParser): change 'delay' to 'duration'

* refactor(AtlasAnimationDefinitionParser): make parse function private to module

* refactor(AtlasAnimationDefinitionParser): use destructuring

* refactor(AtlasAnimationDefinitionParser): use destructuring

* refactor(AtlasAnimationDefinitionParser): rename returned value 'result'

* chore: run linter

* refactor(AtlasAnimationDefinitionParser): rename private error logging functions

* refactor(Atlas): rename private functions

* fix(Atlas): add missing argument to function call

* refactor(AnimatedSprite): merge FrameData types as single type

* refactor(AnimatedSprite): change callbacks to emits

* chore(AnimatedSprite): run linter

* chore(AnimatedSprite): format Atlas error message

* fix(AnimatedSprite): return nullFrame animation if requested animation not found

* refactor(AnimatedSprite): simplify component onLoop

* chore(AnimatedSprite): run lint --fix

* refactor(AnimatedSprite): add Atlasish type

* refactor(AnimatedSprite): remove onLoad prop

* feat(app)!: 227 Change the keyboardcontrols implementation

* docs(AnimatedSprite): update docs and demos

* docs(AnimatedSprite): update playground demo

* refactor(AnimatedSprite): remove TresSprite

* refactor(AnimatedSprite): rename prop, anchor -> center

* refactor(AnimatedSprite): remove asSprite prop, improve clarity

* docs(AnimatedSprite): update docs

* refactor(AnimatedSprite): update playground

* refactor(AnimatedSprite): rename 'page' -> 'atlas'

* refactor(AnimatedSprite): make definitions reactive

* feat(AnimatedSprite): change default fps

* docs(AnimatedSprite): mark props as 'not reactive'

* feat(AnimatedSprite): always emit last frame name on loop and on end

* docs(AnimatedSprite): correct and update docs/demos

* chore(AnimatedSprite): run linter

* docs(AnimatedSprite): improve wording

* feat: add arrow keys support

* refactor(AnimatedSprite): improve variable name

* refactor(AnimatedSprite): use degrees instead of radians in example

* chore(AnimatedSprite): fix linter errors

* refactor(app)!: 349 Remove directives from cientos

* docs(app): 227 Add documentation for new KeyboardControls

* feat(app): 227 Final details, ready to go

* refactor: move in the right position a piece of code

* chore: update core to `v4`

* chore: release v4.0.0-next.0

* fix(MeshReflectionMaterial)!: add features/docs, reorganize

* feat(AnimatedSprite): add asSprite prop

* feat(AnimatedSprite): dispose texture onUnmounted

* feat(AnimatedSprite): remove explicit click event

* feat(AnimatedSprite): remove unnecessary Suspense

* docs(AnimatedSprite): add asSprite control to demo

* docs(AnimatedSprite): update demo code line highlights

* docs(AnimatedSprite): update atlas path, image names

* refactor: defineExpose

* refactor: change value.value -> value.instance in defineExpose

* fix: uncomment section

* refactor(app): 160 Add Global audio, stats, statsGl

* refactor: remove extra semi-colon, lint issue

* chore: Fix Lint (console.logs should be disabled in playground)

* chore: update lint

* chore: fix lints

* chore: fix demos

* chore: fix lint

* feat(app): 421 Adapt components to use useLoop instead of useRenderLoop

* Revert "feat(app): 421 Adapt components to use useLoop instead of useRenderLoop"

This reverts commit 24e9812.

* feat(app): 421 Update components to use useLoop instead of useRenderLoop

* chore: update statsGl y stats

* fix lint

* chore: update useEnviroment

* chore: update fbo

* chore: lint

* feat: re-remove tweakpane (#425)

* feat(app)!: 313 re-uninstall tweakpane

* chore: fix lint

* docs: update enviroment and useEnviroment docs

* fix: remove hardcoded speed number, that setting at 0 doesn't stop the effect

* update lock

* chore: add Cylinder to v4 (#439)

* chore: add Cylinder to v4

* chore: fix playground link

* fix(Lensflare demo): add camera #435 (#441)

* feat: update to core v4.2

* chore(ci): update node version to 20 for linting

* chore: fix lints

* feat: 423 enable on demand render mode usage (#436)

* chore(deps): update deps to latest

* chore: on demand invalidation composable with prop change detection

* feat: on-demand orbit-controls

* feat: on-demand camera controls

* feat: invalidate also on autoRotate

* feat: on-demand map controls and refactor

* feat: on-demand transform controls

* feat: on-demand keyboard controls

* feat: on-demand keybaord controls

* chore: added demo suffix to control pages to avoid confusions

* feat: on-demand pointer lock controls

* feat: on-demand scroll controls

* feat: on-demand levioso

* feat: correct orbit controls auto rotate invalidation

* feat: on-demand text3d

* feat: on-demand mouse-parallax

* feat: on-demand fbo and size watcher refactor

* chore(playground): refactor to use useLoop and sub components

* chore: remove unused import for lint fix

* chore(playground): refactor lensflare demo to use useLoop

* feat: on-demand sampler

* feat: on-demand invaldiation on reflector prop change

* chore: added render activity graph and try to make on-demand work on AnimatedSprite

* chore: renamed positional audio demo

* chore: on-demand smoke

* feat: on-demand precipitation

* feat: on-dermand stars

* feat: on-demand Environment

* feat: on-demand sky

* feat: on-demand Ocean component

* chore: testing on-demand on fit

* feat: on-demand Wobble Material

* feat: on-demand invalidation holographic material

* feat: on-demand reflection material

* feat: on-demand custom shader material

* chore: rename bakeshadows demo

* chore: misc route

* chore: ci, update action setup

* docs: add migration guide from v3 in cientos (to do grammar check, ad… (#428)

* docs: add migration guide from v3 in cientos (to do grammar check, add img)

* docs: grammar corrections

* fix lint

* docs: rename migration-guide.md -> migrating-from-v3.md

* docs: update wording/formatting

---------

Co-authored-by: Peter <petermoldovia@yahoo.ca>

* fix(types): fixed types generics for `useGLTF` (#448)

* feat(app): Add the option for x and y in mouseparallax component (#444)

* feat(app): Add the option for x and y in mouseparallax component

* fix reactivity, grammar corrections

* change ref for shallowRef

* chore: release v4.0.0-next.1

* docs(SVG): set playground render-mode to on-demand

* refactor(HolographicMaterial): remove useOnDemandInvalidation, use invalidate

* refactor(CustomShaderMaterial): remove useOnDemandInvalidated, use invalidate

* refactor(MeshReflectionmaterial): remove useOnDemandInvalidated, use invalidate

* refactor: call invalidate on props update

* docs: add on-demand shapes playground demo

* fix: reimplement ContactShadows for v4 (#449)

* chore(deps): update deps to latest

* chore: on demand invalidation composable with prop change detection

* feat: on-demand orbit-controls

* feat: on-demand camera controls

* feat: invalidate also on autoRotate

* feat: on-demand map controls and refactor

* feat: on-demand transform controls

* feat: on-demand keyboard controls

* feat: on-demand keybaord controls

* chore: added demo suffix to control pages to avoid confusions

* feat: on-demand pointer lock controls

* feat: on-demand scroll controls

* feat: on-demand levioso

* feat: correct orbit controls auto rotate invalidation

* feat: on-demand text3d

* feat: on-demand mouse-parallax

* feat: on-demand fbo and size watcher refactor

* chore(playground): refactor to use useLoop and sub components

* chore: remove unused import for lint fix

* chore(playground): refactor lensflare demo to use useLoop

* feat: on-demand sampler

* feat: on-demand invaldiation on reflector prop change

* chore: added render activity graph and try to make on-demand work on AnimatedSprite

* chore: renamed positional audio demo

* chore: on-demand smoke

* feat: on-demand precipitation

* feat: on-dermand stars

* feat: on-demand Environment

* feat: on-demand sky

* feat: on-demand Ocean component

* chore: testing on-demand on fit

* feat: on-demand Wobble Material

* feat: on-demand invalidation holographic material

* feat: on-demand reflection material

* feat: on-demand custom shader material

* chore: rename bakeshadows demo

* chore: misc route

* chore: ci, update action setup

* chore: update Tres core

* fix: reimplement ContactShadows for v4 core

* docs: change link name

* fix(ContactShadows): add invalidate to updates

---------

Co-authored-by: alvarosabu <alvaro.saburido@gmail.com>

* feat(Sparkles): invalidate on update (#446)

* feat(Sparkles): invalidate on update

* chore: fix linter error

* refactor(Sparkles): remove renderMode predicate before invalidate

* chore: remove on demand composable (#452)

* chore: remove `useOnDemandInvalidation` on Levioso

* chore: remove composable `useOnDemandInvalidation`

* chore: remove composable from Ocean

* chore: remove composable on Precipitation

* chore: remove composable from sky

* chore: remove from Fit

* chore: remove from smoke

* chore: remove from orbit-controls

* chore: remove composable from Text3D

* chore: remove from mouse parallax

* chore: remove composable from Reflector

* chore: only needed fbo invalidation

* chore: remove composable from useSurfaceSampler

* chore: remove composable from all controls

* chore: add invalidation on loop

* chore: remove prop speed check on loop for Levioso

* chore: remove invalidateOnDemand on MapControls

* chore: remove `invalidateOnDemand` from Keyboard controls

* chore: add invalidate on fit method, remove watch props

* chore: invalidation refactor leftovers

* chore(types): fixes some type issues

* fix: update to core v4.2.2 to remove warning on invalidation

* chore: fix lint

* chore: release v4.0.0-rc.0

* feat(fbo): add autoRender flag as an option to useFBO (#458)

This PR adds an `autoRender` flag to `FBOOptions`.

This flag allows consumers of `useFBO` who want to take control of when
and where to render the render target instead of always rendering it
with the default scene and camera.

Co-authored-by: Alvaro Saburido <alvaro.saburido@gmail.com>

* chore: fix lint

* chore: release v4.0.0-rc.1

* docs: added recipe for tweakpane to migration guides

* chore(playground): added same scale as default

* chore: release v4.0.0-rc.2

* chore: linter fix

* chore: update deps to fix docs build

* docs(app): Improve docs examples with code group to avoid confusion

* fix: change name to the async components

---------

Co-authored-by: Peter <petermoldovia@yahoo.ca>
Co-authored-by: alvarosabu <alvaro.saburido@gmail.com>
Co-authored-by: Chau Tran <nartc7789@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants