0
Not a bug

Screen Position and Scene color

Crylar 11 years ago updated by Freya Holmér (Developer) 9 years ago 10
When "Screen Position" node is used as UV cordinates on a "Scene color" node the image is verticaly flipped on my PC but not on my colleagues MAC.

And when "Screen positions" is used as UV on an "Texture 2D" node the material looks as expected in the preview but renders white in the scene.

I think this is a bug, and I hope this is the fight forum for it. Cheers =)
+1
Under review
What is the Screen Position node dropdown set to? When using it on scene color, it should be set to Scene UVs
Oh, it was set to Normalized, and change it to Scene UVs worked better and I could skipp a few nodes haha ^^
Still it was wied that it looked different on the Mac <.<
But thanks a lot, love this tool =)
+1
It's a silly OpenGL vs DirectX thing.
Mac renders using OpenGL, and Windows defaults to DirectX, but you can switch to OpenGL on Windows as well.
And glad you like SF :)


ahaa, cool ^^
I am getting a similar issue, it does not seem to be a DirectX/OpenGL thing in my case.. On most iPads and iPhones, it works as expected, but (for example) on an iPad 2, the UV is flipped as above. Any suggestions? I am experimenting now with per-pixel screen coordinates disabled.
For those stuck on the same issue, this is due to Metal behaving similar to DirectX. On certain iOS devices, you'll have metal support, and the Y axis will go from 0 (top) to 1 (bottom), where as older devices will only have OpenGL, where the Y axis goes from 0 (bottom) to 1 (top).

Here is a fix for the issue, the 'Flipper' method will flip the input around if UNITY_UV_STARTS_AT_TOP has not been defined.

@Joachim I've only run into this issue using Scene UV's. Any other places I should look out for this? If not, maybe its worth having this built in to the Screen Pos node?



+1
It should be built-in, yeah, thanks for tracking down the issue!
Cool, any way I can receive a heads up when this is fixed? Otherwise I'll update shaderforge one day and my shader will break on certain devices as I would be flipping the V after you've already flipped it!
This is one of those Unity bugs I believe. Their flipped projection check should most likely branch this, rather than me. If I flip it in SF, it might possibly break when Unity fixes it on their end, and I have to fix it again. Anyhow, I'll poke Unity about it :)