Mixed Reality Utility Kit - Decorating your scene
Updated: Mar 13, 2025
After completing this section, the developer should understand how to create dynamic decorations based on the scene.
SceneDecorator is an advanced tool to decorate your scene with assets. This allows random or uniform placement of assets (prefabs, 3D models) in your physical space with respect to the scene layout. This is configured with ScriptableObjects called SceneDecoration. You can create new SceneDecorations by using the contextmenu and creating an new object of SceneDecoration, located in /Meta/SceneDecorator. SceneDecorations allow many combinations of modifiers, masks and constraints. Please study the existing decorations in the sample. SceneDecorator needs colliders to identify positions in the room. A fast and simple way to do this in MRUK is to use EffectMesh: configure EffectMesh according to your needs (look for HideMesh & CreateColliders) which will provide colliders out of the box for you.
Overview
Four different types of distribution
- Random
- Grid
- Simplex
- Straggered Concentric
When using multiple prefabs (3D models) per decoration, a random candidate will be evaluated per hit.
Execute Scene Labels: defines which entries in the room will execute this decoration.
Examples:
- Every room has just one floor, so a distribution defined over the Floor will happen once.
- When using Wall, keep in mind that a room has multiple walls. Depending from which direction you start to decorate, the effect will be different:
- Decorating from outside of the room inwards, means you will likely hit the wall directly from the executing object.
- Decorating from inside of the room outwards, means you will likely hit the wall from the executing object, but if the offset is large, you may also hit a desk, cabinet or any other object in front of the wall first. Then depending on your target definition, this hit is taken into account or not.
- Decorating from inside of the room further into the room, means you will likely hit the opposite wall or anything which is in front of it.
Targets
- Using scene mesh or physics layers here gives transparent results. Use other settings for more effects.
Placement, Placement Direction, Select Behind and Ray Offset
- These values define the direction of the ray used to determine an impact point. Use gizmos in the editor to visualize this and play with the settings.
Constraints, Masks, Modifiers
- Use all those settings to make your decorations unique.