Search Unity

_Object2World undeclared?

Discussion in '5.4 Beta' started by SpookyCat, Feb 10, 2016.

  1. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,044
    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.
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,534
    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?
     
  3. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,044
    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.
     
  4. rmuk

    rmuk

    Joined:
    Feb 18, 2015
    Posts:
    34
    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.
     
  5. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    6
    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?
     
  6. Hattoriseed

    Hattoriseed

    Joined:
    Feb 24, 2015
    Posts:
    23
    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
     
    Last edited: Jun 4, 2016
    JoshBrodieNZ likes this.
  7. mikek400

    mikek400

    Joined:
    Jul 1, 2013
    Posts:
    1
    Thank you very much solved my problem on Unity 5.3.5f1
     
  8. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    78
    This doesnt solve. All water shader (water basic, water4) still had this error. I'am using 5.3.5p3
     
    anorse likes this.
  9. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    338