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: clipping not working properly #29

Closed
wants to merge 1 commit into from

Conversation

davidetan
Copy link
Contributor

This PR fixes a couple of problem with clipping:

  • clipping was not always attempted to be ended
  • when spinePipe.addRenderable is called with a cacheData.clippedData.vertexCount set at 0, but cacheData.clippedData.vertices.length is bigger than 0, it was still added to the batch, generating a GL_INVALID_OPERATION: Insufficient buffer size. on webgl and a Calling [RenderPassEncoder (unlabeled)].Draw with an index count of 0 is unusual. on webgpu
  • when spinePipe.updateRenderable is called, the batcher.updateElement was called regardless of the fact the attachment has zero clipped vertices to draw; however, the vertexSize of the BatchableSpineSlot is never set to zero becuase addRenderable set it only if vertices are more than zero. I added an if into updateRenderable, otherwise we can move the batchableSpineSlot.setData outside the if in the addRenderable
  • Removed a useless clipper from the SpinePipe

I'm not an expert of RenderPipe, so let me know if I did some wrong assumption :)

@GoodBoyDigital
Copy link
Member

hey @davidetan , do you have a spine file i could use to test this pls? I think there might be a way we can avoid the extra checks in addRenderable but would like to verify! thanks man

@davidetan
Copy link
Contributor Author

hey @davidetan , do you have a spine file i could use to test this pls? I think there might be a way we can avoid the extra checks in addRenderable but would like to verify! thanks man

Sure, just use the basic example and change the animation from run to portal at this line: https://github.com/pixijs/spine-v8/blob/main/examples/basic.html#L45

@davidetan
Copy link
Contributor Author

Close in favor of this: #32

@davidetan davidetan closed this Aug 1, 2024
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.

2 participants