Page 1 of 1

Scaling to lowest "native" resolution with Gamera and LightWorld

Posted: Fri Nov 18, 2016 11:03 am
by 0x29a
Hi there!

I'm doing low-res pixel art game and I want it to scale nicely on all monitors, with lowest possible resolution for a given monitor without image stretching.

I'm using Gamera library for camera handling ( https://github.com/kikito/gamera ) and Light_World (aka. Light vs. Shadow v2) library for real time lighting/shadows ( https://github.com/tanema/light_world.lua )

I've been trying to use Maid64 (viewtopic.php?f=5&t=82034 , https://github.com/adekto/maid64 ) but it doesn't do anything...

Code: Select all

function love.load()
--
    -- Resolution settings
    love.window.setMode(0,0,
    {
        fullscreen = true,
        fullscreentype = "exclusive",
    })
    maid64.setup(640,480) -- just an example, normally it'll be calculated using getFullscreenModes. 
--
    -- Light_World init
    LW = LightWorld({
     -- options here
    })
    LW:refreshScreenSize(640,480)
--
    cam = gamera.new(0, 0, world_size_x, world_size_y)
    cam:setWindow(0,0,640,480)
--
end

Code: Select all

function love.draw()
	maid64.start()--starts the maid64 process
	cam:draw(function(l, t, w, h) -- Gamera draw function
        		LW:draw(function() -- Light_World draw function 
        			 -- All the love.graphics.draw calls for different objects
        		end)
    		end)
	maid64.finish()--finishes the maid64 process
end
What I get
Image

What I (kinda) want:
Image

How do I proceed with this problem?

Thanks in advance for any help!

Edit: adding .love file for tinkering.

Re: Scaling to lowest "native" resolution with Gamera and LightWorld

Posted: Fri Nov 18, 2016 2:14 pm
by adekto
hi i made maid64.
i looked at the code and im sorry but i cant realy change anything to my side of the library.
light world is using a ton of shaders and canvases and ends up drawing to the screen directly as far as i understand the code.
if you can find or intercept the the shader thats the last one to render and grap that canvas and send it back to the love.draw it might work

hope this helps

Re: Scaling to lowest "native" resolution with Gamera and LightWorld

Posted: Fri Nov 18, 2016 3:11 pm
by 0x29a
Thanks, I'll try to nail it down