Fast Stencil shadow!
-----------------------------------------------------------------------
Before anything else English are not my 1st language.
but heres what im up to tweaking the irrlicht stencil
shadow routine.
DRIVER:
DX:
Modified stencil shadow routine using
3DRS_TWOSIDEDSTENCILMODE
remove the use of zfail,
I just create a one stencil
shadow routine which is working.
OGL :
Remove the use of zfail
I just create a one stencil
shadow routine which is working.
DEVICE/SCENE:
1. Device->IsUseStencilBuffer()
Get whether the system is using stencil buffer
auto set to false if not supported by hardware.
2. Scene->setShadowDelayerMax(2);
You may specify the node shadow building delayer
drawing stencil shadow from previous build shadow
without flickering and seemless even if it is an
animated mesh.
3. Scene->setAutoShadowDelayer(true);
Set shadow deleyer automatic base on the framerate.
passing the setShadowDelayerMax;
NOTE:
You may say your implementation is fast coz you
put a delayer on it you may or may not want to use
the delayer, my stencil shadow if fast coz you have
an option for node Releasing and Receiving stencil
shadow of a node as stated below.
NODE:
1. Node->SetReleaseShadow(true);
Specify whether the node release shadow if
stencil is use.
2. Node->SetReceiveShadow(true);
Specify whether the node receive shadow if
stencil is use.
NOTE: In most cases I would set my terrain or world map
to receive shadow but not releasing for better
performance just like the other commercial
game use to do.
3. Node->SetShadowLightSource( LightNode1 );
NOTE: For better performance I ony want one
light source for my node you may set
which light scene you want to apply for
your node shadow light source.
BTW: Irrlicht use all light source for building the shadow volume
imagine having 8 light will build the shadow volume 8 times
really eat up the framerates.
4. Node->EnableShadow(false);
Cool stuff you may enable or disable the stencil shadow of a node
very useful for your game logic culling routine. of course for
fast performance
5. Node->DelMyShadow();
You may delete the shadow volume of a node on the fly.
6. Node->DrawMyShadowOnly();
Hehe, for me to see if this things really work, this function
will draw only the shadow of the node w/o drawing
the node mesh, only shadow will be drawn on the receiving
shadow node.
BTW: CURRENTLY PREPARING A DEMO REEL & SCREENSHOOT
FOR THE ABOVE STUFF!
-------------------------------------------------------------------------
TO DO: { tho im not sure if this possible but im working on this }
SHADOW MAP FILE
1. Building the shadow map on the fly, and saving to disk
for none animated node.
3. Draw the loaded shadow map not in stencil mode but
as transparent node using the normal drawing method.
----------------------------------------------------------------------------
"CANT SHOW MY GAME STUFF NOW COZ IM AIMING FOR GAMEDEV 4ELEMENT CONTEST HOPE IF I CAN FINISH IT TILL NOV. IF I CANNOT MEET THE DEADLINE, AT LEAST I CAN STILL POST THE DL SITE HERE FOR COMMENTS & SUGGESTION."
FAST STENCIL SHADOW!
-
- Posts: 44
- Joined: Tue Jan 17, 2006 4:04 am
FAST STENCIL SHADOW!
Just part of irrlicht related project| CLEAR CODE NOTATIONS IS LARGELY SELF CODUMENTING!
-
- Posts: 44
- Joined: Tue Jan 17, 2006 4:04 am
Heres a simple screenshoot for my stencil shadow implementation:
1. Room recieve only a shadow
2. Wood1 release shadow but not receiving
3. Wood2 release and recieve shadow
4. Dwarfs release shadow and show shadow only
You will notice that only wood2 receive shadow but not
wood1 and dwarfs shadows is only drawn from these
scene.
http://pub26.bravenet.com/photocenter/a ... 2206558264
1. Room recieve only a shadow
2. Wood1 release shadow but not receiving
3. Wood2 release and recieve shadow
4. Dwarfs release shadow and show shadow only
You will notice that only wood2 receive shadow but not
wood1 and dwarfs shadows is only drawn from these
scene.
http://pub26.bravenet.com/photocenter/a ... 2206558264
Just part of irrlicht related project| CLEAR CODE NOTATIONS IS LARGELY SELF CODUMENTING!