Skip to content

Commit

Permalink
feat: on-demand invalidation holographic material
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Jun 21, 2024
1 parent 14b3bc3 commit 4b2ce7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/materials/holographicMaterial/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useLoop, useTresContext } from '@tresjs/core'
import type { TresColor } from '@tresjs/core'
import { FrontSide } from 'three'
import type { Side } from 'three'
import { useOnDemandInvalidation } from '../../../composables/useOnDemandInvalidation'
import HolographicMaterial from './HolographicMaterialParameters'
Expand Down Expand Up @@ -36,6 +37,8 @@ const props = withDefaults(
},
)
const { invalidateOnDemand } = useOnDemandInvalidation(props)
const MeshHolographicMaterialClass = shallowRef()
const { extend } = useTresContext()
Expand All @@ -48,6 +51,7 @@ const { onBeforeRender } = useLoop()
onBeforeRender(() => {
MeshHolographicMaterialClass.value?.update()
invalidateOnDemand()
})
</script>

Expand Down

0 comments on commit 4b2ce7c

Please sign in to comment.