Hi,
I can’t count how many times I’ve ran into issues caused by the fact that Texture Samplers in materials require some sort of default texture assets:
-
Many times, inexperienced artists try to compile their shaders and get the “[SM6] (Node TextureSampleParameter2D) Param2D> Found NULL, requires Texture2D” error. Usually, since they are inexperienced, the will just look around the project and grab any first texture that comes under their hand that matches the selected sampler type. This then creates often confusing and hard to untangle cobwebs of references when they migrate their assets into another project.
-
When using Convert to Virtual Texture batch tool, materials often tend to reference the default texture from the Engine content directory. Convert to Virtual Texture batch tool disregards this, and often just switches even textures in the Engine folder to VT. Since these textures are often used for essential built in editor features, this can lead to corruption of other projects which have virtual texturing disabled, since they all reference the same assets from the Engine directory.
-
Pretty much every 3rd party content creator, even Megascans, need to add bloat to their project in form of placeholder textures to satisfy the requirement for a default texture:
So here’s a wild proposal:
Materials should compile even when the Texture2D asset field is empty. If that is the case, the engine should use implicit, generated placeholder data for the texture based on the sampler type. Just pitch black for most of the sampler types except perhaps Normal sampler types, where it would be the default Z up vector (blue).
It would not even have to be a texture buffer. Literally just a single constant color value. So even if it was generated and stored in the memory on the fly, it would just take couple of bytes of memory at most.
This would save us so many headaches