Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/collada/EffectExporter.cpp')
-rw-r--r--source/blender/collada/EffectExporter.cpp43
1 files changed, 41 insertions, 2 deletions
diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp
index a45cdccecf3..a0ad3740e45 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -104,6 +104,7 @@ void EffectsExporter::set_transparency(COLLADASW::EffectProfile &ep, Material *m
double alpha = bc_get_alpha(ma);
ep.setTransparency(alpha, false, "alpha");
}
+
void EffectsExporter::set_diffuse_color(COLLADASW::EffectProfile &ep, Material *ma)
{
// get diffuse color
@@ -111,6 +112,25 @@ void EffectsExporter::set_diffuse_color(COLLADASW::EffectProfile &ep, Material *
ep.setDiffuse(cot, false, "diffuse");
}
+void EffectsExporter::set_ambient(COLLADASW::EffectProfile &ep, Material *ma)
+{
+ // get diffuse color
+ COLLADASW::ColorOrTexture cot = bc_get_ambient(ma);
+ ep.setAmbient(cot, false, "ambient");
+}
+void EffectsExporter::set_specular(COLLADASW::EffectProfile &ep, Material *ma)
+{
+ // get diffuse color
+ COLLADASW::ColorOrTexture cot = bc_get_specular(ma);
+ ep.setSpecular(cot, false, "specular");
+}
+void EffectsExporter::set_reflective(COLLADASW::EffectProfile &ep, Material *ma)
+{
+ // get diffuse color
+ COLLADASW::ColorOrTexture cot = bc_get_reflective(ma);
+ ep.setReflective(cot, false, "reflective");
+}
+
void EffectsExporter::set_reflectivity(COLLADASW::EffectProfile &ep, Material *ma)
{
double reflectivity = bc_get_reflectivity(ma);
@@ -123,6 +143,18 @@ void EffectsExporter::set_emission(COLLADASW::EffectProfile &ep, Material *ma)
ep.setEmission(cot, false, "emission");
}
+void EffectsExporter::set_ior(COLLADASW::EffectProfile &ep, Material *ma)
+{
+ double alpha = bc_get_ior(ma);
+ ep.setIndexOfRefraction(alpha, false, "ior");
+}
+
+void EffectsExporter::set_shininess(COLLADASW::EffectProfile &ep, Material *ma)
+{
+ double shininess = bc_get_shininess(ma);
+ ep.setShininess(shininess, false, "shininess");
+}
+
void EffectsExporter::get_images(Material *ma, KeyImageMap &material_image_map)
{
if (!ma->use_nodes) {
@@ -180,10 +212,17 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
COLLADASW::ColorOrTexture cot;
- set_transparency(ep, ma);
set_diffuse_color(ep, ma);
- set_reflectivity(ep, ma);
set_emission(ep, ma);
+ set_ior(ep, ma);
+ set_shininess(ep, ma);
+ set_reflectivity(ep, ma);
+ set_transparency(ep, ma);
+
+ /* TODO: from where to get ambient, specular and reflective? */
+ // set_ambient(ep, ma);
+ // set_specular(ep, ma);
+ // set_reflective(ep, ma);
get_images(ma, material_image_map);
std::string active_uv(getActiveUVLayerName(ob));