ScreenPosition UV upside down on mobile.
From User:
"I believe the editor mobile preview provides "correct" results, while the mobile device produces upside down results. I ran into this issue when creating a post process volume to simulate a camera partially submerged in water with mathematically calculated wave displacement. I can convert the screen position to world position using a custom material node with the code: float2 ViewPos = (ScreenPos.xy - View.ScreenPositionScaleBias.wz) / View.ScreenPositionScaleBias.xy * 10; float4 Pos = mul(float4(ViewPos, 10, 1), [Link Removed]); return Pos.xyz / Pos.w; This works as expected in the editor mobile preview, but the results are weirdly flipped around when launching to a mobile device. Manually inverting the Y-coordinate of the UV by subtracting the Y-component from 1 will correct the ViewportUV output, but the world space calculation still doesn't work (probably because [Link Removed] and [Link Removed]need to also be inverted). Strangely, if I feed the inverted UV coordinates into SceneTexture:PostProcessInput0, the entire scene flips upside down when running on a mobile device. This means that the ScreenPosition's ViewportUV is not the same as the SceneTexture UV. As a result, any post process effects that rely on the ViewportUV do not work correctly when running on mobile devices."
Also confirmed in Main CL 4319846
Result: The mobile device outputs a colored gradient with green at the top left corner and black at the bottom left corner, while the editor mobile preview outputs a colored gradient with black at the top left corner and green at the bottom right corner.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-63442 in the post.
2 |
Component | UE - Graphics Features |
---|---|
Affects Versions | 4.19.2, 4.20.2, 4.21 |
Target Fix | 4.21 |
Fix Commit | 4226825 |
---|
Created | Aug 28, 2018 |
---|---|
Resolved | Aug 30, 2018 |
Updated | Jan 13, 2021 |