Debian Codegraph @

examples/viewport_and_scenes/test_was_visible/README.md

raw symbols SCIP
1 # Test WasVisible method
2
3 This is a demo of `TCastleScene.WasVisible` and `TAbstractShapeNode.WasVisible` methods, that determine whether scene / shape were (potentially, at least partially) visible in the last rendering event. This allows to use the results of frustum culling and occlusion culling (if you activate occlusion culling, see https://castle-engine.io/occlusion_culling ) for any custom need, e.g. to load some content dynamically.
4
5 Note: This is a rare example in 3D in which the order of transforms on `Viewport.Items` matters. Keep the `SceneTestBlocks` *after* the `Plane1`. Only then the shapes in `SceneTestBlocks` can be eliminated by occlusion query when `Plane1` obscures them. Usually, this is resolved within a single scene using `OcclusionSort`, but in this case (when one scene occludes another) for now you have to manually order them right. If you change the order, and render `SceneTestBlocks`, then occlusion query will never eliminate any shapes.
6
7 Using [Castle Game Engine](https://castle-engine.io/).
8
9 ## Building
10
11 Compile by:
12
13 - [CGE editor](https://castle-engine.io/editor). Just use menu items _"Compile"_ or _"Compile And Run"_.
14
15 - Or use [CGE command-line build tool](https://castle-engine.io/build_tool). Run `castle-engine compile` in this directory.
16
17 - Or use [Lazarus](https://www.lazarus-ide.org/). Open in Lazarus `test_was_visible_standalone.lpi` file and compile / run from Lazarus. Make sure to first register [CGE Lazarus packages](https://castle-engine.io/lazarus).
18
19 - Or use [Delphi](https://www.embarcadero.com/products/Delphi). Open in Delphi `test_was_visible_standalone.dproj` file and compile / run from Delphi. See [CGE and Delphi](https://castle-engine.io/delphi) documentation for details.