How to use Lights & Shadows in Passthrough Mode

  • 6 January 2024
  • 12 January 2024
  • 4 min read

Introduction

Hello XR Developers! Today’s video is all about exploring Meta’s Passthrough Relighting (PTRL), a feature that brings real-time lighting to your room mesh in Unity. We’ll delve into using PTRL with the Mixed Reality Utility Kit and the OVR Scene Manager. Plus, we’ll touch on real-time shadows, blob shadows, and adjusting passthrough brightness for an immersive experience. If you enjoy these insights, please like, subscribe, and check out my Patreon for the source code. Join our Discord community for any questions. Let’s dive into Passthrough Relighting! 💡🔍

Setting Up Passthrough Relighting

  1. Project Preparation: Start with a Unity project integrated with Meta XR SDK and the Mixed Reality Utility Kit. If you’re new to this, refer to my previous video on the Utility Kit. 🛠️
  2. Importing Passthrough Relighting: Add the “Passthrough Relighting” sample package to your project. This package is key to implementing real-time lighting effects. 📦
  3. Scene Overview: The scene includes an OVR Interaction component, Passthrough Layer, Oppy character with a flame, MRUK component, and Effect Mesh game-objects. These elements work together to create a dynamic lighting environment. 🌐

Exploring Scene Components

  1. OVR Interaction: This component, containing controller visuals and interactivity, is crucial for manipulating the control panel and navigating the scene. 🎮
  2. Passthrough Layer Activation: Ensure that scene and passthrough support are enabled on the OVR Manager for a seamless AR experience. 👓
  3. Oppy Character: Oppy, equipped with a point light, demonstrates how virtual light interacts with the room mesh. Adjust its position for optimal lighting effects. 🚶‍♂️💡
  4. Effect Mesh Application: Apply the “Transparent Scene Anchor” material with the “Highlights And Shadows” shader to room meshes for realistic lighting effects. 🖌️
  5. Control Panel Features: Experiment with toggles and sliders to switch between real-time and blob shadows, adjust light intensity, and modify passthrough brightness. 🎛️

Behind the Scenes: Script Insights

  1. Control Panel Script: Explore how each UI element triggers specific lighting changes in the scene, from shadow types to brightness adjustments. 📜
  2. Global Mesh vs. Anchor Objects: Understand the difference in lighting effects between the global mesh and specific anchor objects like furniture and walls. 🌍

Testing Passthrough Relighting

  1. Room Mesh Interaction: Observe how Oppy’s light reflects on room surfaces, enhancing the realism of your AR environment. 🌟
  2. Lighting Adjustments: Play with light strength and passthrough brightness to create different atmospheres, from a well-lit room to a dimly lit cave-like setting. 💡🕯️
  3. Shadow Types: Compare the impact of real-time shadows versus blob shadows for performance optimization and visual appeal. 🌑

Passthrough Relighting without MRUK

  1. Alternative Setup: Learn how to achieve similar lighting effects using the OVR Scene Manager and Building Blocks for those not using MRUK. 🔄
  2. Scene Configuration: Add Camera Rig, Passthrough, and Room Model building blocks, and use the PTRL prefabs for Plane and Volume anchors. 🏗️
  3. Light Source Implementation: Create a script to spawn and shoot a light-emitting ball, demonstrating dynamic lighting in your room mesh. 🎾💥

Conclusion

Passthrough Relighting is a powerful tool for XR developers, offering a range of options to integrate real-world lighting into virtual environments. Whether you’re using MRUK or the OVR Scene Manager, PTRL enhances the realism and immersion of your AR projects. If you found this tutorial helpful, please like, subscribe, and consider supporting my work on Patreon. For further discussion and assistance, our Discord community is always here to help. Thank you for watching, and stay tuned for more exciting XR development content! 👋👨‍💻🌐

Support Black Whale🐋

If you find our content helpful, consider supporting us on Patreon. Your contributions enable us to continue creating free, high-quality educational material 👍.

Thank you for following this tutorial. Stay tuned for more in-depth and insightful content in the realm of XR development! 🌐

Did this article help you out? Consider supporting me on Patreon, where you can find all the source code, or simply subscribe to my YouTube channel!

Leave a Reply

Your email address will not be published. Required fields are marked *