The Game Creators
The Game Creators Home Online Shop Click to Login
  Hot: Christmas CompetitionNovember NewsletterModel Pack 36DB Pro Pack 2009DGS BonanzaCharacter PackFPS Creator Bonanza;
The Game Creators
Program Announcements / D3DFunc V1.0

Go to the first page of this board Return to the Forum Menu Post Message
89 Messages - Page   of 3   
Bookmark and Share Search the Forum Next 40

Author Message
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 17th Jun 2005 00:15           | link | toggle

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
Back to top
D3DFunc Plugin
Download: d3dfunc.zip Size: 181550 bytesReport this message as abusive
Philip

User


Joined: Sun Jun 15th 2003
Location: United Kingdom
Posted: 17th Jun 2005 00:33           | link | toggle

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
Back to top
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 17th Jun 2005 00:39           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
Scilynt

User


Joined: Wed Nov 13th 2002
Location: .-#-.
Posted: 17th Jun 2005 03:37     Edited: 17th Jun 2005 03:39     | link | toggle

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.
Back to top
Banded Software
Report this message as abusive
MikeS

Moderator


Joined: Mon Dec 2nd 2002
Location: United States
Posted: 17th Jun 2005 04:46           | link | toggle

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)
Back to top
Report this message as abusive
RossageSausage

User


Joined: Sun Mar 9th 2003
Location: Cyberspace
Posted: 17th Jun 2005 06:18           | link | toggle

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!
Back to top
Report this message as abusive
X Trade

User


Joined: Thu Feb 19th 2004
Location: near bristol, UK
Posted: 17th Jun 2005 16:50           | link | toggle

well done! i can see this being very useful!!

www.AoFP.co.uk
Back to top
AoFP - The Alliance of frelance programmers Send AIM user a message
Report this message as abusive
spooky

User


Joined: Fri Aug 30th 2002
Location: United Kingdom
Posted: 17th Jun 2005 20:34           | link | toggle

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!


Back to top
www.dbhut.com
Report this message as abusive
Baggers

User


Joined: Mon May 31st 2004
Location: Yonder over dem dere hills
Posted: 17th Jun 2005 20:51           | link | toggle

Good stuff man, after my exams I'll probably use this for my menu too.

Back to top
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 17th Jun 2005 21:01           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 17th Jun 2005 21:17           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
Philip

User


Joined: Sun Jun 15th 2003
Location: United Kingdom
Posted: 18th Jun 2005 22:39           | link | toggle

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
Back to top
Report this message as abusive
Keaz

User


Joined: Mon Sep 22nd 2003
Location: Somewhere in south Texas
Posted: 18th Jun 2005 23:56           | link | toggle

Sweet! Me likey
Back to top
Send AIM user a message
Report this message as abusive
spooky

User


Joined: Fri Aug 30th 2002
Location: United Kingdom
Posted: 20th Jun 2005 13:05           | link | toggle

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.


Back to top
www.dbhut.com
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 20th Jun 2005 13:22           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
Philip

User


Joined: Sun Jun 15th 2003
Location: United Kingdom
Posted: 21st Jun 2005 01:55           | link | toggle

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
Back to top
Report this message as abusive
Tartopom

User


Joined: Sun Jun 27th 2004
Location: Cyberspace
Posted: 22nd Jun 2005 23:31     Edited: 22nd Jun 2005 23:31     | link | toggle

If you can do something for fast 2d drawing, dot, box, line, this plugin can be more than great .

Cheers
Back to top
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 27th Jun 2005 21:27           | link | toggle

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
Back to top
D3DFunc Plugin
Download: d3dfunc.dll Size: 487424 bytesReport this message as abusive
Kohaku

User


Joined: Mon May 3rd 2004
Location: The not very United Kingdom
Posted: 27th Jun 2005 21:32           | link | toggle

That's an awesome plugin there.


You are not alone.
Back to top
developing augmentation
Report this message as abusive
Baggers

User


Joined: Mon May 31st 2004
Location: Yonder over dem dere hills
Posted: 27th Jun 2005 21:36           | link | toggle

Wow man, great work !

Back to top
Report this message as abusive
Google Ad
Back to top
 
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 27th Jun 2005 21:37     Edited: 27th Jun 2005 21:37     | link | toggle

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
Back to top
D3DFunc Plugin
Download: d3dfunc.dll Size: 487424 bytesReport this message as abusive
Philip

User


Joined: Sun Jun 15th 2003
Location: United Kingdom
Posted: 30th Jun 2005 23:52           | link | toggle

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
Back to top
Report this message as abusive
Baggers

User


Joined: Mon May 31st 2004
Location: Yonder over dem dere hills
Posted: 1st Jul 2005 00:10           | link | toggle

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.

Back to top
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 1st Jul 2005 00:13           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
David R

User


Joined: Tue Sep 9th 2003
Location: 3.14
Posted: 1st Jul 2005 19:11           | link | toggle

@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

Back to top
OneManBand Software
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 1st Jul 2005 20:30           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
David R

User


