Obi Official Forum
Bug / Crash iOS shader error - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Bug / Crash iOS shader error (/thread-534.html)



iOS shader error - rectalogic - 15-04-2018

In Unity 2017.3.1f1 ObiCloth 3.4, when I build for iOS the build fails with:

Error building Player: Shader error in 'Obi/Particles': '' :  non-square matrices not supported (3x1) at Assets/Obi/Resources/ObiMaterials/ObiEllipsoids.cginc(83) (on gles)

Compiling Vertex program with DIRECTIONAL LIGHTPROBE_SH
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING


RE: iOS shader error - josemendez - 15-04-2018

(15-04-2018, 07:59 PM)rectalogic Wrote: In Unity 2017.3.1f1 ObiCloth 3.4, when I build for iOS the build fails with:

Error building Player: Shader error in 'Obi/Particles': '' :  non-square matrices not supported (3x1) at Assets/Obi/Resources/ObiMaterials/ObiEllipsoids.cginc(83) (on gles)

Compiling Vertex program with DIRECTIONAL LIGHTPROBE_SH
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING

Hi Rectalogic,

Known issue with the gles compiler, it doesn't seem to be able to figure out the types involved in the expression. Simply make the cast explicit so that it does not get confused by it: (ObiEllipsoids.cginc, line 83 & 84)

Code:
a2 = mul((float3x3)UNITY_MATRIX_V,mul(IP,mul(IP,WorldEye(worldPos) - center))); //T^-2 * (eye - center)
a3 = mul((float3x3)UNITY_MATRIX_V,mul(IP,mul(IP,view)));                         //T^-2 * A[0]

(that its, add the (float3x3) cast to UNITY_MATRIX_V).

cheers,