diff options
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 19 | ||||
-rw-r--r-- | drivers/gles2/shader_compiler_gles2.cpp | 2 | ||||
-rw-r--r-- | drivers/gles2/shaders/cubemap_filter.glsl | 7 | ||||
-rw-r--r-- | drivers/gles2/shaders/scene.glsl | 7 | ||||
-rw-r--r-- | editor/editor_profiler.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/particles_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/skeleton_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/skeleton_editor_plugin.h | 1 |
8 files changed, 43 insertions, 8 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 1655f55bfa..e21998d55e 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -107,7 +107,7 @@ void RasterizerSceneGLES2::shadow_atlas_set_size(RID p_atlas, int p_size) { glActiveTexture(GL_TEXTURE0); glGenTextures(1, &shadow_atlas->depth); glBindTexture(GL_TEXTURE_2D, shadow_atlas->depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, shadow_atlas->size, shadow_atlas->size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadow_atlas->size, shadow_atlas->size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -1216,6 +1216,12 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) { glDisableVertexAttribArray(15); // color glDisableVertexAttribArray(8); // custom data + if (!s->attribs[VS::ARRAY_COLOR].enabled) { + glDisableVertexAttribArray(VS::ARRAY_COLOR); + + glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1); + } + glVertexAttrib4f(15, 1, 1, 1, 1); glVertexAttrib4f(8, 0, 0, 0, 0); @@ -1259,7 +1265,12 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) { } if (multi_mesh->color_floats) { - glVertexAttrib4fv(15, buffer + color_ofs); + if (multi_mesh->color_format == VS::MULTIMESH_COLOR_8BIT) { + uint8_t *color_data = (uint8_t *)(buffer + color_ofs); + glVertexAttrib4f(15, color_data[0] / 255.0, color_data[1] / 255.0, color_data[2] / 255.0, color_data[3] / 255.0); + } else { + glVertexAttrib4fv(15, buffer + color_ofs); + } } if (multi_mesh->custom_data_floats) { @@ -2415,7 +2426,7 @@ void RasterizerSceneGLES2::initialize() { glBindTexture(GL_TEXTURE_CUBE_MAP, cube.cubemap); for (int i = 0; i < 6; i++) { - glTexImage2D(_cube_side_enum[i], 0, GL_DEPTH_COMPONENT16, cube_size, cube_size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL); + glTexImage2D(_cube_side_enum[i], 0, GL_DEPTH_COMPONENT, cube_size, cube_size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL); } glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -2449,7 +2460,7 @@ void RasterizerSceneGLES2::initialize() { glGenTextures(1, &directional_shadow.depth); glBindTexture(GL_TEXTURE_2D, directional_shadow.depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, directional_shadow.size, directional_shadow.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, directional_shadow.size, directional_shadow.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 5ac2af6e5c..2227c9769a 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -161,7 +161,7 @@ static String get_constant_text(SL::DataType p_type, const Vector<SL::ConstantNo return text.as_string(); } break; - case SL::TYPE_FLOAT: return f2sp0(p_values[0].real) + "f"; + case SL::TYPE_FLOAT: return f2sp0(p_values[0].real); case SL::TYPE_VEC2: case SL::TYPE_VEC3: case SL::TYPE_VEC4: { diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl index 62ecd9471b..35f0a16325 100644 --- a/drivers/gles2/shaders/cubemap_filter.glsl +++ b/drivers/gles2/shaders/cubemap_filter.glsl @@ -21,7 +21,12 @@ void main() { [fragment] -#extension GL_ARB_shader_texture_lod : require +#extension GL_ARB_shader_texture_lod : enable + +#ifndef GL_ARB_shader_texture_lod +#define texture2DLod(img, coord, lod) texture2D(img, coord) +#define textureCubeLod(img, coord, lod) textureCube(img, coord) +#endif #ifdef USE_GLES_OVER_GL #define mediump diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index b945e696b1..2c9d4f01a3 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -262,7 +262,12 @@ VERTEX_SHADER_CODE } [fragment] -#extension GL_ARB_shader_texture_lod : require +#extension GL_ARB_shader_texture_lod : enable + +#ifndef GL_ARB_shader_texture_lod +#define texture2DLod(img, coord, lod) texture2D(img, coord) +#define textureCubeLod(img, coord, lod) textureCube(img, coord) +#endif #ifdef USE_GLES_OVER_GL #define mediump diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 67700b59de..a8d30d9cbe 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -100,6 +100,8 @@ void EditorProfiler::clear() { updating_frame = false; hover_metric = -1; seeking = false; + + _update_plot(); } static String _get_percent_txt(float p_value, float p_total) { @@ -167,7 +169,7 @@ void EditorProfiler::_update_plot() { int w = graph->get_size().width; int h = graph->get_size().height; - bool reset_texture = false; + bool reset_texture = graph_texture.is_null(); int desired_len = w * h * 4; diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 6a99dcb9a5..3c381158a4 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -262,6 +262,7 @@ void ParticlesEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE) { options->set_icon(options->get_popup()->get_icon("Particles", "EditorIcons")); + get_tree()->connect("node_removed", this, "_node_removed"); } } @@ -444,6 +445,7 @@ void ParticlesEditor::_bind_methods() { ClassDB::bind_method("_menu_option", &ParticlesEditor::_menu_option); ClassDB::bind_method("_generate_aabb", &ParticlesEditor::_generate_aabb); + ClassDB::bind_method("_node_removed", &ParticlesEditor::_node_removed); } ParticlesEditor::ParticlesEditor() { diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp index fe7d1df50c..d871922c8b 100644 --- a/editor/plugins/skeleton_editor_plugin.cpp +++ b/editor/plugins/skeleton_editor_plugin.cpp @@ -126,7 +126,15 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i } void SkeletonEditor::edit(Skeleton *p_node) { + skeleton = p_node; + +} + +void SkeletonEditor::_notification(int p_what) { + if (p_what==NOTIFICATION_ENTER_TREE) { + get_tree()->connect("node_removed", this, "_node_removed"); + } } void SkeletonEditor::_node_removed(Node *p_node) { @@ -139,6 +147,7 @@ void SkeletonEditor::_node_removed(Node *p_node) { void SkeletonEditor::_bind_methods() { ClassDB::bind_method("_on_click_option", &SkeletonEditor::_on_click_option); + ClassDB::bind_method("_node_removed", &SkeletonEditor::_node_removed); } SkeletonEditor::SkeletonEditor() { diff --git a/editor/plugins/skeleton_editor_plugin.h b/editor/plugins/skeleton_editor_plugin.h index b9bdf91902..0ab94c15b5 100644 --- a/editor/plugins/skeleton_editor_plugin.h +++ b/editor/plugins/skeleton_editor_plugin.h @@ -61,6 +61,7 @@ class SkeletonEditor : public Node { friend class SkeletonEditorPlugin; protected: + void _notification(int p_what); void _node_removed(Node *p_node); static void _bind_methods(); |