fakecanvas: canvases for everyone??? [tldr: barely]

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

fakecanvas: canvases for everyone??? [tldr: barely]

Post by Xgoff » Thu Aug 02, 2012 4:26 am

after posting this i somehow got inspired to actually try it. predictably, screenshots aren't affected by the scissor box and only capture what's in the window, so that changed my plans somewhat.

the readme in the link below explains everything. i'll mention again, though, that i'm unsure if this will work for actual programs, because of the dodginess involved. it's pretty likely i have missed some things too. so don't get your hopes up!

love 0.8 is required for this library

github link

attached is the mentioned "minimal test", which draws to and renders a fake canvas, and (if supported) a real canvas. this allows you to compare the results and verify that the library actually works to some extent. underneath, the shader shows that i cared enough to vertically flip the image so that it matches the unfortunately inverted real canvas' texture coordinates

EDIT: should work without pixeleffect support now
Attachments
fakecanvas.love
test test test
(3.96 KiB) Downloaded 339 times
Last edited by Xgoff on Sat Aug 04, 2012 4:53 am, edited 3 times in total.

User avatar
Roland_Yonaba
Inner party member
Posts: 1562
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: fakecanvas: canvases for everyone???

Post by Roland_Yonaba » Thu Aug 02, 2012 8:44 am

What the - :awesome:
That's good news. I predict this is going to be slow, but key, if it works, that's all folks.
Watching this on Github. Kinda busy right now, will try this as soon as possible.
Xgoff, be blessed. :nyu:

User avatar
Nixola
Inner party member
Posts: 1940
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: fakecanvas: canvases for everyone???

Post by Nixola » Thu Aug 02, 2012 9:37 am

Oh, wow, software canvas support! What does it require? Pixeleffects >.<
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: fakecanvas: canvases for everyone???

Post by Xgoff » Thu Aug 02, 2012 12:20 pm

Nixola wrote:Oh, wow, software canvas support! What does it require? Pixeleffects >.<
it doesn't actually require pixeleffects (the demo file does though, oops), unless i messed up somewhere and assumed they existed

EDIT: apparently i did

EDIT2: fixed hopefully

User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: fakecanvas: canvases for everyone???

Post by mickeyjm » Fri Aug 03, 2012 2:22 pm

As I get the text saying if you can see this take my word for it, could you upload a screenshot of it displaying the canvas version so I can see with my own eyes how similar they look?
Your screen is very zoomed in...

User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: fakecanvas: canvases for everyone???

Post by Xgoff » Fri Aug 03, 2012 3:20 pm

mickeyjm wrote:As I get the text saying if you can see this take my word for it, could you upload a screenshot of it displaying the canvas version so I can see with my own eyes how similar they look?
Image

both should (in theory) always look the same since they use the same drawing functions. unless there are subtle driver differences or if canvases are handled differently, settings-wise... but that's something that has to be seen still

Zeliarden
Party member
Posts: 139
Joined: Tue Feb 28, 2012 4:40 pm

Re: fakecanvas: canvases for everyone???

Post by Zeliarden » Fri Aug 03, 2012 4:48 pm

anyone tested this on a real game/program? how fast is it?

User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: fakecanvas: canvases for everyone???

Post by Xgoff » Sat Aug 04, 2012 4:52 am

just to let everyone know: i'll still work on finishing this, but based on some tests i've lost hope in it being very useful in many cases; it's not *as* slow as i figured it would be (clearing a canvas is really slow, though, but clearing it to full transparency can probably be sped up somewhat)... however, all those screenshots eat ram like popcorn, and you will get some hilariously high memory usage if you're updating even a single canvas each frame :(

so, it's probably going to be limited in usefulness to things that don't need to draw to canvases often (like guis i guess)

but it did answer my original question: is it possible? yes. but is it practical? not really!

to quote myself:
get better drivers/hardware dammit >:(

User avatar
Nixola
Inner party member
Posts: 1940
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: fakecanvas: canvases for everyone???

Post by Nixola » Sat Aug 04, 2012 7:30 am

Xgoff wrote: get better drivers/hardware dammit >:(
Or just install Linux and stick with it
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: fakecanvas: canvases for everyone???

Post by mickeyjm » Sat Aug 04, 2012 10:42 am

Zeliarden wrote:anyone tested this on a real game/program? how fast is it?
I tried it on the 3D planets demo, but it looked kind of...warped, but for simpe things it seems to work well
Your screen is very zoomed in...

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests