Search Unity

URP VR cockpit camera stacking lighting question

Discussion in 'Universal Render Pipeline' started by RogueStargun, Aug 5, 2020.

  1. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    296
    So I'm making a VR space shooter with a fully interactable cockpit using URP camera stacking
    There have been some issues, but so far the game is working. Basically the cockpit stays in one place, and gets rendered by the in-cockpit overlay camera while the physical spaceship is moving around the map.

    My problem is that I've tried to avoid rotating the cockpit so far, but when turning the ship the lack of lighting changes to the cockpit is quite noticeable. I want the lighting in the cockpit to change without rotating the physical cockpit as my XR/Rig/character controller still needs to move around the inside of the ship without everything tilting.

    So far I can think of two solutions:
    - Bite the bullet and rotate the cockpit as the ship rotates. The XR rig and all interactables inside the ship will need to be perpendicular to the ground at all times as the ground itself is moving adding complexity and calculation.
    - Keep the cockpit in once place, and create a second set of lights that move around the (non-moving) cockpit relative to the directional lights affecting the actual ships.

    Is there a recommended approach to this problem?