Not fun imo.
Not really doing this to make something useful, merely doing it since I have too much spare time, and I want to get to know php's imaging functions better as well.
Just thought I'd kinda post the stuff here. :3
And yay I got mike's permission to use DROD's graphics, as long as they're in a protected directory (like they are).
Which means you can now see my ugly unfinished pits. (Commented out the section of the code relevant to the pit walls since I haven't finished any of it, having stopped when I realized I needed to fix alpha). :3
Oh btw,
I'm guessing I'll have to use per-pixel shading for lights and shadows cast by light sources, along with raytracing. I've been thinking at school about how to manually draw a shaded polygon per-pixel. The only methods I can think of involve intense use of trigonometrical calculations for every pixel. Shouldn't there be a fast, easy way to fill a triangle?
Also I think I'll need to use two layers for lighting, a shadow layer and a light layer. The shadow layer which initially takes on the room's global lighting level (black/white/gray for dark/clear/semitransparent), and holds stuff like shadows (black-er areas on the shadow layer), and a light layer which would start out completely transparent and contains the actual "
lighting"
be it white/red/green, so areas within the light end up tinted that color.
Hmm. Brb trying something on DROD to see how much my approach would differ from DROD's display engine.
..woah it worked. Red light + Blue light + Green light = White area in DROD. Hey cool, that means my implementation would actually be pretty close to DROD's.
Edit: Hmm.. another thing I wonder is how exactly lights affect the brick areas of walls. At first glance it looks like it simply treats these lower halfs as further "
floor tiles"
, illuminating them accordingly, however sometimes the illumination on the walls go outside the normal radius of the light on the floor.
Ex:
###
L (Light source with the weakest strength)
The circle of light seems to have a larger radius on the wall.
[Last edited by Insane at 06-17-2009 12:32 PM]