diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2009-12-11 16:54:56 +0300 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2009-12-11 16:54:56 +0300 |
commit | 4654afb34c040e54d44308ad338ed5ba14aec176 (patch) | |
tree | fafed805f21775233e6633f18ab6e09a03ac32ed /source/blender/collada/DocumentExporter.cpp | |
parent | 11059178927fcb12fc39079c4b11c00660abc8c7 (diff) |
COLLADA branch: patch from Jan Diederich for bump-map export via <extra> tag.
Diffstat (limited to 'source/blender/collada/DocumentExporter.cpp')
-rw-r--r-- | source/blender/collada/DocumentExporter.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index 6a11fd51e4a..e2a3cca4f33 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -1538,9 +1538,23 @@ public: if (t->mapto & MAP_REF) { ep.setReflective(createTexture(ima, uvname, sampler)); } + // alpha if (t->mapto & MAP_ALPHA) { ep.setTransparent(createTexture(ima, uvname, sampler)); } + // extension: + // Normal map --> Must be stored with <extra> tag as different technique, + // since COLLADA doesn't support normal maps, even in current COLLADA 1.5. + if (t->mapto & MAP_NORM) { + COLLADASW::Texture texture(key); + texture.setTexcoord(uvname); + texture.setSampler(*sampler); + // technique FCOLLADA, with the <bump> tag, is most likely the best understood, + // most widespread de-facto standard. + texture.setProfileName("FCOLLADA"); + texture.setChildElementName("bump"); + ep.setExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture)); + } } // performs the actual writing ep.addProfileElements(); |