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 / Fastbone.fx shader in DBPro.

Author
Message
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Apr 2008 21:50
Hi all,

A lot of you will no doubt have read Lee's article about modifying the fastbone shader from FPSC, so with his permission I thought it would be cool to upload it for use in DBPro. The example I've included shows how much frames you can gain using it. I've already made the adjustments Lee suggests, but I guess there's a lot more than can be done to it to customize the looks of your models.

If you come up with an interesting modification please post about it here.


less is more, but if less is more how you keeping score?

Attachments

Login to view attachments
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Apr 2008 03:11
Amazing! Thank you for sharing this.

http://3dfolio.com
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 7th Apr 2008 03:44
VanB,

I just tested this with Enhanced Animations. My framerate jumped from about 360fps to over 800fps! Cool stuff!

The only problem is that I had to use a different model. For some reason I could not extract animations from your "Bruce.x" model. EnAn would just crash! What method do you use to create your animations? I would like to figure out what is going wrong there and get it fixed!
I also had some problems with another model that I tested with this shader. It made some parts of the model act strange. This had nothing to do with EnAn. It happened with animations with standard DBpro commands as soon as the shader was applied.

This shows some HUGE potential though! Again, VERY COOL STUFF!

-Ron


a.k.a WOLF!
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 7th Apr 2008 09:07
This is amazing stuff!

With your Bruce model I get 1900fps without Fastbone and 3100 with it.
Then I tried it with Cleopatra from FPSC Model Pack 17 and went from 1300fps to 3400.

But by far the most impressive result was when I tried it using a free coverdisc version of this Amazon woman model and the FPS jumped from 375 to almost 2975!!

I would love to know why this shader seems to be providing a free speed boost but I don't understand shader code at all. So there is no point me looking at it to work it out why. Perhaps someone could point out what is happening though?

Thanks



Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 7th Apr 2008 09:32
Wow, some real nice speed increases, I thought it was doing well with my 20%!

Bruce.x is animated in CharacterFX, hopefully you can resolve that as it's a nice and easy to use animator for DBPro, support would be a real bonus. Let me know if you want me to send you the .CFX file for him.


less is more, but if less is more how you keeping score?
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 7th Apr 2008 09:43 Edited at: 7th Apr 2008 09:44
It's faster because it's calculating the animation in the vertex shader(on the GPU), and because the GPU is specifically designed for these vector/matrix calculations this kind of speed boost is expected. Furthermore, standard CPU animations require the animation to be calculated on the CPU and subsequently sent to the GPU which has some overhead, plus to send updated mesh data to the GPU it must be stored in a way that's easy for you to handle which isn't necessarily the fastest for the GPU to access(Though DBP may use the same method to store verts so this may not matter). But that doesn't mean it doesn't have some negative aspects, as this essentially offloads the animation calculations to the GPU, which means you will have more CPU free but less vertex shader bandwidth, though this shouldn't be an issue for most games.

Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 7th Apr 2008 15:27 Edited at: 7th Apr 2008 15:37
Ah this was just what i wanted ^^

//Edit

My luck.. Its for VS 2.0 and when i change to 1.0 it slows down.

Your signature has been erased by a mod because it was too big
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Apr 2008 17:49 Edited at: 7th Apr 2008 21:54
Quote: "Wow, some real nice speed increases, I thought it was doing well with my 20%!"


With my laptop I get:

72fps with no shader;

71-72 with shader.

With my six year old PC I get:

142-149 fps with no shader;

135-147 with shader.


Perhaps it's because, on this laptop, the CPU does all the work anyway and the shader adds an extra, minor, overhead?

Will edit this post when I've got results from my PC.

Edited post with results from PC

Wonder why the two sets are so similar on my machines, i.e. shader slightly worse?

The laptop is about 18 months old and has an integrated ATI Radeon Xpress 200M GFX card (I think), whereas the PC has an nVidia GeForce FX 5200 card.
Thebeely
18
Years of Service
User Offline
Joined: 4th May 2005
Location: Croatia
Posted: 7th Apr 2008 18:33
Shader slowed things sown for me

