-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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 ArrayMesh::surface_remove
#76371
Conversation
b0e7040
to
02fba47
Compare
I rebased and fixed some issues when using blend shapes. Note: when the surface count reaches zero, adding or clearing blend shapes is enabled again. I tested the 3 renderers, the removal of surfaces with or without blend shapes and the ability to add new blend shapes when the surface count is back to 0. |
02fba47
to
69a77d9
Compare
Rebased to resolve conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've also modified the indentation of servers/rendering/renderer_rd/storage_rd/mesh_storage.h
, it will fail CI, please restore it.
69a77d9
to
4d2387b
Compare
Sorry about the indentation, it's fixed now |
4d2387b
to
5c68353
Compare
Rebased to resolve conflicts |
I don't understand why the tests I added some version ago, fail on windows. They never failed so far and I don't have a windows to reproduce the issue. If someone is able to reproduce it locally I would appreciate any help. ps: I noticed the local var |
@ze2j I'm interested in helping resolve this issue, and I have a windows machine. I'm pretty unexperienced though, can you help me with some instruction to test and give you the failure information you need? |
I need to make some fixes for blend shapes as this branch doesn't work anymore when rebased on 4.2. I set the PR to draft in the meantime. Edit: Nothing wrong with blendshapes. My test scene had to be updated for 4.2, I remove the draft status. @matricola787 Thanks for offering your help! I am not sure if I need to give more or less details below, so let me know if I am completely off. You need to compile my branch with Then run the editor with
If there is an error, you should see the same error as the Github action:
The failing test is I suspect they are almost the same but differ for more than 1e-5. |
@ze2j Thank you for the instructions! I managed to compile the rebased project as you said, but I'm not able to execute the tests: when from command line I run
I'm not sure what's wrong, I guess I need some tips to get on the right direction. Edit: I tried the same process on a clean 4.2-stable clone, and the output is pretty much the same, so I guess that's on my end, but I don't know what I should touch. |
(my bad the page updated and I clicked the wrong button) |
Rebased on top of 4.2, ready for review. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This hasn't been approved yet, hopefully it can be soon, we don't have any schedule for this one, please have patience, you can use this for your own projects by cloning the branch However first it needs a rebase and the conflicts need to be fixed |
@AThousandShips In the meantime, is it worth rebasing it every time a conflict occurs or should I wait being asked to? |
I'd say to fix them when they pop up to make it easier and not have it grow on you, as long as it's just when conflicts occur, it helps ability to review and test it (so people who test it don't have to do it themselves) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Just popping in to add some context. This is very much on my radar and should be approved soon. The PR was only finished a few weeks ago, and I have been super busy with the release of 4.2, and preparing 4.2.1, so I haven't found the time to review it yet. Now I am catching up on my 4.3 backlog and so should have a chance to review it soon. This is definitely a wanted feature and its very nice to see it contributed. @ze2j On the topic of rebasing. My personal view is that you should wait until you have received a technical review to rebase. I don't want you to endlessly rebase the PR while waiting for me, that's just not fair to you, and its no benefit to me either. |
Sorry to bother you @clayjohn, any update about this? |
ArrayMesh::surface_remove
@ze2j Could you look into rebasing this PR on top of |
@Calinou I am on it |
9b24a9c
to
97e0b43
Compare
Rebased on top of master. I tested the removal of surfaces with or without blend shapes on both vulkan and opengl backends. |
Can you upload the testing project to make testing this PR easier? |
@Calinou I added it in the first post |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Tested locally and confirmed that it was working correctly.
I would have liked to merge this earlier, but I ended up needed to do a very careful review of the surrounding code. For context, surface_remove()
was removed in 4.0. At the time we thought it couldn't be implemented given the new rendering architecture. However, none of us can remember what the exact issue was and the function was removed during Juan's big rewrite, so there are no PRs/Commits to consult. Accordingly, I had to carefully review all the surrounding code and see if there is something we are missing that would cause an issue for this function.
Ultimately, I haven't found any issues and the code looks fantastic. So I think we should go ahead and merge this PR. Its possible we will discover the reason for removing it after putting this in the hands of users, but at this point I think its worth the risk.
<return type="void" /> | ||
<param index="0" name="surf_idx" type="int" /> | ||
<description> | ||
Removes a surface at position surf_idx, shifting greater surfaces one surf_idx slot down. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes a surface at position surf_idx, shifting greater surfaces one surf_idx slot down. | |
Removes the surface at the given index from the Mesh, shifting surfaces with higher index down by one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<param index="0" name="mesh" type="RID" /> | ||
<param index="1" name="surface" type="int" /> | ||
<description> | ||
Removes a mesh's surface at position surf_idx, shifting greater surfaces one surf_idx slot down. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes a mesh's surface at position surf_idx, shifting greater surfaces one surf_idx slot down. | |
Removes the surface at the given index from the Mesh, shifting surfaces with higher index down by one. |
Thanks! The style changes can be adjusted in a separate PR. |
Fixes #67181
Test project:
remove_surface_test_project.zip