- Home /
Share Occlusion Culling Data among Same Scenes
Hi there. Sorry if this question smells a bit Noobish :) Imagine I have a Scene named A and currently being used in ten levels.
all the scenes are the same and just multiplied ten times with different scripts and some other things tweaks.
now i found that my occlusion culling has some problems and i want to re-bake it for one
of the scenes and use it among other same scenes instead of baking it individually.
is there any way/trick to do so? baking OC is really taking to much time and my game has 51 levels
which are created from only 9 base scenes. so is it possible to bake it only for those
9 Base scenes? thanks in advance :)
Answer by supernat · Jul 12, 2015 at 05:13 AM
You can run a script from the command line, but first you'll need to create an Editor script that bakes the data. See this page for details: http://docs.unity3d.com/ScriptReference/StaticOcclusionCulling.html
And this page for the command line arguments (look at -executeMethod). There's an example just down the page to do this. http://docs.unity3d.com/Manual/CommandLineArguments.html
thanks @supernat for the answer but that really didn't help.
I've noticed 2 things:
1) your second link is exactly the same as the first one which doesn't contain any execute script example.
2) I can't find a copy/paste function in OC API.
it only give you the control over running the process , canceling , check if running and some other useless stuffs.
how to copy data and paste it in another scene?
again thanks for your respond.
Oops, sorry, I switch back and forth between $$anonymous$$ac and PC, probably hit the wrong cmd/ctrl key to copy the link. I updated the answer. Unfortunately you can't copy and paste the data into another scene through the API, but you might be able to manage that by looking at the internal structure of the game data...that's beyond me. This solution would only allow you to click a button to kick off a script that goes and builds the occlusion culling for each scene automatically...yes could take a while depending on your scenes, but you could run it overnight (or several days depending).
thanks @supernat that CommandLine link was quite handy, however I'm working on a brand new OC, this gonna take me around a week to be completed but i think its a better approach for anyone making games on mobile due to heavy builtin OC system which is not that much good on mobile platforms.
Your answer