I have geforce 6300 le if I'm not wrong...
bandM
17
Years of Service
User Offline
Joined: 27th Sep 2006
Location: Home
Posted: 7th Apr 2008 20:50
Great shader, i got 1000 fps without shading, 1300+ with shading.
Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 7th Apr 2008 21:01
712 FPS without shader, 666 with.

My graphics card is over 5 years old though, so upgrading would mean new mobo, mem, CPU etc.

This message was brought to you by Grandma industries.

Making yesterdays games, today!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Apr 2008 21:55
Edited earlier post.
Sid Sinister
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 7th Apr 2008 22:20
Whats the fastbone shader do? I don't understand.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 7th Apr 2008 22:30
DarkCoder explains it pretty well, basically it puts the responsibility of deforming the mesh of a bone animated object on the GPU instead of the CPU. The GPU in more powerful GFX cards is better at handling this, so it gives a speed increase. It does put more burden on shader pipelines though.

I think it needs to be something that is an option, because it's pretty uncertain what GFX hardware it'll be used on. I intend to do a performance check with a shader enabled model in the background to determine if there's a worthwhile benefit to be had.


less is more, but if less is more how you keeping score?
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 7th Apr 2008 23:04
I've got 750 fps with both methods with my Geforce 7600.
By the way, it's interesting to see that bones can be processed that easily in a shader .

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Apr 2008 23:31
Quote: "whereas the PC has an nVidia GeForce FX 5200 card"


I used to have that card, and it never performed fantastically with DBP. I was playing Sid Meier's pirates when I swapped it for an ATO 800XL, and didn't realise I'd been playing the game at about half-speed with the 5200FX
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Apr 2008 01:37
Quote: "I used to have that card, and it never performed fantastically with DBP."


Yeah, I'll upgrade one day - but I doubt I'll achieve much unless I upgrade the PC as well.

Quote: "I was playing Sid Meier's pirates "


Yes, that's one game that gives you a choice whether or not to use the shaders. Nice game - but a bit samey after a while. The graphics should be easy to emulate in DBP.
cjb2006
17
Years of Service
User Offline
Joined: 20th May 2006
Location:
Posted: 8th Apr 2008 15:42 Edited at: 8th Apr 2008 15:43
I see now I'm completely out of touch. I just spent $600 to upgrade my rig. Got a new mobo, 2gigs 1066, bigger power supply, a Phenom 9500 and an HD3870 and it's the highest performance increase for the least price of any other upgrade I've done. I'm still running XP but this shader seems to love the SM4 card. I get 1800 standard and 4100 with.
jeffhuys
17
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 8th Apr 2008 16:57
Hello!

I've attatched a modified project, this time with PixelLighting from Evolved.
Works great !!

Jeff


You're the 'th to view this signature!

Attachments

Login to view attachments
Chris Franklin_
17
Years of Service
User Offline
Joined: 21st Dec 2006
Location: Home
Posted: 8th Apr 2008 17:10
Slowed it down here, no doubt my graphics card though.

Coding again =O - Dedicated Paramore Fan
jeffhuys
17
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 8th Apr 2008 18:55
What example, that one of me or that one from Van B?
Mine can be possible, because even on my 8800GT it slows 10 frames (7800 ~ 7788)


You're the 'th to view this signature!
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 8th Apr 2008 19:05
But your example doesn't use fastbone at all :/, all it does it apply evolved's lighting shader, what does this have to do with anything .

jeffhuys
17
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 8th Apr 2008 23:16
Just wanted to show, 'cause it uses lighting, only using the pixel shader and not the vertex shader. And because it is very simple to apply.


You're the 'th to view this signature!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Apr 2008 00:09
Yes, but why post on this thread?

Login to post a reply

Server time is: 2024-04-25 15:51:06
Your offset time is: 2024-04-25 15:51:06