A new and improved Pheonix101

Posted by Adventus on Sept. 14, 2006, 1:28 a.m.

Some of you may have noticed my little tiff with <b>GearGOD</b> and my subsquent break from GM. Im just writing to let you guys know that i realise i was being an ass…. and i've apologised to <b>GearGOD</b>. I will hence forth try to keep my stupid immature jokes under control.

Anyway i have not yet entirely given up GM but its coming up to test week so i cant do much at the moment. I have begun L3S which currently has a nice bloom filter but im too interested in my new soft shadow algorithm below to do anything else.

Anyway here's some fairly old pics of my Game (which by the way is now called 'Redemption'):

<IMG src='http://64digits.com/users/Pheonix101/Redemption_1.png'></img>

<IMG src='http://64digits.com/users/Pheonix101/Redemption_2.png'></img>

<IMG src='http://64digits.com/users/Pheonix101/Redemption_3.png'></img>

Here's a technique for soft shadows which GearGOD PMed me about:

Quote: GearGOD
http://geargod.livejournal.com/2763.html?view=9419#t9419

The technique in question is called spinning. Instead of one light source, you create a circle of identical lights around the location of where it should be. The radius of this circle corresponds to the physical radius of the light. The alpha of these lights should be 1/n where n is the total number of spun lighs. A minimum is 3 lights is required to produce the effect. 5 lights is optimal. 15-30 depending on radius will produce perfect results but far too slowly to use on the fly.

You can speed this up by collapsing the spun lights into one light with a spun shadow which should cut down on surface switching and given a small enough radius, most shadow calculations. The real use here is for static lights though. Mid-quality lights like this can precalculate the soft shadows as a single black primitive to be drawn during the shadow pass, and high quality lights should be collapsed down to sprites.

I can't find my way around your code well enough to implement these, but you should really give it some thought.

I still dont believe it will be fast enough for mass realtime use but people should find it useful, at least as a starting point. I have been developing my own soft shadow algorithm which uses some pretty heavy maths (inner dot product, etc) it basically does what GearGOD outlined above but in a single shadow pass.

Well peace out, you might be hearing from me once i've done my tests or finished a WIP of my game.

Comments

Firebird 18 years, 2 months ago

I should really learn about lighting.

melee-master 18 years, 2 months ago

Yeah, same.

Sounds really sweet.

Adventus 18 years, 2 months ago

What GearGOD is saying above isnt complicated, he just said it in a complicated way. Basically you just move the light around a radius and shadow cast at each one with a lower alpha than usual. e.g. to implement this in my shadow engine you would replace the "L2S_shadow_update()" with this in the L2S_system_update() script :

xx=x;yy=y;
draw_set_alpha(360/quality)
for(i=0;i<360;i+=quality)
 {
 x=xx+lengthdir_x(light_radius,i)
 y=yy+lengthdir_y(light_radius,i)
 L2S_shadow_update()
 }
draw_set_alpha(1)
x=xx;y=yy;
That should work, havent tested thou. Make sure you replace the 'light_radius' and the 'quality' variables if you want to give it a whirl.

OL 18 years, 2 months ago

Glad to see you patched things up with GG. Your game is looking sweet! I will be awaiting L3S, as you know I loved L2S (but I opted not to use it).

Good luck!

Cesar 18 years, 2 months ago

the lighting is a bit too bright, don't you think?

OL 18 years, 2 months ago

Or rather, the room is a bit too dark.

Eternal 18 years, 2 months ago

No, I don't think so. I think that the light was too clear though. It should have just a little bit of a yellow tint. Not too much, but just a little.

Adventus 18 years, 2 months ago

Yea the ambient light is 100% black except for a lighter ring surrounding your player. Yellowing it might be a good idea, ill try it out.