diff options
| author | Juan Linietsky | 2014-10-27 22:54:32 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-10-27 22:54:32 -0300 |
| commit | e82dc402052a47b44bb3bcf50ee4801257f92778 (patch) | |
| tree | 01c2cd8692b5569cae778f6504b76b3d1f9ccdad /tools/editor/plugins/baked_light_editor_plugin.cpp | |
| parent | 9608d4255eb6c76b1c4496f4494c829133e096f4 (diff) | |
| download | godot-e82dc402052a47b44bb3bcf50ee4801257f92778.tar.gz godot-e82dc402052a47b44bb3bcf50ee4801257f92778.tar.zst godot-e82dc402052a47b44bb3bcf50ee4801257f92778.zip | |
-Much improvement to baked light baker
-Fixed many bugs in stretch mode
-Fixes to camera project and unproject as consequence of the above
-added setget to script (documented in script doc)
-more fixes to collada exporter for blender
Diffstat (limited to 'tools/editor/plugins/baked_light_editor_plugin.cpp')
| -rw-r--r-- | tools/editor/plugins/baked_light_editor_plugin.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp index 3d48f2e73..2f8393f10 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/tools/editor/plugins/baked_light_editor_plugin.cpp @@ -111,7 +111,10 @@ void BakedLightEditor::_notification(int p_option) { #endif ERR_FAIL_COND(node->get_baked_light().is_null()); - baker->update_octree_image(octree_texture); + baker->update_octree_images(octree_texture,light_texture); + baker->update_octree_sampler(octree_sampler); + // print_line("sampler size: "+itos(octree_sampler.size()*4)); + #if 1 //debug Image img(baker->baked_octree_texture_w,baker->baked_octree_texture_h,0,Image::FORMAT_RGBA,octree_texture); @@ -121,11 +124,19 @@ void BakedLightEditor::_notification(int p_option) { #endif - bake_info->set_text("rays/s: "+itos(baker->get_rays_sec())); + + + uint64_t rays_snap = baker->get_rays_thrown(); + int rays_sec = (rays_snap-last_rays_time)*1.0-(update_timeout); + last_rays_time=rays_snap; + + bake_info->set_text("rays/s: "+itos(rays_sec)); update_timeout=1; print_line("MSUPDATE: "+itos(OS::get_singleton()->get_ticks_msec()-t)); t=OS::get_singleton()->get_ticks_msec(); node->get_baked_light()->set_octree(octree_texture); + node->get_baked_light()->set_light(light_texture); + node->get_baked_light()->set_sampler_octree(octree_sampler); node->get_baked_light()->set_edited(true); print_line("MSSET: "+itos(OS::get_singleton()->get_ticks_msec()-t)); @@ -195,6 +206,9 @@ void BakedLightEditor::_bake_pressed() { baker->bake(node->get_baked_light(),node); node->get_baked_light()->set_mode(BakedLight::MODE_OCTREE); update_timeout=0; + + last_rays_time=0; + set_process(true); } |
