Shadows

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Shadows

Post by zuzuf » Sat Feb 14, 2009 1:01 pm

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...)
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sat Feb 14, 2009 3:06 pm

Whohoo, cool!!

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

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Feb 14, 2009 4:25 pm

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
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sat Feb 14, 2009 5:24 pm

Can`t wait to see how it will look like :P

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Mon Feb 16, 2009 10:01 pm

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)
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Tue Feb 17, 2009 8:13 am

This is really looks impressive! Is there anything i can do to help porting ta3d to SDL for win32 OS?

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Tue Feb 17, 2009 8:59 am

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.
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Tue Feb 17, 2009 2:21 pm

I`m doing it right now. I`ve got several different PC`s on my work :P

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests