diff options
-rw-r--r-- | doc/classes/ViewportContainer.xml | 3 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 22 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 3 |
3 files changed, 23 insertions, 5 deletions
diff --git a/doc/classes/ViewportContainer.xml b/doc/classes/ViewportContainer.xml index e4c6091909..2f1bc5d799 100644 --- a/doc/classes/ViewportContainer.xml +++ b/doc/classes/ViewportContainer.xml @@ -15,6 +15,9 @@ If [code]true[/code], the viewport will be scaled to the control's size. </member> <member name="stretch_shrink" type="int" setter="set_stretch_shrink" getter="get_stretch_shrink" default="1"> + Divides the viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering. + For example, a 1280×720 viewport with [member stretch_shrink] set to [code]2[/code] will be rendered at 640×360 while occupying the same size in the container. + [b]Note:[/b] [member stretch] must be [code]true[/code] for this property to work. </member> </members> <constants> diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 4509c9d17e..07d7416905 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -1794,13 +1794,21 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glActiveTexture(GL_TEXTURE0); glBindTexture(texture->target, texture->tex_id); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 10); - // Need Mipmaps regardless of whether they are set in import by user + glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, 0); +#ifdef GLES_OVER_GL + glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, int(Math::floor(Math::log(float(texture->width)) / Math::log(2.0f)))); glGenerateMipmap(texture->target); +#else + glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, 0); +#endif + // Need Mipmaps regardless of whether they are set in import by user glTexParameterf(texture->target, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameterf(texture->target, GL_TEXTURE_WRAP_T, GL_REPEAT); +#ifdef GLES_OVER_GL glTexParameterf(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); +#else + glTexParameterf(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +#endif glTexParameterf(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); if (config.srgb_decode_supported && texture->srgb && !texture->using_srgb) { @@ -1925,7 +1933,11 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb2); +#ifdef GLES_OVER_GL if (j < 3) { +#else + if (j == 0) { +#endif shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, true); shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_PANORAMA, true); @@ -2051,7 +2063,11 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glTexImage2D(GL_TEXTURE_2D, 0, internal_format, size, size * 2, 0, format, type, NULL); glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb2); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmp_tex, 0); +#ifdef GLES_OVER_GL if (lod < 3) { +#else + if (lod == 0) { +#endif shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID, true); shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_SOURCE_PANORAMA, true); diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index a10d27f7cd..be066e15a5 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -2143,7 +2143,6 @@ Error EditorSceneImporterGLTF::_create_skeletons(GLTFState &state) { skeleton->add_bone(node->name); skeleton->set_bone_rest(bone_index, node->xform); - skeleton->set_bone_pose(bone_index, node->xform); if (node->parent >= 0 && state.nodes[node->parent]->skeleton == skel_i) { const int bone_parent = skeleton->find_bone(state.nodes[node->parent]->name); @@ -2324,7 +2323,7 @@ Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) { Array samplers = d["samplers"]; if (d.has("name")) { - animation.name = d["name"]; + animation.name = _sanitize_scene_name(d["name"]); } for (int j = 0; j < channels.size(); j++) { |