Skip to content

GLTF Exporter forces all materials with texID == 0 to opaque black #126

@Dnawrkshp

Description

@Dnawrkshp

Is this intentional? When exporting armor files to gltf the first texture is id 0 and is rendering as black. Not sure if this behavior is required for non-armor files.

Happy to submit a PR changing texID == 0 to texID < 0 or whatever is desired.

public GLTFMaterialPBRValues(int baseColorTextureIndex, int texID)
{
if (texID == 0)
{
this.baseColorFactor = new float[] { 0.0f, 0.0f, 0.0f, 1.0f };
}
else
{
this.baseColorTexture = new GLTFMaterialPBRValuesBaseColorTexture(baseColorTextureIndex);
}
}

public GLTFMaterialEntry(TextureConfig conf, int texOffset)
{
this.name = "Material_" + texOffset + "_" + conf.id;
this.alphaMode = (conf.IgnoresTransparency() || conf.id == 0) ? GLTFMaterialEntry.OPAQUE : GLTFMaterialEntry.MASK;
this.pbrMetallicRoughness = new GLTFMaterialEntry.GLTFMaterialPBRValues(texOffset, conf.id);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions