public sealed class AssetMaterialSourceThe material a scene's references name, loaded, compiled and painted.
Remarks
The join that made MeshRenderable.Material mean something. Every piece either side of it was finished — the importer compiles a .vxmat into a MaterialContent, the manager loads and shares the chunk, MaterialCompiler turns a descriptor into a Material, and MaterialRenderFeature resolves that to an effect — and nothing put them in a line, so every object in a scene was drawn with the one material a host had assigned by hand.
One material per reference, kept and shared. Two entities naming one material get one object, and therefore one descriptor set, one uniform block and one variant — which is the whole economy MaterialRenderFeature is built on. Compiling per entity would be correct and would multiply the frame's per-material work by the instance count.
Textures do not hold the material up. A material is answered as soon as it compiles, with its texture parameters unset; Update fills them in as they land, and MaterialRenderFeature.Index notices — it compares the view it holds against the one the material carries, so a texture that appears later costs one re-index and nothing else. Until then the index stays zero, which is the table's fallback and a defined thing to sample. Waiting instead would hold a whole level's geometry off screen for its slowest texture.
Fields and properties (7)
public AssetTextureSource? TexturesWhere the textures a material assigns come from.
public IReadOnlyDictionary<string, string>? SlotsSlot fillers the project decides rather than the material, by their qualified names.
public ParameterCollection? PermutationsPermutation values the project decides rather than the material, applied to every one it compiles.
public int RequestedHow many distinct materials have been asked for.
public int LoadedHow many have compiled.
public int FailedHow many will not arrive.
public int UnpaintedHow many texture assignments are still waiting for their pixels.
Methods (4)
public AssetMaterialSource(AssetManager assets, AssetTextureSource? textures = null)Builds a source over a content manager.
public bool TryGet(AssetReference reference, out Material material)The material a reference names, if it is ready yet.
public void Update(ICommandList commands)Puts the frame's texture work on a list, and paints what has landed.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (4)
- ArenaThirdPersonShooter
- AssetMaterialSourceTestsVixen.Engine.Renderer.Tests
- AssetTextureSourceTestsVixen.Engine.Renderer.Tests
- WorldRendererVixen.Engine.Renderer