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

Add blending option to use blend factor from the spine file #163

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

Jhonnyg
Copy link
Contributor

@Jhonnyg Jhonnyg commented Apr 3, 2024

Added support for Spine blend modes in the gameobject world - meaning, GUI support is not included in this PR.

Fixes #36
Fixes #125

Comment on lines +269 to +276
if (draw_descs_out)
{
SpineDrawDesc desc;
desc.m_VertexStart = batch_vindex_start;
desc.m_BlendMode = (uint32_t) slot->data->blendMode;
desc.m_VertexCount = vindex - batch_vindex_start;
draw_descs_out->Push(desc);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only generate these if necessary

@@ -295,4 +298,30 @@ uint32_t GenerateVertexData(dmArray<SpineVertex>& vertex_buffer, const spSkeleto
return vcount;
}

void MergeDrawDescs(const dmArray<SpineDrawDesc>& src, dmArray<SpineDrawDesc>& dst)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could use a single array here, but it's a lot easier to read this function when we have a secondary buffer.

@Jhonnyg Jhonnyg requested review from JCash, AGulev and matgis April 3, 2024 17:30
Copy link
Contributor

@AGulev AGulev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@matgis matgis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editor changes look good!

defold-spine/editor/src/spineext.clj Show resolved Hide resolved
defold-spine/editor/src/spineext.clj Outdated Show resolved Hide resolved
defold-spine/editor/src/spineext.clj Show resolved Hide resolved
@Jhonnyg Jhonnyg merged commit a408656 into main Apr 4, 2024
5 of 17 checks passed
@Jhonnyg Jhonnyg deleted the blend-support branch April 4, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blending Modes are not syncing Use blend modes defined in Spine (DEF-2400)
4 participants