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

Interpolation of height calculation isn't 100% precise #56

Closed
chrisgraf opened this issue Jun 1, 2019 · 7 comments
Closed

Interpolation of height calculation isn't 100% precise #56

chrisgraf opened this issue Jun 1, 2019 · 7 comments
Assignees
Labels
limitation a known limitation shader Involves shader programming

Comments

@chrisgraf
Copy link
Member

image

@chrisgraf chrisgraf added the bug Something isn't working label Jun 1, 2019
@chrisgraf chrisgraf added this to the Version 0.3 milestone Jun 1, 2019
@kb173
Copy link
Member

kb173 commented Jun 4, 2019

Did you collide at that point, or could you go down even further?

If you did collide at some point, this may just be due to the collision mesh being pretty imprecise (noticeable at relatively low LODs) - we could expand that code to make it more exact, or to be able to specify that in the settings.

@chrisgraf
Copy link
Member Author

its colliding at some point .. so it's the mentioned inprecision

@kb173
Copy link
Member

kb173 commented Jun 12, 2019

The precision of the collision mesh can now be specified in the settings with 6232127. This fixes some problems, however, this particular issue remains, since the player doesn't use the collision mesh, but the actual pixel value.

I will test whether it's feasible to make the collision mesh precise enough, and only use that instead of the pixel values. Otherwise, we will have to interpolate the height values to provide smooth gradients from pixel to pixel.

@kb173
Copy link
Member

kb173 commented Jun 12, 2019

Interpolation has been added in 98b51b3. This makes movement on the ground smoother and makes this problem less frequent, but it's still there. I believe that this could be due to the mesh quads not actually being bilinear, like the interpolation, because they're laid out like this after triangulation:

 ___
|  /|
| / |
|/__|

Interpolating like this would be more complex, but doable.

It could also be something related to an offset or scaling - I have tested various changes in that direction with no good results, but the way this behaves makes it look like an offset issue sometimes.

Re-implementing wireframes (#55) would probably help with debugging this.

@kb173
Copy link
Member

kb173 commented Jun 12, 2019

8d41f3a fixes the issue which I described as seeming like an offset. This further reduces the extent of this problem. After some more testing, I'm almost certain that the remaining cases are caused by the triangle problem described above.

@chrisgraf
Copy link
Member Author

it's definitely better now

@chrisgraf chrisgraf added limitation a known limitation and removed bug Something isn't working labels Jun 20, 2019
@chrisgraf chrisgraf changed the title collision detection sometimes does not work limitation: in low LOD sometimes collision detection does not work Jun 20, 2019
@chrisgraf
Copy link
Member Author

@kb173 kb173 changed the title limitation: in low LOD sometimes collision detection does not work Interpolation of height calculation isn't 100% precise Sep 29, 2019
@kb173 kb173 added the shader Involves shader programming label Oct 17, 2019
@kb173 kb173 closed this as completed Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
limitation a known limitation shader Involves shader programming
Projects
None yet
Development

No branches or pull requests

2 participants