Changeset View
Changeset View
Standalone View
Standalone View
source/blender/collada/EffectExporter.cpp
| Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| /* XXX check if BLINN and PHONG can be supported as well */ | /* XXX check if BLINN and PHONG can be supported as well */ | ||||
| ep.setShaderType(COLLADASW::EffectProfile::LAMBERT); | ep.setShaderType(COLLADASW::EffectProfile::LAMBERT); | ||||
| } | } | ||||
| void EffectsExporter::set_transparency(COLLADASW::EffectProfile &ep, Material *ma) | void EffectsExporter::set_transparency(COLLADASW::EffectProfile &ep, Material *ma) | ||||
| { | { | ||||
| double alpha = bc_get_alpha(ma); | double alpha = bc_get_alpha(ma); | ||||
| ep.setTransparency(alpha, false, "alpha"); | if (alpha < 1) { | ||||
| // workaround use <transparent> to avoid wrong handling of <transparency> by other tools | |||||
| COLLADASW::ColorOrTexture cot = bc_get_cot(0, 0, 0, alpha); | |||||
| ep.setTransparent(cot, false, "alpha"); | |||||
| ep.setOpaque(COLLADASW::EffectProfile::A_ONE); | |||||
| } | |||||
| } | } | ||||
| void EffectsExporter::set_diffuse_color(COLLADASW::EffectProfile &ep, Material *ma) | void EffectsExporter::set_diffuse_color(COLLADASW::EffectProfile &ep, Material *ma) | ||||
| { | { | ||||
| // get diffuse color | // get diffuse color | ||||
| COLLADASW::ColorOrTexture cot = bc_get_base_color(ma); | COLLADASW::ColorOrTexture cot = bc_get_base_color(ma); | ||||
| ep.setDiffuse(cot, false, "diffuse"); | ep.setDiffuse(cot, false, "diffuse"); | ||||
| } | } | ||||
| Show All 15 Lines | void EffectsExporter::set_reflective(COLLADASW::EffectProfile &ep, Material *ma) | ||||
| // get diffuse color | // get diffuse color | ||||
| COLLADASW::ColorOrTexture cot = bc_get_reflective(ma); | COLLADASW::ColorOrTexture cot = bc_get_reflective(ma); | ||||
| ep.setReflective(cot, false, "reflective"); | ep.setReflective(cot, false, "reflective"); | ||||
| } | } | ||||
| void EffectsExporter::set_reflectivity(COLLADASW::EffectProfile &ep, Material *ma) | void EffectsExporter::set_reflectivity(COLLADASW::EffectProfile &ep, Material *ma) | ||||
| { | { | ||||
| double reflectivity = bc_get_reflectivity(ma); | double reflectivity = bc_get_reflectivity(ma); | ||||
| if (reflectivity > 0.0) { | |||||
| ep.setReflectivity(reflectivity, false, "specular"); | ep.setReflectivity(reflectivity, false, "specular"); | ||||
| } | } | ||||
| } | |||||
| void EffectsExporter::set_emission(COLLADASW::EffectProfile &ep, Material *ma) | void EffectsExporter::set_emission(COLLADASW::EffectProfile &ep, Material *ma) | ||||
| { | { | ||||
| COLLADASW::ColorOrTexture cot = bc_get_emission(ma); | COLLADASW::ColorOrTexture cot = bc_get_emission(ma); | ||||
| ep.setEmission(cot, false, "emission"); | ep.setEmission(cot, false, "emission"); | ||||
| } | } | ||||
| void EffectsExporter::set_ior(COLLADASW::EffectProfile &ep, Material *ma) | void EffectsExporter::set_ior(COLLADASW::EffectProfile &ep, Material *ma) | ||||
| ▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines | |||||