Hello!
It would be super beneficial for me to know when a part is being occluded in my game.
Does the new occlusion culling API have a way to check if an object is occluded or not?
I was unable to find any docs regarding it.
Any input is appreciated.
go into studio, enable wireframe view
noβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
what do you mean by βnoβ? thatβs how you check if a part is occluded
You didnβt understand my question.
Iβm talking about a property like:
Occluded =true/false or something like that.
Thereβs no way and no need to use that. Only thing this needed for is for optimization.
try line of sight with the part, and if no line of sight, itβs probably occluded and you can do whatever function
You could just use WorldToViewportPoint to check if that part is on screen, and use GetPartsObscuringTarget to see if there is anything obscuring the part.
Occlusion Culling works pretty similar to that I think
Exactly, I have some custom effects that I only want to be calculated when on screen.
I guess but for my use case I would need to run this on like 200 different instances each frame. Itβs too expensive.
it wonβt show custom effects if you canβt see them
Iβm doing calculations on those effects. Thatβs why I would like a value that says true or false whether the part is occluded or not. That would allow me to stop unecessary calculations.
I ran into a case where i also need to be able to check if a part is occluded via code, iβve made systems in the past to do this but its quite expensive. Itβs kinda funny to me they didnβt just add a boolean to check this.
for my solution, youβd just be stuck with running raycast operations or what Encaptor said by using WorldToViewportPoint and GetPartsObscuringTarget. I do recommend running these things in parallel to minimize impact on performance (if you can).