- Home /
How Do I Not Render Objects That My Player Doesn't See
Currently, In order to improve the frames in my game, I'd like to create this system that doesn't render objects that my player doesn't see, I know that Unity already has a system that is already built-in that does that, but for example, Imagine that my player is facing a certain wall and doesn't see anything but the wall, behind the wall, there are 3 props as decoration, Unity does render those objects (based on my knowledge at least), so how do I create a system that doesn't render them? Thanks to anyone that helps
the term you are searching for is "culling".
Problem here is: calculating culling can be expensive. Even that much that just drawing everything can be cheaper than the culling calculation itself.
So perhaps you should add a bit more on why you want to do this and what the specific setup is. $$anonymous$$ostly this performance improvement is done later on when everything else is already polished. Do you already use proper gpu-instancing? is the gpu even the bottleneck? did you check the profiler properly for that? -> mostly games are more likely to be cpu-capped.
I'm pretty new to Unity and I've been messing around with a bunch of different scripts for shooting/movement and etc, I've thought of this Culling idea as something I'd like to implement later on when I settle on a game that I want to create, so I just wanted to see if it is worth it, meaning will it increase my game's performance or not? I really didn't understand your part about the GPU instancing and all that, where can you switch or view that option? Thanks for the help @Captain_Pineapple
i'd suggest you read throught the following manual pages:
As i said mostly the performance bottleneck is on the CPU side so check that before you do any fancy custom object culling.
Answer by Yword · Aug 13, 2020 at 04:35 PM
Hi MZK1194, maybe you can check this out, Occlusion Culling.
Yeah ill make sure to check it out, thanks for the help everyone
Your answer
Follow this Question
Related Questions
Render a camera multiple times in a single frame? 1 Answer
Checking if GameObject is rendered by specific camera 1 Answer
Camera.render weird issue? 0 Answers
Overlapping particle systems 0 Answers
Rendering to screen with two different resoulution. 0 Answers