Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Light and Shadow Volume Generation for Sprite Sheet Objects  (Read 2907 times)

0 Members and 1 Guest are viewing this topic.

JayhawkZombie

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Light and Shadow Volume Generation for Sprite Sheet Objects
« on: December 16, 2017, 06:13:17 am »
Hello, all.

This was my first semester of graduate school, and I took a computer vision course.  For my final project, I decided to try to develop a method to generate shadows for sprites without having to meticulously find every corner in the sprite myself.

I hadn't seen anything out there do this yet, though there is likely something out there somewhere.  I doubt this is novel.

The result is a paper I wrote, titled "Light and Shadow Volume Generation for Sprite Sheet Objects using Outline Mesh Generation".

In short, it uses Canny edge detection and contouring to generate the contour of objects in sprite sheets and extracts the coordinates of every point along the contour.
This contour is used as an occlusion mesh for casting shadows.

It seemed to work pretty well for the sprite that I initially tested it on.  It is not a ready-to-go framework, but it is a working sample implementation.  It uses SFML (well duh) and OpenCV (for the contouring).

I've source code here: https://github.com/JayhawkZombie/SpriteMeshLighting 

In there is also the paper, if you've interesting in reading more into it.


An image of a plain sprite:



What the sprite + shadow volumes looks like after extraction is finished:



I will probably get an actual framework/library up for generating these in a cleaner way soon (will update when I do so), but this was just a first working version.