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 V1.0

Author
Message
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Jun 2005 08:15
I have now finished my DirectX additional functions dll.

It allows you to do the following:-

Create 3D text as a DBP object.

Display fast antialiased text. In some cases up to 20+ times faster than standard DBP text (if you are using different fonts and attributes).

Draw 3D lines. These are not DBP objects and currently output on top of everything. I am looking at a 3d point command.

Text and Lines can be drawn with an alpha value as well.

Here is a screenshot of some 3D text created by the dll



The attached zip file contains help, examples and a keywords file as well as the dll itself, and should be extracted to the DBP installation directory.

A big thank you to SilentS for his contribution of the base help files, and everyone who helped with testing.

Also thanks to Mike Johnson who gave me alot of help in getting the creation of DBP objects to work.

If you find any bugs or have any suggestions please let me know and I'll see what I can do.

Cheers,

Cloggy

Attachments

Login to view attachments
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 17th Jun 2005 08:33
WHAT?

Good grief. Don't be scared, but a 3D text DirectX function call DLL???? Cloggy, sir, I hereby declare you to be my favourite person on the planet.

Furthermore, if you get the 3d lines working so they are not on overwrite, I shall marry you.

Philip

Cheer if you like bears! Cheer if you like jam sandwiches!
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Jun 2005 08:39
You're welcome. I may even accept

I'm trying hard to figure out how to stop them printing on top. Hopefully I'll find something soon.

I may release the source at some point in the future, and let a more competant c++ programmer finish the job.

Cloggy
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 17th Jun 2005 11:37 Edited at: 17th Jun 2005 11:39
Again, Nice DLL.

I figured out, sort of, the problem I had with the text object function. You must be running the retail version of DX, as when I run with that everything works. Running with a debug version I get a warning and an error.

First, I assume you are creating a Vertex Buffer, and according to the debug statements you have created it with POOL_DEFAULT but without a WRITEONLY flag. This is proberly for obvious reasons, but causes a slight problem though as it may introduce a 'severe performance problem'. The DLL will happily work like this.

However, the error is to do with incorrect flags when attempting to lock the Vertex Buffer. This fails the lock and the text cannot be created.
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 17th Jun 2005 12:46
Cool 3D text.

I can think of hundreds of uses for this. Be sure to send Rich Davey an e-mail. This is probably worth a little mention in the newsletter.



A book? I hate book. Book is stupid.
(Formerly Yellow)
RossageSausage
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 17th Jun 2005 14:18
Congrats to you on the extremely useful dll. There are so many uses for this its not even funny. The text display speed is excellent.

Keep up the great work!
X Trade
20
Years of Service
User Offline
Joined: 19th Feb 2004
Location: near bristol, UK
Posted: 18th Jun 2005 00:50
well done! i can see this being very useful!!

www.AoFP.co.uk
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Jun 2005 04:34
Wow!

that 3d text is just amazing - just like using Xara3D.

Very good timing as well as I am just about to do main menu and options screen for my puzzle game and needed a resolution independent way of doing menu options. Lots of credit to you!


Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 18th Jun 2005 04:51
Good stuff man, after my exams I'll probably use this for my menu too.

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 18th Jun 2005 05:01
Thanks for all the positive feedback. What I'd really like is for TGC to include a 3d Text option and antialiased text in a future release of DBP. I'm sure Lee could make this much more efficient than I can.

My c++ knowledge is quite limited and I have cobbled this together maily through dissecting examples and pleanty of trial and error.

Cheers,

Cloggy
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 18th Jun 2005 05:17
SilentS,

I create the text using D3DXCreateText. I then reposition the vertices depending on the alignment chosen.
Once this is done I change the vertex format to add normals and UV coords using the CloneMeshFVF method of the ID3DXMesh interface. This uses the option D3DXMESH_MANAGED.

I now have a mesh with the same FVF as a DBPro object. I then use some internal DBpro dll functions to create a new DBP object and copy the vertex data from my mesh to the new object.

When I get round to commenting the code I will post the source for this dll.

Cheers,

Cloggy
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 19th Jun 2005 06:39
How about a create 3D curve option? You could do this using bezier curves?

Cheer if you like bears! Cheer if you like jam sandwiches!
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 19th Jun 2005 07:56
Sweet! Me likey
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 20th Jun 2005 21:05
Is the 3d text always created at same size of roughly 0.5 db units high? I assume there is no way of controlling required size except for rescaling object after creation. Not a major problem but DBPro apparently has a few minor lighting and bounding problems with scaled objects.


Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 20th Jun 2005 21:22
Spooky,

