I'm currently trying to take a greyscale image and turn it into pure black and white every draw event.
Idon't know much about the way I should do this, but I think it should either be done by drawing to a framebuffer (or canvas), getting the framebuffer's imagedata, and then using a MapPixel function on the image data. This seems to be the easier method, as the color values are easy to manipulate, but I need to perform the mapping every draw event, and imagedata (or making a new image from it) specifically says that this isn't a good idea.
The second option seems to be using löve 0.8.0 and using PixelEffect, which appears to be much more speed-friendly. However, the wiki shows next to nothing on how to use these.
Therefore, could someone in the know please provide me (and other rookies) with some help or enlightenment on how to use PixelEffect?
PixelEffect vs MapPixel (a cry for pixeleffect enlightenmen)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: PixelEffect vs MapPixel (a cry for pixeleffect enlighten
Can't you store the black and white version somewhere, and just calculate it once, instead of on every draw event?timmeh42 wrote: turn it into pure black and white every draw event.
When I write def I mean function.
Re: PixelEffect vs MapPixel (a cry for pixeleffect enlighten
Unfortunately not as the image (image? canvas? dunno what to call it) is dynamic; also, this isn't for merely a cosmetic effect as its used as an alpha mask for another image or texture.
I have already achieved the effect in GameMaker, but it used a rather hack-ish way (repeated drawing with a "dodge" blend mode as far as I remember), and I wanted to port it to Löve.
I have already achieved the effect in GameMaker, but it used a rather hack-ish way (repeated drawing with a "dodge" blend mode as far as I remember), and I wanted to port it to Löve.
Last edited by timmeh42 on Thu Mar 15, 2012 6:39 pm, edited 1 time in total.
Re: PixelEffect vs MapPixel (a cry for pixeleffect enlighten
I didn't know anything about pixeleffects too, but then found this thread:
Share a shader!
I have to say it's a great thread with very good examples! I learned quite much about shaders even though I knew nothing.
Share a shader!
I have to say it's a great thread with very good examples! I learned quite much about shaders even though I knew nothing.
Re: PixelEffect vs MapPixel (a cry for pixeleffect enlighten
Ah thanks very much. Didn't find it when i searched because I searched for the wrong terms...
On the other hand, oh poop. One of the shaders does exactly what I intended, and better (the metaballs one). Oh well
On the other hand, oh poop. One of the shaders does exactly what I intended, and better (the metaballs one). Oh well
Who is online
Users browsing this forum: No registered users and 3 guests