Vixen
02b45cc4
csharp
public record class TexturedMetalRoughnessFeature

The metalness/roughness workflow with a base-colour map.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The first material feature that samples a texture, which doc 06 records as a gap for as long as a feature had no way to name one: sampling needs a binding index only the compiled shader knows, and a feature is composed into a shader it has never seen.

It carries no texture handle. What it carries is a name — the parameter the host writes a table slot into — and the texture itself is assigned on the material, paired to that name through MaterialRenderFeature.TextureIndices. That indirection is the whole of what "materials are values, not resources" means here: this record is data that serialises, and nothing in it is a handle to something on a device.

Needs a device with HasBindless and a host that gave the material feature a BindlessTable. Without one the index stays zero and every material samples the table's fallback, so a project targeting GL or WebGL2 uses MetalRoughnessFeature and tints instead — which is the same fork ADR-011 makes everywhere else.

Fields and properties (5)

  • public Vector3 BaseColor

    Multiplied into the map, so a shared map can be tinted per material.

  • public float Metalness

    How much of a conductor this is, 0..1.

  • public float Roughness

    Perceptual roughness, as authored.

  • public string BaseColorMap

    What the material calls the base-colour map it wants sampled.

  • public string ShaderName

    The Raven shader implementing this feature, from Raven/Library/Material.

Methods (2)

  • public static string BaseColorIndexParameter(string path)

    What the shader calls the slot, under a composition path.

  • public void Compile(MaterialCompilationContext context)

    Writes this feature's parameters, and fills any slots of its own.

Used by (9)

  • AssetMaterialSourceTestsVixen.Engine.Renderer.Tests
  • AssetTextureSourceTestsVixen.Engine.Renderer.Tests
  • MaterialSurfaceVixen.Rendering
  • MaterialSurfaceTestsVixen.Rendering.Tests
  • TexturedMaterialTestsVixen.Rendering.Tests
  • TypeRegistrationVixen.Rendering
  • Vixen_Rendering_Materials_TexturedMetalRoughnessFeatureSerializerVixen.Rendering
  • WorldRendererVixen.Engine.Renderer
  • WorldRendererTestsVixen.Engine.Renderer.Tests