Unity-Technologies / com.unity.demoteam.hair

An integrated solution for authoring / importing / simulating / rendering strand-based hair in Unity.
Other
710 stars 96 forks source link

Unity is crashing #91

Closed AmanRaghu closed 1 month ago

AmanRaghu commented 1 month ago

Unity is crashing when i try to create new material and using the hair vertext sub shader in it. Capture

qlee01 commented 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).

qlee01 commented 1 month ago

PS: Just opening the HairVertex subgraph from hair package already produces same crash on my system.

qlee01 commented 1 month ago

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.

qlee01 commented 1 month ago

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....)

qlee01 commented 1 month ago

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.

camnewnham commented 1 month ago

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.

qlee01 commented 1 month ago

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.

fuglsang commented 1 month ago

I'm currently working on fixing this issue.

fuglsang commented 1 month ago

Please update to 0.14.2-exp.1 which should resolve this.