Info for ShaderHackers: Unity 5.3 breakages
tonka reported that my extraction scripts were not working properly on Dungeon Kingdom, which uses Unity 5.3 - they were extracting bare bones headers and not the shaders themselves. Upon investigation, I have found that Unity 5.3 has made several changes to how shaders are stored: - The unity specific headers are stripped down to a bare minimum to identify which version of DX/OpenGL the shader is for - DX9 shaders are stored as bytecode instead of assembly - Shaders are stored in a different part of the asset files - Shaders no longer have their reflection information stripped, so you get headers within the shader without needing my extraction scripts to add them - All shaders will have new CRCs (UseAlternateCRC=true may return to the old CRCs, at least for pixel shaders) My extraction scripts will need updates to cope with the new formats, though since the shaders are no longer stripped it is now possible to use the shaders dumped from Helix Mod instead. I have updated the patterns in shadertool.py to work with the MS style headers so all the Unity autofixes will work again, but the MS headers don't contain as much information as the Unity headers, so at least for now the following things will not work: --fix-unity-reflection will not add sections to copy the transformation matrices (as it has no way to determine which shaders are safe to use and which are SHADOWCASTERS with bogus matrices) --fix-unity-lighting-ps-world will not add sections to copy the depth buffer for use in an auto HUD adjustment, as it has no way to determine which shaders are safe to use and which are directional with bogus _ZBufferParams. As such, for now I do not recommend attempting to use the DX9-New template, as it heavily depends on the transformation matrices. The old template can be used, but shadertool will need to be run manually on the shaders extracted with Helix Mod until I have updated the extraction scripts. If you are updating a fix for a game that has migrated to Unity 5.3, consider trying UseAlternateCRC=true as it should use the old CRCs, however this may only work for pixel shaders (needs testing to confirm).
tonka reported that my extraction scripts were not working properly on Dungeon Kingdom, which uses Unity 5.3 - they were extracting bare bones headers and not the shaders themselves.

Upon investigation, I have found that Unity 5.3 has made several changes to how shaders are stored:

- The unity specific headers are stripped down to a bare minimum to identify which version of DX/OpenGL the shader is for

- DX9 shaders are stored as bytecode instead of assembly

- Shaders are stored in a different part of the asset files

- Shaders no longer have their reflection information stripped, so you get headers within the shader without needing my extraction scripts to add them

- All shaders will have new CRCs (UseAlternateCRC=true may return to the old CRCs, at least for pixel shaders)

My extraction scripts will need updates to cope with the new formats, though since the shaders are no longer stripped it is now possible to use the shaders dumped from Helix Mod instead. I have updated the patterns in shadertool.py to work with the MS style headers so all the Unity autofixes will work again, but the MS headers don't contain as much information as the Unity headers, so at least for now the following things will not work:

--fix-unity-reflection will not add sections to copy the transformation matrices (as it has no way to determine which shaders are safe to use and which are SHADOWCASTERS with bogus matrices)

--fix-unity-lighting-ps-world will not add sections to copy the depth buffer for use in an auto HUD adjustment, as it has no way to determine which shaders are safe to use and which are directional with bogus _ZBufferParams.


As such, for now I do not recommend attempting to use the DX9-New template, as it heavily depends on the transformation matrices. The old template can be used, but shadertool will need to be run manually on the shaders extracted with Helix Mod until I have updated the extraction scripts.

If you are updating a fix for a game that has migrated to Unity 5.3, consider trying UseAlternateCRC=true as it should use the old CRCs, however this may only work for pixel shaders (needs testing to confirm).

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#1
Posted 01/18/2016 04:01 AM   
Scroll To Top