Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Improve heightfield collision performance #3276

Closed
glebm opened this issue Feb 21, 2021 · 2 comments
Closed

Improve heightfield collision performance #3276

glebm opened this issue Feb 21, 2021 · 2 comments

Comments

@glebm
Copy link
Contributor

glebm commented Feb 21, 2021

In openmw, btHeightfieldTerrainShape::processAllTriangles is 15% of the total frame time

perf report showing heighfield collision taking a significant amount of time in openmw

I've noticed the following TODO in the code that points to the possibility of optimizing this:

// TODO If m_vboundsGrid is available, use it to determine if we really need to process this area

Heightfield accelerator data structure (m_vboundsGrid) was introduced in #2062

There are a few other TODOs in the file that also indicate missing optimizations.


Update: No longer a bottleneck even without the accelerator thanks to #3287. Leaving open for now in case someone wants to do address the TODOs and claim the bounty.

/cc @Zylann @psi29a

@glebm
Copy link
Contributor Author

glebm commented Feb 26, 2021

@glebm glebm changed the title Heighfield collision performance Improve heighfield collision performance Feb 26, 2021
@glebm glebm changed the title Improve heighfield collision performance Improve heightfield collision performance Feb 26, 2021
psi29a pushed a commit to OpenMW/openmw that referenced this issue Feb 26, 2021
This enables accelleration of heightfield collisions.

Unfortunately, `btHeightfieldTerrainShape::processAllTriangle` does not
yet use the accellerator data, so this change does not improve
performance yet but might do so in future bullet versions.

References:

* Accellerator introduced in:
  bulletphysics/bullet3#2062

* Feature request to use the accellerator in `processAllTriangle`:
  bulletphysics/bullet3#3276
@glebm
Copy link
Contributor Author

glebm commented Mar 1, 2021

After #2062, in areas where heightfield collision is still slow, perf report looks like this:

perf report showing most time spent in btGjkPairDetector::getClosestPointsNonVirtual

@bulletphysics bulletphysics locked and limited conversation to collaborators Apr 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants