Closed AmanRaghu closed 1 month ago
I have somewhat related issue; just updated to newest Hair package, and cannot edit our hair shader (shader graph). My system freezes completely and I need to reboot (probably also swapchain issue).
PS: Just opening the HairVertex subgraph from hair package already produces same crash on my system.
I guess I found the issue: In HairSimComputeLOD.hlsl is a for and a while loop. I guess some variables are not initialized in shader graph preview, thus ending in an infinite loop. I had same issues multiple times in last weeks, I guess some safety mechanism for shader graph preview is either broken or never existed. You can work around by clamping _LODFrustumCount and/or _LODCount in the above mentioned file as a workaround.
Unfortunately this did not fix all issues, still having same system crash with my shader (which uses other stuff from hair package, too, unfortunately I cannot open it anymore to check....)
I finally managed to open shader graph (by manually closing all previews of all components in text editor). But issues with this version became even bigger, compilation of arbitrary .cs files (not from hair package!) in the project lead to system crash. I went back to a older version (0.12.0), which seems to work fine, all issues are gone.
Also ran into this crash with URP in Unity 6000.0.4f1 and hair 0.14.1-exp.1. In my case, it reproduces by creating a new shader graph and attempting to add a hair vertex node. It consistently produced a hard freeze requiring a PC restart.
Backdating to 0.12.0-exp.1 works.
Tried 0.13.0-exp.1, this also works. Issue has been introduced in either 0.14.0 or 0.14.1. And with 0.14.1 I got crashes of Windows in 2023.2.18 HDRP and Unity 6000.0.4f1 URP, just by opening shader graph or compiling any files of the project with the hair package being integrated.
I'm currently working on fixing this issue.
Please update to 0.14.2-exp.1 which should resolve this.
Unity is crashing when i try to create new material and using the hair vertext sub shader in it.