Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, 1 invisible), 877 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Serious User
painkiller  Offline 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/?l7kb4kq4kvyyptk



If 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:

Code:
#define PRAGMA_PATH "ACDFSM";
#include "acdfsm_main.c"



then start them:

Code:
init_shadows(1,1,7);



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: painkiller] #388689
12/06/11 16:05
12/06/11 16:05
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
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.

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 Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: the_clown
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
T
the_clown Offline
User
the_clown  Offline
User
T

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 Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: the_clown
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: painkiller] #388695
12/06/11 16:41
12/06/11 16:41
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Ah, I see; Cool, looks like you found a excellent shadowmapping solution. Strange that it wasn't very popular till now.

Re: ACDFSM (or the ultimate dynamic shadowmapping solution?) [Re: the_clown] #388696
12/06/11 16:51
12/06/11 16:51
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you mate, I should give it a try laugh Is it fast?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ACDFSM (or the ultimate dynamic shadowmapping solution?) [Re: 3run] #388697
12/06/11 16:57
12/06/11 16:57
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
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?

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 Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: HeelX
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

Originally Posted By: 3run
Thank you mate, I should give it a try laugh 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
Re: ACDFSM (or the ultimate dynamic shadowmapping solution?) [Re: 3run] #388699
12/06/11 17:05
12/06/11 17:05
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Its good but it laggs like hell bro...

Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1