Page 2 of 4
Re: The Image Effect Giver
Posted: Sun Sep 04, 2011 2:28 pm
by Ancurio
kraftman wrote:I've started converting your code to use shaders just to see how much quicker it'd be.
There's only a couple atm, I'll add a few more later.
Obviously this needs 0.8+ to run
Wow, this speed is awesome! Just cloned the latest 0.8 source and built it just to test this,
I'm speechless..
btw., reading the changelog, I didn't see any mention of "shaders", were they already added earlier or are
they simply known under a different name?
Re: The Image Effect Giver
Posted: Sun Sep 04, 2011 2:30 pm
by GijsB
but when we have shaders what is then the use of Imagedata:MapPixel(function)?
Re: The Image Effect Giver
Posted: Sun Sep 04, 2011 3:07 pm
by thelinx
Ancurio wrote:
btw., reading the changelog, I didn't see any mention of "shaders", were they already added earlier or are
they simply known under a different name?
The LÖVEly name for them is "
PixelEffects"
GijsB wrote:but when we have shaders what is then the use of Imagedata:MapPixel(function)?
mapPixel can still be used for one-time image modification, or generating data from an image (tiled maps using an image for reference, like Notch likes to do things)
Also, not all platforms support PixelEffects.
Re: The Image Effect Giver
Posted: Sun Sep 04, 2011 4:10 pm
by GijsB
thelinx wrote:
mapPixel can still be used for one-time image modification, or generating data from an image (tiled maps using an image for reference, like Notch likes to do things)
Also, not all platforms support PixelEffects.
But for that we have Qauds..
Re: The Image Effect Giver
Posted: Sun Sep 04, 2011 7:01 pm
by thelinx
GijsB wrote:thelinx wrote:
mapPixel can still be used for one-time image modification, or generating data from an image (tiled maps using an image for reference, like Notch likes to do things)
Also, not all platforms support PixelEffects.
But for that we have Qauds..
No, I mean making an image to show where tiles are located, then loading that image and putting the data in a table.
Re: The Image Effect Giver
Posted: Sun Sep 04, 2011 9:43 pm
by kraftman
GijsB wrote:but when we have shaders what is then the use of Imagedata:MapPixel(function)?
Shaders are fast and so are useful for applying effects per frame, but kind of overkill for one-off changes to an image.
Re: The Image Effect Giver
Posted: Wed Sep 07, 2011 9:41 am
by miko
GijsB wrote:but when we have shaders what is then the use of Imagedata:MapPixel(function)?
If I am not mistaken, output of the shaders goes directly to the screen, you can not save your modified image. With :MapPixel() you can.
Re: The Image Effect Giver
Posted: Wed Sep 07, 2011 10:28 am
by kraftman
miko wrote:GijsB wrote:but when we have shaders what is then the use of Imagedata:MapPixel(function)?
If I am not mistaken, output of the shaders goes directly to the screen, you can not save your modified image. With :MapPixel() you can.
You can draw to a Canvas/Framebuffer with a shader though.
Re: The Image Effect Giver
Posted: Wed Sep 07, 2011 6:02 pm
by The Burrito
mapPixel pretty much works on all computers, shaders and framebuffers do not (although usually framebuffers just have nonPo2 issues).
kraftman wrote:miko wrote:GijsB wrote:but when we have shaders what is then the use of Imagedata:MapPixel(function)?
If I am not mistaken, output of the shaders goes directly to the screen, you can not save your modified image. With :MapPixel() you can.
You can draw to a Canvas/Framebuffer with a shader though.
framebuffers are not really intended for long term storage, I would definitely avoid using them for calculate once kind of things, especially if you need to make a lot of them.
Re: The Image Effect Giver
Posted: Wed Sep 07, 2011 8:33 pm
by Jasoco
The Burrito wrote:framebuffers are not really intended for long term storage, I would definitely avoid using them for calculate once kind of things, especially if you need to make a lot of them.
Explain.