2.4 KiB
code, scope, severity, title
| code | scope | severity | title |
|---|---|---|---|
| MAT004 | asset | error | A material, shader domain or texture reference is incompatible with its consumer. |
A material's shader domain, schema or texture bindings cannot be used by its consumer.
Fix. Follow the reported asset and full cause to repair the incompatible assignment or dependency, keeping the intended shader domain and stable references.
Identify the incompatible assignment
Read the reason after the code. MAT004 is used for a shader-domain mismatch, a missing shader schema or material reference, and unresolved or incompatible texture bindings. Some unresolved references are warnings and are retained; the code alone does not determine whether a file was lost.
Select the Console or Problems entry. Find its asset path or AssetID, then inspect the material's shader and its actual consumer. In a nested SHD009, keep the outer driver error and the inner MAT004 reason: they describe different levels of the failure.
| Reason in the message | Correction |
|---|---|
postfx shader cannot draw sprite geometry |
Use that material in a camera Post Process Custom effect. Choose a sprite-compatible material for SpriteRenderer; retain the postfx shader's purpose. |
| A shader domain changed or the consumer needs another domain | Check the shader selected by the material and the consuming component. Restore the intended compatible assignment. |
| Shader schema or material asset is unavailable | Follow the referenced AssetID to its source and current import error. Repair that dependency rather than replacing IDs arbitrarily. |
| A texture cannot be resolved | Locate its .meta and source, check the referenced subasset and its current import result. A retained reference is not a successful load. |
| Normal/emission/region semantics are incompatible | Assign a texture imported for that surface role and matching region semantics. Normal data must be linear and not premultiplied; emission must use the supported RGB or mask role. |
Verify the fix
Save the corrected source or assignment, import the affected dependency if needed, and inspect the same consumer during Play. Check that the intended sprite, normal, emission or camera effect appears and that the full cause no longer occurs. Keep unrelated materials and AssetIDs unchanged. See Materials and shaders and camera post-processing.