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

perf: improve performance of mesh generator for chunks #4794

Merged
merged 25 commits into from
Aug 19, 2021

Conversation

pollend
Copy link
Member

@pollend pollend commented Jun 25, 2021

some minor performance tweaks to mesh generation. so one bottleneck I found is we evaluate the sides of all the blocks for every block within the chunks so each block will check all its ordinals even if it is lets say its air which has no geometry. API is coupled to the block so mesh information is defined by the block itself. would like this to be more data oriented but that is something to consider later.

I also swapped out the maps for switch cases for BlockParts which should also help to some extent.

hard to test all the permutations so just verifying that chunks render correctly for a couple different types of blocks will be sufficient.

@github-actions github-actions bot added the Type: Chore Request for or implementation of maintenance changes label Jun 25, 2021
pollend added a commit to Terasology/Health that referenced this pull request Jun 26, 2021
@pollend pollend marked this pull request as ready for review June 26, 2021 04:11
@pollend pollend changed the title chore: minor cleanup for BlockAppearance perf: improve performance of mesh generator for chunks Jun 26, 2021
@pollend pollend added the Topic: Rendering Requests, Issues and Changes related to lighting, meshes, camera, etc. label Jun 26, 2021
pollend and others added 5 commits July 5, 2021 14:21
…rt.java

Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
…rt.java

Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
…s/BlockMeshGeneratorSingleShape.java

Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
…ngBlocks/Terasology into chore/minor-cleanup-BlockAppearance
@pollend pollend requested a review from skaldarnar August 1, 2021 17:47
@skaldarnar
Copy link
Member

@pollend did you check the rest of Omega for any broken code with this? At least in a MetalReneages workspace this does not compile:

> Task :modules:MetalRenegades:compileJava FAILED
/home/skaldarnar/Code/movingblocks/ts-mr/modules/MetalRenegades/src/main/java/org/terasology/metalrenegades/world/dynamic/roads/RailRasterizer.java:65: error: cannot find symbol
        for (Side side : Side.getAllSides()) {
                             ^
  symbol:   method getAllSides()
  location: class Side

skaldarnar pushed a commit to Terasology/Health that referenced this pull request Aug 18, 2021
pollend added a commit to Terasology/MetalRenegades that referenced this pull request Aug 19, 2021
…ngBlocks/Terasology into chore/minor-cleanup-BlockAppearance
@skaldarnar skaldarnar merged commit 180d36d into develop Aug 19, 2021
@skaldarnar skaldarnar deleted the chore/minor-cleanup-BlockAppearance branch August 19, 2021 17:53
skaldarnar pushed a commit to Terasology/MetalRenegades that referenced this pull request Aug 19, 2021
skaldarnar pushed a commit to Terasology/Health that referenced this pull request Aug 19, 2021
pollend added a commit to Terasology/MetalRenegades that referenced this pull request Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Rendering Requests, Issues and Changes related to lighting, meshes, camera, etc. Type: Chore Request for or implementation of maintenance changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants