Self Shadows

Blitz3D Forums/Blitz3D Programming/Self Shadows

Colonel_Klink(Posted 2009) [#1]
Has anybody experimented with self shadow casting, where a model casts shadows onto itself as well as the surrounding terrain or objects?

I can do this by baking on shadows, but in real time it looks kinda lame.
Any thoughts on this would be appreciated.


Naughty Alien(Posted 2009) [#2]
yes, it is done by Mikhail FastExt library.


Colonel_Klink(Posted 2009) [#3]
Tried that, cannot get it working.


Naughty Alien(Posted 2009) [#4]
it does require some tweaking but its doable..


Vorderman(Posted 2009) [#5]
Are you sure you can self-shadow in FastExt? I don't think you can.

You can have more than 1 shadow system working at the same time, so for example a car and trees can both cast onto the ground, and the trees can cast also onto the car, but I don't think you can have the car cast shadows onto itself. If you did that, due to the way the shadowing works, the whole object would cast a shadow, covering itself up entirely.

The only way you could do it would be to have the bits of the object that you want to cast shadows split off into seperate objects, which then cast onto the main object. For example, a TV aerial on a house roof - the aerial would have to be a seperate object to the house to enable it to cast a shadow onto the roof.


Colonel_Klink(Posted 2009) [#6]
I tried using FastExtend shadows by using a duplicate object for the shadows but that didn't work.


MikhailV(Posted 2009) [#7]
I already explained why so, I will try once again...
The shadow system realised in FastExt library, probably to use in real projects with good FPS - it is main advantage of library.

Self-shadowing is present in other libraries based on stencil buffer (Devil Shadow system, AShadow library). But it cannot be used in real projects, as FPS will be very low.

My shadow system too can be improved and create real self-shadowing, but these are +3 additional RenderWorld !
And then the system will be unsuitable for projects, only for small and beautiful demonstrations.

All of us are in DirectX7 frameworks and it is impossible to fall outside the limits.

It is possible to achieve high efficiency to the detriment of quality. Or it is possible to make qualitatively to the detriment of productivity. I select the first path.


Rroff(Posted 2009) [#8]
Devil Shadow System can do stencil self shadowing at acceptable performance on modern computers (3gig P4 or 2gig core 2, nVidia 8 series or ATI 3800 series or higher) however you will potentially run into 2 issues:

DSS seems to screw up multi texturing capabilities and some objects will not texture correctly if your using more than 1-2 extra texture layers or texture layers with certain blending effects.

Theres a potential patent overlap with IP owned by Creative Labs which could result in you being liable for royalties depending on the circumstances.

You can "hack" in some degree of self shadowing with FastExt but its not always going to work entirely properly - I highly reccomend buying it tho as theres so many enhancements it provides.



You _could_ hack up a low res dynamic lightmap system of your own that updates the shadows on the nearest character models in real time... however it could only test against the model geometry and not take into account when world geometry occludes the light source if you wanted viable real time performance... you'd also need some kinda light grid system or a fast external line pick routine.


Colonel_Klink(Posted 2009) [#9]
"My shadow system too can be improved and create real self-shadowing, but these are +3 additional RenderWorld !
And then the system will be unsuitable for projects, only for small and beautiful demonstrations."

Do you have an example of this?

What I cannot understand is why a shadow lod using FastExt won't work. When I reduced the alpha on the shadow lod the shadow disappeared as well.


MikhailV(Posted 2009) [#10]
@Colonel_Klink: Latest example of self-shadowing - http://fastlibs.com/temp/ppssm2.zip
In demo used one singlesurface 3D model. But the given experiment is very difficult for using in real projects, there are many problems (no free time to describe).

p.s. At present FastExt library not contain given technology...


Colonel_Klink(Posted 2009) [#11]
MikhailV
Thanks for the demo.


Rroff(Posted 2009) [#12]
Example works nice... but I can imagine theres a lot of issues with complex, multi surface, world geometry... getting almost 400fps as well in the example on a fairly modest rig so I'd imagine it would scale well.


Guy Fawkes(Posted 2009) [#13]
try devilshadowsystem :)


6(Posted 2009) [#14]
Is there any code to go with the ppssm2 demonstration? I'm writing a graphics tool that I'd like to include self-shadowing in.


MikhailV(Posted 2009) [#15]
@Rez: Read above
p.s. All peoples already long ago tried DevilShadow system... This system not support self-shadowing.


Colonel_Klink(Posted 2009) [#16]
"Is there any code to go with the ppssm2 demonstration? I'm writing a graphics tool that I'd like to include self-shadowing in."

Me too. I'm not creating a game, but a previsualization application for movie makers (e.g. machinima). So the use of self shadows is more for artistic merit than real time gameplay.

As I explained earlier, I had tried using a shadow lod model, which would probably work, IF, the shadow model was invisible.