diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-06-16 10:22:26 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-06-16 10:22:26 -0300 |
commit | 703004f830f39adcde9b9565f1aa49d1b10e8d27 (patch) | |
tree | b8fd669af9dee07177ff658f0ebca83aff836598 /tools/editor | |
parent | 64e83bfd1404ea593f0c79b478d196a3fcde42a8 (diff) |
More 3D Work
-=-=-=-=-=-
-ESM Shadow Mapping for softer and less glitchy shadows
-HDR Pipeline (convert to Linear on texture import, convert to SRGB at the end)
-Fix to xml parse bug
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | tools/editor/io_plugins/editor_texture_import_plugin.cpp | 11 | ||||
-rw-r--r-- | tools/editor/io_plugins/editor_texture_import_plugin.h | 3 | ||||
-rw-r--r-- | tools/editor/plugins/baked_light_baker.cpp | 14 | ||||
-rw-r--r-- | tools/editor/plugins/baked_light_editor_plugin.cpp | 2 |
5 files changed, 23 insertions, 9 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index ceb5b45a03..27a5ddbeaf 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4067,7 +4067,7 @@ EditorNode::EditorNode() { import_menu->get_popup()->add_separator(); - import_menu->get_popup()->add_item("Import Settings",SETTINGS_IMPORT); + import_menu->get_popup()->add_item("Re-Import..",SETTINGS_IMPORT); editor_plugin_screen=NULL; editor_plugin_over=NULL; diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 5d45594246..c7593625ff 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -45,6 +45,7 @@ static const char *flag_names[]={ "Repeat", "Filter (Magnifying)", "Premultiply Alpha", + "Convert SRGB->Linear", NULL }; @@ -57,6 +58,7 @@ static const char *flag_short_names[]={ "Repeat", "Filter", "PMAlpha", + "ToLinear", NULL }; @@ -927,6 +929,10 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc image.premultiply_alpha(); } + if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + + image.srgb_to_linear(); + } if (shrink>1) { @@ -985,6 +991,11 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc image.premultiply_alpha(); } + if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + + image.srgb_to_linear(); + } + int orig_w=image.get_width(); int orig_h=image.get_height(); diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/tools/editor/io_plugins/editor_texture_import_plugin.h index fcc1bd2d0c..9374c6eb0b 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.h +++ b/tools/editor/io_plugins/editor_texture_import_plugin.h @@ -92,7 +92,8 @@ public: IMAGE_FLAG_NO_MIPMAPS=16, //normal for 2D games IMAGE_FLAG_REPEAT=32, //usually disabled in 2D IMAGE_FLAG_FILTER=64, //almost always enabled - IMAGE_FLAG_PREMULT_ALPHA=128//almost always enabled + IMAGE_FLAG_PREMULT_ALPHA=128,//almost always enabled + IMAGE_FLAG_CONVERT_TO_LINEAR=256 //convert image to linear }; virtual String get_name() const; diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index ae5746321a..36948673a8 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -912,12 +912,6 @@ float BakedLightBaker::_throw_ray(int p_light_index,const Vector3& p_begin, cons Color diffuse_at_point(0.8,0.8,0.8); Color specular_at_point(0.0,0.0,0.0); - if (triangle->material) { - - //triangle->get_uv(r_point); - diffuse_at_point=triangle->material->diffuse.get_color(uv); - specular_at_point=triangle->material->specular.get_color(uv); - } float dist = p_begin.distance_to(r_point); @@ -963,6 +957,14 @@ float BakedLightBaker::_throw_ray(int p_light_index,const Vector3& p_begin, cons + if (triangle->material) { + + //triangle->get_uv(r_point); + + diffuse_at_point=triangle->material->diffuse.get_color(uv); + specular_at_point=triangle->material->specular.get_color(uv); + } + diffuse_at_point.r=res_light.r*diffuse_at_point.r; diffuse_at_point.g=res_light.g*diffuse_at_point.g; diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp index 4d84b95900..71f9671fd9 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/tools/editor/plugins/baked_light_editor_plugin.cpp @@ -111,7 +111,7 @@ void BakedLightEditor::_notification(int p_option) { ERR_FAIL_COND(node->get_baked_light().is_null()); baker->update_octree_image(octree_texture); -#if 0 +#if 1 //debug Image img(baker->baked_octree_texture_w,baker->baked_octree_texture_h,0,Image::FORMAT_RGBA,octree_texture); Ref<ImageTexture> it = memnew( ImageTexture ); |