Problem with OffscreenViewport

Hi, I’m currently in the process of allowing my application to be resized on demand, as restarting it each time is kinda uncool :slight_smile:

I use a own texturerendere for everythig ingame, and use the resulting texture for composing my final rendering.

Now I need to rescale this viewport if the windowis resized.

The following code works for some reason only one time. (it is called on startup with the current windows resolution, however any further resizing does not work and I only see the background color.

Does anyone has any ideas why the following method does not produce the desired result?

[java]
useles code snipped cut
[/java]

Any probably not cleanup issues ignored, the newly created framebuffer should render to the texture and this used for my compositors resultquad or? And why does it always work the first time on startup this way?

Any help would be appreciated

EDIT:

I just figured, since I need to recreate the camera, the location and rotation is lost :facepalm:

@Empire Phoenix said: Hi, I'm currently in the process of allowing my application to be resized on demand, as restarting it each time is kinda uncool :)

I use a own texturerendere for everythig ingame, and use the resulting texture for composing my final rendering.

Now I need to rescale this viewport if the windowis resized.

The following code works for some reason only one time. (it is called on startup with the current windows resolution, however any further resizing does not work and I only see the background color.

Does anyone has any ideas why the following method does not produce the desired result?

[java]
useles code snipped cut
[/java]

Any probably not cleanup issues ignored, the newly created framebuffer should render to the texture and this used for my compositors resultquad or? And why does it always work the first time on startup this way?

Any help would be appreciated

EDIT:

I just figured, since I need to recreate the camera, the location and rotation is lost :facepalm:

Did you get this resolved? If not, I have this working and could probably help you track down the issue.

Well mostly, i simply forgot to copy the values rom the old cam to the new one.

However I still have some problems with postprocessors being corrupted in the process. But I guess it’s just something like a missing call somewhere.