Page 3 of 4
Re: The Image Effect Giver
Posted: Wed Sep 07, 2011 9:58 pm
by kraftman
It's not long term storage :/
Re: The Image Effect Giver
Posted: Wed Sep 07, 2011 10:07 pm
by slime
Framebuffers/canvases will stay in VRAM all the time until they're gone, taking up space even when they aren't used, I think.
Re: The Image Effect Giver
Posted: Wed Sep 07, 2011 11:11 pm
by kraftman
slime wrote:Framebuffers/canvases will stay in VRAM all the time until they're gone, taking up space even when they aren't used, I think.
but if you're using the same one each time its ok?
Re: The Image Effect Giver
Posted: Thu Sep 08, 2011 1:18 am
by Rad3k
kraftman wrote:slime wrote:Framebuffers/canvases will stay in VRAM all the time until they're gone, taking up space even when they aren't used, I think.
but if you're using the same one each time its ok?
AFAIK, with hardware accelerated graphics, moving things between regular RAM and VRAM is a relatively expensive operation. So if you keep frequently used sprites (or textures) in VRAM, then you actually get a speed benefit.
Re: The Image Effect Giver
Posted: Thu Sep 08, 2011 1:42 am
by kraftman
But the speed of using a shader + framebuffer is 1.7 billion times faster than using mapPixel(etc)
Re: The Image Effect Giver
Posted: Thu Sep 08, 2011 7:14 am
by Jasoco
The point is FrameBuffers don't just disappear if not used, right? They're permanent until destroyed manually.
Re: The Image Effect Giver
Posted: Thu Sep 08, 2011 10:53 am
by Rad3k
You can save framebuffer's contents back to imagedata (with :getImageData), so I don't see why framebuffers (combined with shaders) couldn't (or shouldn't) be used for image effects, if this would speed up calculations. But, like The Burrito pointed out, you can't rely on them working on every computer, so it's always good to have a fallback using :MapPixel.
Jasoco wrote:The point is FrameBuffers don't just disappear if not used, right? They're permanent until destroyed manually.
If you keep a reference to them, then probably yes. If not, then I
think Löve should automatically free them when they're garbage-collected.
Re: The Image Effect Giver
Posted: Thu Sep 08, 2011 2:13 pm
by GijsB
Guys, back on topic plase xD?
Give me some ideas for effects
Re: The Image Effect Giver
Posted: Thu Sep 08, 2011 3:18 pm
by vrld
Implement convolution. Using that you can do a lot of stuff, like blur, sharpening, edge detection, corner detection, emboss, ...
Re: The Image Effect Giver
Posted: Thu Sep 08, 2011 8:59 pm
by Jasoco
Rad3k wrote:Jasoco wrote:The point is FrameBuffers don't just disappear if not used, right? They're permanent until destroyed manually.
If you keep a reference to them, then probably yes. If not, then I
think Löve should automatically free them when they're garbage-collected.
What do you mean "keep a reference to them"?