The D3DXCreateText method gives no option for size. I hadn't really considered this, but I could take a size parameter and manually resize the object in my dll before making it into a DBP object.

I'll check it out tonight if I get the chance.

Cheers,

Cloggy
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 21st Jun 2005 09:55
This is more of a workaround aimed at a DBPro bug rather than necessary extra functionality in Cloggy's great DLL though.

Cloggy, this is a REALLY useful DLL. You are seriously to be congratulated for this. Faster 2d text and 3d text are major contributions to the community.

Philip

Cheer if you like bears! Cheer if you like jam sandwiches!
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Tartopom
20
Years of Service
User Offline
Joined: 27th Jun 2004
Location:
Posted: 23rd Jun 2005 07:31 Edited at: 23rd Jun 2005 07:31
If you can do something for fast 2d drawing, dot, box, line, this plugin can be more than great .

Cheers
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 28th Jun 2005 05:27
I have made a slight amendment to the 3d Line command. The lines now do not draw if the are behind another object. Sorry Philip but I wont be able to marry you (already spoken for!)

Also managed to squeeze another 5% onto the fps.

won't be able to do anything about the 3d text size, but I am having a look at 2d lines etc.

Also does anyone think a 3d point command would be useful?

Cheers,

Cloggy

Attachments

Login to view attachments
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 28th Jun 2005 05:32
That's an awesome plugin there.


You are not alone.
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 28th Jun 2005 05:36
Wow man, great work !

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 28th Jun 2005 05:37 Edited at: 28th Jun 2005 05:37
Aura,Baggers,

Thanks. Glad you like it

BTW I've added a 3d point command :-

Point3d x#,y#,z#

Will redo help files when I get the chance.

Cheers,

Cloggy

Attachments

Login to view attachments
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 1st Jul 2005 07:52
Great. But how about a 3D curve command?

Cheer if you like bears! Cheer if you like jam sandwiches!
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 1st Jul 2005 08:10
Now Philip, you just asking for bigger things...next it'll be a sandwich, then a beer...next thing Cloggy knows you will be married to him.

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 1st Jul 2005 08:13
Hey! Next you'll want the moon on a stick! .

If you can help me out with the maths I'll gladly give it a go.

Cheers,

Cloggy
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 2nd Jul 2005 03:11
@Cloggy; Haven't had a chance to try your plugin, but about lines; would it be possible to create lines as actual 3d objects (with a certain thickness etc.) I know its probably a severely crazy/stupid idea, but the ability to put 3d lines (in actual 3d) in my current program (editor for my RPG) would be very useful.

Just an idea

[url=www.lightningstudios.co.uk][/url]
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 2nd Jul 2005 04:30
David,

It isn't possible to make the lines into actual DBP objects, Also I am certain you cannot create them in varying widths unfortunately.

But if you try them out they are completely 3d, you just have to define them in each game loop. This actually makes them more flexible than if they were objects because you do not need to keep changing the vertex information using the DBP vertex manipulation code. I hope this makes sense.

Thanks for you input,

Cheers,

Cloggy
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 2nd Jul 2005 04:33
Okedoke Cloggy; I knew my idea was impossible/pointless

Still a great plugin though. Can't wait to integrate it into my current RPG. Thanks for the plugin!

[url=www.lightningstudios.co.uk][/url]
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 2nd Jul 2005 05:10 Edited at: 2nd Jul 2005 05:12
i tried putting the 3d line command in and my game got sort of screwed up and the line doesnt show
screen without 3d line command:

screen with:


If you want anything DB related hosted, log in (with ws ftp or something) www.lysergium.net with username public@lysergium.net and password public. you'll be directed to lysergium.net/public
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 2nd Jul 2005 07:28
qwe,

I've tried a few tests here. You need to put the initd3d command after any 'set display mode' commands. Also you need the 'set view' command. The best place to put this is just above you main game loop.

Let me know if that helps.

Cheers,

Cloggy
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 2nd Jul 2005 08:40
Hey cloggy, looks like a great dll. I tried adding you to msn but you havnt appeared online yet I'm wondering if you would consider sharing the source, mainly for the anti-aliased text, so i can convert it to a library-type format usuable with the DarkSDK.

