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.

Program Announcements / D3DFunc V3.0

Author
Message
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 17th Jan 2009 17:18
Hey great work with the DGDK conversion!!!

I haven't tested it yet, but I'll do it soon.
I'll be glad to assist with any further performance testings, if needed

Good job again
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Jan 2009 17:26
AlexI,

You don't need the d3dStartText and d3dEndText. Thats just for surrounding the 2d text rendering code.

Morcilla,

Once I have the Showcase example converted I'll send it to you to try. Seems a strange on as I haven't changed the code between the dll and the library versions.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 18th Jan 2009 02:04
This has saved me loads of work you can be in the credits on my game What name do you want me to put in?

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 19th Jan 2009 13:02
AlexI,

Cloggy is just fine.

@All

Attached is an updated library version of D3Dfunc. It contains some corrections to the 3D commands.

Attachments

Login to view attachments
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 19th Jan 2009 21:43
Here is exe showing the main functions of D3DFunc in DGDK.

Attachments

Login to view attachments
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 20th Jan 2009 01:34
for 1. i get a higher FPS for dbp text Everything else is faster though

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 20th Jan 2009 14:04
Alex,

I'm not sure why the text is like that. I'm using the same code as I do in the main dll. In DBPro using the dll gives you a big speed boost.

It's something I need to look into.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 20th Jan 2009 19:11
Ok thanks, I just need the 3D text for my game only

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 21st Jan 2009 01:13 Edited at: 21st Jan 2009 01:14
The text rendering is a strange problem.

If I use my dll and create a DBP test app. The following code renders text at approx 32fps



If I use my DGDK version of the dll converted to a library and create a DGDK app. The following equivalent code produces 12fps



This seems a hell of a drop just for compiling to a library rather than a dll.

Also I have produced a .net dll using the directX wrapper "SlimDX" and the following equivalent code produces 21 fps.



As this is a managed wrapper for DirectX and my library is unmanaged and not wrapped I can;t for the life of me see what the problem is.

Can anyone think of a logical explaination. I have checked to source and it all looks fine. Problem is I still can't debug the library so it is tricky trying to track down any problems.

This is the only problem I still have unresolved and it is very frustrating.

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 22nd Jan 2009 01:03
An update if anyone out there is interested.

If i and d3dx9.lib to the list of additional dependencies when I compile my library the fps goes from 12 to 20!.

Why this happens I have no idea as C++ points to the August 2007 sdk library so would pick up this library anyway!

Still not as good as DBPro but still an improvement.

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 22nd Jan 2009 18:10
Well I got these numbers,

in the showcase:

Option 1, D3D Text vs DBPro Text:

DBP : 15 fps
D3D : 30 fps

Option 2, D3D Text vs DBPro Text (multiple fonts and sizes):

DBP : 1 fps
D3D : 60 fps

DBPro dll versus DGDK lib gives me equal performance results:

DBP dll: 5 fps
DGDK lib: 5 fps

Adding 'd3dx9.lib' as Aditional Dependencies in the project propierties->linker->input results here in no performance change, still 5 fps.

So, these may not be the expected results, but they seem coherent. Also I wonder why I get those low 5, while you are getting an acceptable 32. I'm using a quadcore here with an ati hd4870.

The DBP code:



The DGDK code:



I'm afraid I'm not using .net, but please tell me if you want me to test anything else. You are doing a great job here.
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 22nd Jan 2009 19:32
Hey cloggy, was wondering if theres any way to make D3D Text draw in front of sprites?

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 22nd Jan 2009 21:27 Edited at: 22nd Jan 2009 21:30
Morcilla,

Thanks for you input. Having done many experiments I believe that although the d3dx9.lib seemed to make a difference to me here. The real problem is that there appears to be a performance difference between the October 2004 SDK which is the one I use for the dll, and the August 2007 one which is what I've used for the library.

The reason I've had to use the August one in the library is that when i use the October 2004 one I have to add libcp to the ignore library list in the c++ linker.

I am going to try compiling as a dll using 2004 and try linking this into the app. It will mean the dll will have to be in the app directory if you distribute but that shouldn't be a problem.

As far as .net is concerned I think I'm going to wait for Apex now to provide access to the other GDK commands that I need.

DBKing,

You need to use Paste Sprite i'm afraid. My dll suffers from the same problems as DBPro text. Currently there is no way around that I'm afraid.

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 22nd Jan 2009 22:03
Morcilla,

I have attached a new .lib compiled with the d3dx9.lib and the October 2004 SDK.

Can you give that a go and tell me if you get any improvement.

You will need to ignore libcp in the linker options.

Also are you able to do a test with the text functions you converted to GDK earlier. It would be interesting to see those results.

Attachments

Login to view attachments
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 23rd Jan 2009 08:44 Edited at: 23rd Jan 2009 08:48
I've tested this 'October 2004' version. It performs better, using the DGDK code that I posted above:

August 2007 DGDK lib: 5 fps
October 2004 DGDK lib: 19 fps

