Search code examples
unity-game-enginethree.jstexturesbabylonjs

Why in 3D game we need to separate a material into so many textures for a static object?


Perhaps the question is not that correct, the textures should be say a kind of channel? although I know they will be mixed in the shader finally.

I know the knowledge of the various textures is very important, but also a bit hard to understand completely.

From my understanding:

  1. diffuse - the 'real' color of an object without light involved.
  2. light - for static objects. render light effections into texture beforehand.
  3. specular - the area where has direct reflection.
  4. ao - to absorb indirect light for the different area of an object.
  5. alpha - to 'shape' the object.
  6. emissive - self illuminance.
  7. normal - pixel normal vector to deal with the light ray.
  8. bump - (dont' know the exact differences between normalmap).
  9. height - stores Z range values, to generate terrain, modify vertex etc.

And the items below should be related to PBR material which I'm not familiar with:

  • translucency / cavity / metalness / roughness etc...

Please correct me if some misunderstandings there. But whatever, my question is why we need to separate these textures apart for a material but not only render them together into the diffusemap directly for a static object?

It'll be appreciated if some examples (especially for PBR) , and thank you very much.


Solution

  • I can beforehand bake all things into the diffuse map and apply to my mesh, why I need to apply so many different textures?

    Re-usability:

    Most games re-use textures to reduce the size of the game. You can't if you combine them together. For example, when you two similar objects but you want to randomize the looks of them(aging effect), you can make them share the-same color(albedo) map but use different ao map. This becomes important when there hundreds of objects, you can use different combination of texture maps on similar objects to create unique Objects. If you have combined this into one, it would be impossible to share it with other similar objects but you to slightly make to look different.

    Customize-able:

    If you separate them, you'll be able to change the amount of effect each texture will apply to the Object. For example, the slider on the metallic slot for the Standard shader. There are more of this sliders on other map slots but they only appear once you plug a texture into the slot. You can't do this when you combine the textures into one.

    Shader:

    The standard shader can't do this so you have to learn how to write shader since you can't use one image to get the effects you would with all those texture maps with the standard shader. A custom shader is required and you need a way to read the information about the maps in the combined shader.