Skip to content

EfthymisB/Katana-Frustum_Culling

Repository files navigation

Katana - Frustum Culling

by Efthymis B.


This OpScript calculates what is inside the Camera's Frustum and creates Attributes accordingly.

  • Hide geometry that is outside of the Frustum (from the viewport)

  • Set Visibility Attribute (for render)

  • Create Attributes based on distance from the camera.

  • Create instanceSkipIndex attribute for PointClouds.

frustumKatanaVideo.mp4

How to use

1. FrustumCulling.macro

  1. In order to be able to see Camera Resolution changes, the root should be included in the location paths.
  2. Then add Geometry (types: polymesh, subdmesh, sphere) and/or Pointcloud (type: pointcloud) locations.

Example:

path_example

You can combine locations using expressions as usual.

  1. Add the Camera's location path in user.camera.path and change the camera settings according to your needs.

camera_settings

  1. Set the preferable calculation method and Viewport/Render visibility.

Refer to Help Text for more details.

calcMethodSettings

  1. Enabled/Disable viewport color representation for objects inside/outside the Frustum. Enable Depth Colors to preview objects based on distance from the camera.

colorSettings

  1. Enable/Disable attributes.

attrSettings

  1. Add instanceSkipIndex attribute for points outside the Frustum (only for Pointclouds).

Then copy the instanceSkipIndex attribute to your instance array location.

pointcloudSettings

For more information, refer to the Help Text of each option.

2. FrustumCullingCollections.macro

Premade collections.

katanaBin_5Mv0OrFNQn


Installation

Download the .macro files from my GumRoad page or GitHub and place them in any of Katana's startup Macros folder.

  • ~/.katana/Macros

  • custom_path/Startup/Macros*

* Custom Paths should be included in KATANA_RESOURCES Environment Variable.


Special thanks to:

Jonathan W. Rodegher for suggestions and troubleshooting.

Adam Davis for sharing his OpScript "Constraint camera focus distance to a locator" in the Katana Discord Server. Was very helpful for some parts of my script.

Everyone in Katana Discord who helped me.


About

Camera Frustum culling OpScript for Katana

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages