Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Comparing your two screenshots, I can see that your game exhibits what are commonly called "mixels." Some sprites have chunkier pixels than others (said another way, the floppy disk is higher-resolution than everything else). When you run your game normally, GameMaker usually provides you with a high resolution framebuffer, which means that the camera and your sprite positions don't have to conform to a strict pixel grid. This is incompatible with the CRT shader, since CRT TVs expect a uniform, low resolution input. Your game might look like 320x240 or so, but is actually, secretly 1080p (or similar).

To solve this without having to get too down into the details, the CRT constructor provides the convenience function crt.draw_to_backbuffer(), which just wraps crt.draw:

static draw_to_backbuffer = function(source=application_surface) {
    // Prevent the application surface from being drawn over our work
    if (application_surface_is_enabled()) {
        application_surface_draw_enable(false);
    }
    
    // Ensure the application surface matches the internal content resolution
    if (surface_get_width(application_surface) != geometry.content_width) {
        surface_resize(application_surface, geometry.content_width, geometry.content_height);
    }
    
    // Render
    draw(source, 0, 0, window_get_width(), window_get_height());
}

This function automatically resizes the application surface down to your intended low resolution. But when the shader is disabled, you might prefer the look of the high-resolution rendering and the associated mixels. To restore this appearance after toggling the CRT shader off, you simply need to resize the application surface, and potentially the GUI surface, back to the native window dimensions (which is what GameMaker silently does for you by default).

if (global.crt_preset == CRT_PRESET_OFF) {
    var w = window_get_width();
    var h = window_get_height();
    // This should fix undersampled sprites and camera jitter by increasing the size of the framebuffer
    if (surface_get_width(application_surface) != w) or (surface_get_height(application_surface) != h) {
        surface_resize(application_surface, w, h);
    }
    // If this shrinks your GUI, then just comment it out (I don't know your setup)
    if (display_get_gui_width() != w) or (display_get_gui_height() != h) {
        display_set_gui_size(w, h);
    }
}

If I've interpreted your problem correctly, this should return your game's appearance back to what you expect. If you ever decide to make your game pixel-perfect, then this step won't be necessary. I hope this helps!

(1 edit)

Thank you! This fixed the issue!! What you said about the floppy disk being a higher resolution than everything else makes sense because it was the ONLY sprite that was having this issue (probably because it was one of the earliest sprites i made for the game, and has actually looked a bit weird in-game without the CRT anyways), but I'll keep the code as a safeguard against this issue in the future. The only thing  that I don't understand is why that sprite specifically is higher resolution than the rest, even though i tried scaling it down to 16 x 16 and made sure it wasnt being scaled by any non-integer value. 


EDIT: 

oh my gooodness  it WAS scaling, i found out when i checked the instance of the object in the room editor :0 

Anyways, that  solved the root cause of the issue, and I'll keep scaling sprites properly in my mind from now on, thanks again for the help figuring all this out!