Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / So, how does native shadow shading really work?

Author
Message
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 22nd Jan 2013 01:48
I want to understand more about DBP's shadow shading command.

Quote: "This command requires hardware specifically designed for this feature, as it"s a very intensive calculation. Use this command sparingly for best performance. Shader based shadows cannot be used in combination with animated bone models. You must use CPU based shadow rendering for this. To change the offset to reduce/increase self-shadowing artifact described above, simply copy the stencilshadow.fx from the effects folder of the compiler directory, and paste it into your project folder. Open it up and you can change the shader near the bottom to a value other than 0.1 to choose your own value."


Now I have seen many examples of shadow shading, HLSL shadow mapping, some snippets here and there and in DarkSOURCE; all of which show you have to get shadows drawn. All fine, but with the native command I am least certain about its inner workings.

Where is the shadow drawn? On a high res texture with runtime calculated projectional UV coordinates or something?

What similarities does it have with light mapping? Apart from the obvious, shadows only; less cpu intensive, not baked...

I think I have seen a DarkSOURCE or DarkShader snippet for creating shadows for boned characters (or any animated model). I see that the native shadow shader cannot work with boned characters. I would quite like the players to have shading options in their control panels and will probably try to get some of Evolved's shadow shaders in addition to work with my shaders. However, how viable is it to have a series of character frames baked into seperate models and have the native shadow mapper cast shadows using these seperate low poly models in hidden state?

I am guessing the more polygons, the more intensive the calculation. The idea here is to use the cheaper system in the distance, and the more accurate system near the player.

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 22nd Jan 2013 09:20
This has me interested, Just tagging in here Chris, hope you do not mind...

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 22nd Jan 2013 14:15
Hi there....I did something like that long ago....I made 16 different meshes of the player object....it was the walking animation of my object secuence....then I made a new object with the 16 meshes...just to project shadows...as this object was to be hide...lastly, I had to make my own funktion to offset object limb to exactly the x,y,z of my player....so this object made with 16 limbs, where in any place out and the function show us the correct limb every time, and the shadows where ok for my purpose....I have to say that is a hard work,but it works if we prepare our object of 16 meshes in low poly....I hope this idea van help somehow.


Cheers

I'm not a grumpy grandpa
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 22nd Jan 2013 15:21
Thanks chafari

How would you rate the performance of your solution?

I have a feeling the method will be more lightweight than a bone ready shadow shader; but will probably need to do a test.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 22nd Jan 2013 19:36
Well I remember I had to do it with several meshes becuse of the bad results with boned characters.....I don't use shaders...just objects in low poly.


Cheers.

I'm not a grumpy grandpa
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jan 2013 08:42
Cool

Login to post a reply

Server time is: 2026-07-08 23:04:51
Your offset time is: 2026-07-08 23:04:51