KanikamaGI logo
  • English

Setup monitors

KanikamaBakeTargetMonitorGroup

The KanikamaBakeTargetMonitorGroup component is a BakeTargetGroup for monitors. When there are multiple monitors projecting the same image, the number of lightmap bakes can be reduced by combining them into a single monitor group. You need to setup this component even if there is only one monitor in your Scene.

fieldstypenote
mainMonitorKanikamaMonitorA main monitor. Can not be null.
subMonitorsKanikamaMonitor[]Sub monitors (optional). main and sub monitors are supposed to have the same image.
bakeTargetPrefabBakeTargetA prefab for grid cells of monitors.
partitionTypeKanikamaMonitor.PartitionTypeHow to divide monitors.
monitorGridFibersList<MonitorGridFiber>BakeTargets used on baking. Fibers are generated by clicking Setup Lights button.

Prefabs

Prefabs for MonitorGroups:

  • Unity: Packages/Kanikama/Runtime/Application/Prefabs/KanikamaMonitorGroup.prefab
  • Udon Unity : Packages/Kanikama Udon/Runtime/Application/Prefabs/KanikamaMonitorGroup.prefab

For Bakery, set the following Prefab for bakeTargetPrefab field.

  • Packages/Kanikama Bakery/Runtime/Application/Prefabs/BakeryGridCell.prefab

KanikamaRuntimeMonitorCamera

This is a runtime component to capture a monitor by Camera and get averaged colors. This component is attached in KanikamaMonitorGroup.prefab. Averaged colors are given by choosing appropriate mipmap levels. For example, if you use 2x2 grids, the mipmap level should be 7. To work this correctly, the render target of the Camera needs to have the resolution 256 x 256.

fieldstypenote
isSRPboolCheck this when URP.
monitorRendererRendererA renderer that the camera captures. It is recommended to use a Unity Quad hidden for players.
bakeTargetPrefabBakeTargetA prefab for grid cells of monitors.
partitionTypeKanikamaMonitor.PartitionTypeSet the same value to the KanikamaBakeTargetMonitorGroup.
targetCameraCameraA Camera capturing a monitor to get colors. Its depth should be smaller than the main camera.
readingTextureTexture2DSet 256 x 256 readable RGBA 16 SFloat Texture2D object with mipmap.

KanikamaUdonMonitorCamera

This is a Udon version of KanikamaRuntimeMonitorCamera. It is a bit slower than the C# version because of U#'s rescriction of Unity API.