geometry nodes camera culling (3.0+)
camera culling for geometry nodes fields. it works extremely well. the camera culling node outputs a boolean mask around the border of the camera that allow you to generate or delete geometry only in the cameras view, making it lighter and faster to edit the node tree, navigate in the viewport and render.
instructions:
download the ".blend" file.
append the node groups "Perspective camera culling HN V3_0 {append this}" and "Orthographic camera culling HN V3_0 {append this}"
insert the camera parameters to the node and choose the active camera in the "camera" option.
-
plug the node group to any boolean input that you want the camera culling to be effected by.
Parameters:
Perspective camera:
"X resolution" set to the X resolution of your camera. (can be found the the "Render Properties section")
"Y resolution" set to the Y resolution of your camera. (can be found the the "Render Properties section")
"Focal Length" set to the Focal Length of your camera. (can be found the the "Object Data Properties" when the active camera is selected under the "Lens" section)
"Sensor Size" set to the Sensor Size of your camera. (the default size is 36 but if you changed it you can find it in the "Object Data Properties" when the active camera is selected under the "Camera" section)
"X Shift" set to the X Shift of your camera. (the default value is 0 but if you changed it you it you can find it in the "Object Data Properties" when the active camera is selected under the "Lens" section )
"Y Shift" set to the Y Shift of your camera. (the default value is 0 but if you changed it you it you can find it in the "Object Data Properties" when the active camera is selected under the "Lens" section )
"offset" how much offset you want from the border of your camera(0 means 0 distance).
"Under Cast" enabling will create a projection to the "Under Cast Direction". very helpful for scenes with tall objects or low shots.
"Use Local Direction(Override)" use the local direction of the camera and override the values in the "Under Cast Direction"
"Under Cast Direction" the direction of the under cast(the default is 0,0,1 which is the direction of the ground, in most cases there will be no need to change it).
"Ray Length" if your scene is big and the current ray length is not enough increase this value.
Orthographic camera:
the only difference between the orthographic and perspective node in terms of settings is that in the orthographic instead of focal length and sensor size there is only orthographic scale which can be found in the "Object Data Properties" when the active camera is selected under the "Lens" section
enjoy!
camera culling node, you just need to append it, set the camera settings and plug!