2 registered members (Quad, 1 invisible),
877
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
ACDFSM (or the ultimate dynamic shadowmapping solution?)
#388687
12/06/11 15:38
12/06/11 15:38
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
OP
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Some days ago I was browsing through Acknex Unlimited and I found this 2009 Summer Contest Entry by Martin Coumont ( http://www.opserver.de/coni_users/web_users/pirvu/au/demo/zips/acdfsm.zip) and couldn't resist to share it with people here, as I'm sure some of you didn't know about it. Approximate Cumulative Distribution Function Shadowmapping (ACDFSM) allows bassically dynamic shadowmapping for: -Sun Light -Pointlights -SpotLights -Up to 9 Lights at the same time. I've searched for a long time for something like this and finally found it, I tested on A8 building a simple scene using ACDFSM and A8's HDR It and it worked perfectly. Here are some screenshots: Link for scene+source: http://www.mediafire.com/?l7kb4kq4kvyyptkIf you want to use it I've prepared it so you just have to copy the folder "ACDFSM" to you project folder and add these lines to your code:
#define PRAGMA_PATH "ACDFSM";
#include "acdfsm_main.c"
then start them: You can easily add lights using the included my_pointlight and my_spotlights dummy models, as they will get automatically assigned their action and you can set them up in WED in seconds. Thank you very very much Martin Coumont!!
Last edited by painkiller; 12/06/11 15:39.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: ACDFSM (or the ultimate dynamic shadowmapping solution?)
[Re: the_clown]
#388691
12/06/11 16:13
12/06/11 16:13
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
OP
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Hm, sounds pretty good.... I tried the demo, had to uncomment your HDR activation etc though cause I use A7... apart from that, however, as this resource is from 2009 I suppose it shouold work flawlessly under A7, yet I get an "Invalid Name" error with the combiscene.fx files when opening the test level. yes, I also get those warnings when I open it in WED, don't worry, that's because the name of those files is too long and WED doesn't read them, but when you run the game it will work fine
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: ACDFSM (or the ultimate dynamic shadowmapping solution?)
[Re: painkiller]
#388692
12/06/11 16:26
12/06/11 16:26
|
Joined: Nov 2008
Posts: 946
the_clown
User
|
User
Joined: Nov 2008
Posts: 946
|
Makes sense. The demo itself works fine. Without having read through the code yet, can any mesh be used for the light models or does it have to be like the example ones?
EDIT: I tried to add a) another pointlight and b) another spotlight by just copying+pasting the existing ones; with two spotlights, I got an fps loss of about 50 percent. Have you tried it with more than two lights yet?
Last edited by the_clown; 12/06/11 16:30.
|
|
|
Re: ACDFSM (or the ultimate dynamic shadowmapping solution?)
[Re: the_clown]
#388693
12/06/11 16:33
12/06/11 16:33
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
OP
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Makes sense. The demo itself works fine. Without having read through the code yet, can any mesh be used for the light models or does it have to be like the example ones?
EDIT: I tried to add a) another pointlight and b) another spotlight by just copying+pasting the existing ones; with two spotlights, I got an fps loss of about 50 percent. Have you tried it with more than two lights yet? you can use any mesh, of course, but it will be invisible unless you write your own function. I added those dummy models because they get assigned automatically their actions and you can see the direction the spot will have. About adding more lights, note that I set a resolution of 2048 for that spotlight (default value is 256), so if you add lot of lights with that huge resolution the performance will be really poor.
Last edited by painkiller; 12/06/11 16:34.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: ACDFSM (or the ultimate dynamic shadowmapping solution?)
[Re: HeelX]
#388698
12/06/11 17:04
12/06/11 17:04
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
OP
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Hm, it runs very slow here and I would like to know where I can change the settings for it? The code looks like lasagna on meth.
For example, what mean the parameters start, mode and amount? How can I control the resolution of the targets? You can tweak sun shadows in acdfsm_main.c at lines 59-69. Every other light sources are managed directly in their actions in WED through their skills, there you can set their color, range, arc and resolution start means activate them and should be 1, mode I'm not sure but should also be always 1, amount is the max number of lights it will manage at the same time, set it from 1 to 7 Thank you mate, I should give it a try Is it fast? I you don't use lights with huge resolution It should be fast. In my pc I get 33 fps with the test level, If I set the spotlight resolution to 256 then I get more than 100 fps
Last edited by painkiller; 12/06/11 17:09.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
|