wave-harmonic / crest

A class-leading water system implemented in Unity
MIT License
3.48k stars 480 forks source link

Broken Shader When Fresh Install Built-In on Unity 2020 versions #763

Closed sayginkarahan closed 3 years ago

sayginkarahan commented 3 years ago

Describe the bug Hi, I've just tried your latest open-sourced water system with the latest built-in rendered Unity Editor. But shaders are broken and pink. Can you help me, please?

Screenshots / video unknown

Versions

To Reproduce

  1. Download the latest released versions of the Crest Open-Source (10.0.0) version.
  2. Create an empty Unity Built-In Rendered Project (Latest Version 2020.2.5f1 or 2020.2.1f1)
  3. Import the Crest files into the project.
  4. Open and run any example scene.

Platform

Hardware Msi GE72 6QF - GTX970M

Additional context Thank You.

daleeidd commented 3 years ago

Thanks. Those releases are really old as we stopped doing releases. Can you try downloading Crest from the master branch? Let me know how you go.

https://github.com/wave-harmonic/crest/archive/master.zip

sayginkarahan commented 3 years ago

It still gives errors on import and pink on runtime.

Error At First

Error

I think, open-sourced Crest is outdated for now.

daleeidd commented 3 years ago

Did you delete all of the old Crest files before importing the code from that link?

sayginkarahan commented 3 years ago

Yes, I only created a new project and import the codes. Unity threw the errors right after importing the shaders. Don't you get any errors when you import your code into the latest version of Unity 2020?

daleeidd commented 3 years ago

Yes, I only created a new project and import the codes.

Are you saying you created a new project to test the master branch?

Don't you get any errors when you import your code into the latest version of Unity 2020?

I don't get any errors. I am using the repository as a project though. I tested on 2020.

All I can think of at the moment is to delete all of the Crest files, delete the Library folder and then import Crest. Or try cloning this repository and using it as a project and see if there are issues on your system?

sayginkarahan commented 3 years ago

I'll try these when I have more time. I read lots of comments about these kinds of issues. And all your suggestion is deleting library or restarting unity twice. I shouldn't have to do these to run a shader. I'm using lots of third-party shaders and any of the other shaders don't have this kind of issues. I kindly suggest you focus on these integration problems when you have time. :)

huwb commented 3 years ago

We've never had these kinds of issues either, hence why we're asking you for more information

fallguard commented 3 years ago

Hello everybody! I have the same issue on Unity 2020.2.5: the sea is pink as on the screenshot above. But everything works correct on Unity 2019.4.20, so I guess the problem is linked somehow with the Unity version. I have tested it on the master branch with the new project.

daleeidd commented 3 years ago

On Windows I just tested creating a new project for built-in, and dragging and dropping the Crest folder from the master branch download into Unity 2020.2.5. No issues to report.

@fallguard can you provide more information about your system?

Also, we have tagged "releases" now if anyone wants to grab Crest 4.8.

fallguard commented 3 years ago

On Windows I just tested creating a new project for built-in, and dragging and dropping the Crest folder from the master branch download into Unity 2020.2.5.

@daleeidd Yep. I did the same. In Unity 2019 it works for me, in Unity 2020 it does not work for me. My OS is Windows 7, the videocard is GeForce GTX 1060 6GB. It seems the reason of the issue is the shader Chest/Ocean is failed to compile:

Shader error in 'Crest/Ocean': Compilation failed (other error) '' at line 216 (on d3d11)

Compiling Vertex program
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE
Disabled keywords: FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _APPLYNORMALMAPPING_ON _COMPUTEDIRECTIONALLIGHT_ON _DIRECTIONALLIGHTVARYROUGHNESS_ON _SUBSURFACESCATTERING_ON _SUBSURFACESHALLOWCOLOUR_ON _TRANSPARENCY_ON _CAUSTICS_ON _FOAM_ON _FOAM3DLIGHTING_ON _PLANARREFLECTIONS_ON _OVERRIDEREFLECTIONCUBEMAP_ON _PROCEDURALSKY_ON _UNDERWATER_ON _FLOW_ON _SHADOWS_ON _CLIPSURFACE_ON _CLIPUNDERTERRAIN_ON _PROJECTION_PERSPECTIVE _PROJECTION_ORTHOGRAPHIC _DEBUGDISABLESHAPETEXTURES_ON _DEBUGVISUALISESHAPESAMPLE_ON _DEBUGVISUALISEFLOW_ON _DEBUGDISABLESMOOTHLOD_ON _COMPILESHADERWITHDEBUGINFO_ON UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30

And when I try to edit the shader (via the Edit... btn) I get The file is not found, maybe it's because of it's not compiled.

sayginkarahan commented 3 years ago

