Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions demos/aquarium/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import turtleModel from './model_52a_-_kemps_ridley_sea_turtle_no_id-transformed

export default function App({ spheres }) {
return (
<Canvas shadows camera={{ position: [30, 0, -3], fov: 35, near: 1, far: 50 }}>
<Canvas shadows camera={{ position: [30, 0, -3], fov: 35, near: 1, far: 50 }} gl={{ stencil:true }}>
Copy link
Member

Choose a reason for hiding this comment

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

is this gl={{ stencil:true }} really necessary in this case? I tried without, seems to have no effect :/

Copy link
Member

Choose a reason for hiding this comment

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

what's default value?

Copy link
Contributor Author

@rndexe rndexe Jul 31, 2024

Choose a reason for hiding this comment

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

Without it the turtle and the spheres were not clipping to the inside of the aquarium. I was using the fix for the issue mentioned in the description.

The default value is false from r163 onwards.
mrdoob/three.js#27900

Copy link
Contributor Author

@rndexe rndexe Jul 31, 2024

Choose a reason for hiding this comment

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

without gl={{ stencil:true }}

Screenshot from 2024-07-31 12-28-02

with gl={{ stencil:true }}

Screenshot from 2024-07-31 12-26-49

<color attach="background" args={['#c6e5db']} />
{/** Glass aquarium */}
<Aquarium position={[0, 0.25, 0]}>
Expand All @@ -24,8 +24,8 @@ export default function App({ spheres }) {
</Instances>
</Aquarium>
{/** Soft shadows */}
<AccumulativeShadows temporal frames={100} color="lightblue" colorBlend={2} opacity={0.7} scale={60} position={[0, -5, 0]}>
<RandomizedLight amount={8} radius={15} ambient={0.5} intensity={1} position={[-5, 10, -5]} size={20} />
<AccumulativeShadows temporal frames={100} color="lightblue" colorBlend={2} opacity={0.7} alphaTest={0.65} scale={60} position={[0, -5, 0]}>
<RandomizedLight amount={8} radius={15} ambient={0.5} intensity={Math.PI} position={[-5, 10, -5]} size={20} />
</AccumulativeShadows>
{/** Custom environment map */}
<Environment resolution={1024}>
Expand Down