Skip to content

Shader interoperability

shader interoperabilityĀ¶

Since shaders work different on different platforms, we cant make 1 shader to rule them all.

but an asset could be assigned a shader-ID e.g. anime-1ā€ƒ, orā€ƒrealistic-4 then on requesting the asset, we get the tag and load the matching shader

this empowers game devs to customize the shaders. e.g. Anime shaders in their gameā€™s style.

you canā€™t load a shader just on itā€™s own. you always need to load it in a material.

what is a materialĀ¶

a combination of

  • shader
  • texture
  • parameters (e.g. specular strength, glow strength)
  • mesh input (e.g. mesh normals, mesh UV)

scenario 1Ā¶

  • realistic
  • stylized

Both approaches could use a PBR shader. But they require different texture input: realistic textures vs stylized textures.

scenario 2Ā¶

  • stylized
  • anime style

stylized uses a PBR shader, anime style needs a custom shader

but we might be able to reuse textures between both styles. or maybe we donā€™t want too.

platformsĀ¶

a shader might work in unity 2019 but not in unity 2022

maintaining a library of premade shaders could be a lot of work.

i suggest to keep it to a minimum and instead rely on devs using the tags to support their own shaders.