Skip to content

Conversation

depilz
Copy link
Contributor

@depilz depilz commented Jan 16, 2025

Fixes this:

CleanShot.2025-01-16.at.18.01.58.mp4

Result:

CleanShot.2025-01-16.at.18.02.16.mp4

@ggcrunchy does this looks good to you?

@depilz depilz requested a review from Shchvova as a code owner January 16, 2025 22:16
@ggcrunchy
Copy link
Contributor

Definitely looks better in your example. 😄

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


depilz seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Shchvova
Copy link
Contributor

Reason I haven't merged it yet is because of backward compatibility. Do you think it'll break existing apps?

@ggcrunchy
Copy link
Contributor

@Shchvova Yeah, maybe the // center mesh block wants to be in a if (fromVertices) condition. Even if nothing did break, it would avoid redoing the calculation.

@depilz
Copy link
Contributor Author

depilz commented Feb 13, 2025

Actually both of them need the center mesh code, I took it from the non-fromVertices and now it's being applied to both cases (pure Lua and buffered)

This is an initialization call, so centering the mesh will always be required.

Also the pure Lua version logic remains intact, the one that changed is the one using buffers so there shouldn't be any danger in this change.

@ggcrunchy
Copy link
Contributor

@Shchvova I was looking over some of the code with @depilz and it seems like the vertex offset calculation is almost replicated in the tessellator's Update() method; I think the only difference is that the latter is done on the already-offseted vertices.

This doesn't affect the correctness, but seems like a legitimate optimization—meshes can have plenty of points, after all. Off-hand I didn't see if the situation would always occur or if the rect would want to be an optional input to Update(). (I could probably supply some some rough code in the next day or two.)

@depilz
Copy link
Contributor Author

depilz commented May 23, 2025

@Shchvova 20ee14a will prevent unnecessary updates when using regular tables to update a mesh.

@depilz
Copy link
Contributor Author

depilz commented May 28, 2025

Testing branch using lua tables to update meshes.

CleanShot.2025-05-28.at.13.05.53.mp4

Testing branch using buffered memory data to update meshes.

CleanShot.2025-05-28.at.13.11.35.mp4

They both look equally good but buffered is definitely a great improvement in performance .

@Shchvova this branch is ready to go. Can we merge it in?

@Shchvova Shchvova merged commit 98c835e into coronalabs:master May 28, 2025
1 check was pending
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.

4 participants