I just baked an occlusion culling thing for the first time. It DOES work BUT, it is culling ALL objects not just static ones, and it doesn’t F***ing work in game. (and when i did do it in game with the scene editor window opened during play, it made the gameplay SLOWER, MUCH SLOWER)
- Don’t behave like a 3 year old using swear words instead of brain, we aren’t on that level and you will not get answers, only flames.
- You surely did it wrong, so a short breakdown on the worldflow:
- Mark the objects that are meant to be occluders as static. Ensure to NOT mark objects with transparent / cutout shaders static cause transparent materials will trash occlusion
- Place occlusion areas for your camera to be in and target areas for the areas where dynamic objects are meant to be occluded
- setup the occlusion according your camera, use a cell size thats appropriate for your object size and close cam range.
- bake
- check that your camera is tagged as Main Camera, cause its the only one relevant for OC at runtime
- run
Ok first, I really don’t care about being politically correct, i just waited 2 hrs for this things to do nothing, and had to rearrange the scene because it moved some objects out of position, so yes im mad. #2 no i did everything you said (i think it was working but it did nearly nothing, only saved me like 2 fps). So i tried it on the second map (has a LOT more stuff in it). Now, im looking directly at some objects at it wont render them… wtg Umbra, the only thing i can think of is that the second map did have some transparent objects that weren’t marked static. Umbra HAS to work for this game to be playable (the second map only gets like 15-25 fps, but mostly its around 15).
SEE!!! i ran it again and unchecked static on all of the transparent objects, but LOOK: With Occlusion Culling,
Without Occlusion CullingThis is probably one of the many reason why it didn’t work, so no need for cursing
Yeah well if you get excited and behave like you’re 14 then you’re not going to get anywhere in unity. First thing you want to do is bake a low res occlusion test till you get the hang of how it all works. So you spend 10 seconds between each test, then gradually raise the resolution.
YES i baked the lowest reslution possible, on preview with i think 1000 or 10000 cell size (i cant remember). And no the fact that i just baked for the first time has nothing to do with it, i did look up how to do this before hand so this wouldn’t happen, but it still did. Also why do care if i’m a little angry? I just wasted a LOT of time waiting for this, then i ask what happened hoping to get an answer, and you people are just like “OMG YOU SAID WTF” (i didn’t even spell it out, the initials is all i put).
naturally it won’t work if you use such totally incorrect values.
normal cell size is 1, depending on how far away from the wall the cam is and how large the objects are (do them in unity worker / robo size or basing on that as human height, if you make them too large you will never ever go anywhere due to numeric and memory constraints!) you can get away with cell sizes of up to 16. But for indoor I would take it granted that you won’t go with anything beyond 2-4 at max.
i normally go at 0.1 to 0.01 with camera ranges of 0.3 near, 1000 far
also, when using OC ensure that every object is an own one, don’t believe to be intelligetn by importing whole groups or use the dreaded mesh combine, cause occlusion culling hides and shows whole objects, if just a little bit of them is in view, so if you have objects grouped all over the level for example, they will never occlude at all for example cause you are permanentely within their bounding volume
So is it a problem that i put almost all of the objects into a empty parent object? i just did it to organize the hierarchy a little bit.
No, putting them into 1 hierarchy is no problem. it will only become a problem if you combine them with the combine children script cause they then no longer are distinct objects.
BUT: an error on that end wouldn’t give you the problem you document above, it would result in the opposite, that the stuff never is culled and permanentely visible making OC useless
Ok thank you i think ill try it with a cell size of 2 or 3
Because its not the sort of communication that will get you far as a game developer. In fact it will get you nowhere, instead focus on hard facts and supplying as much information as possible to people on the forum. Why should I answer someone barely capable of typing anything but WTF etc. If you’re angry, you will get less help from people. Same in real life if someone is angry, I will avoid them.
But good luck with it, I hope you make progress.
I’ve gotta say, I’m disappointed with Unity’s documentation on Occlusion areas, portals, and anything related to Occlusion Culling. I’ve researched extensively for hours on end over the course of several weeks only to find new information hidden in obscure threads. Apparently Occlusion culling doesn’t like alpha cutouts, or gpu instanced materials, or static batching, (now it doesn’t work at all in my current project, I tried the most basic of settings in a new scene and nothing.) Now I got occlusion portals working, when the camera moves or is further away, the mesh I’m hiding is displayed again. Anyways, I’m ditching it for the project I’m currently working on, it’s too unpredictable and irreliable. Back to parenting items to an empty and turning it on or off.