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

FOV not working, missing material? #2

Open
Oarcinae opened this issue Sep 2, 2021 · 3 comments
Open

FOV not working, missing material? #2

Oarcinae opened this issue Sep 2, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Oarcinae
Copy link

Oarcinae commented Sep 2, 2021

I opened the project with 2019.4. All I see is the pink for missing materials. I didn't have time to figure it out myself yet but just wanted to check if that was expected, or an issue on my side maybe? Thanks!

EDIT: Disabling FOV fixed it. So it seems like something is broken or missing or needs config on the FogOfWarProjector

@Oarcinae Oarcinae changed the title Materials not set? FOV not working, missing material? Sep 2, 2021
@MinaPecheux MinaPecheux self-assigned this Sep 2, 2021
@MinaPecheux MinaPecheux added the bug Something isn't working label Sep 2, 2021
@MinaPecheux
Copy link
Owner

Hi, nice catch, thanks! So the project actually works for Unity 2019.3 and Unity 2020+, but it seems to have some shaders issues at version 2019 LTS (2019.4).

I'm guessing it's because of the LWRP to URP render pipeline change (https://docs.unity3d.com/Manual/UpgradeGuide2019LTS.html)... sadly I don't have time to work on this at the moment :(

If you happen to know a bit how this works, feel free to contribute and offer some changes :)
Or else, try and upgrade to Unity 2020 (in my case it seems to work fine with 2020.3 for example)!

Don't hesitate to tell me if that doesn't work for you...

@Oarcinae
Copy link
Author

Oarcinae commented Sep 2, 2021

Oh, it was just this line in the shader. I commented out and that fixed it.
#pragma exclude_renderers d3d11 gles

What does the explanation mean? "Upgrade NOTE: excluded shader from DX11, OpenGL ES 2.0 because it uses unsized arrays"?
I'm not sure that's required but I guess depending on the hardware this is running on it might be?

No worries if you don't have time to look into it, I'll take a look at some point too if I get time. It's a minor issue and fix anyway. Thanks!

@MinaPecheux
Copy link
Owner

Nice one, happy to know you found a solution!

This "Upgrade NOTE" comes from the automatic "level up" of the Unity project: I wrote my project using Unity 2019.3, so I'm guessing when you opened it with Unity 2019.4, you got a little warning saying "we need to upgrade your project, are you sure?" etc.

When Unity does this, it basically goes through the project, changes some settings and modifies a few assets (mostly shaders, sometimes scripts from my experience) and "updates" them to match the new version.
It kindly leaves notes along the way to tell you the auto-upgrader was here, but that's not always super readable... ;)

As I said, some default pipeline render options changes between 2019.3 and 2019.4, so my guess is that during the auto-upgrade, Unity "disabled" some renderers... but I don't know why, sorry, I'm not super great with shaders in Unity!
What I know is that different renderers store your variables using different data types, and that this might conflict/not properly fit your own hardware - so, yup, indeed, this might be a failsafe to avoid errors on some computers, but on yours it just works?

I'd need to learn more about rendering and shaders to really solve this issue ^^

In the meantime, I will add a little section to the README file to tell of this little upgrade issue and link your fix - perhaps it could help others. Thanks a lot for the info! :)
(But I'll keep the issue open just in case...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants