HybridRenderingEngine icon indicating copy to clipboard operation
HybridRenderingEngine copied to clipboard

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

Open Kermalis opened this issue 2 years ago • 1 comments

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 avatar May 24 '22 19:05 Kermalis

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 avatar May 24 '22 21:05 Kermalis