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.

Dark GDK / Need help with Stencil shadows.

Author
Message
s_i
14
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 4th Sep 2012 22:16
I have 3D-scene with 20-30 objects (asteroids, spaceships), and I need shadows for them. I think hardware stencil shadows will be good.
Spending many hours in a fruitless attempts to translate code from old DarkBasicPro example, I have to give up and ask someone to give me a 100% working DarkGDK example or piece of code. Please help.

DarkGDK 1.0, NVidia GForce 460, Win7.
s_i
14
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 5th Sep 2012 01:47 Edited at: 5th Sep 2012 01:50
Uffff... I made this. This example helped me:

stencilshadow.fx mast lay in the project folder, or in other folder if you change dir (for example dbSetDir("media\\"); ).

But other problem is "quads" (see red shadow on the picture). When pot rotates, quads sharply jumps... How to smooth this "teeth"? Maybe, I need to use other shader for my objects?

Attachments

Login to view attachments
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 5th Sep 2012 18:16
Try EVOVLED's soft stencil shadow example here: http://www.evolved-software.com/shaders/shadowing

All of EVOVLED's shaders are great quality and fairly easy to implement, if you have't seen them all I recommend you look through his wonderful collection.
s_i
14
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 6th Sep 2012 01:06 Edited at: 6th Sep 2012 01:09
Thanks, Mr Bigglesworth, for reminder. I know this beautiful site, but something bothered me...
I play now with this fx. I changed all techniques from 1_1 and 1_4 to 2_0. Here my test:

dbSetDisplayModeAntialias (Sw,Sh,32,1,4,0) where 4 is AntiAlias;
videocard NVidia GeForce 460;
101 objects (white tee pots by dbInstanceObject(...));
1680*1050 resolution;
2 colored lights;
470256 polycounts;
worst FPS is 45.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-19 00:24:03
Your offset time is: 2024-04-19 00:24:03