Author Topic: Object shadows  (Read 2708 times)

0 Members and 1 Guest are viewing this topic.

Alex

  • Newbie
  • *
  • Posts: 15
    • View Profile
Object shadows
« on: November 10, 2009, 06:11:58 PM »
Hi,
I am looking at `Shadow_Mapping` and `Shadow_Volumes` demos to see how it works.

What does that `shadow_caster="TRUE"` do?

Simply adding `shadow_caster="TRUE"` to my models introduces their shadows in the scene. So shader programs used in demos somehow add to that builtin shadow_caster functionality ?

How can every model cast shadow using one of those two techniques ?
Maybe iterating through every model, apply `HYP_Object.SetShadowCasterState`, apply shader program for every material in every mesh

Thanks

JeGX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 478
    • View Profile
    • Geeks3D.com
Re: Object shadows
« Reply #1 on: November 14, 2009, 01:40:23 PM »
By default, shadow_caster="TRUE" allows to use stencil shadow volumes. No shader is required with shadow volumes.
The only requirement is that your models and meshes must have closed surfaces else you will have visual artifacts
(see at the end of this artticle for details).

Shadow volumes work fine with omni lights but can be CPU intensive if you have dense meshes.

The second technique is the shadow mapping. You have to enable it in the scene node (see the shadow mapping demo).
Shadow mapping works with any mesh or object that modifies the depth buffer. But it suffers from aliasing and then requires the use of shaders to have soft shadows.

Currently GeeXLab supports the basic shadow mapping algorithm so it works fine with spot lights. And depending on your scene, it
can also work with omni light (see HERE).