Chris G.
Member
Hi there, I'm a beginner and I come with a problem that I'm struggling with for a while. I searched on the internet but I have no luck so, my game is low resolution (640x360) and I use surface_resize to upscaled two times for a good look, I also use a vibrant light system with shaders that I found the problem is that I draw the application surface In the draw event for lights to work and have the vibrant effect and the scaling Is way bigger than the view :
But for fixing this I divided the scale two times and it seems to work but now Is another problem, because I scaled down the size of the application surface In the draw event the image Is now 640x360 and everything looks very low res when I move or rotate something:
I think this happens because I increased the scale two times on the application surface, and redrawing the application surface in the draw event it's displaying the surface bigger than the view that I have, and if I downscale it's back to the original resolution.
My question is why this happens? I want the surface to stay on the same scale as the view while still being high res maybe I don't understand how surfaces work and someone can help me? Here is the code:
But for fixing this I divided the scale two times and it seems to work but now Is another problem, because I scaled down the size of the application surface In the draw event the image Is now 640x360 and everything looks very low res when I move or rotate something:
I think this happens because I increased the scale two times on the application surface, and redrawing the application surface in the draw event it's displaying the surface bigger than the view that I have, and if I downscale it's back to the original resolution.
My question is why this happens? I want the surface to stay on the same scale as the view while still being high res maybe I don't understand how surfaces work and someone can help me? Here is the code:
GML:
var _u_pos = u_pos;
var _u_zz = u_zz;
var _cameraX = cameraX;
var _cameraY = cameraY;
if !surface_exists(shad_surf) {
shad_surf = surface_create(cam_w,cam_h);
}
matrix_set(matrix_world,matrix_build(-cameraX,-cameraY,0,0,0,0,1,1,1));
surface_set_target(shad_surf);
draw_clear_alpha(c_black,0);
draw_surface_ext(application_surface,cameraX,cameraY,1/2,1/2,0,c_white,0.2);
with(p_lights) {
gpu_set_blendmode_ext_sepalpha(bm_inv_dest_alpha,bm_one,bm_zero,bm_zero);
shader_set(shd_light);
shader_set_uniform_f(_u_pos,x,y);
shader_set_uniform_f(_u_zz,size);
draw_surface_ext(application_surface,_cameraX,_cameraY,1/2,1/2,0,color,1);
}
shader_reset();
surface_reset_target();
matrix_set(matrix_world,matrix_build(0,0,0,0,0,0,1,1,1));
gpu_set_blendmode_ext(bm_dest_alpha,bm_inv_dest_alpha);
draw_surface(shad_surf,cameraX,cameraY);
gpu_set_blendmode(bm_normal);