Post Processing and window resizing problems [SOLVED]

Back to grind on the post processing topic: the problem now occurs when i resize the window. For some reason, it doesnt matter what is the initial viewport size, the game world is drawn as a texture just fine, but the moment i resize the window everything gets messed. This is the result before any window resizing (at this moment, the viewport was 960x640):
image

but when put into fullscreen:
image

Testing the thing into renderdoc i found that for some reason the camera view area just wasnt being updated. This is the a frame captured whole draw call before and after resizing the window:


but then, after resizing, i got this:
the texture that is generated from the frame buffer (render target)

the final result, that is, the quad and the render target used as a texture in it:

note how in the process of drawing to the frame buffer the objects in view change position, but the camera doesnt change size. And after that, it just slaps that frame buffer into the quad, causing a distortion in the image. I think something is making the camera size not being updated, ima dive deeper into it, but if anyone knows what could be, please let me know.

just to note, removing the fixed area parameter of rendercam doesnt even change something:
image

the problem was that the render target was created once and never updated when needed. I noticed this bc render cam had a function fallback for when the window was to be resized. Adding this to the fact that in the renderdoc it appears that the camera wasnt updating its size, but in fact the rt was the one not being updated, i could ve noted this before bc the logo was being pushed to the sides, if the camera was the problem then the logo would stay in the same place. Anyway, now i create the render target once at the start and recreate it again everytime the window is resized. IDK how fps wise this is going to be in a real game tho, as most games have options for fixed resolutions.

2 Likes

Great to see you are using renderdoc now! And recreating a framebuffer is not an issue performance wise regardless of platform

2 Likes

Not much of an issue, if you put recreation of render targets in a quick if block with check if window was resized,like I guess you did. I do it like this. But yeah, fixed resolution in end product would be even better imho :wink:

2 Likes

rendercam has a message handle for window resizing, i just update the frame buffer there

im documenting the most i can of what im trying to do. As soon as i finish post processing and make a good interface to have ease of use for everyone i will document everything here in the forums. I took notice of renderdoc this week, glad that i ve come to know it, im getting banned from most graphics computer communities out there for asking too much.

3 Likes