When the material's entry for a pass, or the pass's own descriptor, sets shaderDescriptor, as
an outline or the shadow pass does, the pass takes each field from the first that is set:
shaderDescriptor: the material's entry, then the pass's own.
state: the material's entry, the pass's own, then material.state.
topology: the material's entry, the pass's own, material.topology, then the geometry's.
That shader can't read the material's values or textures. Otherwise a material's main pass
(opaque, transparent, transmission or blended refraction) draws with the material's shader, from
BaseMaterial3D#getPrimaryDescriptor, and skips the pass's own entry: state comes from
the material's entry, then material.state, and topology from the material's entry,
material.topology, then the geometry's.
Meshes resolve these values when they build their draw data, so giving a field a new value after
a render isn't supported: clone the material with the new entry
and assign the copy. A changed field of a state
object reaches the meshes after Mesh3D#invalidate on each one.
Pass overrides as the engine stores them: PassDescriptorOptions with the shader always a ShaderDescriptor
When the material's entry for a pass, or the pass's own descriptor, sets
shaderDescriptor, as an outline or the shadow pass does, the pass takes each field from the first that is set:shaderDescriptor: the material's entry, then the pass's own.state: the material's entry, the pass's own, thenmaterial.state.topology: the material's entry, the pass's own,material.topology, then the geometry's.That shader can't read the material's values or textures. Otherwise a material's main pass (opaque, transparent, transmission or blended refraction) draws with the material's shader, from BaseMaterial3D#getPrimaryDescriptor, and skips the pass's own entry:
statecomes from the material's entry, thenmaterial.state, andtopologyfrom the material's entry,material.topology, then the geometry's.Meshes resolve these values when they build their draw data, so giving a field a new value after a render isn't supported: clone the material with the new entry and assign the copy. A changed field of a
stateobject reaches the meshes after Mesh3D#invalidate on each one.Example