Phase 2 updates

Phase 2 · Slice 1 ·

3D basics

  • Renderer (tassix_render, wgpu 30): reverse-Z depth, left-handed view, clockwise front faces, draws sorted by mesh and instanced (one draw call per mesh), lit shader with one directional light plus ambient, sRGB output, offscreen targets with PNG readback. Multiple cameras by depth with Unity's clear flags.
  • Scripting API: Camera (projection, view matrix, world/viewport/screen conversions and rays, matched against Unity to 1e-5, 1e-4 for orthographic), Light, Mesh (vertices/normals/uv/triangles, bounds, RecalculateNormals), MeshFilter/MeshRenderer with mesh/material instancing as in Unity, Material/Shader.Find, GameObject.CreatePrimitive with meshes generated to Unity's layouts (vertex counts, first vertices, winding and sums verified by the rendering_data scenario), data-only colliders, Screen.
  • Native side: managed components push compact camera/light/renderer records; each frame extracts draw items, views and lighting, and uploads only changed meshes. The simulation stays at 0 allocations per frame; rendering adds ~110, almost all inside wgpu (encoders, bind groups), to be pooled.
  • Player: windowed rendering (vsync or --no-vsync), --scene + --scripts, and --screenshot for headless renders.
  • MCP: view_screenshot returns a PNG through the scene's cameras, a framing view when there are none, or a free camera (position, look_at, fov). cargo xtask mcp installs a snapshot so development builds don't collide with a running server.
  • Progress (2026-10-25), slice 2, textures and 2D:
  • Renderer: RGBA8 textures (sRGB or linear) with CPU-built mip chains and samplers for Unity's filter and wrap modes; surfaces lit or unlit, opaque, alpha-cutout or alpha-blended, one- or two-sided, with _MainTex_ST tiling. Opaque items (queue <= 2500) draw first, batched by pipeline, texture and mesh; transparent ones draw per view by sorting layer, order in layer, queue, then distance (view depth for orthographic cameras), as Unity does.
  • Scripting API: Texture2D (pixels, GetPixelBilinear, wrap modes, RGBA32 quantization, mip counts, Apply, built-in white/black textures), ImageConversion.LoadImage (PNG, JPEG)/EncodeToPNG, Sprite.Create (rect, pivot, pixels per unit, bounds, vertices, UVs, triangles), SpriteRenderer (color, flip, sorting order, bounds), SortingLayer (Default only), and a built-in shader table (Standard, Legacy, Unlit, Sprites/Default, UI/Default, URP Lit/Unlit/2D) with Unity's render queues and properties; Shader.Find returns null for unknown names, _Mode/_Surface switch Standard and URP to cutout or transparent. The rendering_2d scenario (156 checks, recorded in Unity) passes.
  • Scenes and MCP: textures, sprites and materials described inline in scenes; dotnet/samples/scenes/platformer2d.json: a level built from text rows by TileMapBuilder with sprites cut from an atlas, SpriteAnimator frame animation, a procedural GlowSprite, and patrolling and bobbing characters, using Kenney's CC0 Pixel Platformer art.