Phase 5 updates

Phase 5 · Slice 10 ·

PBR maps and RenderSettings

  • Material maps:
    • normal maps (with _BumpScale / glTF's scale), in a tangent frame computed per mesh on upload with Unity's handedness;
    • metallic maps (Standard's and URP's R metallic, A smoothness times the scale; glTF's B metallic, G roughness times the factors);
    • occlusion (Standard's G with _OcclusionStrength; glTF's R with its strength) darkening ambient light and reflections;
    • emission maps multiplying the emission color.
  • Maps apply behind Unity's keywords (_NORMALMAP, _METALLICGLOSSMAP, URP's _METALLICSPECGLOSSMAP and _OCCLUSIONMAP, _EMISSION). .mat files now import their keywords.
  • glTF imports every map with glTFast's factors and keywords, color images in sRGB and the others linear, embedded and linear images without mipmaps (as glTFast does).
  • Texture .meta files: normal maps and sRGB-off textures load linear, and Texture.isDataSRGB reports it.
  • RenderSettings:
    • each scene has its own (Unity's defaults for a new one); loading a .unity scene brings its RenderSettings and sun;
    • making another scene active switches to its settings; without a sun, sun is the brightest directional light;
    • JSON scenes take a "renderSettings" object, which the Unity round trip uses.
  • The renderer lights from the trilight ambient (or flat, or the skybox stand-in times the intensity), scales reflections by reflectionIntensity, and applies linear, exponential and squared fog by view depth. Sprite and UI shaders skip the fog.
  • MCP inline materials take "textures" (maps turn their keywords on), "colors" and "keywords"; textures take "linear".
  • The conformance project now uses Linear color space, as Tassix renders.
  • Conformance:
    • a new render_settings scenario records defaults, script changes, a Unity scene's settings and switching the active scene;
    • gltf_import gained a generated model with every map (conformance/assets/make_pbr_maps.py);
    • 36 scenarios pass in both runs.
  • GPU tests cover normal, metallic and occlusion maps in both channel layouts, trilight ambient and fog. MCP e2e tests cover fog and ambient from a script, and an inline emission map.
  • Not yet: the MCP editor keeping a scene's RenderSettings, so playing a .unity scene from MCP uses the defaults; skyboxes and reflection probes; detail and height maps; Mesh.tangents.
  • Next: the MCP editor's RenderSettings, then skyboxes (procedural and cubemap) as backgrounds and ambient.