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.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.
The positions are clearly correct, it's just the colour/transparency seems wierd.Code: Select all
love.graphics.setColor( Colour, Colour, Colour, 255 ) love.graphics.point( n + 0.5, YCo + 0.5 )
I Love Gameboy
Re: I Love Gameboy
Re: I Love Gameboy
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
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
- slime
- Solid Snayke
- Posts: 3161
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: I Love Gameboy
Try setting the blend mode to "premultiplied" when drawing the canvas to the screen (before line 44 of main.lua).
-
- Prole
- Posts: 24
- Joined: Sat Sep 24, 2011 12:22 am
Re: I Love Gameboy
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.slime wrote:Try setting the blend mode to "premultiplied" when drawing the canvas to the screen (before line 44 of main.lua).
Re: I Love Gameboy
I changed to this and things got better. but not perfect yet.
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
Code: Select all
love.graphics.setBlendMode( "premultiplied" )
love.graphics.draw(canvas, 10, 10, 0, 3, 3)
love.graphics.setBlendMode( "alpha" )
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
Re: I Love Gameboy
i wouldn't think you'd need premultiplied alpha anyway since as far as i know, the gameboy only uses simple masking for transparency
-
- Prole
- Posts: 24
- Joined: Sat Sep 24, 2011 12:22 am
Re: I Love Gameboy
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.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
Re: I Love Gameboy
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)
"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)
-
- Prole
- Posts: 24
- Joined: Sat Sep 24, 2011 12:22 am
Re: I Love Gameboy
Yeah unfortunately without the only-updating-changed-pixels optomisation the fps is in signle figures at best.
Re: I Love Gameboy
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.
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
Who is online
Users browsing this forum: No registered users and 3 guests