在我的libgdx項目中,我正在嘗試向模型中添加其他材質。實際上,我需要獲得紋理組合 - 以下材質的紋理必須放置在前一個紋理上。在某些情況下具有透明度。在LibGDX中合併多個材質紋理
類似的東西
Model knight = assets.get("data/g3d/knight.g3db", Model.class);
knightInstance = new ModelInstance(knight);
Material additionalMaterial = new Material();
knightInstance.materials.add(additionalMaterial);
knightInstance.materials.get(0).clear();
knightInstance.materials.get(0).set(TextureAttribute.createDiffuse(assets.get("data/g3d/checkboard.png", Texture.class)));
BlendingAttribute blendingAttribute1 = new BlendingAttribute(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, 0.4f);
knightInstance.materials.get(0).set(blendingAttribute1);
knightInstance.materials.get(1).clear();
knightInstance.materials.get(1).set(TextureAttribute.createDiffuse(assets.get("data/g3d/tiles.png", Texture.class)));
BlendingAttribute blendingAttribute2 = new BlendingAttribute(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, 0.6f);
knightInstance.materials.get(1).set(blendingAttribute2);
Offcorse,它不工作。只有第一種材料可見。 在LibGDX中可以做到嗎?