From 6c643af6a7044c4481a72314e9e96a723470b47c Mon Sep 17 00:00:00 2001 From: Omar El Sheikh Date: Wed, 4 Aug 2021 18:55:49 -0400 Subject: [PATCH] Fix Bugs w/ Octahedral Compression Implementation Initial octahedral compression incorrectly wrote tangent to the buffer using an offset of 3 rather than 4, losing the sign of the tangent vector needed for things like tangent space for texturing mapping GLES3 renderer used remove_custom_define rather than set_conditional to change back to the default conditional state the scene shader should be in --- drivers/gles3/rasterizer_scene_gles3.cpp | 2 +- servers/visual_server.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index c91f92c0762..d9de7ca508a 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2154,7 +2154,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ glBindVertexArray(0); - state.scene_shader.remove_custom_define("#define ENABLE_OCTAHEDRAL_COMPRESSION\n"); + state.scene_shader.set_conditional(SceneShaderGLES3::ENABLE_OCTAHEDRAL_COMPRESSION, false); state.scene_shader.set_conditional(SceneShaderGLES3::USE_INSTANCING, false); state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON, false); state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP, false); diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 424e7ce0585..9e4bbc5d790 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1496,11 +1496,11 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector::Write w = arr.write(); @@ -1508,11 +1508,11 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector