Skip to content

Commit

Permalink
Fix stencil mask (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
rndexe authored Aug 2, 2024
1 parent 06683a8 commit b36b4c5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions demos/stencil-mask/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Target(props) {
export function App() {
const { invert, colorWrite, depthWrite } = useControls({ invert: false, colorWrite: true, depthWrite: false })
return (
<Canvas camera={{ position: [0, 0, 5] }}>
<Canvas camera={{ position: [0, 0, 5] }} gl={{ stencil: true}}>
<hemisphereLight intensity={1} groundColor="red" />
<Suspense fallback={null}>
<Float floatIntensity={5} rotationIntensity={2} speed={10}>
Expand All @@ -51,12 +51,8 @@ export function App() {
* meshes, you can deform or transition them any way you like
*/}
<Mask id={1} colorWrite={colorWrite} depthWrite={depthWrite}>
{(spread) => (
<>
<planeGeometry args={[2, 2, 128, 128]} />
<MeshDistortMaterial distort={0.5} radius={1} speed={10} {...spread} />
</>
)}
<MeshDistortMaterial distort={0.5} radius={1} speed={10} />
</Mask>
</TransformControls>

Expand Down

0 comments on commit b36b4c5

Please sign in to comment.