diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-06-03 17:34:47 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-06-03 17:35:01 +0300 |
commit | 97e53d2385cd0b72add07bff4df1f8bc660f51fb (patch) | |
tree | 1bc4d0f35e7402d9ef701b66b145a9dfe79c7bb2 /source/blender/collada/EffectExporter.cpp | |
parent | 1f650c402d3b43eee7cb51c7d4f373ba82ac2116 (diff) |
fix collada: get Alpha and Emission from principled BSDF Shader
Diffstat (limited to 'source/blender/collada/EffectExporter.cpp')
-rw-r--r-- | source/blender/collada/EffectExporter.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp index 676d939e8f5..a45cdccecf3 100644 --- a/source/blender/collada/EffectExporter.cpp +++ b/source/blender/collada/EffectExporter.cpp @@ -101,14 +101,8 @@ void EffectsExporter::set_shader_type(COLLADASW::EffectProfile &ep, Material *ma void EffectsExporter::set_transparency(COLLADASW::EffectProfile &ep, Material *ma) { - COLLADASW::ColorOrTexture cot = bc_get_base_color(ma); - float transparency = cot.getColor().getAlpha(); - if (transparency < 1) { - // Tod: because we are in A_ONE mode transparency is calculated like this: - COLLADASW::ColorOrTexture cot = getcol(1.0f, 1.0f, 1.0f, transparency); - ep.setTransparent(cot); - ep.setOpaque(COLLADASW::EffectProfile::A_ONE); - } + double alpha = bc_get_alpha(ma); + ep.setTransparency(alpha, false, "alpha"); } void EffectsExporter::set_diffuse_color(COLLADASW::EffectProfile &ep, Material *ma) { @@ -125,7 +119,8 @@ void EffectsExporter::set_reflectivity(COLLADASW::EffectProfile &ep, Material *m void EffectsExporter::set_emission(COLLADASW::EffectProfile &ep, Material *ma) { - // not yet supported (needs changes in principled shader + COLLADASW::ColorOrTexture cot = bc_get_emission(ma); + ep.setEmission(cot, false, "emission"); } void EffectsExporter::get_images(Material *ma, KeyImageMap &material_image_map) |