I Love Gameboy

Showcase your libraries, tools and other projects that help your fellow love users.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: I Love Gameboy

Post by coffee »

Technicolour wrote:It looks like the pixels are drawing slightly transparently or something... My pixel drawing code is in gmb_gpu.lua at lines 536 and 536, it should be a pretty standard affair.

Code: Select all

love.graphics.setColor( Colour, Colour, Colour, 255 )
love.graphics.point( n + 0.5, YCo + 0.5 )
The positions are clearly correct, it's just the colour/transparency seems wierd.
I don't have knowledge enough on this tech questions. Could be perhaps a Canvas/OSX LuaJIT only problem or even something related with my mac GPU. Maybe slime or jasoco (they have also mac's) can test this and check if this was an isolated problem or not.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: I Love Gameboy

Post by Xgoff »

yeah i get the ghosting as well (in both your build and slime's)

if the only luajit thing you're using is the bit library, maybe someone could try the standalone version with an official love build, to see if it's a luajit bug
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: I Love Gameboy

Post by slime »

Try setting the blend mode to "premultiplied" when drawing the canvas to the screen (before line 44 of main.lua).
Technicolour
Prole
Posts: 24
Joined: Sat Sep 24, 2011 12:22 am

Re: I Love Gameboy

Post by Technicolour »

slime wrote:Try setting the blend mode to "premultiplied" when drawing the canvas to the screen (before line 44 of main.lua).
Thanks, I can't unfortunately test it (as I don't have the issue), so if someone who is having the issue would mind testing it that'd be great! May I ask what exactly "premultiplied" blendmode does? The wiki doesn't reveal anything.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: I Love Gameboy

Post by coffee »

I changed to this and things got better. but not perfect yet.

Code: Select all

    love.graphics.setBlendMode( "premultiplied" )
    love.graphics.draw(canvas, 10, 10, 0, 3, 3)
    love.graphics.setBlendMode( "alpha" )
EDITED:
Conclusions: Got the output more whited and less blacked and some effects like in opening logo got better. Still having ghosting in mostly scenes.

EDITED2: Screenshots uploaded
5.png
6.png
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: I Love Gameboy

Post by Xgoff »

i wouldn't think you'd need premultiplied alpha anyway since as far as i know, the gameboy only uses simple masking for transparency
Technicolour
Prole
Posts: 24
Joined: Sat Sep 24, 2011 12:22 am

Re: I Love Gameboy

Post by Technicolour »

Xgoff wrote:i wouldn't think you'd need premultiplied alpha anyway since as far as i know, the gameboy only uses simple masking for transparency
It's not the alpha for the gameboy itself (that's handled entirely in software), rather, there's an issue with the alpha when the pixels are being drawn to the canvas and/or the canvas being drawn to the window.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: I Love Gameboy

Post by Xgoff »

i can get it to work "correctly" if i clear the canvas with 255, 255, 255, 255 right after setting it

"correctly" as in it doesn't work well with the "drawing only changed pixels" optimization. but then if you removed that optimization you wouldn't need canvas clearing anyway. unfortunately clearing is really fast :(

using imagedata instead of canvas might be an option (as you only need points) but unfortunately there's no way to set imagedata data from a table (without expensive per-pixel functions)
Technicolour
Prole
Posts: 24
Joined: Sat Sep 24, 2011 12:22 am

Re: I Love Gameboy

Post by Technicolour »

Yeah unfortunately without the only-updating-changed-pixels optomisation the fps is in signle figures at best.
User avatar
SiENcE
Party member
Posts: 804
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: I Love Gameboy

Post by SiENcE »

Hey,

i added a lua bitwise operation lib and a fix to run it on 0.7.2.

But, i only get a nearly corrrect screen on 0.8.0.

On 0.7.2 is something wrong.

This might be, because in 0.7.2 the framebuffer is cleared after you have drawn it. In 0.8.0 you have to clear the canvas yourself.
Attachments
Love Gameboy_(bitfix).love
Love Gameboy with bitfix (runs on 0.8.0 and 0.7.2)
(29.94 KiB) Downloaded 101 times
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests