Skip to content

Commit

Permalink
Fix to just submitted AO example to disabled baked in occlusion maps (#…
Browse files Browse the repository at this point in the history
…6593)

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
  • Loading branch information
mvaligursky and Martin Valigursky committed May 23, 2024
1 parent 9c07c3e commit be75565
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/src/examples/graphics/ambient-occlusion.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,16 @@ assetListLoader.load(() => {
laboratoryEntity.setLocalScale(100, 100, 100);
app.root.addChild(laboratoryEntity);

// set up materials to disable incorrectly set up blending / depth writes
// set up materials
laboratoryEntity.findComponents('render').forEach((render) => {
render.meshInstances.forEach((meshInstance) => {

// disable blending / enable depth writes
meshInstance.material.depthState = pc.DepthState.DEFAULT;
meshInstance.material.blendType = pc.BLEND_NONE;

// disable baked AO map as we want to use SSAO only
meshInstance.material.aoMap = null;
meshInstance.material.update();
});
});
Expand Down

0 comments on commit be75565

Please sign in to comment.