diff options
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 6 | ||||
-rw-r--r-- | servers/visual_server.h | 1 | ||||
-rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.cpp | 13 | ||||
-rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.h | 1 |
4 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 6ea696e153..96f6ca3ece 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -2421,7 +2421,7 @@ AABB RasterizerGLES2::mesh_get_aabb(RID p_mesh, RID p_skeleton) const { sk=skeleton_owner.get(p_skeleton); AABB aabb; - if (sk) { + if (sk && sk->bones.size()!=0) { for (int i=0;i<mesh->surfaces.size();i++) { @@ -4409,7 +4409,7 @@ void RasterizerGLES2::_add_geometry( const Geometry* p_geometry, const InstanceD oe->additive_ptr=&oe->additive; } - if (shadow || m->flags[VS::MATERIAL_FLAG_UNSHADED]) { + if (shadow || m->flags[VS::MATERIAL_FLAG_UNSHADED] || current_debug==VS::SCENARIO_DEBUG_SHADELESS) { e->light_type=0x7F; //unshaded is zero } else { @@ -5831,7 +5831,7 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans if (light_type!=prev_light_type) { - if (material->flags[VS::MATERIAL_FLAG_UNSHADED]) { + if (material->flags[VS::MATERIAL_FLAG_UNSHADED] || current_debug==VS::SCENARIO_DEBUG_SHADELESS) { material_shader.set_conditional(MaterialShaderGLES2::LIGHT_TYPE_DIRECTIONAL,false); material_shader.set_conditional(MaterialShaderGLES2::LIGHT_TYPE_OMNI,false); material_shader.set_conditional(MaterialShaderGLES2::LIGHT_TYPE_SPOT,false); diff --git a/servers/visual_server.h b/servers/visual_server.h index 7d7b10bed2..8934fa7903 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -795,6 +795,7 @@ public: SCENARIO_DEBUG_DISABLED, SCENARIO_DEBUG_WIREFRAME, SCENARIO_DEBUG_OVERDRAW, + SCENARIO_DEBUG_SHADELESS, }; diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 78df6ffa0c..95622f72f3 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -2662,6 +2662,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), true ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), false ); + view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), false ); } break; case MENU_VIEW_DISPLAY_WIREFRAME: { @@ -2670,6 +2671,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), true ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), false ); + view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), false ); } break; case MENU_VIEW_DISPLAY_OVERDRAW: { @@ -2678,6 +2680,16 @@ void SpatialEditor::_menu_item_pressed(int p_option) { view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), true ); + view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), false ); + + } break; + case MENU_VIEW_DISPLAY_SHADELESS: { + + VisualServer::get_singleton()->scenario_set_debug( get_scene()->get_root()->get_world()->get_scenario(), VisualServer::SCENARIO_DEBUG_SHADELESS ); + view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_NORMAL), false ); + view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_WIREFRAME), false ); + view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_OVERDRAW), false ); + view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_DISPLAY_SHADELESS), true ); } break; case MENU_VIEW_ORIGIN: { @@ -3366,6 +3378,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->add_check_item("Display Normal",MENU_VIEW_DISPLAY_NORMAL); p->add_check_item("Display Wireframe",MENU_VIEW_DISPLAY_WIREFRAME); p->add_check_item("Display Overdraw",MENU_VIEW_DISPLAY_OVERDRAW); + p->add_check_item("Display Shadeless",MENU_VIEW_DISPLAY_SHADELESS); p->add_separator(); p->add_check_item("View Origin",MENU_VIEW_ORIGIN); p->add_check_item("View Grid",MENU_VIEW_GRID); diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h index 29719cb80c..bdeac2e4ef 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/tools/editor/plugins/spatial_editor_plugin.h @@ -348,6 +348,7 @@ private: MENU_VIEW_DISPLAY_NORMAL, MENU_VIEW_DISPLAY_WIREFRAME, MENU_VIEW_DISPLAY_OVERDRAW, + MENU_VIEW_DISPLAY_SHADELESS, MENU_VIEW_ORIGIN, MENU_VIEW_GRID, MENU_VIEW_CAMERA_SETTINGS, |