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
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Mar 2008 17:25 Edited at: 16th Mar 2008 18:14
I can trigger this consistently with a simple piece of code. In test 1, you can reduce the step right down to 1, thus creating hundreds of display resizes. As soon as you hit a number of D3D_inits in the 2nd test, it falls over with a "Inavlid parameter" message on the Display resize.

I've started with STEP 20 in the first test, feel free to reduce it to 1 or 2, and see that the crash is consistent in test 2.



This isn't the exact same problem, as it generates a DBP error. But in all likelihood, it's got the same root cause.
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 16th Mar 2008 21:52 Edited at: 16th Mar 2008 21:52
I've had a look and it appears that when d3d_init is called it initializes all 20 possible fonts as Arial. Fonts were not being released properly and I think this is what was causing the problem.

I have made a temporary fix for you to try and have attached it to this message.

Note that when you call D3D_Init you have to redefine any D3D fonts you have used with the D3D_Font command.

Let me know how you get on.

D3DFunc - Superfast Antialiased text & much much more

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Mar 2008 22:28
You are a star - excellent service on a free product!

Tested on the sample code and worked perfectly. I've now hammered my project and it's also working just fine.

Thanks again, can this DLL be used on a permanent basis or is it a special build?
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 16th Mar 2008 22:32
No problem.

I will create a new version 3.6.6 and stick it on my website as soon as I get the chance.

For all intents and purposes it will be the same.

D3DFunc - Superfast Antialiased text & much much more
Ian T
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 16th Mar 2008 23:26
Thanks for the excellent extension to DBP, Cloggy. It's come in handy in basically all of my projects.

This is hardly a huge bug, but when you disable zdepth and set wireframe on any given object, it seems to make all d3d_box's wireframe as well.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Mar 2008 02:07
Ian,

I've looked at this and have fixed it. All filled rectangles and polygons now remain solid regardless of the object settings.

I will release a patch shortly.

D3DFunc - Superfast Antialiased text & much much more
Ian T
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 17th Mar 2008 05:31
Talk about quick support. Thanks
Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 17th Mar 2008 18:37 Edited at: 17th Mar 2008 18:38
Hey Cloggy is it possible for you to add the "round box corner" parameter I mentioned in this thread earlier? It's okay if you cant - I do understand you are busy and can not fulfill everyones needs.


ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, DirectX10, DBPro 6.7
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Mar 2008 20:57
Olby,

I'll have a look. unfilled rounded corners would be ok, filled is a bit more awkward as you would need 4 quadrants plus 2 rectangles. I may be able to implement something fairly quickly and inefficiently by creating 1 filled circle in each corner rather than a quadrant.

I'll release V3.6.6 tonight and have a look after that.

D3DFunc - Superfast Antialiased text & much much more
Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 17th Mar 2008 22:15
Thank you for looking at this. This is great.


ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, DirectX10, DBPro 6.7
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Mar 2008 22:58
I've uploaded 3.6.6 to my website. Having extreme internet connection problems at the moment. I've been trying for about an hour to send this message.

D3DFunc - Superfast Antialiased text & much much more
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Mar 2008 23:16
@Cloggy
An extremely easy way to do curved corner rectangles is to just copy your filled circle code, and add a bit that adds an offset to every point depending on its quadrant

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 18th Mar 2008 10:11
Diggsey,

I have done some experimenting and the method you mention does work correctly, the problem is that things look ok if you have large radius corners, but as soon as you reduce them they start looking very dodgy.

I have looked at Bresenham's Circle Algorithm and the circles look much better but it plots the circle dot by dot and so is slower and is not easily converted to make polygons.

I'll have more of a look when I get back home tonight.

D3DFunc - Superfast Antialiased text & much much more
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 18th Mar 2008 18:52
Duplicate the vertex that appears on the edge of each quadrant. You can keep a running total of the current vertex index.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 18th Mar 2008 21:10
Diggsey,

Here is an example of 2 rounded rectangles. one has a radius of 5 and the other has a radius of 50.



To me the both look a little dodgy on the corners. It's the same with normal circles. The smaller the radius the more pronounced are the problems. It's all due to rounding the floating point positions of the vertices to integers.

D3DFunc - Superfast Antialiased text & much much more
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 20th Mar 2008 16:04
@Cloggy
Have you tied using a smaller number of vertices for the curves? I see what you mean now, and it looks like if you do that, plus some antialiasing it would look good

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 20th Mar 2008 17:08
I just thought of an awesome command! If you don't add it, I certainly will! A command to use a memblock or pointer to draw a shape from. Basically a wrapper for DrawPrimitiveUP, where we could set the type (point list/line list/line strip/tri list/tri strip/tri fan). Commands to optionally change the FVF as well as the texture and the render state would be nice

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 4th Apr 2008 01:51
Just a post to let you know I've updated my website. It should be a little kinder on the eyes.

