Naev

Module love_shaders

A module containing a diversity of Love2D shaders for use in Naev.

These are designed to be used with the different aspects of the VN framework.

In general all shaders have a "strength" parameter indicating the strength of the effect. Furthermore, those that have a temporal component have a "speed" parameter. These are all normalized such that 1 is the default value. Temporal component can also be inverted by setting a negative value.

Functions

shader2canvas (shader[, width=love.w][, height=love.h], img) Renders a shader to a canvas.
paper (width, height[, sharpness=1]) Generates a paper-like image.
blur (image[, kernel_size=5[, blurtype="gaussian"]]) Blur shader applied to an image.
oldify (params) Creates an oldify effect, meant for full screen effects.
hologram (params) A hologram effect, mainly meant for VN characters.
corruption (params) A corruption effect applies a noisy pixelated effect.
steam (params) A rolling steamy effect.
circuit (params) An electronic circuit-board like shader.
windy (params) A windy type shader.
aura (params) An aura effect for characters.
colour (params) Simple colour modulation shader.
tint (params) Simple colour modulation shader.
cyberspace (params) A cyberspace effect, mainly for backgrounds.

Tables

shaderparams Shader common parameter table.

Fields

shaderimage2canvas Renders an image with a shader to a canvas.


Functions

shader2canvas (shader[, width=love.w][, height=love.h], img)
Renders a shader to a canvas.

Parameters:

  • shader Shader Shader to render.
  • width number Width of the canvas to create (or nil for fullscreen). (default love.w)
  • height number Height of the canvas to create (or nil for fullscreen). (default love.h)
  • img Image Image to use in the shader.

Returns:

    Canvas Generated canvas.
paper (width, height[, sharpness=1])
Generates a paper-like image.

Parameters:

  • width number Width of the image to create.
  • height number Height of the image to create.
  • sharpness number How sharp to make the texture look. (default 1)

Returns:

    Canvas A apper-like canvas image.
blur (image[, kernel_size=5[, blurtype="gaussian"]])
Blur shader applied to an image.

Parameters:

  • image Drawable A drawable to blur.
  • kernel_size number The size of the kernel to use to blur. This is the number of pixels in the linear case or the standard deviation in the Gaussian case. (default 5)
  • blurtype string Either "linear" or "gaussian". (default "gaussian")
oldify (params)
Creates an oldify effect, meant for full screen effects.

Parameters:

  • params Parameter table where "strength" field is used.

See also:

hologram (params)
A hologram effect, mainly meant for VN characters.

Parameters:

  • params Parameter table where "strength" field is used.

See also:

corruption (params)
A corruption effect applies a noisy pixelated effect.

Parameters:

  • params Parameter table where "strength" field is used.

See also:

steam (params)
A rolling steamy effect. Meant as/for backgrounds.

Parameters:

  • params Parameter table where "strength" and "speed" fields is used.

See also:

circuit (params)
An electronic circuit-board like shader. Meant as/for backgrounds.

Parameters:

  • params Parameter table where "strength" and "speed" fields is used.

See also:

windy (params)
A windy type shader. Meant as/for backgrounds, however, it is highly transparent.

Parameters:

  • params Parameter table where "strength", "speed", and "density" fields is used.

See also:

aura (params)
An aura effect for characters.

The default size is 40 and refers to the standard deviation of the Gaussian blur being applied.

Parameters:

  • params Parameter table where "strength", "speed", "colour", and "size" fields are used.

See also:

colour (params)
Simple colour modulation shader.

Parameters:

  • params Parameter table where "colour" field is used.

See also:

tint (params)
Simple colour modulation shader.

Same as love_shaders.colour, except it has an additional uniform 'strength' that controls how the tint is applied.

Parameters:

  • params Parameter table where "colour" field is used.

See also:

cyberspace (params)
A cyberspace effect, mainly for backgrounds.

Parameters:

  • params Parameter table where "colour", and "size" fields are used.

See also:

Tables

shaderparams
Shader common parameter table.

Fields:

  • strength number Strength of the effect normalized such that 1.0 is the default value.
  • speed number Speed of the effect normalized such that 1.0 is the default value. Negative values run the effect backwards. Only used for those shaders with temporal components.
  • colour Colour Colour component to be used. Should be in the form of {r, g, b} where r, g, and b are numbers.
  • size number Affects the size of the effect.

Fields

shaderimage2canvas
Renders an image with a shader to a canvas.
  • shader Shader Shader to user
  • image Image Image to render.
  • width number Width of the canvas to create. (default image.w)
  • height number Height of the canvas to create. (default image.h)
  • sx number Scale factor for width. (default 1)
  • sy number Scale factor for height. (default 1)
generated by LDoc 1.5.0 Last updated 2024-11-21 07:14:26