A Corona SDK plug-in for dynamically shading display objects in real time
Type | Library |
Corona Store | Dynamic Shader |
Visual Guide | Visual Guide |
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
local shader = require "plugin.dynamic_shader"
- shader.addLight()
- shader.removeLight()
- shader.setLightColor()
- shader.switchLightType()
- shader.getLightSource()
- shader.setAlpha()
- shader.setIntensity()
- shader.setZValue()
- shader.setConstant()
- shader.setLinear()
- shader.setQuadratic()
- 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"
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.
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" }
},
}
If you have activated this plugin, you can download this plugin from the corresponding plugin page in the Corona Store.
[Insert discussion on issues specific to iOS/Android/etc, or to specific devices]
You can access sample code here.
More support is available from the PUBLISHER_NAME team:
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 |