Skip to content

Commit 6116b62

Browse files
committed
Updates chapter25/chapter25.md
Auto commit by GitBook Editor
1 parent 76c8c27 commit 6116b62

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

chapter25/chapter25.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,11 @@ public void filter(Map<? extends Mesh, List<GameItem>> mapMesh) {
140140

141141
And that’s it. We can use that class inside the rendering process. We just need to update the frustum planes, calculate which GameItems are visible and filter them out when drawing instanced and non instanced meshes.
142142

143-
| frustumFilter.updateFrustum\(window.getProjectionMatrix\(\), camera.getViewMatrix\(\)\); frustumFilter.filter\(scene.getGameMeshes\(\)\); frustumFilter.filter\(scene.getGameInstancedMeshes\(\)\); |
144-
| :--- |
145-
143+
```
144+
frustumFilter.updateFrustum(window.getProjectionMatrix(), camera.getViewMatrix());
145+
frustumFilter.filter(scene.getGameMeshes());
146+
frustumFilter.filter(scene.getGameInstancedMeshes());
147+
```
146148

147149
You can play with activating and deactivating the filtering and can check the increase and decrease in the FPS that you can achieve. Particles are not considered in the filtering, but its trivial to add it. In any case, for particles, it may be better to just check the position of the emitter instead of checking every particle.
148150

0 commit comments

Comments
 (0)