We have 1920/1080 resolution set in our game.project file. But it only resizes (stretches) to resolutions smaller than 1920/1080. If we try to stretch it to 4k, it seems like it stretches correctly, but everything beyond that 1920/1080 is black, i.e. our game is running in 1/4 corner of a black screen.
Not so sure about that( We still can’t remove the black border. In one case it appears in the right part of the screen, in other case it’s on top…
Maybe some example might help. We checking few examples right now, but not sure if they will help in our case. Will be extremely grateful for some desktop resolutions example.
Nope. Fixed almost everything and now the game layer stretches correctly as it should. But still everything beyond workspace (1920x1080) is pitch black, i.e. 4k looks like this.
Done. That’s the correct stretch to final window in all resolutions. But it paints black everything that is beyond workspace /gamecamera resolution (1920x1080). And I don’t know where that black border came from.
Well, for me it might still take some effort to sort it all out
Alex remade all screen render target calculations and moved them to separate function, and now it works fine.
Maybe Alexey @AGulev will find a minute to briefly describe where the problem was.
it’s important to change RT size when window size changed, to be able to draw pixels 1 to 1
We should know the size of the quad we use for texture drawing and take it into account for the quad projection
In my case, I have 0, 0 in the bottom left, but in @kidkiedis case, they have 0, 0 in the screen center (it should be taken into account in projections)
and some other small fixes like RT clear, set_depth_mask(false), etc
I can’t share the render script I sent to @kidkiedis (it’s not my project), but here is my old render_script from Solitaire I made all the fixes based on it: render.zip (4.9 KB)