Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Deterministic Importers: What else will be supported?

Discussion in '2017.2 Beta' started by Grimreaper358, Jul 15, 2017.

  1. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    I was wondering if the new import system will support importing things like recognizing what type of texture it is important and set it to that.

    Example: Importing a albedo texture and a normal map. Will it be able to recognize and switch the texture type of the normal map from default to normal (Wouldn't have to hit "Fix Now" on normals) or recognize EXRs/HDRIs and set those to cubemaps?

    Maybe also switch normals from DirectX to OpenGL on import if someone forgot to set that correctly.

    Just wanted to know if that's something coming with the new import system or in the works.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    12,015
    I don't think that sounds like a great idea. Exr files don't have to be cubemaps, so why would Unity do weird assumptions about them?
     
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You can do this now with regular texture importers. For instance, if you decide that anything with _norm in the filename is a normal map, you can set the TextureImporter accordingly.

    But those types of standards should not be something that Unity enforces. I already fight with the "Fix it now" button in Unity, because it will pop those up if you assign a shaders default value to "bump". But there are cases where I want the default value to be "bump", but I don't want to actually have Unity set the type to Normal - mainly, when packing data in other channels of the normal map rather than using the G/A format Unity uses for normals.
     
  4. markvi

    markvi

    Joined:
    Oct 31, 2016
    Posts:
    118
    Exactly like jbooth and AcidArrow point out, we can't always make assumptions like that without breaking someone's workflow.

    I think you're looking for AssetPostprocessor.PreProcessTexture. You can implement whatever rules you like.