public record class TexturedOcclusionFeatureBaked ambient occlusion from a map, on its own.
Remarks
What TexturedOrmFeature could not be. That feature carries occlusion, roughness and metalness together because it reads all three out of one packed file — and the packing is exactly why a layered material had no baked occlusion at all. A TexturedMaterialLayersFeature has already blended per-layer roughness and metalness and split the diffuse itself, so composing the packed feature behind it writes the author's per-layer answer over with a flattened one and splits the albedo twice. The packed feature has to be dropped there, and until this existed the occlusion went with it. See #1130.
⚠ It reads the map's red channel, which is TexturedOpacityFeature's decision for the same reason: an occlusion map is one channel — BC4, R8, or the R of a packed ORM file, which is the one a bake actually writes — and a one-channel texture samples alpha as 1, so reading .a would make every AO map fully unoccluded. That is a map that arrived and did nothing, which is the failure this library spends its fallback checker on making visible.
Multiplied into whatever occlusion is already there rather than assigned, on OcclusionFeature's argument: a baked map and a screen-space term compose without either knowing about the other. It is therefore not a base workflow and has no opinion about anything the surface before it decided — which is what lets it sit behind a layered surface where the packed one cannot.
Same conditions as every other sampling feature: a name rather than a handle, a device with HasBindless, and a host that paired the name through MaterialRenderFeature.TextureIndices.
Fields and properties (3)
public string OcclusionMapWhat the material calls the occlusion map it wants sampled.
public float OcclusionStrengthHow much of the map is applied, 0 for none and 1 for the map exactly.
public string ShaderNameThe Raven shader implementing this feature, from Raven/Library/Material.
Methods (2)
public static string OcclusionIndexParameter(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 (7)
- MaterialCompilerTestsVixen.Rendering.Tests
- TexturedMaterialTestsVixen.Rendering.Tests
- TypeRegistrationVixen.Rendering
- Vixen_Rendering_Materials_TexturedOcclusionFeatureSerializerVixen.Rendering
- WorldRendererVixen.Engine.Renderer
- MaterialBakeVixen.Editor.Assets
- MaterialBakeTestsVixen.Editor.Assets.Tests