Once again, adding 'd3dx9.lib' as Aditional Dependencies results in no performance change.

Also, I get a message when starting the October 2004 version:



I guess you are already aware about this.

Regarding to the 'earlier DGDK functions', I included them into the project source code, and it seems that performance is the same that the August 2007 version: 5 fps.
I used a slightly different code:



Please tell me if you want me to post the source code for text.h, text.cpp (containing AAText functions and the rest).
Oh, it was Sephnroth who initially ported the text functions to DGDK, that gave me the tips to convert some of the other d3d_func functions.

[Edit: I don't know what 'libcp.lib' is about, but I guess I'll be glad to ignore it if it gives that performance boost (+15fps)]

Attachments

Login to view attachments
Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 23rd Jan 2009 20:45
Could you tell me how you got your text drawing that fast?
I get way less fps than in DBPro when drawing text in c++/DirectX,
even if I use a sprite.




Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 23rd Jan 2009 21:11
Master Xilo,

Looking at your code you are printing one letter at a time unless I am mistaken as my c++ is not too hot

Also you are calculating the clipping rectangle, which you don't need to do.

Have a look at my D3Dfunc source. It's feely available from my wbe site (see sig).

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 24th Jan 2009 11:15
These two programs should do exactly the same, yet the DB program runs at 27 FPS, the directx/c++ only at 9:




Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 24th Jan 2009 12:42
Master Xilo,

What DirectX SDK are you using?

I compile my dll with October 2004 because when I use any later one I get highly degraded performance with the text commands.

I also include d3dx9.lib in the additional dependencies field in the linker options.

