Skip to content

Commit

Permalink
fix: reduce beforeRenderer time
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Dec 17, 2023
1 parent dca5c31 commit b9df580
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/materials/meshReflectionMaterial/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const computedBlur = computed(() => {
const hasBlur = computed(() => computedBlur.value[0] > 0 || computedBlur.value[1] > 0)
const state = shallowReactive({
const state = {
reflectorPlane: new Plane(),
normal: new Vector3(),
reflectorWorldPosition: new Vector3(),
Expand All @@ -184,7 +184,7 @@ const state = shallowReactive({
q: new Vector4(),
virtualCamera: new PerspectiveCamera(),
textureMatrix: new Matrix4(),
})
}
watchEffect(() => {
fbo.value?.texture.dispose()
Expand Down Expand Up @@ -256,10 +256,8 @@ onLoop(() => {
parent.visible = false // Avoid re-rendering the reflected object
const currentXrEnabled = renderer.value.xr.enabled
const currentShadowAutoUpdate = renderer.value.shadowMap.autoUpdate
console.time('beforeRender')
beforeRender(parent)
console.timeEnd('beforeRender')
renderer.value.shadowMap.autoUpdate = false
renderer.value.setRenderTarget(fbo.value)
Expand Down

0 comments on commit b9df580

Please sign in to comment.