Search Unity

Feedback The .shadergraph serialized format is pretty bad

Discussion in 'Shader Graph' started by Awarisu, Jan 31, 2020.

  1. Awarisu

    Awarisu

    Joined:
    May 6, 2019
    Posts:
    215
    It's a bunch of JSONs within JSONs, full of pretty-printed strings(!!!) with sequences like "\n " (<<< edit: the forum destroys the long run of spaces within this string, imagine some serious indents there) and triple backslashes, all on massively-long single lines that don't really lend themselves to version control nicely. Just at a glance it screams "shoehorned", and that not much thought was put into it beyond "yeah whatever this serializes". Why bother with JSON and not go down a more efficient binary route then?

    Unity already has a solid history of serializing things into YAML, plenty of tooling support, years of testing by virtually everyone, version control friendly, etc., why depart this strongly (to not just JSON but two layers of it when JSON perfectly supports having an arbitrary object as your value)? These are the kind of file formats you sometimes see featured on The Daily WTF.
     
    Last edited: Feb 1, 2020