Copy pixels from one image to another? [resolved]

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
OmarShehata
Party member
Posts: 259
Joined: Tue May 29, 2012 6:46 pm
Location: Egypt
Contact:

Copy pixels from one image to another? [resolved]

Post by OmarShehata »


I've rephrased my question to:

It is possible to copy pixels from one canvas/image to another using PixelEffect? If so, how?


The answers seems to be no, you can't alter a texture that was sent to a PixelEffect. I've decided to just copy the pixels with imageData instead.

----------------------------------------------------------------------------------------------------

Quick question, if I have a PixelEffect running on an object, and I pass to it a canvas. Is it possible to alter this Canvas?

So if I have something like:

Code: Select all

extern Image GBuffer;

vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords)
{
vec4 pixel = Texel(texture, texture_coords);
vec4 bufferPixel = Texel(GBuffer,texture_coords);


//do some stuff, blah blah, change color of pixel

bufferPixel.rgba = pixel.rgba;

return pixel;
}

This code should copy over the old texture to "GBuffer", but that doesn't seem to happen. In fact it says that the "GBuffer" variable isn't being used. So I'm guessing I'm doing it wrong?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 55 guests