microsoft / microsoft/MixedReality-GraphicsTools-Unity
UV flips up and down on HoloLens2 real device in magnifier function.
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 209
- Fork
- 49
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con lo shader della lente d’ingrandimento in Graphics Tools/Magnifier e riproduci il problema di orientamento delle UV su HoloLens 2 usando Unity 2021.3.5f1, URP, MRTK v2.8.2 e OpenXR. Confronta l’output del dispositivo con quello dell’Editor e con il comportamento segnalato delle UV con Y invertita; il lavoro è completato quando la lente d’ingrandimento esegue correttamente il rendering su HoloLens 2 e in VR senza modifiche manuali al codice.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- unity
- Ambito
- ar-vr-xr, computer-graphics
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100