Strawbry_jam
Member
Note: This asset is no longer being supported or updated.
Description
This is a normal map lighting engine using deferred rendering, made and designed for GameMaker Studio 2.
Features:
Normal map lighting makes your flat 2d world pop out and look 3d. Specular highlights give sprites shininess like metallic armor or glass. Ambient occlusion gives sprites realistic shadows that disappear in light.
How do you use it?
Manual covering all the functions in detail.
It's as easy as that!
For spine support, I created a tool (download) to generate the required code and materials. Takes the spine atlas image, atlas file, and json file and exports the creation code for the object and a map. Spine lighting has never been easier to add!
This is a normal map lighting engine using deferred rendering, made and designed for GameMaker Studio 2.
Features:
- Easy to drop into any project and implement lighting
- Highly optimized
- Supports sprites and tilemap layers
- Supports Spine Animations with a tool to streamline the process! (download)
- No set limit on number of lights (and performance doesn't take much of a hit for more)
- Includes functionality for Specular Highlights and Ambient Occlusion
Normal map lighting makes your flat 2d world pop out and look 3d. Specular highlights give sprites shininess like metallic armor or glass. Ambient occlusion gives sprites realistic shadows that disappear in light.
How do you use it?
Manual covering all the functions in detail.
Code:
\\\create event lighting controller object
if(view_enabled){
lighting_init(camera_get_view_width(view_camera[0]),camera_get_view_width(view_camera[0]),true,true,false,false);
} else {
lighting_init(room_width,room_height,true,true,false,false);
}
\\\draw end event lighting controller object
lighting_draw_all();
\\\create event player
lighting_instance_create();
lighting_instance_normals(sprPlayerNormals);
lighting_instance_specular(sprPlayerSpecular); //optional
lighting_instance_ao(sprPlayerOcclusion); //optional
\\\draw event player
draw_self();
lighting_instance_add();
\\\create event light
lighting_light_create(true);
lighting_light_radius(64);
\\\draw event light
lighting_light_add();
For spine support, I created a tool (download) to generate the required code and materials. Takes the spine atlas image, atlas file, and json file and exports the creation code for the object and a map. Spine lighting has never been easier to add!
- Marketplace Link
- Demo Link - hold space to disable lighting, arrow keys to move view
- Manual Link
- Changelog Link
Code:
lighting_init(view_width,view_height,specular,ao)
lighting_draw_all()
lighting_set_ambience(color)
lighting_instance_create()
lighting_instance_add()
lighting_instance_normals(sprite/layerName)
lighting_instance_specular(sprite/layerName)
lighting_instance_ao(sprite/layer name)
lighting_instance_tilemap()
lighting_instance_spine()
lighting_instance_bonemap(sprite)
lighting_light_create(pointLight)
lighting_light_add()
lighting_light_color(color,alpha)
lighting_light_radius(radius)
lighting_light_direction(x,y,z)
lighting_spine_get_bone_states()
lighting_spine_draw(instance_id,function)
Last edited: