Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lights flipped on x axis flipped on Windows #6

Open
jamespohalloran opened this issue Aug 2, 2016 · 2 comments
Open

Lights flipped on x axis flipped on Windows #6

jamespohalloran opened this issue Aug 2, 2016 · 2 comments

Comments

@jamespohalloran
Copy link

Working fine on Mac build, but for Windows (on a macbook pro), the lights are showing up on the reverse y value based on the center of the screen. (So when the player jumps, the light goes down instead of up).

This old issue seems to accurately describe the problem:
https://m.reddit.com/r/Unity2D/comments/4cmr4w/looking_for_anyone_who_has_a_clue_what_might_be/
Although setting the settings to OpenGLCore on Windows is not always an option.

@prime31
Copy link
Owner

prime31 commented Aug 2, 2016

I don't use DirectX so I cant confirm but this line should take care of flipping the UVs. Unless you are using a different shader in which case you will just need to make sure the UV flip happens to account for DirectX being upside down.

@jamespohalloran
Copy link
Author

Ah, ok.
The fix for me was to remove that line, and replace it with
#if UNITY_UV_STARTS_AT_TOP if (_MainTex_TexelSize.y < 0) o.uv.y = 1.0f - o.uv.y; #endif
BUT, that needs to be in the vertex shader, not the fragment shader.
This seems to align with Unity's documentation https://docs.unity3d.com/Manual/SL-PlatformDifferences.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants