{{newinoldin|[[0.8.0]]|080|[[0.9.0]]|090|type=function|text=It has been renamed to [[love.graphics.newShader]]}}
Creates a new PixelEffect object for hardware-accelerated pixel level effects.

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

== 関数 ==
=== 概要 ===
<source lang="lua">
pixeleffect = love.graphics.newPixelEffect( code )
</source>
=== 引数 ===
{{param (日本語)|string|code|The pixel effect code.}}
=== 返値 ===
{{param (日本語)|PixelEffect|pixeleffect|A PixelEffect object for use in drawing operations.}}

== Effect Language ==
Pixel effects are not programmed in Lua, but by using a special effect language instead. The effect language is basically [http://www.opengl.org/sdk/docs/manglsl/ GLSL 1.20] ([http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf specs]) with a few aliases added for existing types:

{|cellpadding="5"
!GLSL               || Effect language
|-
|float              || number
|-
|sampler2D          || Image
|-
|uniform            || extern
|-
|texture2D(tex, uv) || Texel(tex, uv)
|}

== Effect Function ==
=== 概要 ===
<source lang="glsl">
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords )
</source>
=== 引数 ===
{{param (日本語)|vec4|color|The drawing color set with [[love.graphics.setColor]].}}
{{param (日本語)|Image|texture|The texture of the image or canvas being drawn.}}
{{param (日本語)|vec2|texture_coords|Coordinates of the pixel relative to the texture. The y-axis of canvases are inverted. Coordinates (1,1) would be the top right corner of the canvas.}}
{{param (日本語)|vec2|screen_coords|Coordinates of the pixel on the screen. Pixel coordinates are not normalized (unlike texture coordinates). (0.5, 0.5) is the bottom left of the screen.}}
=== 返値 ===
{{param (日本語)|vec4|output_color|The color of the pixel.}}


== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[Constructs::PixelEffect (日本語)]]
* [[love.graphics.setPixelEffect (日本語)]]
[[Category:Functions (日本語)]]
[[Sub-Category::Object Creation (日本語)| ]]
{{#set:Description=Creates a new [[PixelEffect]].}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.newPixelEffect}}