I'm hoping to expand on the code snippets over the next few weeks.

If anyone has any d3d related snippets and is happy for them to go on the site, please let me know. Obviously full credit will be given to any contributors.

Here's hoping my new sig works

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 5th Apr 2008 12:08
Hi Cloggy,

Could you say a little more about the isometric camera function and how it might possibly help with rpg projects etc in 3d

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 5th Apr 2008 13:33
@Duffer,

What exactly do you want to know?

Games like 'Knight Lore' are displayed from and isometric view point.

Attached is a Early stage X model viewer I have written that uses the isometric functions of d3dfunc. Just drag a .x file onto the exe and it will display it.

Attachments

Login to view attachments
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 6th Apr 2008 01:37
For those interested I have got rounded boxes working both filled and unfilled with various radius corners.

Screenshot


Here is the code for this screenshot



It will be a few days before it will be available as I'm looking to add d3d_polygon rotation as well.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Apr 2008 14:17 Edited at: 6th Apr 2008 14:18
@Cloggy
While your updating it, could you fix the bug where filled polygons (and therefore, filled circles, and probably now filled rounded corner rectangles) do not draw if a command from Basic3D is used. The reason is because they do not turn off back face culling before drawing, and the vertex order is the wrong way around, causing them to be culled. This a very serious bug, and incredibly easy to to fix, just add this line to the functions:

[d3d device]->SetRenderState(D3DRS_CULLMODE,D3DCULL_NONE);

I apologise if you have already done this, but it effectively makes you plugin almost useless in 3d (unless you just want to draw unfilled stuff or boxes)

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 6th Apr 2008 14:28
@diggsey

I've done that already

I'm addint the polygon rotation command, but it looks like I'll have to remove the following commands:-



as they cause problems with darkbasic and the string table. The compiler doesn't see the difference between int, DWORD and Float in the string table when the same command is redefined.

I wouldn't imagine anyone is using those commands because they produce elipses which are already handled by the d3d_ellipse command.

BiggAdd
Retired Moderator
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 9th Apr 2008 19:53 Edited at: 9th Apr 2008 20:00
Hi Cloggy!
I have only been using your plugin for a week, but I have to say it is absolutely incredible!
Good job!

I'm having a little trouble when I am using multiple cameras however.
I think it is just with Batch rendering. It seems if I add a batch to a camera, it will mask sprites and text to that view. In this example the text seems to be unaffected... No idea why, but it has been in the past.
Before Batch:


After Batch:


Code:



I've had a look through this thread and I'm unable to find an answer. Sorry if I have overlooked anything!

I'm Running WinXP Pro x64. and DBP 6.4 [EDIT]Just updated to 6.7, but the problem still persists.[/EDIT]

Thanks for your time!

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 9th Apr 2008 22:04
@BigAdd

I've had a look and it's the camera viewport that needs resetting. I've made a temporary change and attached the test dll. Could you see how it works on your system. It seems good here.

This problem effects alot of areas so well done for finding it. I'll make the permanent change to the new version which would be ready if it wasn't for me trying to add some new examples for the help file.

Attachments

Login to view attachments
BiggAdd
Retired Moderator
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 9th Apr 2008 22:15
Thats smashing! Works a treat. Thank you very much for your support.
Amazingly fast work!

BiggAdd
Retired Moderator
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 10th Apr 2008 01:02
Actually noticed another issue similar to the first.
Calling the command D3D_Circle3D produces similar effects if you specify a camera number. But the problem is removed by calling D3D_Line3D with a specific camera number.

Thanks again!

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th Apr 2008 01:16
Here is the version with the viewport fixed for all 3d drawing commands. This is how the final version will work providing no other bugs are found/corrected.

Attachments

Login to view attachments
BiggAdd
Retired Moderator
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 10th Apr 2008 01:53
Works like a charm! Great work again Cloggy!

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Apr 2008 12:18
Now, how about a DrawPrimitiveUP wrapper (Along with commands such to pick a 2d viewport, or a 3d one from a camera) That way, we are no longer limited to drawing standard shapes

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th Apr 2008 14:30
@Diggsey

I've been looking at a command to do the DrawPrimative wrapper.

There is a D3D_CURSOR_IN_CAMERA which when called tels you which viewport your mouse cursor is.

If this isn't what you mean then please expand a little on your explaination.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 12th Apr 2008 02:58
@Diggsey

I've done some preliminary coding to create a Primative from an array of points (unfilled only at the moment).