DarkSDK suffers the same problem as dbpro when it comes to text - my gui drawing routine takes about 20 fps off my game which i get back if comment out the text commands! Would be very interested in making a version of your faster commands usable in darksdk

I could open my dx help file and do it manually i suppose but im wrapped up in my puzzle game competition and looking for a short cut XD

let me know through here or msn what you think.

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 7th Jul 2005 07:49 Edited at: 7th Jul 2005 07:49
I have updated the dll. 2 new commands :-

D3D_Line x1,y1,x2,y2 - Faster version DBP Line command
D3D_Dot x1,y1 - Faster version DBP Dot command

Also changed Point3D command to be D3D_Point.

I intend to prefix all commands with D3D_ in my next version, and update my help files.

Here is some code to test the speed improvements over the native Dot and Line commands.



On my Athlon 2600 with a Radeon 9700 and 1024MB Ram, I get a 6 time speed increase!

Cheers,

Cloggy

Attachments

Login to view attachments
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 7th Jul 2005 17:26
Strange,

I've just tried this on my work PC which has just intel graphics and the D3D commands produce no output!

Currently not sure why but would appreciate someone else testing this.

Cheers,

Cloggy
RossageSausage
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 7th Jul 2005 18:54
Hey Cloggy,

I've ran into a snag. When I put the AA text in the main loop the text seems to just continually overwrite itself making the text pixelated. I don't quite know what to do, I have copied and run your main example just fine and the only difference that I have noticed is that you used a line command and a dbp text command in your loop. Any help with it would be excellent.

I've attached my code for you to look at so you know I am not just making a crazy error. Or maybe I did...its bedtime

Thanks!
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 8th Jul 2005 17:48
RossageSausage,

You get this problem if you have some image commands between the starttext and endtext. This is what you should do.



This does slow it down a little, but it is still way faster the the standard commands. I am trying to find a resolution to this though.

Attached is a new version of the dll.

This update fixes the 2d commands to render correctly on a no accelerated graphics card. On testing at work with an intel graphics chip my 2dline and dot commands work about 30 times faster than DBPro's own commands,

I've just got to get the box command working correctly now.

Cheers,

Cloggy

Attachments

Login to view attachments
RossageSausage
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 8th Jul 2005 18:29
Hey Cloggy,

HAHA I found out the issue. You have to set backdrop on in order for the text to not overwrite itself in the loop. Must be some weird dll quirk....god I am glad I figured that out. Anyways thanks for the response and be sure to get the word out about the issue.

Btw: If you are still unsure as to what I am talking about, remove the backdrop on: color backdrop 0 line from your example, compile it and look at the pixelization goin on with the d3d text.

Any way to fix it?

Thank you for listening and creating an extremely useful dll.
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 8th Jul 2005 18:38
RossageSausage,

Interesting! I'll take a look tonight. Pretty sure I can sort that one out.

Glad to hear you're finding the dll useful. Let me know if you find any more 'features'.

Cheers,

Cloggy
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Jul 2005 22:48
I would imagen pixelation happens when the screen isn't constantly clearing and you are constantly using AAed text. I may be wrong though..


"Lets migrate like bricks" - Me
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 20th Jul 2005 20:26 Edited at: 21st Jul 2005 01:08
Ben's got it right there

It's like having a 25% alpha'd image on one layer, then copy + pasting that layer on top a few times, and you'll start to see it more and more clearly...

The problem is the same thing, but the screen isn't being cleared before you put the new Text ( rather than the new layer in my example ), so the alpha'd parts get more and more visible each loop untill they are 100% alpha

Setting the backdrop on fixes this 'cos when you call the "Sync" command, it completely whipes the screen, and just renders what has been updated since the last Sync ( the same explanation goes for the Paste Sprite command ).

If you don't turn on the backdrop, but have a CLS command, you should be fine



Also, Cloggy, thought you might like to know that I used your DLL for all the text in my Puzzle Compo entry RoboMen.
And found that I can create a sexy-looking beveled effect by offsetting alpha'd Text

Thanks for the DLL, it really helped to add that extra touch to my game, and I didn't want you to go un-credited

Jess.

Team EOD :: All-Round Nice Guy
Want Better dbHelp Files?
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 20th Jul 2005 20:39
Great DLL and top quality help files too!

Have a gold star

Good work fella


