Skip to content

Commit

Permalink
Clear first RC pass
Browse files Browse the repository at this point in the history
  • Loading branch information
hmans committed Sep 16, 2022
1 parent 8d7108f commit 679d934
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nine-cycles-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"render-composer": patch
---

The first render pass did not have its clear flag set. This has been fixed.
3 changes: 2 additions & 1 deletion apps/render-composer-examples/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Animate } from "@hmans/r3f-animate"
import { Environment, Loader, OrbitControls } from "@react-three/drei"
import { Suspense, useState } from "react"
import * as RC from "render-composer"
import { bitmask } from "render-composer"
import { Mesh, Object3D } from "three"

const rotate = (o: Object3D, dt: number) => {
Expand Down Expand Up @@ -67,7 +68,7 @@ function App() {
}}
>
<Animate fun={rotate}>
<mesh layers-mask={1 << 16}>
<mesh layers-mask={bitmask(RC.Layers.TransparentFX)}>
<icosahedronGeometry />
<meshStandardMaterial
color="#f1faee"
Expand Down
1 change: 1 addition & 0 deletions packages/render-composer/src/RenderPipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const RenderPipeline = ({ children }: RenderPipelineProps) => {
<RC.LayerRenderPass
camera={camera}
scene={scene}
clear
layerMask={camera.layers.mask & bitmask.not(Layers.TransparentFX)}
/>

Expand Down

0 comments on commit 679d934

Please sign in to comment.