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

Potential Distance Issue with Shader-based Background #121

Open
thombruce opened this issue Nov 24, 2023 · 1 comment
Open

Potential Distance Issue with Shader-based Background #121

thombruce opened this issue Nov 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@thombruce
Copy link
Owner

I was noticing a weird artefact near the origin of the shader background - a sort of bloom with a cross-section, probably an artefact of calculations near to 0.,0.

To try to hide this, I attempted to set some initial coordinates far, far away from that origin. The result was a loss of detail and a set of large pixelated artefacts being rendered.

Given that all I did was add N to the X and Y values (where N was a number in the 10s of thousands - relatively small), I fear that the shader might produce those artefacts again once the player moves far away enough from the origin.

I am not presently sure how concerned to be about this (the apparent motion of the shader is the players motion divided by a large number, so it will take some distance before it is an issue), but it is worth noting.

@thombruce thombruce added the bug Something isn't working label Nov 24, 2023
@github-project-automation github-project-automation bot moved this to Inbox in Verse Nov 24, 2023
@thombruce
Copy link
Owner Author

Image with large values added to X and Y:

image

And how it is supposed to look (no values added):

image

The difference (above is with the adjustments producing the bug, below is without):

- var from_ = vec3<f32>(100000.0 + (background.position.x / 50000.0), 100000.0 + (-background.position.y / 50000.0), 0.5);
+ var from_ = vec3<f32>(background.position.x / 50000.0, -background.position.y / 50000.0, 0.5);

It's just a large value added to X and Y, meaning we probably encounter the effect if we travel out beyond some distance...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

1 participant