Code Monkey home page Code Monkey logo

lumiere's Introduction

Lumiere - Work In Progress!

Lumiere is a collection of post processing effects for use in Defold.

Installation

You can use Lumiere in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:

https://github.com/britzl/lumiere/archive/master.zip

Or point to the ZIP file of a specific release.

Usage

Lumiere has to be integrated with your render script to be able to apply effects.

Render script integration

Integrating Lumiere is done in two steps:

  1. Add /lumiere/lumiere.go to a loaded collection, either the bootstrap collection or a loaded proxy collection. This game object contains a full screen quad to which the final composition of post processing effects is drawn.
  2. Integrate Lumiere in the render script:
-- require lumiere for use in the render script
local lumiere = require("lumiere.lumiere")


function init(self)
	-- initialize lumiere
	lumiere.init()

	-- the rest of your init code
	...
end

function update(self)
	-- update lumiere each frame
	lumiere.update()

	-- your render script update code
	...

	-- wrap any render.draw() calls that should be affected by lumiere effects
	lumiere.draw(function()
		local frustum = self.projection * self.view
		render.draw(self.tile_pred, { frustum = frustum })
		render.draw(self.particle_pred, { frustum = frustum })
	end)

	...
end

function M.on_message(self, message_id, message, sender)
	-- pass messages to lumiere (to detect change in clear color etc)
	lumiere.on_message(message_id, message, sender)

	-- the rest of your on_message code
	...
end

Using effects

Lumiere provides a system to apply multiple post-effects to a game. Examples of effects provided:

Each effect consists of some shader code, a Lua module and a game object. To use an effect the game object for the effect has to be added to a loaded collection, either the bootstrap collection or a loaded proxy collection. The Lua module for the effect also has to be added to Lumiere:


local lumiere = require("lumiere.lumiere")
local blur = require("lumiere.effects.blur.blur")
local grain = require("lumiere.effects.grain.grain")


function init(self)
	-- use the blur and grain effect (in that order)
	lumiere.use_effects({ blur, grain })
end

lumiere's People

Contributors

britzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lumiere's Issues

Dependency: not compatible with current defold-orthographic

Hi Britzl,

looks like Lumiere does not play with the current version of the orthographic camera anymore?

Adding https://github.com/britzl/defold-orthographic/archive/2.6.0.zip as a dependency to my test project works (as in the Lumiere example project), but adding https://github.com/britzl/defold-orthographic/archive/master.zip as a dependency results in an error.

Apparently, "orthographic/render/helper.lua" is referenced but no longer exists in the current version?

Best regards,
Lutz

Picture in picture rendering for multiple predicates

Something I want is the ability to render specific scenes within rectangles (as in cutting off the sides outside of a rectangle) using multiple 3d cameras. Manually setting this up in like rendercam is a bit of a pain. It can be useful for drawing 3d characters on top of other assets.

ucf9hi12rx931

This is a kind of thing that would be useful to be able to do. I've thought about ways to do this properly and it all seems like a pain to me.

Another thing is imagine 3 windows looking into 3 different 3d scenes. It is currently possible to do but requires custom render script, maybe it could be made simple and easy.

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.