SOLVED Drawing sprite on surface with high res quality against low res application surface

Hello GMC,

As the title says, I'm wondering if it's possible to have:

. An application surface that is drawn 4x the native resolution of my game (4x window size and view, but keep ports unchanged), WHILE having one specific element rendered as a high resolution sprite where the sprite is also drawn 4x the native resolution. The high resolution rendering I'm talking about happens when increasing the port sizes also by 4x. I understand surfaces are a way to achieve this, but I'm having some difficulties. I basically need this so that when in-game scaling is done (which is a must), it doesn't look completely horrible.

When I perform in-game scaling, if the application surface is rendered such that the views, window sizes and importantly, the port sizes, are all increased to 4x, the in-game scaling looks good. However, if I increase everything except the port sizes and perform scaling, the sprites look too distorted. Yet, I need to have the option of rendering the application surface without changing the port sizes for sake of performance. So I figured a surface would help with this. Code is below:

surface object. Create:

GML:
surf_x=0
surf_y=0

surf_width = 500
surf_height = 100//95 //55

ratio = 4

surf = surface_create(surf_width * ratio, surf_height * ratio);
Draw end:

Code:
var upscl = 1.16//1.08

ratio = 1//s_hport / global.window_size_native_height;

surf_x = 0//x//
surf_y = 0//y//

sx = (x - __view_get( e__VW.XView, 0 )) * ratio;
sy = (y - __view_get( e__VW.YView, 0 )) * ratio;

if surface_exists(surf){
surface_set_target(surf)
draw_clear(c_black)

draw_sprite_ext(spr_test_stand, 0, oPlayer.x, oPlayer.y, 1 * upscl, 1 * upscl, image_angle, c_white, 1)

surface_reset_target();
draw_surface_ext( surf, surf_x, surf_y, 1/ratio, 1/ratio, 0, c_white, 1);
// draw_surface_ext( surf, surf_x, surf_y, 1, 1, 0, c_white, 1);
}// surf ex chk
Currently, with the above code, I get a black screen that covers the entire screen, with the test sprite on which the scaling is to be performed drawn on top of the black screen, but still distorted. Please note that if the ratio values in the create/draw end are left consistent (as they ought to be), nothing gets drawn on screen. But obviously having two different ratio values doesn't make sense... just testing to see if this works. Native view size is 384 x 216, rendered at 4x to give 1536 x 864. Surely what I'm after can be achieved with surfaces?

Never used surfaces before, so any guidance will be much appreciated. Thanks!
 
Just to simplify things quite a bit, lets forget about ports and everything else and focus only on resizing the surface, in particular resizing the application surface versus a custom surface.

In a controller object, I have this:

GML:
if (instance_exists(ocon_global_game)) {
    with (ocon_global_game) {    ////////show_message("camstart")
        //global.game_scale_match    = argument[0];
        game_w        = round(game_w_start / argument[0]);
        game_h        = round(game_h_start / argument[0]);

        surface_resize(application_surface, game_w, game_h);
        camera_set_view_size(view_camera[0], 384, 216);
       
    }
...where game_w_start is 1536, game_h_start is 864, and argument[0] is the scale factor. If arg[0] is 4, I get game_w and game_h as 384 (1536/4) and 216 (864/4) respectively. When the application surface is resized along with the view, this produces the degraded, blocky look when changing sprite scales. However, if arg[0] is 1, I get game_w and game_h as 1536 and 864 (both simply divided by 1). When the application surface is resized along with the view, this produces the crisp, high resolution look. Simple enough. Yet, when I try to use the same surface_resize function for a custom surface, even with the 1536 x 864 values, I still get the blocky sprite look.

So it basically boils down to how GMS treats resizing the application surface versus resizing custom surfaces. Is it possible to get GM to apply the same resizing it performs on the application surface, on custom surfaces?
 
So it seems that I'm actually trying to do something that's fundamentally impossible - rendering two different resolutions at once. I thought using a surface in addition to the application surface might allow me to achieve the desired goal, but this isn't the case.

Best case is to simply use options to switch resolutions.
 
Top