I have attached an exe for you to try. Is this what you have in mind?

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Apr 2008 19:17
@Cloggy
Kind of, yes But let us optionally provide much more data than just positions (UDTs in an array could be created to be a valid D3D vertex struct, and we could pass in the FVF it uses)

Also, could you make it so that it will take a pointer to memory as well, that way we can use memblocks and raw memory access with it

Thanks for doing this

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 12th Apr 2008 22:56
@Diggsey,

That may have to wait for a later version. I've only just started to get my head around accessing DBPro Arrays in c++

I want to concentrate on getting some more samples coded and getting all the latest bug fixes out there.

Cheers,

Cloggy

draknir_
17
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 12th Apr 2008 23:54
argh!! dont remove D3D_polygon! please I use it for a 2d hex-based wargame without media
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th Apr 2008 00:07
@draknir_
D3D_Polygon is not being removed It is an overloaded function, and two of its overloads are being removed. They were never usable anyway, because DBP couldn't tell whether or not it should call them (they have the same parameter types as other D3D_Polygon functions)

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 13th Apr 2008 01:23
@draknir_

You will need to make a slight modification to your usage of the command.



Rotation is 0 if you want to retain the way things work now.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 13th Apr 2008 03:25
@Diggsey,

Is this more like it?



dll attached for testing. Can't texture yet plus you can't change anything like CULL MODE etc. I;ll wait to perfect this before adding memblock version.

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th Apr 2008 11:42
draknir_
17
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 13th Apr 2008 14:35
ah ok good! you scared me there
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 14th Apr 2008 23:00
Found a wierd problem. If I set a d3d_font to a size of 10 pixels or lower the d3d_text command is slower than it's equivalent dbpro version.

It seems that below a size of 15 pixels d3d fonts are not anti aliased and that makes them slower. Very Peculiar

Can anyone shed any light on this?

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 27th Apr 2008 20:30 Edited at: 27th Apr 2008 20:30
I get the error:

Quote: "This application has failed to start because d3dx9_35.dll was not found. Re-installing the application may fix this problem."


followed by
Quote: "Failed to load DLL (3: D3DFunc.dll)"


I'm running vista sp1.

Thanks
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 29th Apr 2008 02:20
@Xlaydos

The problem is due to d3dfunc being compiled with the August 2007 DirectX SDK. I am compiling the new version with October 2004 which will eradicate the problem. I am trying to compile some new demos to go with the help files so this could be a week or so off.

You could ensure that you have the very latest directX runtime from the microsoft website. That may well include the file.

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 30th Apr 2008 18:18
Okay thanks I'll have a look at that, otherwise i'll wait
Lover of games
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 15th May 2008 11:14
where can i get the DLL with the rounded boxes? and can you do slanted boxes? also, what's your secret? i've been trying for ever to make a box plug in for DBPro and so far, nothing!

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th May 2008 22:27
@All

I've just put the latest version (3.7) of the dll on my website (see sig.)

Here is the readme showing new updated commands:-



Any problems post them here. Sorry for the delay but I've been a little sidetracked. I hoped to add some more examples but thought I release it as is for the moment.

cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 17th Jul 2008 11:07 Edited at: 17th Jul 2008 11:13
Hi Cloggs.

I'm using your d3d_text to improve the speed of my game. I don't know if you (or anyone else here) will be able to answer this but I'll try anyway.

For some reason, my text isn't anti-aliasing and it looks really bad:


I'm pretty sure I'm using the right code. There it is below:



This function is in a seperate DBA that's #included in the main file. It's only about 133 lines (the main program is 591 lines) so that shouldn't be an issue. Any way to make my text look like everyone else's?

EDIT: Here's another, more simple, example:




a total noob.
Currently working on - A letter-by-letter Message Script
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Jul 2008 13:02
cyangamer,

This problem normally occurs when the backdrop isn't being cleared. The second example could also be because you are using a resolution doesn't match your desktop ie desktop res is 1024x768 but you are using 640x480.

cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 17th Jul 2008 14:22 Edited at: 17th Jul 2008 14:43
Which command clears the backdrop? Also, what do the minimum, maximum, and value parameters mean in D3D_PROGRESS_BAR? For texture, that refers to an image file am I correct?

a total noob.
Currently working on - D3D_Text
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Jul 2008 15:04
set backdrop on will clear after each sync.cls will also clear the screen.

minimum is the minimum value of the progress bar, maximum is the maximum value and value is the current value.

For example, if you have a progress bar showing a percentage value, minimum would be 0, maximum would be 100 and value would be the current percentage.

Login to post a reply

Server time is: 2024-04-27 03:46:06
Your offset time is: 2024-04-27 03:46:06