Streaming
Cullpoint Info
The cull point is the origin for the surrounding entities (by default, it’s a child of the camera). The cull state of the surrounding entities varies depending on the distance to the culling point (example). You can change the distances in the cull config.
States
Culled : entity is far away (by default, the entity is destroyed or disabled).
CloseToCamera : entity is enabled but with limited or modified functionality for better performance.
PreInitInCamera : state between to CloseToCamera and InViewOfCamera, currently used to activate static physics objects [optional].
InViewOfCamera : entity is fully enabled.
Default State List
The default list is used for most objects, contains Culled, Close to camera, In view of camera states.
Default state list example.
Note
States add to the prefab entity by CullComponentsExtension.CullComponentSet extension method.
Extended State List
The extended state list is used for objects that require a pre-init state before viewing in camera state, but earlier than the close to camera state, contains Culled, Close to camera, Pre-init in camera, In view of camera states.
Extended state list example.
Note
States add to the prefab entity by CullComponentsExtension.PreinitCullComponentSet extension method.
It is used in the project for static physics objects to load them earlier than the dynamic physics objects to avoid dips through static surfaces.
Scene Streaming
Road Streaming
Road Streaming is needed to split the map into chunks to create huge maps, so that road entities: TrafficNodes, PedestrianNodes, etc. are only loaded where the player is.
How To Adjust
Enable streaming in the Road Streaming Config to load road sections at the runtime.
Adjust load/unload distance and section cell size.
TrafficNode, PedestrianNode, TrafficLightHandler automatically attaches to related RoadSegment.
Traffic lights has a SectionObjectAuthoring component.
If you want to add your own section object, add the SectionObjectAuthoring component and select the appropriate Section object type.
Debug streaming distance and section size.
Road streaming example.
Scene Streaming
You can split the scene content into chunks for partial loading at runtime.
How To Create
Create a new empty GameObject and add the SubSceneCreator component.
Adjust the chunk settings.
If necessary, enable post process settings [optional step].
Press the Create button.
Adjust the Streaming Level Config to load/unload subscenes at the runtime.
SubScene Chunk Creator
Content chunking tool to split the scene into chunks. Old objects remain disabled in the old scene and are used to create duplicates in the chunk sub-scenes.
Assigments
Chunk Settings
- Position source typesource position of the object to be assigned to the chunk.
Object position
Mesh center
- Object find methodmethod for finding an object to add to a chunk.
By tag : by Unity tag.
By layer : by Unity layer.
- Disable source object type
Mesh renderer : disable meshRenderers of source objects.
Parent : disable parents of source objects.
Parent if no mesh : disable the meshRenderer, but if not, disable the parent.
Post Process Settings
- Post process type:
Delete component : the component found will be deleted.
Delete object : the object with the found component will be de.
Chunk Data
Configs
Cull Config
Config of the cull point.
- Has cull:
Max distance : maximum distance to activate entities.
Visible distance : distance to activate visual features of entities.
Road Streaming Config
Config for load/unload road sections from the entity subscene.
Streaming Level Config
Config for load/unload content subscenes.
- Streaming is enabled:
Distance for streaming in : distance at what the subscene is loaded.
Distance for streaming out : distance at what the subscene is unloaded.