Skip to content

Corona SDK plug-in for dynamically shading display objects in real time

Notifications You must be signed in to change notification settings

sporkfin/DynamicShaderPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Shader

A Corona SDK plug-in for dynamically shading display objects in real time

Dynamic Shader: Plugin API Docs

 
Type Library
Corona Store Dynamic Shader
Visual Guide Visual Guide

Overview

The Dynamic Shader plugin can be used in your Corona project. It enables you to add real time shading to your display objects.

ADDITIONALLY, you will need to provide a normal map file for each object you wish to shade. There are many applications that will allow you to easily create normal maps for your image files. We suggest trying Sprite Illuminator using their free trial option. If you like it, please upgrade.

The Dynamic Shader does NOT support image sheets

Syntax

local shader = require "plugin.dynamic_shader"

Functions

Controlling the Light Source

Adding and Removing Objects

Adjusting Shading Parameters

Controlling the Dynamic Shading Engine

Info and Debugging

Pulse Functions

Pulse Alpha

Pulse Intensity

Pulse zValue

Pulse Time

Pulse Easing

Parameters

  • effect string "composite.normalMapWith1DirLight" or "composite.normalMapWith1PointLight"
  • effectName = string "directional light" or "1 point light"
  • table.color = table table = {red, blue, greed, alpha}
  • table.alpha = number a value from 0 to 1
  • table.intensity = number a value from 0 to 1
  • table.zValue = number a value from 0 to 1
  • table.constant = number a value from 0 to 1
  • table.linear = number a value from 0 to 1
  • table.quadratic = number a value from 0 to 1
  • table.engine = Boolean true = "shader on" , false = "shader off"

Project Configuration

Corona Store Activation

In order to use this plugin, you must activate the plugin at the Corona Store. You will also need to provide a normal map file for each object you wish to shade. There are many applications that will allow you to easily create normal maps for your image files. We suggest trying Sprite Illuminator using their free trial option. If you like it, please upgrade.

SDK

When you build using the Corona Simulator, the server automatically takes care of integrating the plugin into your project.

All you need to do is add an entry into a plugins table of your build.settings. The following is an example of a minimal build.settings file:

settings =
{
    plugins =
    {
        ["plugin.dynamic_shader"] = { publisherId = "com.sporkfin" }
    },      
}

Enterprise

If you have activated this plugin, you can download this plugin from the corresponding plugin page in the Corona Store.

Platform-specific Notes

[Insert discussion on issues specific to iOS/Android/etc, or to specific devices]

Resources

Sample Code

You can access sample code here.

Support

More support is available from the PUBLISHER_NAME team:

Compatibility

Platform Supported
iOS Yes
Android Yes
Android (GameStick) No
Android (Kindle) Yes
Android (NOOK) Yes
Android (Ouya) No
Mac App Yes
Win32 App Yes
Windows Phone 8 No
Corona Simulator (Mac) Yes
Corona Simulator (Win) Yes

About

Corona SDK plug-in for dynamically shading display objects in real time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published