love.graphics.newPixelEffect

Available since LÖVE 0.8.0
This function is not supported in earlier versions.

Creates a new PixelEffect object for hardware-accelerated pixel level effects.

A PixelEffect contains at least one function, named effect, which is the effect itself, but it can contain additional functions.

Function

Synopsis

pixeleffect = love.graphics.newPixelEffect( code )

Arguments

string code
The pixel effect code.

Returns

PixelEffect pixeleffect
A PixelEffect object for use in drawing operations.

Effect Function

Synopsis

vec4 effect( vec4 color, sampler2D texture, vec2 texture_coords, vec2 pixel_coords )

Arguments

vec4 color
The color of the polygon itself. The same as the last love.graphics.setColor call
sampler2D texture
The texture currently used by the polygon, if it has one.
vec2 texture_coords
The current texture coordinates.
vec2 pixel_coords
The current pixel coordinates.

Returns

vec4 output_color
The color to set the current pixel to.
  • Note: LÖVE defines the types Image and Texel, which can be used instead of sampler2D and texture2D, respectively.

See Also

Other Languages