diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-06-04 15:31:22 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-06-05 13:42:54 +0300 |
commit | eda377c223cfc0460e3294c95771313f8d4388c3 (patch) | |
tree | d8c7d5d74a74f19b993ad18f09d098f5ed039549 /source/blender/collada/Materials.h | |
parent | 98cea7edcefa58d5eb7e2350461b8efe33fe7d9e (diff) |
update Collada Importer: reworked export and import of Materials
- added import of transparency and emission into principled BSDF Shader
- added support for importing all default collada material parameters
* diffuse
* emission
* index_of_refraction
* shininess (mapped to BSDF Roughness)
* reflectivity (mapped to BSDF Metallic)
* transparency + transparent mapped to BSDF Alpha)
* ambient (creates unconnected texture node)
* specular (creates unconnected texture node)
* reflective(creates unconnected texture node)
- added support for exporting collada material parameters:
* diffuse
* emission
* index_of_refraction
* shininess (mapped to BSDF Roughness)
* reflectivity (mapped to BSDF Metallic)
* transparency + transparent mapped to BSDF Alpha)
- prepared support for exporting the following parameters
but currently commented out:
* ambient (creates unconnected texture node)
* specular (creates unconnected texture node)
* reflective(creates unconnected texture node)
Problem: For now we only allow export of principled BSDF based
materials. I am not sure from where to get ambient, specular
and reflective as those values are not included in the
principled BSDF Shader (wip).
Diffstat (limited to 'source/blender/collada/Materials.h')
-rw-r--r-- | source/blender/collada/Materials.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/collada/Materials.h b/source/blender/collada/Materials.h index 445b9fd0758..8f3c3dbcd93 100644 --- a/source/blender/collada/Materials.h +++ b/source/blender/collada/Materials.h @@ -31,12 +31,6 @@ extern "C" { #include "collada_utils.h" #include "COLLADAFWEffectCommon.h" -typedef enum BC_pbr_inputs { - BC_PBR_DIFFUSE = 0, - BC_PBR_METALLIC = 4, - BC_PBR_IOR = 14, -} BC_pbr_inputs; - typedef std::map<std::string, bNode *> NodeMap; class MaterialNode { @@ -63,15 +57,20 @@ class MaterialNode { public: MaterialNode(bContext *C, COLLADAFW::EffectCommon *ef, Material *ma, UidImageMap &uid_image_map); MaterialNode(bContext *C, Material *ma, KeyImageMap &key_image_map); - void set_diffuse(COLLADAFW::ColorOrTexture &cot, std::string label); Image *get_diffuse_image(); - void set_specular(COLLADAFW::ColorOrTexture &cot, std::string label); - void set_ambient(COLLADAFW::ColorOrTexture &cot, std::string label); - void set_reflective(COLLADAFW::ColorOrTexture &cot, std::string label); - void set_emission(COLLADAFW::ColorOrTexture &cot, std::string label); - void set_opacity(COLLADAFW::ColorOrTexture &cot, std::string label); - void set_reflectivity(float val); - void set_ior(float val); + + void set_diffuse(COLLADAFW::ColorOrTexture &cot); + void set_specular(COLLADAFW::ColorOrTexture &cot); + void set_ambient(COLLADAFW::ColorOrTexture &cot); + void set_reflective(COLLADAFW::ColorOrTexture &cot); + void set_emission(COLLADAFW::ColorOrTexture &cot); + void set_opacity(COLLADAFW::ColorOrTexture &cot); + void set_reflectivity(COLLADAFW::FloatOrParam &val); + void set_shininess(COLLADAFW::FloatOrParam &val); + void set_ior(COLLADAFW::FloatOrParam &val); + void set_alpha(COLLADAFW::EffectCommon::OpaqueMode mode, + COLLADAFW::ColorOrTexture &cot, + COLLADAFW::FloatOrParam &val); }; #endif |