SF2DLib smooth scaling?

Discussion in '3DS - Homebrew Development and Emulators' started by UraKn0x, Mar 5, 2016.

  1. UraKn0x
    OP

    UraKn0x Official senpai

    Member
    360
    268
    Mar 20, 2014
    France
    Hello everyone!

    I am currently writing a VN interpreter (for cs2-based VNs, think about the Grisaia series for example) for 3DS, and I have encountered a problem: the image files are meant to be used with a PC screen resolution, so I have to downscale them to fit on the 3DS screen.
    The problem is, the built-in scaling functions in SF2DLib makes the result pixelated (see spoiler below).
    Warning: Spoilers inside!
    It seems it takes only one pixel out of N when I downscale and does no interpolation. Is there a way to fix it directly with the lib (ie is there any way to do this with the GPU), or will I have to do it in software?

    If I have to do it in software, could you recommend a downscaling algorithm which is a good compromise between speed and quality?

    Thanks in advance!
     
    Last edited by UraKn0x, Mar 6, 2016
  2. UraKn0x
    This message by UraKn0x has been removed from public view by Costello, Mar 6, 2016, Reason: no bumping.
    Mar 6, 2016
  3. Luglige
    This message by Luglige has been removed from public view by Costello, Mar 6, 2016, Reason: no bumping.
    Mar 6, 2016
  4. catlover007

    catlover007 GBAtemp Regular

    Member
    173
    200
    Oct 23, 2015
    Germany
    use
    PHP:
    sf2d_texture_set_params(yourTexturePointerHereGPU_TEXTURE_MAG_FILTER(GPU_LINEAR) | GPU_TEXTURE_MIN_FILTER(GPU_LINEAR)); 
    once for every texture you want to change the filter
     
    UraKn0x and Gocario like this.
  5. UraKn0x
    OP

    UraKn0x Official senpai

    Member
    360
    268
    Mar 20, 2014
    France
    Thanks! Are there any other filters, like bicubic? Because I've tried GPU_BICUBIC and it doesn't compile...

    EDIT: Nevermind, I've found it. They are all in ctrulib/include/3ds/gpu/enums.h
     
    Last edited by UraKn0x, Mar 6, 2016