--- name: pbr-materials-tissue description: Author and tune PBR materials for the LaparoscopicSurgeryEmulation scene, focused on tissue / mucosa / cavity-wall / instrument surfaces. Use when creating, editing, or duplicating materials under Assets/Materials/LaparoscopicBenchmark/ or assigning them to renderers in the SurgeryBenchmark/ authored roots. --- # PBR Materials for Tissue (project-scoped) This skill constrains material work in this project to a small, deliberate set of tissue-like PBR patterns. The available material inventory is fixed (see below); the goal is to tune them, not multiply them. ## When to load Load when the agent is about to: - Create, edit, duplicate, or assign any `.mat` under `Assets/Materials/LaparoscopicBenchmark/` or `Assets/Materials/`. - Adjust shader properties on the URP/Lit, URP/SimpleLit, or the project's custom shaders (`Assets/Shaders/RenderDepth.shader`, `Assets/Shaders/BlendShader.compute` — the latter is a compute shader, not a material). - Assign materials to renderers inside the `SurgeryBenchmark/Shared/*Slot` anchors or any scenario root. - Diagnose "plastic-looking tissue", "mucosa too dry", "specular too harsh", or "normal map stretched" reports. ## Material inventory (do not duplicate blindly) | Material | Purpose | Tunable axes | |---|---|---| | `CavityWall.mat` | The moist wall of the cavity | roughness, normal scale, subsurface tint, specular tint | | `Tissue_Default.mat` | The "clean" tissue reference | roughness, normal scale, albedo tint, AO | | `Tissue_Wet.mat` | Wet specular variant for Scenario_02 | higher specular tint, lower roughness, slight clearcoat if URP/Lit | | `Tissue_LowTexture.mat` | Low-texture variant for Scenario_03 | uniform albedo, minimal normal, low contrast | | `InstrumentProxy.mat` | The instrument placeholder | metalness 1.0, low roughness, neutral albedo | Scenario roots should reference one of these materials — do **not** create per-scenario material instances unless the change is bounded and reported. If a new variant is needed, add it to `LaparoscopicBenchmark/` with a name that ends in the scenario tag, e.g., `Tissue_Wet_S04.mat`. ## Available textures - `Assets/Textures/LaparoscopicBenchmark/TissueMucosa.png` — the canonical mucosa PBR base map. Verify its import settings before assigning: - Texture Type: Default (or Albedo if no separate normal/roughness is bundled). - sRGB: **on** (it is colour data). - Alpha Source: None (unless a specific transparency case is approved). - Max Size: 1024 (or 2048 for hero work; do not exceed 2048 without a performance budget review). - Compression: High-quality BC7 / ASTC. Avoid DXT5 with alpha for opaque mucosa. - `Assets/Models/FabOrgans/StylizedDigestiveSystem_{Diffuse,Normal,Roughness}.png` — the stylized organ set; usable for the `AnatomySlot` placeholder if needed. - `Assets/Models/organs/textures/` and `Assets/Models/organs/archive.fbm/` — packed with `archive.fbx`. Do not move files out of `Assets/Models/organs/` — the FBX references them by relative path. ## URP/Lit PBR cheat sheet (defaults for tissue) - **Shader**: `Universal Render Pipeline/Lit` (or `Universal Render Pipeline/Simple Lit` only as a performance fallback — never as the default for tissue). - **Surface Type**: Opaque. Use Transparent only with explicit approval, and never for mucosa. - **Workflow**: Metallic (this project is metallic workflow). - **Render Face**: Front (tissue is single-sided). - **Double Sided**: off by default; enable only on the cavity wall if it is a thin sheet viewed from inside. | Property | Tissue_Default | Tissue_Wet | Tissue_LowTexture | CavityWall | InstrumentProxy | |---|---|---|---|---|---| | Base color | warm pink-red `#B66A6A` ish | warm pink-red | uniform pink-red | deep red `#7A2A2A` ish | neutral metal `#C8C8C8` | | Metallic | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | | Smoothness | 0.35 | 0.55 | 0.20 | 0.40 | 0.85 | | Normal Map | `TissueMucosa` normal (or the FabOrgans normal) | same | none / flat | cavity bump from `TissueMucosa` normal at low scale | none / flat | | Normal Scale | 0.5–1.0 | 0.5–1.0 | n/a | 0.3–0.7 | n/a | | Occlusion | AO from texture (or 1.0 flat) | 1.0 | 1.0 | AO from texture | 1.0 | | Emission | off | off | off | off | off | | Specular (workflow override) | leave default | leave default | leave default | leave default | n/a (metallic) | Treat the colour values as **starting points** to be confirmed by screenshot, not as final. The cavity is small and HDR-lit; hex picks rarely match what the eye sees. ## Subsurface / translucency URP/Lit does not have a first-class subsurface-scattering slot in 14.0.11. To get a mucosal feel: - Keep `Smoothness` low enough (≤ 0.4) that the BRDF does not look like enamel. - Drive the cavity / tissue color slightly redder than the reference photo; URP tone-mapping pulls warmth out. - If translucency is required for backlit tissue (e.g., a thin membrane), use a `Translucent` Lit shader if the project has one, or a custom URP shader. Adding a new shader is a bounded change — state it in the handoff before writing the `.shader` file. ## Roughness and specular realism - Wet tissue in a laparoscope: `Smoothness` 0.5–0.6, `Normal Scale` 0.3–0.6, no `Clearcoat`. - Dry / low-texture: `Smoothness` 0.15–0.25, no normal. - Instrument proxy (steel): `Metallic` 1.0, `Smoothness` 0.7–0.9, slightly tinted toward warm grey to avoid chrome-looking plastic. The "plastic" failure mode is almost always: 1. `Smoothness` too high (> 0.7) on tissue, or 2. Normal map stretched because UV scale does not match the mesh, or 3. `Specular` workflow left in default Metallic workflow but the colour was hand-tweaked to look right in the editor, breaking under tone-mapping. ## UV scale and stretching When a tissue-like material is applied to a primitive (Cube, Sphere, Cylinder, Quad), the default UVs produce obvious stretching. Mitigations: - Use the same material on a mesh that has clean UVs (the FabOrgans or archive FBX meshes). - For primitives, scale the UVs in the import settings of the mesh (read-only) or place a small tiling texture and adjust the material's `Tiling` (`.x`, `.y`) instead of stretching the UVs. - A stretching texture is a **visible failure**, not a stylistic choice — fix it before reporting done. ## Common operations and the right MCP call | Intent | MCP call | Notes | |---|---|---| | Read current material | `manage_material(action="get_material_info", material_path="Assets/Materials/LaparoscopicBenchmark/Tissue_Default.mat")` | Always re-read before editing | | Set a single property | `manage_material(action="set_material_shader_property", material_path="...", property="_Smoothness", value=0.4)` | Property name is the shader's serialized name; for URP/Lit use `_Smoothness`, `_BaseColor`, `_BumpScale`, `_Metallic` | | Set a colour | `manage_material(action="set_material_color", material_path="...", property="_BaseColor", color=[0.71, 0.42, 0.42, 1.0])` | Linear vs gamma: URP expects linear when colour space is Linear; pass sRGB-ish values and let the conversion happen if the project is Linear | | Create a new variant | `manage_material(action="create", material_path="Assets/Materials/LaparoscopicBenchmark/Tissue_Wet_S04.mat", shader="Universal Render Pipeline/Lit")` | Then set properties; do not assign to a renderer until verified | | Assign to a renderer | `manage_material(action="assign_material_to_renderer", material_path="...", target="Tissue_S04_00", search_method="by_name", slot=0)` | Always re-read after assigning | | Tint a renderer in-scene without changing the asset | `manage_material(action="set_renderer_color", target="...", color=[...], mode="property_block")` | Property block is reversible and does not duplicate the asset | ## Reversibility checklist 1. Did you read the material's current state before editing? If no, do that first. 2. Did you change the shared asset (`Tissue_Default.mat` etc.) rather than create a per-instance override? Document the choice in the handoff. 3. Will any scenario that currently uses this material be affected? If yes, list the affected scenarios in the handoff. 4. Is the change expressed as a single property tweak, or a coordinated multi-property tweak? Coordinated is fine, but state the target look in one sentence. 5. After the change, does the screenshot show a believable tissue surface, or does it look like plastic / wax / enamel? If plastic, lower `Smoothness` first; do not increase emission. ## Anti-patterns to refuse - Creating per-scenario `.mat` files for every minor variation — tune the existing five. - Setting `Metallic > 0` on tissue or cavity wall. Tissue is not metal. - Setting `Emission > 0` on tissue. If a region "needs to glow", it is probably a lighting problem, not a material problem. - Using `Standard` shader (Built-in pipeline) on URP — pink materials are a URP/Built-in mismatch symptom. - Stretching UVs by scaling the GameObject instead of adjusting material tiling. - Generating textures procedurally inside the project (no procedural assets without approval). - Renaming any of the existing `Tissue_*.mat`, `CavityWall.mat`, `InstrumentProxy.mat` — the names are part of the contract referenced by `LaparoscopicSurgeryEmulation.md`.