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.

DLL Talk / D3D Extras for DBPro DLL

Author
Message
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 23rd Apr 2005 05:26
I have been working on a dll to provide some D3D functions that aren't in DBPro.

Currently I have the following :-

Antialiased Text - Text AA x,y,Text$
3D Mesh Text - Text3D xfilename$,text$,depth,quality (0 - Highest to 2 - Lowest)
3D Lines - Line3D x1#,y1#,z1#,x2#,y2#,z2#

Also in order to select the font for the text operations :-

Set Font Fontname$,size,bold(0 or 1),Italic(0 or 1)

And to set the color for the Text AA and Line3D command :-

Draw Color r,g,b,a

Here is some demo source :-



The dll is attached.

Comments appreciated.

Cloggy

Attachments

Login to view attachments
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 23rd Apr 2005 05:42
Quote: "Load Dll "DBProSetupDebug.dll", 1

`Get pointer to D3DDevice
CID=Call Dll(1, "?GetDirect3DDevice@@YAPAUIDirect3DDevice9@@XZ")"


you could do that in the dll - save the user from doing it

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 23rd Apr 2005 05:44
Though you could but have no idea how
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 23rd Apr 2005 06:25
this is untested code so might not work


Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2

Attachments

Login to view attachments
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 23rd Apr 2005 06:27 Edited at: 23rd Apr 2005 06:28
Thanks, I'll give it a try.

I presume everything works ok on your machine?

This is my first real look at c++ and directX only done a little c at work before now.
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 23rd Apr 2005 06:34
Quote: "I presume everything works ok on your machine?"

as i said that code is untested - i wrote it from what i can remeber so it might not work

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 23rd Apr 2005 06:36
I meant my code

Thanks for your help BTW
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 23rd Apr 2005 06:40
sorry - im half asleep

it works really well - i like the 3d text

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 23rd Apr 2005 06:45
Cheers,

I'm currently trying to get the mesh alignment working. the text is always offset to the right a little. Nearly there though.
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 23rd Apr 2005 06:48 Edited at: 23rd Apr 2005 06:48
Quote: " Cheers"

I gather it has worked then - which is good as it will mean that it is easier for people to use and because i actually gave some good c++ code which was understanable by you

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
dj chainz
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: England
Posted: 23rd Apr 2005 07:24
This is good stuff - but isnt there any way the text can be made a bit faster?:

60 lines DBPro text - ~200FPS
60 lines AA text - ~25FPS

I am the lead programmer at red spark studios
http://www.brazilianhotties.tk
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 23rd Apr 2005 07:27 Edited at: 23rd Apr 2005 07:27
I'm looking into it. My c++/directx knowledge is very limited unfortunately. I've stumbled my way through this by experimenting and trawling he web for various samples
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 27th Apr 2005 06:51 Edited at: 27th Apr 2005 07:21
I've improved the speed of the Antialiased text command. It now runs faster than the inbuilt text command.

Also the text3D command takes an extra parameter 'Alignment'

possible values are:-

0 - Align Left
1 - Align center (standard DBPro Alignment)
2 - Align Left
3 - Glyph origin Alignment


Full list of parameters :-

3D Mesh Text - Text3D xfilename$,text$,depth,quality,alignment

The command now also returns a 1 if the mesh was created successfully or a 0 if it failed.

Cloggy

Attachments

Login to view attachments
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 27th Apr 2005 08:15
I have discovered a way of displaying text at approx. double the speed currently available in DBPro.

I need my dll to be able to create an array of fonts, but I'm not sure how to code this. Currently I have the following definition :-

ID3DXFont* g_pFont = NULL;

If I try to change this to

ID3DXFont* g_pFont[10] = NULL;

I get a compiler error - cannot convert from 'const int' to 'struct ID3DXFont *[10]'

Could some kind soul point me in the right direction.

BTW I got 200 items of text to display at 242fps my way rather than 100fps using standard DBpro, and it's antialiased!

Cloggy
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 27th Apr 2005 09:08
I'm busy tonight. Here is another update.

162 fps for 200 antialised text calls in 3 different fonts. It's 100fps for 1 font using standard DBPro.



Can somebody let me know how this runs on their machine. I'm hoping this will be useful to many people.

Cloggy
Cheers

Attachments

Login to view attachments
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 27th Apr 2005 18:43
Anyone willing to test/comment?
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 28th Apr 2005 01:41
works nicely here - i get around 80fps

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 28th Apr 2005 01:44
How does that compare to normal text?
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 28th Apr 2005 03:56
I get similar results to yourself , roughly 60fps difference.

To do a function that doesn't return or recieve a value you'd do this



and the stringtable would be something like

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 28th Apr 2005 04:22
Cheers, I'll give that a try. It was the string table that was giving me problems.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 28th Apr 2005 08:02
Seems like a very good function. But after I've replaced all text commands with your DLL, this happened:



Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 28th Apr 2005 08:06
Is the background made up of sprites or images?

I'll have a look and see if I can reproduce it.
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 28th Apr 2005 08:14 Edited at: 28th Apr 2005 08:23
This dll works, but is slower as it writes directly to the screen. Still faster than normal text.

You need to comment out the lines 'StartText' and 'EndText'

I've done a bit more investigation, and if you use the original dll and make sure there are no paste images between starttext and endtext it will be ok.

Attachments

Login to view attachments
dre
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: West Side
Posted: 30th Apr 2005 16:25
Can you include a little command guide and maybe some examples here and there? Would be much appreciated.

AMD Athlon 64 fx-53, 1 gig PC3200 Dual Channel Performance DDR, ATI Radeon X800 XL PCI-E, 74 gig 10000rpm HD, Abit AX8 Motherboard
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 2nd May 2005 01:12
@Cloggy - NICE... This DLL is a keeper Hehe..

My Website:
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 5th May 2005 09:11 Edited at: 5th May 2005 09:12
Here is the latest version with some code to demonstrate all the commands and the speed improvements over native text commands.



All comments welcome.

Cloggy

Attachments

Login to view attachments
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th May 2005 16:43
That is all frickin brilliant

One comment.. The line demo.. Is it me or is that slower than using a triangle with 2 of its points on the same vertex and switching it to wireframe mode (per line obviously) See my boucing bezier demo - that uses a LOT of those lines and runs faster than 67fps on my PC (as I recall)..

That 3D Text is awesome thought!!

Keep up the EXCELENT work!

My Website:
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 5th May 2005 18:13
I think the triangle method is currently faster. I'm going to do a bit more investigating to see if there is some way of speeding it up though.

Glad you like it. Hopefully some of these things can go into a future release of DBPro and remove the need for my dll.

Cheers,

Cloggy
dj chainz
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: England
Posted: 10th May 2005 04:39
This is really good!

I am the lead programmer at red spark studios
http://www.brazilianhotties.tk
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th May 2005 05:26
@Cloggy - hows that work on the line method going?

My Website:
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th May 2005 06:22
I'm looking but I'm having trouble seeing where the speed loss is. I think it's something to do with the fact that I have to reset the transform matrix to the world matrix to prevent the lines taking on the rotation of the last drawn object. It should be fast as it uses the directx draw primative method.
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th May 2005 06:36
Nicholas,

Try this version. It initialises the line vertex buffer when you get the D3Dsurface pointer rather than for every line that you draw. It gave me another 100+ fps.

Attachments

Login to view attachments
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th May 2005 07:37
that version of the DLL and the most recent demo code (above) I still get 63fps... no improvement.

System Spec (if its any use):
AMD Barton 2500+
Gigabyte 6800GT 256Mb RAM
1Gb DDR 400

My Website:
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th May 2005 08:51 Edited at: 10th May 2005 08:52
That is very strange!

My system spec is:
AMD Barton 2600+
Radeon 9700
1GB DDR 333

I currently get 1190fps!
A massive difference.

I'll reattach the dll just in case i posted the wrong one.

[Edit] - Just tried with 2000 lines and got 58fps!

Attachments

Login to view attachments
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th May 2005 10:12
I think you posted the wrong one The example code now runs at an astonishing 815fps.. My card is running too slowly. a 6800GT should whoop a 9700 (Pro?). I have recently noticed it struggling with counterstrike 1.6.. I think there is a setting wrong somewhere

My Website:
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th May 2005 18:13
How does that compare to your current 3d line code?

Also could you post the fps results for all the demos including the basic DBpro text commands.

I'm interested to know how it performs on other peoples machines. Once I'm home this evening I will post my results.

Cheers,

Cloggy
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th May 2005 19:10
Will do - i'm at work right now, it'll be later on tonight when i do it.

My Website:
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 10th May 2005 23:20 Edited at: 11th May 2005 04:48
Just tried the new DLL, first off, great work! The line code using triangles I get 1100fps, you're previous DLL I get 750fps, but with the latest I get a 2x speed increase, now running at 1500fps.

[EDIT]
Here are my demo results:

Demo 1) Normal Text - 71fps AAText - 223fps
Demo 2) Normal Text - 2fps AAText - 105fps
Demo 3) 3DText - 1263fps (Not a benchmark but I thought I'd throw it in)
Demo 4) See above.

Specs:
Athlon XP 3000+
128MB 9800 Pro
1GB PC2700 Ram

[EDIT #2]
Here are my demo results after restarting my comp:

Demo 1) Normal Text - 82fps AAText - 264fps
Demo 2) Normal Text - 3fps AAText - 124fps
Demo 3) 3DText - 1389fps (Not a benchmark but I thought I'd throw it in)
Demo 4) Still the same as above.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 11th May 2005 03:42
Demo 1) Normal Text - 110fps AAText - 240fps
Demo 2) Normal Text - 3fps AAText - 105fps
Demo 3) 3DText - 1500-1600fps (Not a benchmark but I thought I'd throw it in)
Demo 4) 3D Lines - 650fps

Using latest DLL and above code you gave out. My PC was also encoding some MP3s at the same time

My Website:
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 11th May 2005 04:53
What are the rest of your system specs? I'd expect your card to beat mine, but we're about even apart from the 3DText demo.
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 11th May 2005 07:11
Thanks for the fps info.

My results are

Demo 1)Normal Text - 107fps AAText - 266fps
Demo 2)Normal Text - 3fps AAText - 135fps
Demo 3)1095fps
Demo 4)1170fps

Specs.

Athlon 2600+
Radeon 9700
1024GB 333Mhz

Don't think there is much more to do here other than a lot more testing to find/remove any bugs.

Thanks for your responses. I hope this dll proves useful to you until such a time that these functions are made native to DBpro.

Cheers,

Cloggy
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 11th May 2005 07:53
My system specs are:
AMD Barton 2500+
Gigabyte 6800GT 256Mb
1Gb DDR (its meant to be 500, but its currently runnning at 333.. I'm trying to diagnose system instability..)

My Website:
dj chainz
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: England
Posted: 23rd May 2005 07:15
Is there a way to make the AA text dll centre? This would be rather useful.

I am the lead programmer at red spark studios
http://www.redsparkstudios.co.uk
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th May 2005 19:09
Nice functionality!

My PC specs are in my Sig. It looks like my Gfx card may not be too good!

Normal Text - 79 FPS
AA Text - 68 FPS

Multiple Fonts:
Normal Text - 3 FPS
AA TEXT - 33 FPS

3D lines - 122 FPS
3D text - 122 FPS, 2700 polys

BatVink
Tartopom
20
Years of Service
User Offline
Joined: 27th Jun 2004
Location:
Posted: 6th Jun 2005 09:01
Hello, I've tried your plugin really nice .

Aniway, there's a problem when using lines in a viewport (for instance centered in the window with a resolution of 320 * 200). It seems that they are drawn out of the view, and this is cause a strange result because the backdrop is not refreshed.

Hope you can do something.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 6th Jun 2005 19:51
Does this not happen with the built in line function too?

My Website:
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 7th Jun 2005 06:02
I have made some updates

You can now align AA text with the align parameter of 'Text AA'

0=Left align
1=Center
2=Right align

Also 3d line should work when you change the camera view. Just remember to set the 3d line viewport to the same as the camera view.



Here is the demo program updated with these changes



Don't forget to download the attached dll.

Enjoy,

Cloggy

Attachments

Login to view attachments
Tartopom
20
Years of Service
User Offline
Joined: 27th Jun 2004
Location:
Posted: 7th Jun 2005 07:37
Works perfeclty now, thanks.
D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 9th Jun 2005 10:16
I just got your dll. Execellent work! Keep it up...
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 13th Jun 2005 04:21
Maybe you could make a readme, or rather a Reference manual or something. That would be a lot easier than having to read everything on this thread. And then you could maybe make the keywords highlighted(if you have time enough).

*** PANZERGAMES ***

Login to post a reply

Server time is: 2024-11-21 20:12:54
Your offset time is: 2024-11-21 20:12:54