Garment explodes on Android, but not in editor (also some ParticleShader errors) - CptnFabulous - 28-10-2024
I upgraded to Obi Cloth 7.0.3, from 6.5.4. I'm using Unity 2021.3.3f1.
After fixing some compile errors (and deleting and reinstalling the entire package to prevent compile errors from improper importation), the fabric simulation is far more performant. But while the fabric simulates the same as before in the editor, when I built and tested on Android, the created garments would ‘explode’ and burst away from the mannequin at a high velocity.
I know this kind of glitch is common with fabric simulations, but I’m not sure how the differing platforms could cause this error, so I don’t want to make changes to the many existing settings.
It’s possible that this is an ‘editor vs. build’ thing, rather than a ‘Windows vs. mobile’ thing. I tried making a Windows build to test, and it initially failed due to some shader errors in Shader Graphs/ParticleShader, but after deleting the whole package and reimporting it, it built successfully to Windows (where the fabric didn't glitch out). However, this now meant that the compiling failed when trying to build to Android, with the same ParticleShader errors (plus one more). I'll list them here:
Code: Shader error in 'Shader Graphs/ParticleShader': invalid subscript 'sh' at line 8032 (on gles3)
Compiling Subshader: 2, Pass: BuiltIn Forward, Vertex program with DIRECTIONAL LIGHTMAP_ON LIGHTPROBE_SH SHADOWS_SCREEN VERTEXLIGHT_ON _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS_CASCADE
Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_LIGHTMAP_RGBM_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_FORWARDBASE UNITY_PBS_USE_BRDF3
Disabled keywords: DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_SHADOW_MIXING SHADOWS_SHADOWMASK UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHT_SHADOWS _ADDITIONAL_OFF _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
Code: Shader error in 'Shader Graphs/ParticleShader': invalid subscript 'sh' at line 9185 (on gles3)
Compiling Subshader: 2, Pass: BuiltIn Deferred, Vertex program with LIGHTMAP_ON LIGHTPROBE_SH UNITY_HDR_ON _MAIN_LIGHT_SHADOWS
Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_LIGHTMAP_RGBM_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_DEFERRED UNITY_PBS_USE_BRDF3
Disabled keywords: DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON LIGHTMAP_SHADOW_MIXING SHADOWS_SHADOWMASK UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING _GBUFFER_NORMALS_OCT _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _MIXED_LIGHTING_SUBTRACTIVE _SHADOWS_SOFT
This third one is the one that only appeared when trying to build to Android.
Code: Shader error in 'Shader Graphs/ParticleShader': undeclared identifier 'UNITY_DISPLAY_ORIENTATION_PRETRANSFORM' at Files/Unity/Hub/Editor/2021.3.3f1/Editor/Data/CGIncludes/UnityCG.cginc(817) (on vulkan)
Compiling Subshader: 2, Pass: BuiltIn Forward, Vertex program with DIRECTIONAL LIGHTMAP_ON LIGHTPROBE_SH _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS_CASCADE
Platform defines: SHADER_API_MOBILE UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_FORWARDBASE UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION
Disabled keywords: DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SCREEN SHADOWS_SHADOWMASK UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING VERTEXLIGHT_ON _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHT_SHADOWS _ADDITIONAL_OFF _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _SCREEN_SPACE_OCCLUSION _SHADOWS_SOFT
One additional error: when I stop play mode while the cloth simulation is active, the editor crashes. To work around this, I have to instead pause, wait a few minutes, then end play mode.
What issues could be causing all of this? I've done a heap of testing, but I wanted to post my experiences here in case there's a really obvious thing I've missed.
EDIT: I also created a blank project (in the same editor version) and installed the same version of Obi Cloth, and it built to both Windows and Android fine.
|