Closed rafaskb closed 1 year ago
Solved! The issue was the programmer (also known as me). I was applying the viewport too many times in places I shouldn't have, which was causing the issue. Simply applying the viewport before binding gdx-vfx and before drawing its FBO to the screen fixed the issue.
Heya! I'm having trouble getting gdx-vfx to work with FitViewports in my game, admittedly I don't understand much of viewports, but I tried a bunch of different combinations and made some progress, but not without some issues left.
The issue I'm having is that gdx-vfx doesn't seem to be capturing the correct area of the window when black bars / viewport gutters are present. The more black borders I have, the more offset gdx-vfx renders.
Video
Here's a video that demonstrates the issue: (Note: One of the resize lines in the video says
Game.graphics.getWidth/Height
, these are identical toGdx.graphics.getWidth/Height
)https://user-images.githubusercontent.com/2331058/230236935-91fb3456-6094-4e29-a3d0-cad47ac1a97f.mp4
What I tried
As far as I understand there are two places where I can set the viewport in gdx-vfx:
resize
method, and here's where changes seem to affect the input region,renderToScreen
with parameters. I believe I got these values correct, as the final FBO is being rendered exactly where it should.I tried to call
resize
with multiple values, such as the real window dimensions (Gdx.graphics.getWidth/Height), I tried to pass my logical game size (1920x1080), and I also tried to pass the viewport width/height, the viewport values are by far the most accurate ones, resulting in the correct capture size, however there's an offset I can't figure out how to solve.I appreciate any directions on how to fix this issue, and great job for creating such an amazing library! ♥