diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-12-20 00:21:07 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-12-20 00:21:07 -0300 |
commit | 075fde7f26d6c3b02df5108065d1a9f979437bb8 (patch) | |
tree | 991058c18d9715c8015fc3cfff0263d9d1e3cc1a /tools/editor/io_plugins | |
parent | 22a90e8f2acce60f92958788a52b3f0bdb1a0cdf (diff) |
work in progress global illumination
Diffstat (limited to 'tools/editor/io_plugins')
-rw-r--r-- | tools/editor/io_plugins/editor_import_collada.cpp | 17 | ||||
-rw-r--r-- | tools/editor/io_plugins/editor_scene_import_plugin.cpp | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index 217a5fe78d..1d53ccf1ef 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -394,7 +394,8 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { -// material->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,texture); + material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,texture); + material->set_albedo(Color(1,1,1,1)); // material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1,1)); } else { missing_textures.push_back(texfile.get_file()); @@ -413,6 +414,8 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_texture(FixedSpatialMaterial::TEXTURE_SPECULAR,texture); + material->set_specular(Color(1,1,1,1)); // material->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,texture); // material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,Color(1,1,1,1)); @@ -435,7 +438,9 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { -// material->set_texture(FixedSpatialMaterial::PARAM_EMISSION,texture); + material->set_texture(FixedSpatialMaterial::TEXTURE_EMISSION,texture); + material->set_emission(Color(1,1,1,1)); + // material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1)); }else { // missing_textures.push_back(texfile.get_file()); @@ -455,6 +460,8 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_texture(FixedSpatialMaterial::TEXTURE_NORMAL,texture); +// material->set_emission(Color(1,1,1,1)); // material->set_texture(FixedSpatialMaterial::PARAM_NORMAL,texture); }else { @@ -466,8 +473,10 @@ Error ColladaImport::_create_material(const String& p_target) { // material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,effect.shininess); -// material->set_flag(Material::FLAG_DOUBLE_SIDED,effect.double_sided); -// material->set_flag(Material::FLAG_UNSHADED,effect.unshaded); + if (effect.double_sided) { + material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + } + material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,effect.unshaded); diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 41b245eb7d..e3fb8986c6 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -1692,7 +1692,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> String str=name; int layer = str.substr(str.find("lm")+3,str.length()).to_int(); - mi->set_baked_light_texture_id(layer); + //mi->set_baked_light_texture_id(layer); } if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"colonly")) { |