Skip to content

Instantly share code, notes, and snippets.

@RevoluPowered
Created August 3, 2021 12:01
Show Gist options
  • Save RevoluPowered/15a4a6962ffec7647867e00237a7b3a9 to your computer and use it in GitHub Desktop.
Save RevoluPowered/15a4a6962ffec7647867e00237a7b3a9 to your computer and use it in GitHub Desktop.
Problem commit
I just bisected the problem commit
➜ godot git:(7f4eafa6f28) git bisect good
Bisecting: 1 revision left to test after this (roughly 1 step)
[18f09492b4ff5db708cbb6b31f4ea3419f8092c1] Merge pull request #50874 from raulsntos/backport-44355
➜ godot git:(18f09492b4f) htop
➜ godot git:(18f09492b4f) git bisect good
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[d27428406922697382348ca1b769805db20a5310] Octahedral Normal/Tangent Compression
➜ godot git:(d2742840692) git bisect bad
d27428406922697382348ca1b769805db20a5310 is the first bad commit
commit d27428406922697382348ca1b769805db20a5310
Author: Omar El Sheikh <[email protected]>
Date: Mon Mar 8 12:58:13 2021 -0500
Octahedral Normal/Tangent Compression
Implement Octahedral Compression for normal/tangent vectors
*Oct32 for uncompressed vectors
*Oct16 for compressed vectors
Reduces vertex size for each attribute by
*Uncompressed: 12 bytes, vec4<float32> -> vec2<unorm16>
*Compressed: 2 bytes, vec4<unorm8> -> vec2<unorm8>
Binormal sign is encoded in the y coordinate of the encoded tangent
Added conversion functions to go from octahedral mapping to cartesian
for normal and tangent vectors
sprite_3d and soft_body meshes write to their vertex buffer memory
directly and need to convert their normals and tangents to the new oct
format before writing
Created a new mesh flag to specify whether a mesh is using octahedral
compression or not
Updated documentation to discuss new flag/defaults
Created shader flags to specify whether octahedral or cartesian vectors
are being used
Updated importers to use octahedral representation as the default format
for importing meshes
Updated ShaderGLES2 to support 64 bit version codes as we hit the limit
of the 32-bit integer that was previously used as a bitset to store
enabled/disabled flags
doc/classes/ArrayMesh.xml | 2 +-
doc/classes/Mesh.xml | 7 +-
doc/classes/SurfaceTool.xml | 4 +-
doc/classes/VisualServer.xml | 9 +-
drivers/gles2/rasterizer_scene_gles2.cpp | 10 +
drivers/gles2/rasterizer_storage_gles2.cpp | 96 +++++---
drivers/gles2/shader_gles2.cpp | 8 +-
drivers/gles2/shader_gles2.h | 22 +-
drivers/gles2/shaders/scene.glsl | 26 +++
drivers/gles3/rasterizer_scene_gles3.cpp | 9 +
drivers/gles3/rasterizer_storage_gles3.cpp | 56 +++--
drivers/gles3/shaders/scene.glsl | 27 ++-
editor/import/editor_import_collada.cpp | 2 +-
editor/import/resource_importer_obj.cpp | 2 +-
modules/fbx/data/fbx_mesh_data.cpp | 2 +-
scene/3d/soft_body.cpp | 7 +-
scene/3d/sprite_3d.cpp | 44 ++--
scene/resources/mesh.cpp | 1 +
scene/resources/mesh.h | 3 +-
servers/visual_server.cpp | 353 +++++++++++++++++++++++------
servers/visual_server.h | 7 +-
21 files changed, 529 insertions(+), 168 deletions(-)
➜ godot git:(d2742840692)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment