Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Vertex Attribute Specification Octahedral #54768

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion drivers/gles2/rasterizer_storage_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
// UNLESS tangent exists and is also compressed
// then it will be oct16 encoded along with tangent
attribs[i].normalized = GL_TRUE;
attribs[i].size = 4;
attribs[i].size = 2;
attribs[i].type = GL_SHORT;
attributes_stride += 4;
} else {
Expand All @@ -2330,6 +2330,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
case VS::ARRAY_TANGENT: {
if (p_format & VS::ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION) {
attribs[i].enabled = false;
attribs[VS::ARRAY_NORMAL].size = 4;
if (p_format & VS::ARRAY_COMPRESS_TANGENT && p_format & VS::ARRAY_COMPRESS_NORMAL) {
// normal and tangent will each be oct16 (2 bytes each)
// pack into single vec4<GL_BYTE> for memory bandwidth
Expand Down
3 changes: 2 additions & 1 deletion drivers/gles3/rasterizer_storage_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3404,7 +3404,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
// UNLESS tangent exists and is also compressed
// then it will be oct16 encoded along with tangent
attribs[i].normalized = GL_TRUE;
attribs[i].size = 4;
attribs[i].size = 2;
attribs[i].type = GL_SHORT;
attributes_stride += 4;
} else {
Expand All @@ -3425,6 +3425,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
case VS::ARRAY_TANGENT: {
if (p_format & VS::ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION) {
attribs[i].enabled = false;
attribs[VS::ARRAY_NORMAL].size = 4;
if (p_format & VS::ARRAY_COMPRESS_TANGENT && p_format & VS::ARRAY_COMPRESS_NORMAL) {
// normal and tangent will each be oct16 (2 bytes each)
// pack into single vec4<GL_BYTE> for memory bandwidth
Expand Down