diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-06-06 23:32:12 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-06-06 23:32:12 +0400 |
commit | 05188c26cecdf8a8283285d37a604136494e555a (patch) | |
tree | efa4e6e1357f577820c7aa41d3b129c2b1f4c132 /source/blender/collada/DocumentExporter.cpp | |
parent | ce9d2b8eb423708f1abde3a8897d6835873eb888 (diff) |
Merge -c 29280 from COLLADA branch into trunk.
Diffstat (limited to 'source/blender/collada/DocumentExporter.cpp')
-rw-r--r-- | source/blender/collada/DocumentExporter.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index 8cc8e7455c9..b474f65ac0d 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -1578,18 +1578,27 @@ public: else { ep.setIndexOfRefraction(1.0f); } + + COLLADASW::ColorOrTexture cot; + // transparency - ep.setTransparency(ma->alpha); + // Tod: because we are in A_ONE mode transparency is calculated like this: + ep.setTransparency(1.0f); + cot = getcol(0.0f, 0.0f, 0.0f, ma->alpha); + ep.setTransparent(cot); + // emission - COLLADASW::ColorOrTexture cot = getcol(0.0f, 0.0f, 0.0f, 1.0f); + cot=getcol(ma->emit, ma->emit, ma->emit, 1.0f); ep.setEmission(cot); - ep.setTransparent(cot); + // diffuse cot = getcol(ma->r, ma->g, ma->b, 1.0f); ep.setDiffuse(cot); + // ambient cot = getcol(ma->ambr, ma->ambg, ma->ambb, 1.0f); ep.setAmbient(cot); + // reflective, reflectivity if (ma->mode & MA_RAYMIRROR) { cot = getcol(ma->mirr, ma->mirg, ma->mirb, 1.0f); @@ -1597,15 +1606,16 @@ public: ep.setReflectivity(ma->ray_mirror); } else { - cot = getcol(0.0f, 0.0f, 0.0f, 1.0f); + cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f); ep.setReflective(cot); - ep.setReflectivity(0.0f); + ep.setReflectivity(ma->spec); } + // specular if (ep.getShaderType() != COLLADASW::EffectProfile::LAMBERT) { cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f); ep.setSpecular(cot); - } + } // XXX make this more readable if possible @@ -1714,7 +1724,19 @@ public: } // performs the actual writing ep.addProfileElements(); + bool twoSided = false; + if (ob->type == OB_MESH && ob->data) { + Mesh *me = (Mesh*)ob->data; + if (me->flag & ME_TWOSIDED) + twoSided = true; + } + if (twoSided) + ep.addExtraTechniqueParameter("GOOGLEEARTH", "double_sided", 1); + ep.addExtraTechniques(mSW); + ep.closeProfile(); + if (twoSided) + mSW->appendTextBlock("<extra><technique profile=\"MAX3D\"><double_sided>1</double_sided></technique></extra>"); closeEffect(); } |