Joined: Tue Sep 9th 2003
Location: 3.14
Posted: 1st Jul 2005 20:33           | link | toggle

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!

Back to top
OneManBand Software
Report this message as abusive
qwe

User


Joined: Wed Sep 3rd 2003
Location: place
Posted: 1st Jul 2005 21:10     Edited: 1st Jul 2005 21:12     | link | toggle

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
Back to top
Send AIM user a message
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 1st Jul 2005 23:28           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
Sephnroth

User


Joined: Thu Oct 10th 2002
Location: United Kingdom
Posted: 2nd Jul 2005 00:40           | link | toggle

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
Back to top
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 6th Jul 2005 23:49     Edited: 6th Jul 2005 23:49     | link | toggle

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.

+ Code Snippet
sync on:sync rate 0:set display mode 1024,768,32
backdrop on:color backdrop 0

initd3d

rem test native commands
randomize 1

starta#=timer()
for x=1 to 1000
   for i=1 to 1000
      ink rnd(16777215),0
      dot rnd(1024),rnd(768)
      ink rnd(16777215),0
      Line rnd(1024),rnd(768),rnd(1024),rnd(768)
   next i
sync
next x
enda#=timer()

rem test D3DFunc.dll commands
randomize 1

startb#=timer()
for x=1 to 1000
   for i=1 to 1000
      draw color rnd(255),rnd(255),rnd(255),rnd(100)
      D3D_dot rnd(1024),rnd(768)
      draw color rnd(255),rnd(255),rnd(255),rnd(100)
      D3D_Line rnd(1024),rnd(768),rnd(1024),rnd(768)
   next i
sync
next x
endb#=timer()
draw color 255,0,0,75
ink rgb(255,255,0),0
nativespeed#=1000/((enda#-starta#)/1000)
D3Dspeed#=1000/((endb#-startb#)/1000)
increase#=D3Dspeed#/nativespeed#
do
text 0,0,"Speed Comparisons - 1000 frames, each drawing 1000 dots and 1000 lines in random colours"
text 0,30,"Native DBP Dot and Line commands - "+str$(nativespeed#)+ " fps"
text 0,45,"D3D Dot and Line commands        - "+str$(D3Dspeed#)+ " fps"
text 0,75,"Speed Improvement                - "+str$(increase#)+ " times faster"
D3D_Line 0,14,705,14
D3D_Line 0,70,490,70
sync
loop


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

Cheers,

Cloggy
Back to top
D3DFunc Plugin
Download: d3dfunc.dll Size: 487424 bytesReport this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 7th Jul 2005 09:26           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
RossageSausage

User


Joined: Sun Mar 9th 2003
Location: Cyberspace
Posted: 7th Jul 2005 10:54           | link | toggle

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!
Back to top
Click to view the attached source code in a new windowReport this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 8th Jul 2005 09:48           | link | toggle

RossageSausage,

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

+ Code Snippet
StartText
Text AA 0,0,0,"Text"
Text AA 0,15,0,"Text"
EndText
Paste image 1,0,0
...

Starttext
Text AA 0,30,0,"Text"
EndText


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
Back to top
D3DFunc Plugin
Download: d3dfunc.dll Size: 409600 bytesReport this message as abusive
RossageSausage

User


Joined: Sun Mar 9th 2003
Location: Cyberspace
Posted: 8th Jul 2005 10:29           | link | toggle

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.
Back to top
Report this message as abusive
Cloggy

Valued Member


Joined: Sun Oct 31st 2004
Location: Rayleigh, Essex
Posted: 8th Jul 2005 10:38           | link | toggle

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
Back to top
D3DFunc Plugin
Report this message as abusive
Benjamin

User


Joined: Sun Nov 24th 2002
Location: France
Posted: 8th Jul 2005 14:48           | link | toggle

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
Back to top
Report this message as abusive
Jess T

Moderator


Joined: Sat Sep 20th 2003
Location: Over There... Kablam!
Posted: 20th Jul 2005 12:26     Edited: 20th Jul 2005 17:08     | link | toggle

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?
Back to top
jt0.org
Report this message as abusive
Scraggle

User


Joined: Thu Jul 10th 2003
Location: Teesside University
Posted: 20th Jul 2005 12:39           | link | toggle

Great DLL and top quality help files too!

Have a gold star

Good work fella


Back to top
http://www.codebrewers.com
Report this message as abusive
warship45

User


Joined: Sat Jul 24th 2004
Location: uk
Posted: 20th Jul 2005 21:26           | link | toggle

just tryed it it is great

lone land the rpg
web site coming soon
Back to top
0z0
Report this message as abusive

Go to the first page of this board Return to the Forum Menu Post Message
89 Messages - Page   of 3   
Search the Forum Next 40

This is a multi-page thread older than 30 days.
Go to the last page to check if you can reply to it.

Forum Search

Enter a word or phrase to search our Forum for:

Thread Subject Search
Search Phrase:
Search Scope: Entire forum
Just this board
 
Google Forum Search
Search Phrase:
 
Apollo v2.02


Dark Game Studio
Privacy Policy AUP Top of Page