0

So here's the gyst. I'm working on creating a Head Up Display (HUD) such as is found in military jet aircraft among others. To do this, I have a world space canvas which contains the HUD display functions. All fine.

Now here's my issue. On an actual HUD, the pilot does not perceive the images he's seeing as being close to his face (as though on the glass pane it's being projected on) but actually at an infinite view distance. My plan to mimic this is essentially to put the canvas really far in front of the aircraft and make it large. However, the obvious issue with this is that it will be covered by nearly everything in front of the aircraft such as other aircraft, clouds, and even the ground itself. This won't do. It needs to render on top of EVERYTHING...except an image mask because of one other important feature...

...you can only see it if your head is in the right spot. It's as if you're looking at far off images in the sky but can only see them when looking through the small glass pane in front of you. I'm achieving this with an image mask which is on the glass pane. This is an good time to mention that this project is in VR. Thus the pilot can move their head such that the HUD is masked and thus this is just as important of a feature if not more important.

But these requirements all create a somewhat unique dilemma for me that has ruled out solutions for the basic issue of having the HUD render over everything. I can't use a screen space canvas because VR and because I need it in world space for the masking effect. I can't use a second camera as we're rendering in HDRP VR and I'm told it would get computationally expensive very quickly and I'm not even sure how it'd be achieved in the first place. And when experimenting with some shaders (of which I know next to nothing about) and have gotten a shader which renders the HUD over everything....it also renders over the masking object thus overriding my solution to the other important feature. It's like I can't have it both ways.

At this point I feel the solution may be a special shader perhaps even accompanied by a custom masking shader as well but I don't know anything about shaders myself. The quick tutorials for specific shader masking effects I've found online so far have not worked with UI objects. Any help or advice is greatly appreciated.

4
  • I answered an alike question before, but the op didn't believe a vr device can draw overlay canvases. You may have a try if you believe. stackoverflow.com/questions/75767453/…
    – shingo
    Commented May 11, 2023 at 14:08
  • @shingo, I appreciate the reply. However, even believing that VR can use a screen space rendered, it will eliminate the ability for other important effects. The canvas is in world space primarily because it's simulating something that appears in world space. This canvas should not move with the camera. It appears at a fixed point relative the aircraft, albeit, very far from the aircraft. Commented May 11, 2023 at 14:25
  • The type of the canvas doesn't matter, you can always render one camera before another. Overall you need 2 cameras to render different layers individually.
    – shingo
    Commented May 11, 2023 at 14:42
  • @shingo I didn't initially understand what you were suggesting. Having two cameras rendering in HDRP comes with a significant overhead. HDRP doesn't even recommend doing it for this reason and with the frame rates I need to maintain for VR, it's really not an option for me. Commented Nov 8, 2023 at 21:44

0