Page 1 of 1

Shadows

Posted: Sat Feb 14, 2009 1:01 pm
by zuzuf
I've been rewriting the way shadows work. Now there is only 1 variable for shadows:
shadow_quality

currently there are 3 levels of quality:
0 -> no shadows
1 -> low (old shadowing code using shadow volumes)
2 -> normal (new code for shadow mapping, uses GLSL :), won't work on "old" machines - need at least a GeForce FX video card)

I'll probably add more effects in the future (water caustics, etc...)

Posted: Sat Feb 14, 2009 3:06 pm
by Balthazar
Whohoo, cool!!

Maybe you can add some kind of "default shaders for units and buildings" ? So they can reflect sun by default?

Posted: Sat Feb 14, 2009 4:25 pm
by zuzuf
there is now a default shader for shadow map mode since we need to change the lighting equation to take shadows into account. But it's not enabled when shadow quality is < 2, because it needs a shadow map for rendering and wouldn't work on systems which doesn't support GLSL.

This default shader doesn't use specular lighting, only diffuse and ambient terms are used along with the shadow factor :), but this may change :D

Posted: Sat Feb 14, 2009 5:24 pm
by Balthazar
Can`t wait to see how it will look like :P

Posted: Mon Feb 16, 2009 10:01 pm
by zuzuf
it looks like this:
http://picasaweb.google.fr/zuzuf86/Shad ... directlink

I've put 3 shoots of the same scene, same point of view, only shadow quality changes so you can see the difference between none, low and normal :)

NB: in normal mode, lighting equation is computed per pixel, not per vertex like in none or low modes, so it's a bit nicer :D even without shadows (and if your graphic card can do, it's not that slow)

Posted: Tue Feb 17, 2009 8:13 am
by Balthazar
This is really looks impressive! Is there anything i can do to help porting ta3d to SDL for win32 OS?

Posted: Tue Feb 17, 2009 8:59 am
by zuzuf
well, you can test the binaries I sent you on several machines, with more results we'll have a more precise diagnostic :).

For now all we know is it's not working on your machine (ATI windows) but it's working on an other one (windows XP, nvidia), so we don't know if the problem is due to the hardware (it may change some system behaviour) or to the driver, or it may even be something else.

Posted: Tue Feb 17, 2009 2:21 pm
by Balthazar
I`m doing it right now. I`ve got several different PC`s on my work :P