DSprtn / GTFO_VR_Plugin

A plugin to add full roomscale Virtual Reality support to your favorite game!
MIT License
144 stars 13 forks source link

Nav marker visibility #39

Closed Nordskog closed 2 years ago

Nordskog commented 2 years ago

What

This PR fixes

How

Glass

We already mess with the NavMarker icon material when they are set up, but only set the shader. Renderqueue changed to 4001 to render ontop of everything, glass included

foreach (SpriteRenderer r in __instance.transform.GetComponentsInChildren<SpriteRenderer>())
{
    r.material.shader = VRAssets.SpriteAlwaysRender;
    r.material.renderQueue = 4001;    // New
}

This does still affect a number of other world-space UI elements ( e.g. player outlines ), and the text accompanying nav markers does not render through anything, but as long as the marker icons are visible it's mostly a non-issue.

Terminal pings

0ce1bb5 added a check to see if NavMarkerLayer.m_visible and skips all the world-space nav marker logic if false. Unfortunately this is false when the player is in the terminal, resulting in pings not displaying until they leave it. Could add another check for whether or not the user is in the terminal at the time, but realistically the impact of a few markers is negligible, so I just reverted that for now. Menu stutterhell doesn't really seem to be a vram issue anyway, though it sure behaves like it.

Other

UpdateAllNavMarkers() was also modified to skip any markers whose GameObject is inactive. It keeps a number of these around and in the list of "active" markers, despite them being inactive ( not just out-of-view inactive, but doesn't-need-to-exist-anymore inactive ).

DSprtn commented 2 years ago

Nice job!