Description

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

Steps to Reproduce
  1. Create new empty blueprint project with target hardware set to mobile
  2. Add post process volume and adjust boundaries to enclose the camera
  3. Create new post process material and plug ScreenPosition material node's ViewportUV output to emissive color
  4. Assign this post process material to the post process volume
  5. Launch on Android

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.

Community References

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-63442 in the post.

2
Login to Vote

Fixed
ComponentUE - Graphics Features
Affects Versions4.19.24.20.24.21
Target Fix4.21
Fix Commit4226825
CreatedAug 28, 2018
ResolvedAug 30, 2018
UpdatedJan 13, 2021