microsoft / microsoft/MixedReality-GraphicsTools-Unity
UV flips up and down on HoloLens2 real device in magnifier function.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 209
- Forks
- 49
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Describe the bug
While playing with the new feature while working on other MRGT issues, I encountered a problem with the screen of the magnifier function flipping upside down on the actual HoloLens2 device.
I was able to get it working on the actual device by inverting the Y component of the UV in Graphics Tools/Magnifier.
half4 frag(v2f i) : SV_Target
{
float2 normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(i.vertex);
float2 normalizedScreenSpaceUVStereo = UnityStereoTransformScreenSpaceTex(normalizedScreenSpaceUV);
normalizedScreenSpaceUVStereo.y *=-1; //Add!!
float2 zoomedUv = zoomIn(normalizedScreenSpaceUVStereo, MagnifierMagnification, Center);
float4 output = SAMPLE_TEXTURE2D_X(MagnifierTexture, samplerMagnifierTexture, zoomedUv);
return output;
}
I have previously encountered the same UV upside down phenomenon when using CameraOpaqueTexture in a URP environment to create my own lightweight Bloom post effect.
This only occurred on the actual HoloLens device, not on the Editor, and seems to be the same as this time.
Maybe there is something going on with the HoloLens rendering or deploying from Untiy, but I don't understand it and am very curious.
To reproduce
I deployed to HoloLens2 in Unity2021.3.5f1 with MRTKv2.8.2 using OpenXR platform.
Expected behavior
It needs to be rendered correctly in HoloLens as well as VR without tampering with the code itself.
Screenshots
Please refer to the above Youtube video.
Your setup (please complete the following information)
Unity Version 2021.3.5f1 (URP)
Graphics Tools Version 0.5.0(Introduced from MixedRealityFeatureTools)
Target platform (please complete the following information)
Only HoloLens 2
Additional context
I would like to understand the cause of the problem as I am curious about the causes in this area.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem Magnifier-Shader unter Graphics Tools/Magnifier und reproduziere das Problem mit der UV-Ausrichtung auf einer HoloLens 2 mit Unity 2021.3.5f1, URP, MRTK v2.8.2 und OpenXR. Vergleiche die Geräteausgabe mit dem Editor und dem gemeldeten Verhalten invertierter Y-UVs; abgeschlossen ist die Aufgabe, wenn der Magnifier auf HoloLens 2 und in VR ohne manuelle Codeänderungen korrekt rendert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- unity
- Bereich
- ar-vr-xr, computer-graphics
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100