Hey there! I am trying to figure out how to completely disable a scene object (like a tree) when its hidden behind the terrain but its still technically in the 3D cameras view. My tree has a GD script that checks the distance from the player and replaces the mesh with a 2D imposter when far away, as well as a basic wind shader.
How do i completely disable all of it so it displays no mesh and runs no code/shader when its hidden behind a hill or a mountain etc?
In case it is relevant, I am using the addon Terrain3D for my landscape
Godot handles occlusion culling, but for big open scenes like this it’s probably not worth it. If your script is only to replace with an imposter- keep in mind Godot also handles LOD generation and replacement, you could use visibility ranges to show a very specific LOD or group of objects LOD, such as replacing a forest of individual trees with one backdrop mesh. You do not need to script this.
aah thanks so much for the advice! I removed the imposter script and stuck to occlusion culling and LODs. Apoligies for the late reply, life suttenly took me by storm ^^
@gertkeno If you want, I would love to learn some pointers on how to get multiple trees to share one backdrop mesh!
The billboard has at least it’s Visibility Range Begin set to a higher than zero value, moving the camera far enough back only shows the billboard. Setting the margin values and Fade Mode can smoothly transition from the HLODs, but I don’t think a Sprite3D likes this fade in-out much.
Yoo that is so cool! Yeah I wasn’t able to find much on it either, so I really appreciate the tips. You are a damn hero!
I got it implemented and it has already upped the performance