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

With non-16:9 screen aspect ratios, the lights are no longer properly rendering #42

Open
Kermalis opened this issue May 24, 2022 · 1 comment

Comments

@Kermalis
Copy link

Here is a weird resolution example (665x689):

image

Even when the screen is small, it works fine with 16:9. As soon as 16:9 is no longer the aspect ratio, the lights are getting misplaced. This is probably something to do with the PBR shader getting the wrong linearDepth value

@Kermalis
Copy link
Author

Kermalis commented May 24, 2022

If you match the GRID_SIZE_X and GRID_SIZE_Y in the light cull shader and the RenderManager to the aspect ratio of the screen, then they work fine. But those are constants, so a generic handling of this must be made for the target resolution

For example, by default, the screen is 1920x1080, and the grid size X and Y are 16 and 9. This matches.
If you will make the screen 640x640, then you have to update the shader and render manager to change Y to also be 16. Then it also matches the aspect ratio (1:1) and works fine for that screen size

The culprit is Screen2View. The x aspect ratio is stored but the Y is not. I'll look into it and see if that can be changed without changing the grid size

@Kermalis Kermalis mentioned this issue May 25, 2022
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

Successfully merging a pull request may close this issue.

1 participant