Difference between revisions of "Shader"
m |
(→See Also) |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 2: | Line 2: | ||
A Shader is used for advanced hardware-accelerated pixel or vertex manipulation. These effects are written in a language based on GLSL (OpenGL Shading Language) with a few things simplified for easier coding. | A Shader is used for advanced hardware-accelerated pixel or vertex manipulation. These effects are written in a language based on GLSL (OpenGL Shading Language) with a few things simplified for easier coding. | ||
− | Potential uses for | + | Potential uses for shaders include HDR/bloom, motion blur, grayscale/invert/sepia/any kind of color effect, reflection/refraction, distortions, bump mapping, and much more! Here is a collection of basic shaders and good starting point to learn: https://github.com/vrld/moonshine |
+ | |||
+ | To use the most recent version of GLSL, you must put <code>#pragma language glsl3</code> at the top of your shader files. See [[love.graphics.newShader]] for details. | ||
== Constructors == | == Constructors == | ||
− | {{#ask: [[Category:Functions]] [[Constructs::Shader]] | + | {{#ask: [[Category:Functions]] [[Constructs::Shader]] [[Concept:Current]] |
| headers=hide | | headers=hide | ||
| default=None. | | default=None. | ||
Line 15: | Line 17: | ||
| ?PrettySince | | ?PrettySince | ||
| ?PrettyRemoved | | ?PrettyRemoved | ||
+ | | ?PrettyDeprecated | ||
}} | }} | ||
== Functions == | == Functions == | ||
− | {{#ask: [[Category:Functions]] [[parent::Shader||Object]] | + | {{#ask: [[Category:Functions]] [[parent::Shader||Object]] [[Concept:Current]] |
| headers=hide | | headers=hide | ||
| format=template | | format=template | ||
Line 26: | Line 29: | ||
| ?PrettySince | | ?PrettySince | ||
| ?PrettyRemoved | | ?PrettyRemoved | ||
+ | | ?PrettyDeprecated | ||
}} | }} | ||
== Supertypes == | == Supertypes == | ||
Line 32: | Line 36: | ||
* [[parent::love.graphics]] | * [[parent::love.graphics]] | ||
* [[love.graphics.setShader]] | * [[love.graphics.setShader]] | ||
+ | * [[Shader Variables]] | ||
+ | * [https://blogs.love2d.org/content/beginners-guide-shaders A Beginner's Guide to Shaders] | ||
[[Category:Types]] | [[Category:Types]] | ||
{{#set:Description=Shader effect.}} | {{#set:Description=Shader effect.}} | ||
+ | |||
== Other Languages == | == Other Languages == | ||
{{i18n|Shader}} | {{i18n|Shader}} | ||
− | |||
− |
Latest revision as of 14:16, 2 April 2023
Available since LÖVE 0.9.0 |
This type is not supported in earlier versions. |
A Shader is used for advanced hardware-accelerated pixel or vertex manipulation. These effects are written in a language based on GLSL (OpenGL Shading Language) with a few things simplified for easier coding.
Potential uses for shaders include HDR/bloom, motion blur, grayscale/invert/sepia/any kind of color effect, reflection/refraction, distortions, bump mapping, and much more! Here is a collection of basic shaders and good starting point to learn: https://github.com/vrld/moonshine
To use the most recent version of GLSL, you must put #pragma language glsl3
at the top of your shader files. See love.graphics.newShader for details.
Constructors
love.graphics.newShader | Creates a new Shader. | 0.9.0 |
Functions
Object:release | Immediately destroys the object's Lua reference. | 11.0 | |
Object:type | Gets the type of the object as a string. | ||
Object:typeOf | Checks whether an object is of a certain type. | ||
Shader:getExternVariable | Gets information about an 'extern' ('uniform') variable in the Shader. | 0.9.2 | 11.0 |
Shader:getWarnings | Gets warning and error messages (if any). | 0.9.0 | |
Shader:hasUniform | Gets whether a uniform / extern variable exists in the Shader. | 11.0 | |
Shader:send | Sends one or more values to the shader. | 0.9.0 | |
Shader:sendColor | Sends one or more colors to the shader. | 0.10.0 |
Supertypes
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info