Skip to content

Commit

Permalink
fix: accshadow bg bug
Browse files Browse the repository at this point in the history
  • Loading branch information
drcmda committed Oct 28, 2022
1 parent 860b192 commit fd90f05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/AccumulativeShadows.tsx
Expand Up @@ -342,7 +342,6 @@ class ProgressiveLightMap {
this.renderer = renderer
this.res = res
this.scene = scene
this.scene.background = null
this.buffer1Active = false
this.lights = []
this.meshes = []
Expand Down Expand Up @@ -433,10 +432,13 @@ class ProgressiveLightMap {
const activeMap = this.buffer1Active ? this.progressiveLightMap1 : this.progressiveLightMap2
const inactiveMap = this.buffer1Active ? this.progressiveLightMap2 : this.progressiveLightMap1
// Render the object's surface maps
const oldBg = this.scene.background
this.scene.background = null
this.renderer.setRenderTarget(activeMap)
this.previousShadowMap.value = inactiveMap.texture
this.buffer1Active = !this.buffer1Active
this.renderer.render(this.scene, camera)
this.renderer.setRenderTarget(null)
this.scene.background = oldBg
}
}

1 comment on commit fd90f05

@vercel
Copy link

@vercel vercel bot commented on fd90f05 Oct 28, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.