Phase 6 updates

Phase 6 · Slice 17 ·

Immediate drawing into render textures

  • GL, Graphics.DrawTexture and DrawMeshNow draw into RenderTexture.active (or SetRenderTarget's texture) when one is set: their triangles go to the native side as each call ends and replay in order with blits and copies, before the cameras; GL.Clear clears the texture. Camera-space GL maps through the camera's viewport onto the texture.
  • DrawTexture outside OnGUI goes through GL's matrices and shows the texture's top at the rect's yMin edge, as Unity does (upright with LoadPixelMatrix(0, w, h, 0)). GL shades as the SetPass material's shader does: Unlit/Color its color only, sprite-style shaders vertex colors too.
  • Built-in shaders 10750, 10751, 10752 and 10755 (Unlit/Transparent, Transparent Cutout, Texture, Color), identified by their properties in unity_builtin_extra.
  • TurboTrack2D now draws as designed: lamps and the car in its foreground texture, the road with its rumble strips and grass bands in its plane texture.
  • Next: ReadPixels from render textures; CompositeCollider2D; effector forces; Odin-serialized fields; UI Toolkit.