{"id":16429095,"url":"https://github.com/codeandweb/cocos2d-dynamic-lighting-with-normal-maps","last_synced_at":"2026-01-28T18:02:31.721Z","repository":{"id":27726993,"uuid":"31214407","full_name":"CodeAndWeb/cocos2d-dynamic-lighting-with-normal-maps","owner":"CodeAndWeb","description":"Dynamic Lighting Demo for Cocos2D with Normal Maps","archived":false,"fork":false,"pushed_at":"2015-03-23T15:00:01.000Z","size":11028,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-07T21:09:38.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeAndWeb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-23T15:36:23.000Z","updated_at":"2024-10-17T02:34:38.000Z","dependencies_parsed_at":"2022-09-08T11:50:36.154Z","dependency_job_id":null,"html_url":"https://github.com/CodeAndWeb/cocos2d-dynamic-lighting-with-normal-maps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeAndWeb%2Fcocos2d-dynamic-lighting-with-normal-maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeAndWeb%2Fcocos2d-dynamic-lighting-with-normal-maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeAndWeb%2Fcocos2d-dynamic-lighting-with-normal-maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeAndWeb%2Fcocos2d-dynamic-lighting-with-normal-maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeAndWeb","download_url":"https://codeload.github.com/CodeAndWeb/cocos2d-dynamic-lighting-with-normal-maps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240619430,"owners_count":19830204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T08:20:56.438Z","updated_at":"2026-01-28T18:02:31.614Z","avatar_url":"https://github.com/CodeAndWeb.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic Lighting Demo for Cocos2D with Normal Maps\n\nTutorial by Andreas Loew / CodeAndWeb GmbH\nThanks for collidernyc from Cocos2d Forum for the Swift port\n\nThis demo uses the same normal mapped sprite in different dynamic light scenarios.\nThe light source can be dragged do light the sprite from different angles.\n\nRead the full tutorial: [Cocos2d Dynamic Lighting Tutorial](https://www.codeandweb.com/blog/2015/03/17/cocos2d-dynamic-lighting-tutorial)\n\n#### Summer scene (directonal light)\n\n* Bright yellow directional light\n* Bright ambient light\n\n![Normal Mapped Sprite with 2D Dynamic Lighting, Directional Light](images/normal-mapped-sprite-directional-light-1.png)\n\n#### Winter scene (directional light, particles)\n\n* Bright light blue directional light\n* Bright light blue ambient light\n* Snow particles (no light effect, just for the fun)\n\n![Normal Mapped Sprite with 2D Dynamic Lighting, Directional Light and some Particles](images/normal-mapped-sprite-directional-light-2.png)\n\n#### Point light scene (point light)\n\n* White point light (restricted radius)\n* Dark gray ambient light\n\n![Normal Mapped Sprite with 2D Dynamic Lighting, Point Light Source](images/normal-mapped-sprite-point-light-1.png)\n\n#### Camp fire scene (animated point light + particles)\n\n* Orange point light (restricted radius)\n* Dark blue ambient light\n* Fire particles (no light effect, just for the fun)\n* Animated ligth source position (flickering)\n\n![Normal Mapped Sprite with 2D Dynamic Lighting, Point Light, Fire Particle Emitter](images/normal-mapped-sprite-point-light-2.png)\n\n\nAll light effects are calculated in real time using Cocos2D's lighting system.\n\n\n## Normal Maps\n\nA normal mapped sprite consists of 2 files:\n\n![Normal Mapped Sprite: Sprite's Texture](images/character-with-si-logo.png)\n![Normal Mapped Sprite: Sprite's Normal Map](images/character-with-si-logo_n.png)\n\nThe texture itself is used for the sprite's color. \n\nThe pixels in the normal map represent a direction - the direction in which the normal vector of a given pixel is pointing. It's encoded into the color channe - this is where the strange color scheme comes from.\n\nThe normal maps were generated using SpriteIlluminator - our [Normal Map Generator](https://www.codeandweb.com/normal-map-generator).\n\nRead the full tutorial: [Cocos2d Dynamic Lighting Tutorial](https://www.codeandweb.com/blog/2015/03/17/cocos2d-dynamic-lighting-tutorial)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeandweb%2Fcocos2d-dynamic-lighting-with-normal-maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeandweb%2Fcocos2d-dynamic-lighting-with-normal-maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeandweb%2Fcocos2d-dynamic-lighting-with-normal-maps/lists"}