You could try that.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 24th Jan 2009 19:16
Of course I include that lib too, have to (otherwise it doesn't compile).

I use 2007, does that really make a difference?!?!?

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 24th Jan 2009 21:30
I understand that it compiles with that lib. I can't explain why but when I include that lib explicitly in the Addition libs it runs faster.

Yes it makes a big difference. From the first SDK after Oct 2004 the performance is considerably worse for what I can tell. If you run the the Text3d examples in the DirectX SDK's the fps decreases as well, so there appears to have been some change that has degraded performance.

I have spent alot of time looking at this so trust me it is different. But I have to say that even using Oct 2004 you still don't get the same performance as you would with DBPro. Maybe it's because all the DGDK libs are compiled on August 2007, I'm not sure.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 24th Jan 2009 22:17
For some reason I get 10 times as much (100) Fps when using the font called
"System"
In the directx program I posted above. Any reason for that?

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 25th Jan 2009 01:00
I've just tried a similar test, and although I don't get the exact same results, it goes from 20 - 30 fps.

Have you tried ANTIALIASED_QUALITY rather than NONANTIALIASED_QUALITY?

The System font is probably not a True Type font in the same way as Courier New. I have to say I can't really explain things, sounds like a job for Microsoft's DirectX development team

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 25th Jan 2009 02:43
AA changes nothing.
This is truly strange...

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 26th Jan 2009 10:27
Cloggy,

are you releasing then a d3d_func October 2004 DGDK library?

I ask because the one you published above pops that 'debug' message () and I cannot turn it off
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 26th Jan 2009 12:19 Edited at: 26th Jan 2009 21:22
Morcilla,

Apologies, I will compile a version without the debug message tonight when I get home.

EDIT - Attached is the latest Library compiled with October 2004. You will need to exclude library libcp from you project linker options.

Attachments

Login to view attachments
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 27th Jan 2009 11:36
Allright, new version is working great.
No need to apologize Always grateful here
Thanks again
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 27th Jan 2009 14:25 Edited at: 27th Jan 2009 14:25
Is the new version faster than DBP text?

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 27th Jan 2009 21:28
The new version still isn't faster than DBPro. It is 60-80% faster than the previous DGDK version though.

I just ran a test. In Oct 2004 SDK I get about 950fps in the supplied Text3D Demo. In the April 2005 SDK version of the same exe I get 750. In October 2006 onwards they removed the display of the fps (no suprises there).

@Master Xilo

If you could send me the test project you posted code from I can compile it in different SDK's and post the results.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 27th Jan 2009 22:01

Attachments

Login to view attachments
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 27th Jan 2009 22:33
Just quickly (I'll try to post screenies later.

With August 2007 I get from 7-13 fps
With October 2004 I get from 60-65 fps

That's quite a performance difference!

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 28th Jan 2009 18:56
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 29th Jan 2009 00:04
Here are the 2 exe's for you to see the difference.

Attachments

Login to view attachments
Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 29th Jan 2009 16:47
What do you think did they change?
I can't see any visual difference, yet FPS is 30 with the october 2004...
(how come you get 60? What are your pc specs?)

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 29th Jan 2009 20:55
PC specs are:-

Athlon 64 3500+
1 GB Ram
Radeon X1950Pro

Not sure how that compares with you.

No idea what they changed, but it sure made a difference.

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 30th Jan 2009 10:56
I tried the 2 latest exe's :

With August 2007 : 17 fps
With October 2004: 112 fps

It is shocking and revealing.
I've read that October 2004 could have been the latest sdk without managed code. After it, all were prepared to be used with .net applications. So, that points to a possible reason to me, but it would be great to confirm it someway, as I'm not stepping sure.

Another point would be to know how has this affected DBPro/DGDK, as it looks (to me) like its performance could have been lowered as well. I feel like I'm not getting the expected framerates in many situations (DGDK uses now August 2007 DirectX SDK).
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Jan 2009 20:14
I recently came across this library only a few weeks ago but have finally given it a try. No doubt text rendering is significantly faster, but I have issues with the rounded box commands. When specifying a color inline with the rounded box command all the other box commands will fail to draw anything at all.

It would also be nice if I could set the drawing color with a variable rather than having to specify each color channel, as I define my colors into constants usually. Could you also add another text function so I wouldn't have to specify the justification every time? Have it just assume left instead?

Other than that and rounded boxes with small dimensions not looking so great, nice library.

Your signature has been erased by a mod because it's larger than 600x120
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 31st Jan 2009 00:26
Phaelax

Glad you like the dll.

There is a new version of the dll. Unfortunately I have not put it on the website as yet. It is contained in a post on this thread dated 11th Jan 2009 00:42.

It fixes the problem with rounded boxes killing other boxes.

d3dFunc commands accept colours in the same way as any DBPro commands. the D3D_RGBA just allows you to specify an alpha value.

I will look at the addition of a default justification.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 15th Feb 2009 16:02
Can you add a function to render 2d text to a texture? instead of putting it on a view port. Then you can texture objects with it.

Thanks,
Alex

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st Mar 2009 01:19
Cloggy, I managed to make a filled circle drawing algorithm 50% faster than your current method, IN DBPRO

It might be something you could add to your plugin, as a super fast filled circle function (even faster in C++). Here is the code I used:


It uses a pre-calculated array of values for sin(acos(<value>) to increase speed.

You can uncomment the commented line and comment the one above to compare speeds using the two methods.

Also, my method produces more accurate circles, and allows you to have colour gradient circles, because it goes through line by line

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 4th Mar 2009 01:27 Edited at: 4th Mar 2009 01:29
Cloggy:

Not sure if this falls under your jurisdiction or not.

When I compile my game (10,500 Lines) it compiles and runs just fine.
When I compile my game with media included in the EXE, it throws an illegal operation on load stating your DLL in the technical data:

My attached media is:

Any clues as to why this might occur? Using 3.7 U7.0 in DBPro. If absolutely necessary, I can send an EXE but I will have to include you in a NDA

- GIDustin
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 19th Mar 2009 15:01
Cloggy:

I can't seem to get 2D boxes to draw any more. I'm not sure whats wrong. Lines, text, circles and dots all draw fine, but boxes just don't want to no matter what i do. This is the DBP version i'm talking about by the way.

Also, any chance of rounded 2D boxes for the DBP version of this plugin?

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 19th Mar 2009 19:48
@DBking
Sounds like you have an old version of the plugin.

Boxes work fine for me, and there is a command 'd3d_rounded_box' to do rounded boxes...

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 19th Mar 2009 21:56
@Diggsey:
Ah thanks. That sorted the problem.

Dr Manette
18
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 28th Mar 2009 15:34
I tried out the latest version of the dll and it worked great. But when I tried using it in my project (in which I have the option of changing resolution) and none of the boxes of text shows up. When changing the resolution my original test I get the same results. So does changing resolution mess with the dll or something? Here's my test code:



If anyone knows how to fix this I'd really appreciate it.

AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 28th Mar 2009 16:13 Edited at: 28th Mar 2009 16:14
Quote: "So does changing resolution mess with the dll or something? Here's my test code:
"


If you create a font, then change the resolution afterward, you'll have to re-init the plugin with D3D_Init as well as recreate the font with D3D_Font.

Dr Manette
18
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 28th Mar 2009 23:11
Thanks for the tip, it worked perfectly!

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 19th Apr 2009 13:10
Just to let people know, I now have a new domain so website is at http://www.dbdepot.co.uk/index.html now.

Haven't had time to work on this lately as I've been busy with work and my back is playing up which means I'm not on the PC at home alot!

cjb2006
18
Years of Service
User Offline
Joined: 20th May 2006
Location:
Posted: 9th May 2009 01:32
If and when you do get back to it Jason, the 7.3 upgrade has messed up the ortho projection just like 7.0 did. You can detect the object is on screen but it does not display.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th May 2009 02:23
Cloggy, can you explain the font measurement parameter for me please?
I've tried 0 and 1 but neither produce the same result as DBP fonts. I am trying to output antialiased fonts that are the same size as standard DBP fonts but can't seem to manage it.

Here is the code to test the fonts:


... and to save you from running it, here is the output:




Login to post a reply

Server time is: 2024-11-21 20:29:40
Your offset time is: 2024-11-21 20:29:40