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

Vertex jittering when a object is far from the origin #554

Open
Khalzz opened this issue Jun 9, 2024 · 1 comment
Open

Vertex jittering when a object is far from the origin #554

Khalzz opened this issue Jun 9, 2024 · 1 comment

Comments

@Khalzz
Copy link

Khalzz commented Jun 9, 2024

Im doing a game with wgpu while learning from the learn-wgpu tutorials and im getting a problem when moving an object far from the 0,0,0 origin point, i dont know if it might be because i missed something or i did something wrong.

The problem is that the far i am from the origin, the more distorted or jittery the vertexes look (it might be another reason on why thos elements looks like that but i think it might be the vertexes moving randomly), i tested some things like making the calculations as a f64 and then turning the values to f32 for the shader or changing the zfar and znear values of the camera.

The only thing that changed something was the znear, but the problem is that if there is something too close to the camera it disappears and is something i dont want it to happen.

If someone had the same problem or haves it i would like to know.

WGPU: v0.18.0
SDL2: v0.36
Source code with the error: https://github.com/Khalzz/Project-Skies

2024-06-08.19-52-39.mp4
@sotrh
Copy link
Owner

sotrh commented Jun 12, 2024

How far from the origin are we talking?

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

No branches or pull requests

2 participants