From 4654afb34c040e54d44308ad338ed5ba14aec176 Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Fri, 11 Dec 2009 13:54:56 +0000 Subject: COLLADA branch: patch from Jan Diederich for bump-map export via tag. --- source/blender/collada/DocumentExporter.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/collada/DocumentExporter.cpp') 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 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 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(); -- cgit v1.2.3