warship45
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location: uk
Posted: 21st Jul 2005 05:26
just tryed it it is great

lone land the rpg
web site coming soon
Essence
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: The Netherlands
Posted: 8th Aug 2005 15:04
It crashes when i try to compile my program.

It's just when i even add one line with a D3D function
Any help please?

I'm using 5.8


First DifNiX -> now EvaX.
101100GAWJon 010101
19
Years of Service
User Offline
Joined: 4th Jul 2005
Location:
Posted: 9th Aug 2005 07:02
/\ To EvaX /\
Sorry about your error, I have no clue on how to fix it...

<> To Everyone else <>
This is a great plugin , I am very impressed! I'm going to use it in a map designer that I'm making.




Visit my website at http://nodimensions.com/
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 9th Aug 2005 20:51
EvaX,

Sorry for the slow replies, I've been away for a few days.

Does it happen when you use the supplied examples?

Cheers,

Cloggy
Catalyst
21
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 11th Aug 2005 08:01
Cloggy, great DLL, it's working way better than DBPro internal text. For some reason DBP didn't seem to like 100 point size fonts, slowed the whole program down to 25 FPS or so. This brings it back up to 160 FPS.

Now onto the fun part. I have my program that I can compile and run, text looks great. I put that program onto my laptop, runs fine. I send it to a buddy to test, doesn't run at all. I've been working on this program all week so he's tested earlier versions and they worked. Rem out any lines of code that pertain to the DLL and then he can run it. Made a new project with one of your examples and send it to him. It runs.

So, I'm sure this is nice and vague, but anyone have any input? Or at least any idea what info you would need to figure out anything on this?
Kangaroo2 BETA2
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: Somerset / UK
Posted: 14th Sep 2005 17:13
Wow this is excellent The faster 2d text is very useful and the 3d text is really fun to play with Thanks!

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 14th Sep 2005 21:34
Was the idea inspired from the DirectX SDK Text3D example? If you don't get time to post the source at least share the secret of how you fed the vertex information through DBP internal functions to ultimately create an object. Please Please!

The best audio plugin for DarkBASIC Pro!
Plays Ogg Vorbis,MP3,FLAC,uncompressed WAV,AIFF,MOD,S3M,XM,and IT files.
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 15th Sep 2005 00:48
I'm so busy at the moment with work related stuff which means I'm not going to be able to take this any further for a while.

Therefore after thinking about it I have decided to post the complete source code for this dll. It is fairly sparsely commented (not my best point), but I'm sure most people will glean at least some useful information out of it.

The major difference between this and my last released version is the fact the all commands are now prefixed d3d_ and there are a couple of new commands d3d_pyramid for example.

Please note that I normally program in VB and this was cobbled together from msdn documentation and examples, and much experimentaion. I'm sure an experienced c++ programmer could rip it apart and make it much more efficient.

If anyone has any questions about the code I will still be checking the thread on a regular basis, and will answer as soon as I get the change.

enjoy!, I'm off to try and work out how to write a SOAP server in .net now

Cheers,

Cloggy

Attachments

Login to view attachments
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 15th Sep 2005 12:56
That's brilliant! Thanks Cloggy

Interesting to see the way that you did some of that.
Also noticed a few things that I would do differently, but I wouldn't necessarily say better ( and I'm definatly not a seasoned C++ programmer ).

Thanks again, mate

Jess.

Team EOD :: All-Round Nice Guy
Want Better dbHelp Files?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 18th Oct 2005 00:26
@Cloggy, are you going to re-compile this for v5.9 when that update is released? Your dll is damned useful and it'd be a grade 1 bummer if it ceased to work with everyone's projects.

Cheer if you like bears! Cheer if you like jam sandwiches!
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 19th Oct 2005 06:59 Edited at: 25th Oct 2005 06:12
Been working on this the last 2hrs or so, inbetween watching some IPTV, fixing up the help files, and a few code edits. As Cloggy has said all commands are now prefixed with D3D_ which required help updates and example updates. I removed most of the examples since the showcase pretty much shows everything and I couldn't be bothered updating the other examples. Few new commands, and extensions to some commands, so check the help.

Works with Beta 3, if U5.9 Final breaks it I'll recompile.

If you installed a previous version then you should probably remove the files. To install simply extract to your DBP root folder.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-24 06:20:58
Your offset time is: 2024-11-24 06:20:58