Giter Club home page Giter Club logo

shine's Introduction

shine

Postprocessing in LÖVE made easy as pi.

Usage:

local shine = require 'shine'

function love.load()
    -- load the effects you want
    local grain = shine.filmgrain()
    
    -- many effects can be parametrized
    grain.opacity = 0.2
    
    -- multiple parameters can be set at once
    local vignette = shine.vignette()
    vignette.parameters = {radius = 0.9, opacity = 0.7}
    
    -- you can also provide parameters on effect construction
    local desaturate = shine.desaturate{strength = 0.6, tint = {255,250,200}}
    
    -- you can chain multiple effects
    post_effect = desaturate:chain(grain):chain(vignette)

    -- warning - setting parameters affects all chained effects:
    post_effect.opacity = 0.5 -- affects both vignette and film grain

    -- more code here
end
    
function love.draw()
    -- wrap what you want to be post-processed in a function:
    post_effect:draw(function()
        draw()
        my()
        stuff()
    end)
    
    -- alternative syntax:
    -- post_effect(function()
    --     draw()
    --     my()
    --     stuff()
    -- end)
    
    -- everything you draw here will not be affected by the effect
end

Documentation:

A full documentation including all included effects can be found in the wiki.

Add your own effects:

Easy: create a new file that returns a table with:

  • a table requires that names the required graphics capabilities (shader, canvas, ...),
  • a function new(self) that initialized the effect (creates canvas, shaders, ...),
  • a function draw(self, func) that applies the effect, and
  • a function set(self, key, value) to set parameters of the effect.

See the wiki for more information.

shine's People

Contributors

vrld avatar pablomayobre avatar danieloaks avatar josefnpat avatar martinfelis avatar antoniomoder avatar janwerder avatar yonaba avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.