I just downloaded the latest 5.4 beta and copied a project over but I am getting errors on some of my shaders about _Object2World being undeclared. Have I missed something? I didn’t use the auto convert when loading up the scene as I want to find out what has changed in 5.4 so I can make changes in a previous version.
When opening the project your shader files should have had _Object2World replace with unity_ObjectToWorld automatically (we did some renaming internally, to better account for instancing & single-pass VR).
Are the files read-only by chance, or something?
I just copied the project folder to another directory, and loaded it with Unity 5.4 latest beta, I declined the option to update the project but then got the errors in my custom shaders, so no the files are not read only. The shaders themselves do not even contain the _Object2World so it is something Unity is including automatically into my shaders.
I had a similar issue. Try deleting the library folder and having it regenerate everything. In my particular case, I got it to occur by opening a 5.3.2 project in 5.4, but for my second attempt, I made a fresh checkout of my git repo (which does not include the library) and that worked just fine.
Looks like unity does this replacement on read-only files - could you guys make it so it checks out the files from version control when it makes this update?
I had the exact same problem since I updated to Unity 5.3.5 all the water prefabs from the Environment assets are pink, I fixed it by replacing back “unity_ObjectToWorld” with “_Object2World” on every shader.
Although I am pretty sure they were working on Unity 5.3.4
Thank you very much solved my problem on Unity 5.3.5f1
This doesnt solve. All water shader (water basic, water4) still had this error. I’am using 5.3.5p3
This impacts a lot of third-party assets; e.g. the Ceto water shader, Realistic Effects Pack, and several Flying Teapot FX.
It looks like it’s fixed in 5.4.0 (when it’s out of beta): Unity Issue Tracker - [Shaders] Some _Object2World references are not changed to unity_ObjectToWorld in 5.4