Tuesday, July 17, 2012

Towards the Light / Beaming Outward

Two terrible titles to make up for the missing title of the last post.

Moving along.  First, I was testing the order in which light scans occur by starting dark and getting lighter for each ten "pixels" scanned, the restarting. Working properly, it looked like this, and was pretty cool, so I took a snapshot.

 I will note that the program scans in octants, 8 traingular sweeps ouward from the center of a light source (our player, at the moment).  This picture shows the lightest points at the beginning of the sweep and darkening at the end of the sweep (light multiplied by angle).

This was closer, but I found 4 points where the light overlapped still, and corrected it.  Now i need the bricks underneath to block the light.

Next, I wanted to see where the scans first detect shadow.  There seems to be some sort of offset error I need to fix, but it's close to correct.  Here's a video that is somewhat interesting!

More pics to come, as I code.

Saturday, July 14, 2012

I'm getting closer.  I formed a method that involved drawing small squares of different shades over and over, reducing my game's frame rate to 13 frames per second. Scrapped that idea.

Now I have figured out how to manipulate the pixels of a texture, so I am drawing a small texture, scaling it to cover the screen, then blending it with the image of my world. A lot faster, keeping a smooth 60 fps, but there are some alignment issues.  And my code is messy as hell.  I need to re-code my light-mapper, then tackle the issue of misalignment.  From there, I should be able to manipulate the pixels in an efficient manner and start the core shading code.

Sunday, July 1, 2012

In The Shadows

Shading is a totally new thing for me, and I need it to fit the image of the game properly. Been doing a lot of research, and found that it will take a combination of recursive shadow casting and alpha blending (oooh! Big game concept words!). It's pretty interesting how it's done, and looks somewhat complicated, but should work for what I have in mind, keeping a pixelated look, while enhancing the experience with color and shadow. This is the article I found most helpful.. What? But your game isn't a rouge-like!