On Windows I just tested creating a new project for built-in, and dragging and dropping the Crest folder from the master branch download into Unity 2020.2.5.

@daleeidd Yep. I did the same. In Unity 2019 it works for me, in Unity 2020 it does not work for me. My OS is Windows 7, the videocard is GeForce GTX 1060 6GB. It seems the reason of the issue is the shader Chest/Ocean is failed to compile:

Shader error in 'Crest/Ocean': Compilation failed (other error) '' at line 216 (on d3d11)

Compiling Vertex program
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE
Disabled keywords: FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _APPLYNORMALMAPPING_ON _COMPUTEDIRECTIONALLIGHT_ON _DIRECTIONALLIGHTVARYROUGHNESS_ON _SUBSURFACESCATTERING_ON _SUBSURFACESHALLOWCOLOUR_ON _TRANSPARENCY_ON _CAUSTICS_ON _FOAM_ON _FOAM3DLIGHTING_ON _PLANARREFLECTIONS_ON _OVERRIDEREFLECTIONCUBEMAP_ON _PROCEDURALSKY_ON _UNDERWATER_ON _FLOW_ON _SHADOWS_ON _CLIPSURFACE_ON _CLIPUNDERTERRAIN_ON _PROJECTION_PERSPECTIVE _PROJECTION_ORTHOGRAPHIC _DEBUGDISABLESHAPETEXTURES_ON _DEBUGVISUALISESHAPESAMPLE_ON _DEBUGVISUALISEFLOW_ON _DEBUGDISABLESMOOTHLOD_ON _COMPILESHADERWITHDEBUGINFO_ON UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30

And when I try to edit the shader (via the Edit... btn) I get The file is not found, maybe it's because of it's not compiled.

Yes, this is exactly the same issue as mine. Unity can't compile the Crest ocean and underwater shaders.

huwb commented 3 years ago

'Compilation failed (other error)' sounds like a compiler crash to me. Might be worth uploading it using the Bug Report feature in editor?

I'm not sure why the Edit.. button would work though. Even if i had create a compile error here, i can still edit the shader. Do you have the Ocean.shader file in your assets? If you click it does it say anything interesting in the inspector?

sayginkarahan commented 3 years ago

image

As you can see, I've got that shader and it has an error icon in the inspector.

daleeidd commented 3 years ago

All of the reported line numbers is CGPROGRAM so far which is bizarre. Are there more errors?

Both cases are with Windows 7. I am using Windows 10 which is fine.

All I could find online searching "Compilation failed (other error)": https://forum.unity.com/threads/build-crashes-when-shader-debuggers-attach.1054571/ (it's recent so perhaps more will show up).

Might be worth uploading it using the Bug Report feature in editor?

I agree that getting the ball rolling with Unity is a good idea. Anyone willing to submit a bug report?

fallguard commented 3 years ago

I have submitted a bug report. I hope this will give us some useful info or even a solution (but I'm not sure).

sayginkarahan commented 3 years ago

Hello, I downgraded my Unity Editor to 2019 LTSC from 2020. Thanks to this, it now works as expected.

zirik commented 3 years ago

I ran into the same issue with a project I develop on both Win 7 and Win 10 computers. The issue popped up on the Win 7 computer after moving to Unity 2021.1.0b6. The compiler crash theory is probably right since I see a bunch of hung(?) UnityShaderCompiler.exe processes in the task manager as well as UnityCrashHandler.exe processes even though the actual editor hasn't crashed.

Anyway, I started removing parts of the shader until the error disappeared and commenting out the following line seems to fix it for now: #pragma shader_feature _COMPILESHADERWITHDEBUGINFO_ON

huwb commented 3 years ago

Thanks for that report.

@fallguard thanks for doing the bug report. If you happen to get a bug link or such that we can all pile into and upvote, please let us know.

In the meantime if other people get it and read this, filing additional bug reports would not hurt..

fallguard commented 3 years ago

@huwb Okay, but I still did not get any response and I'm not really sure the support will respond on the report.

fallguard commented 3 years ago

@huwb Fortunately, I was wrong, the unity support answered me just in few hours later after I wrote the comment above =) They have confirmed the issue and provided the issue url: https://issuetracker.unity3d.com/issues/shader-fails-to-compile-when-using-windows-7

huwb commented 3 years ago

Lovely, thanks. I upvoted it!

daleeidd commented 3 years ago

Apparently this is now fixed (Unity versions in issue tracker link above). Can anyone confirm @fallguard @sayginkarahan?

fallguard commented 3 years ago

@daleeidd I just checked it with the 2020.3.4f1 version and I can confirm the bug is gone here.

daleeidd commented 3 years ago

Perfect. Thank you both for helping get this resolved. I'll close this but keep it pinned.