fix skeleton AABB computation, addeded shadeless view mode

This commit is contained in:
Juan Linietsky 2014-09-18 00:18:57 -03:00
parent e0ce701c8c
commit 7d6b160a44
4 changed files with 18 additions and 3 deletions

View file

@ -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);

View file

@ -795,6 +795,7 @@ public:
SCENARIO_DEBUG_DISABLED,
SCENARIO_DEBUG_WIREFRAME,
SCENARIO_DEBUG_OVERDRAW,
SCENARIO_DEBUG_SHADELESS,
};

View file

@ -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);

View file

@ -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,