text
stringlengths 0
1.11k
|
|---|
FloorZone
|
Generate a number of radial free space zones in a room.
|
MultiSpawn
|
See how to find valid positions on specific surfaces, for example to instantiate content.
|
NavMesh
|
Observe two NavMeshAgents traversing a NavMesh, defined by the room bounds and furniture or Scene Mesh.
|
VirtualHome
|
Reconstruction of an interior scene using different pieces of furniture for each anchor label. FancyResizable.cs allows you to define a minimum / maximum object size, and swap to a different prefab if the spawned object is too large or small (Used in OTHER prefab). You may specify multiple prefabs and one will be randomly selected from the list, maintaining the same transform as the original object (Used in PLANT and WALL_ART).
|
PassthroughRelighting
|
See the Passthrough Relighting page for more details.Passthrough Relighting
|
Unity
|
Quest
|
The platform for which this article is written (Unity) does not match your preferred platform (Nativa).
|
Haz clic aquí para ver la página del índice de la documentación para tu plataforma de preferencia.
|
Overview
|
This documentation walks you through the features and structure of the passthrough relighting (PTRL) sample. It shows you how your Unity project can be set up such that virtual lights and shadows in your Unity scene can interact with scene/space anchor objects such as the floor, walls, desks, and so on. This helps your virtual content to blend with the real-world environment seen displayed in passthrough.
|
Requirements
|
MRUK package installed in your project.
|
Manual scene capture or completed space setup
|
Run the sample
|
From the MRUtilityKit zip, open Sample folder.
|
Open the MRUtilityKitSample project and then load the PTRL map.
|
Build and run the Passthrough relighting scene on your device.
|
Sample app description
|
Once the application starts, you see lights and shadows interacting with scene objects. You control the movements of the character, Oppy, which projects shadows and highlights.
|
Those lighting effects are hidden by the Environment Depth, in order to be occluded by real world objects similarly to the rest of the virtual scene.
|
You can control Oppy’s movement using the left or right controller thumbstick. Moving the thumbstick up moves Oppy in a forward direction relative to the headset.
|
To make Oppy jump, press the A, X, or the grip buttons. Jumping while moving is also possible, and encouraged in order to jump on scene objects like desks. Holding the jump button makes Oppy jump higher.
|
A control panel is attached to the left controller and is interactable with a ray shooting from the right controller, using the right trigger to select. Through the panel, you can adjust the render parameters for highlights and shadows, toggle between scene objects and the scene mesh, and change passthrough brightness and depth check.
|
Showing the control panel and its adjustable options.
|
Scene overview
|
The experience implementation is in the sample as a single scene named PassthroughRelighting.
|
The main elements of the scene are:
|
The character, “Oppy”.
|
A directional light that will cast shadows.
|
The Flame character floating over Oppy. It has a point light attached to it projecting highlights onto the scene planes and volumes
|
The OVRCameraRig to move the cameras and controllers.
|
OVRPassthrough, with a OVRPassthroughLayer component, to show the passthrough.
|
The MRUK prefab, with a MRUK component, to get information on user defined scene anchors and overload the prefabs with PTRL material.
|
The EffectMeshGlobalMesh game object, with a EffectMesh component, to apply the material with PTRL shader to the global mesh.
|
The EffectMesh game object, with an EffectMesh component, applies the PTRL effect materials to the other scene objects.
|
The OVRInteraction prefab includes a RayInteractor to allow the user interaction with the UI panel.
|
Project structure
|
Everything that is required to create highlights and shadows in passthrough is located in the MRUK package in the core folder:
|
Shader: HighlightsAndShadows with subshaders for both BiRP and URP implementing passthrough effects to receive shadows and render highlights point lights.
|
Materials: the TransparentSceneAnchor material uses the HighlightsAndShadows shader mentioned above, to be applied on scene geometry.
|
Textures: the textures needed to create a blob shadow.
|
Prefabs: contains prefabs for scene planes, scene volumes and scene mesh, already using the above mentioned material. They are ready to be inserted to the Unity scene OVRSceneManager component in the respective sections.
|
The resources for the Oppy and flame character are separated into their own respective folders in the sample.
|
Adding Passthrough relighting to an MR project
|
With OVRSceneManager
|
Import the MRUK package in your project and link the PTRLScenePlane and PTRLSceneVolume prefabs from the folder onto OVRSceneManager.
|
Import the MRUK package in your project and link the PTRLScenePlane and PTRLSceneVolume prefabs from the folder onto OVRSceneManager.
|
Open the OVRSceneManager component in your project to set the OVRSceneAnchors prefab to type plane, volume, and global mesh; these prefabs should have a material assigned to them that makes use of the PTRLHighlightsAndShadows shader, from Core/Shaders folder.
|
The sample only features integration with Scene API. This means a user has to perform a manual scene capture or complete Assisted Scene Capture (ASC) to capture a scene mesh. However, the material can be applied on arbitrary objects, for example, a floor-level plane.
|
Using Mixed Reality Utility Kit
|
Import the MRUK package into your project and add the MRUK prefab to your scene.
|
Import the MRUK package into your project and add the MRUK prefab to your scene. Add an EffectMesh component, link the TransparentSceneAnchor material to it’s MeshMaterial field. Add an MRUKStart component and link the CreateMesh method of the newly created EffectMesh to the list of MRUKStart scene loaded event list.
|
Multiple point light support
|
In order to show highlights from more than one point light source, make sure that the desired amount of per-pixel light sources is specified in your project settings. For the BiRP the setting is called Pixel Light Count and it is in Project Settings > Quality.
|
For the URP in the Universal Render Pipeline Asset, in section Lighting, set Additional Lights to be Per Pixel, and set the Per Object Limit to the desired number.
|
Shadow quality
|
The shadow appearance is dependent on the quality settings of your project. In order to set the correct shadows quality for your project, go to the Project Settings > Quality.
|
Enable Shadow, set the Shadow Resolution, and set the Shadow Distance. The smaller the distance, the higher the shadow quality will be.
|
Highlights and shadows shader
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.