This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Material
ousttrue edited this page Aug 27, 2018
·
20 revisions
- https://github.com/ousttrue/UniGLTF/issues/12
- https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-material
- https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md
GLTF | Unity | |
---|---|---|
/materials/*/pbrMetallicRoughness/baseColorFactor |
material.color |
shorthand of material.SetColor("_Color", color)
|
/materials/*/pbrMetallicRoughness/baseColorTexture |
material.mainTexture |
shorthand of material.SetTexture("_MainTex", texture)
|
- Incompatible texture format
// gltf to unity
static Color32 ConvertMetallicRoughnessOcclusion(Color32 src)
{
return new Color32
{
r = src.b, // metallic
g = src.r, // occlusion
b = 0,
a = (byte)(255 - src.g), // smoothness
};
}
- Unpack DXT5 Texture
Unity RenderType Tag | glTFのmaterial.alphaModeプロパティ |
---|---|
Opaque | OPAQUE (デフォルトなので出力は不要) |
Transparent | BLEND |
TransparentCutout | MASK |
Require custom shader
Require custom shader