Skip to content

Commit 42313e2

Browse files
mvaligurskyMartin Valigursky
andauthored
Fix the order of layers in ReflectionPlanar example to render MiniStats last (#5642)
Co-authored-by: Martin Valigursky <[email protected]>
1 parent 13a2be2 commit 42313e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/src/examples/graphics/reflection-planar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ class ReflectionPlanarExample {
123123
return primitive;
124124
}
125125

126-
// create a layer for objects that do not render into texture
127-
const excludedLayer = new pc.Layer({ name: "Excluded" });
128-
app.scene.layers.push(excludedLayer);
129-
130126
// get existing layers
131127
const worldLayer = app.scene.layers.getLayerByName("World");
132128
const skyboxLayer = app.scene.layers.getLayerByName("Skybox");
133129
const uiLayer = app.scene.layers.getLayerByName("UI");
134130

131+
// create a layer for objects that do not render into texture
132+
const excludedLayer = new pc.Layer({ name: "Excluded" });
133+
app.scene.layers.insert(excludedLayer, app.scene.layers.getTransparentIndex(worldLayer) + 1);
134+
135135
// Create the shader from the vertex and fragment shaders
136136
const shader = pc.createShaderFromCode(app.graphicsDevice, files['shader.vert'], files['shader.frag'], 'myShader', {
137137
aPosition: pc.SEMANTIC_POSITION,

0 commit comments

Comments
 (0)