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
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2006 01:12 Edited at: 10th Mar 2006 01:13
Could it just be a problem of the distance of the line being smaller than 1 and therefore, as the 2d screen is real numbers rather than floats, the line is mathematically scaled down to 1 pixel?



I say this because this code seems to work properly.

Errr... I know this seems bizarre, but I confess I find it easier to think in 3d than 2d. So if what I just said above is nonsense, I apologise.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th Mar 2006 12:25 Edited at: 10th Mar 2006 12:29
Philip,

That code doesn't work for me I just get a line from 10,10 to 11,11.

If I draw a line from 10,10 to 12,10 then I get a 3 pixel long line.

Very strange. Maybe it's a driver problem, maybe it's just a problem with my version of the dll.

I could do with a few people trying it and letting me know the results.

EDIT - Just tried it with a really old version and I still get the problem. May try updating my drivers now!

Cheers,

Cloggy
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2006 13:47
It is weird. I can't claim to be a specialist on DirectX so I'll leave this for wiser heads to comment on.

Incidentally, in my example 3d circle code above I stupidly forgot to scale the circular vector by the radius. As a result the function just draws a unit circle and the radius parameter doesn't do anything. I'll fix this later on this evening / tomorrow.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2006 22:38
Well, here is slightly revised code, which enables the radius parameter of the 3d circle command.



But, there is a curiosity (as always with these things). It is that the circle is drawn on a plane further away from the centre of the plane. There does seem to be something wrong with the definition of the vector from the centre of the 3d circle to the edge. It seems to be slightly more than 90 degrees to the normalised vector of the plane. I've looked at this code for a while and I can't spot any obvious mathematical error. It occurred to me that it might be a float / integer issue but I can't see any example of that either.

Possibly a bug? If so, a very very small one.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 11th Mar 2006 16:17
@Cloggy

Here is a revised circle3d example. If you've seen my thread on the bugs forum, you'll see that Danny kindly pointed out my stupid mathematical oversight and fixed it.



Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Matt W
18
Years of Service
User Offline
Joined: 4th Mar 2006
Location:
Posted: 11th Mar 2006 22:18
Great .dll!
Matinuker
20
Years of Service
User Offline
Joined: 25th Mar 2004
Location:
Posted: 11th Mar 2006 22:32
Thanks for this great .dll!

This may be a stupid question but how do you delete 3d lines when you don't want to use them anymore?

Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 11th Mar 2006 22:54
3d lines are not DBPro objects, i.e. they do not persist past the loop in which they are called. So you don't need to delete them. They delete themselves.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Matt W
18
Years of Service
User Offline
Joined: 4th Mar 2006
Location:
Posted: 11th Mar 2006 23:29
Ah brilliant!
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 12th Mar 2006 06:51
Haven't spoken with Cloggy yet, but I implemented your code Philip in the plugin, and it's working great. Changed a few things in the drawing code, but the math is all the same.

What I'd like to request is, if someone knows how I can scale the circle by a width and height radius to product ellipse shapes in 3D rather than a uniform scale. I'm not familiar with vector math, so it's not my territory.

The unofficial new commands so far are...

D3D_Polygon3D - Which can be used to draw anything from a triangle up, used for shapes that don't necessarily require they're own commands.

The circle command is D3D_Circle3D.

And hopefully, if I can find some code for non-uniform scale, you'll get something like D3D_Ellipse3D.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 12th Mar 2006 14:19
Are you drawing the circumference of the circle using dots, as per my example above, or do you also have a parameter that creates a complete circumference by drawing a line between each of the vectors representing the dots?

My reason for asking is that some people might want to draw large circles and, if they do so, the spaces between the dots become quite noticeable.

I've been meaning to tidy up my own ellipse command for you. Its very messy. I'll try and post it today if I have time.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 12th Mar 2006 15:08
I use lines to draw the shapes, all batched at the end so as to cut down on overhead.

Thanks for providing your functions, otherwise I doubt these new commands would exist.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 12th Mar 2006 17:02 Edited at: 12th Mar 2006 17:38
Great! I think lines are best.

Although I've been a bit distracted by "American Idol" on ITV, I've neatened up my ellipse3d code. Here it is. There is a more elegant way of drawing an ellipse using two foci vectors rather than the sin/cos parametric equations I've used but, well, I like this method.



Of course, you can draw a circle3d with this code by defining length = width. But I think its probably best to stick to two separate commands for those people who aren't mathematicians.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 12th Mar 2006 23:59
The way it's setup all these shapes such as ellipses, and circles call into 1 function.

So I have

void Polygon3D(...)

and then the quick use commands, used for example to draw a circle are



So I'll probably implement the ellipse code as the main function, just makes everything tidier code-wise.

The main benefit for the Polygon3D function, is that I can specify how many points I want drawn, so I can go from 3 (a triangle), up to a memory-limited infinite. Depending on the size of your circle you can get away with 22 points.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 13th Mar 2006 01:08
Thats very neat. Good idea.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 14th Mar 2006 01:11
I have managed to amend the Circle3D command. We now draw the circle in 2 dimensions around the origin and on the plain 0,0,0. This is the same as drawing a 2d circle. Then we create o matrix to rotate and translate the circle to the correct position and orientation.

Here is the code



It appears to work ok and is slightly faster.

Cheers,

Cloggy
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 14th Mar 2006 20:40
Philip,

As you seem to use them more than most, would you find a function to batch draw a number of 3ddots or lines useful? It would work like this



This would i imagine be much quicker to render as all the dots would be added to a zertex buffer and then just rendered in one go, rather than each dot being rendered seperately.

Cheers,

Cloggy
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 15th Mar 2006 00:11 Edited at: 15th Mar 2006 00:12
@Cloggy

Taking your posts in order:

1. circle3d, yup, thats another equally good way of drawing a circle3d. I can see why it would be a bit faster because you can drop one axis from the sin and cos commands and rely on matrix and vector maths to translate the circle from the cardinal planes to a fully 3d realisation. Good thinking, sir!

You can, of course, do exactly the same thing with the ellipse code.

2. a batch dot 3d command would be fantastic. Incidentally, a lot more people are using this excellent plugin than you may realise. To choose one person, see Morcilla's thread about his impressive solar system proggy on the WIP forum.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 15th Mar 2006 00:14 Edited at: 15th Mar 2006 00:14
As inspired by Philips post in the Bug Reports forum, I present a screen of the latest addition to the command set.

Attachments

Login to view attachments
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 15th Mar 2006 01:58
Oh thats brilliant. If you can include a MAKE OBJECT TEAPOT command, I'd love it.

Funniest thing I've seen all day.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 15th Mar 2006 13:11
I agree with you about the batch draw, of course it sounds interesting. For 3d dots and for 3d lines as well.
Anything that speeds up the dll is a major improvement for it.

Also think about that many times you rarely are going to draw a single dot (3d or 2d) and even a single line (3d or 2d).
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 15th Mar 2006 20:54 Edited at: 15th Mar 2006 20:58
Just been looking at coding a batch draw function for dots and lines and there is a major problem. The dots all have to be the same size in a batch, and more of a problem is the fact that they must all be the same colour. I'll investigate more, but I think it may kill this idea.



EDIT - Maybe I'm talking rubbish. I think I've found the soultion to both problems.

Cheers,

Cloggy
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 15th Mar 2006 23:47
I have been busy experimenting with batch drawing and have come up with the following :-

Drawing 10000 dots by the current method results in 19fps on my pc.
Drawing 10000 dots using the batch methond results in 177fps

A staggering 900%+ increase in speed.

In order to do this I have had to used a fixed size array of dots. This limits you to a maximum of 10000 dots per batch. The command structure currently is:-



I have also tried this methon with text. I get a very minor increase 1-2 fps. But you can queue up all the text commands without worrying about having images or sprites causing display problems. The command to output the batch of text can be put just before the sync (there is no start text command now). Also this has a 10000 string limit.



Does anybody have any objections to doing things this way? I tried dynamically sizing the arrays for both dots and text, but this had big speed overheads.

Cheers,

Cloggy
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 16th Mar 2006 01:10
I seriously can't think of anything that would need more than 10,000 dots anyway. I think that using a fixed array is fine and, in any event, is an automatic improvement over not having the functionality at all.

Something > nothing

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 16th Mar 2006 11:48
That 900% speed increase speaks by itself.
If anyone should need to draw more than 10.000 dots, maybe they could be drawn with "single" dots or a second batch.
If they need to draw less than 10.000, they will have two ways of doing it.

The batch text should be useful too, but I don't recommend to take out old commands as this would annoy some users. If you are already maintaining "legacy" functionality, just forget this comment.

It would be great if you could make the 3d lines "batcheable" with the same technique.

Good work!
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 16th Mar 2006 20:14
Morcilla,

The text command is effectively batch at the moment. I have just removed the need to run d3d_starttext before each batch and replaced the d3d_endtext with d3d_drawtext. I can leave it so you can use eith endtext or drawtext but I think it would be better removing starttext totally. It's not much of a change to aske people to make.

As far as batch lines, I hope to implement that code tonight. I should have a new version available with all the latest changes over this weekend.

Cheers,

Cloggy
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 17th Mar 2006 13:05
Fine with me. Seems like everybody will understand.

By the way, some people (that includes me) was searching a way of making text zenabled, so it is occluded by 3d objects. I made my own workaround, but it includes too many checks (mainly pick object commands) for a thing that -maybe- could be DX (or hardware) handled. If you have any idea, please let me know.

Great news those batch lines. I really appreciate your effort.
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Mar 2006 14:42
I had had a change of heart with the batch text. It appears that due to the way the array of text was stored when you tried to do the following:-



It would print mousex twice because str$ always used the same address for storing the string. To allocate memory for each string would slow things down too much, so I'm putting back the original code.

Is far as batch dot3d and line3d, you need to be aware that each dot/line in a batch must be output to the same camera and have the same zEnable value. This is an example:-



I've added in SilentS function D3D_Teapot and D3D_Torus as a little extra. I've also added some experimental commands to create mouse zones, and functions to return the number of the zone you are in. I know this can be done in DBP, but I wanted it for something I'm working on and it keeps things cleaner and faster if I put it in the dll.

I'll have a look at zEnables text over the weekend, but I'd like to get this version out first.

Cheers,

Cloggy
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 17th Mar 2006 17:25
Sure, take your time and finish started things first, but glad to know that you like the idea.

The requirements of using the same camera and zenable for batching sound perfectly reasonable to me. They must share as much info as they can to speed up batching.

And about the batch text issue, I think it shouldn't be a big problem. In my oppinion, nobody is going to output 10.000 strings, so if the 1-2 fps increase was for 10.000 strings, we better forget it. On the other hand, if that fps increase was for a reasonable text output (should be ... 40 strings? One per each line of the screen?) maybe it isn't to bad to store those 40 strings separately.
Of course we are not storing 10.000 strings, thats too much.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 17th Mar 2006 19:46
@Cloggy

I really like the idea of a torus object being added.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 17th Mar 2006 20:37 Edited at: 17th Mar 2006 21:32
Here is the teapot and torus together



And I've knocked up a quick demo to keep eveyone upto date



Enjoy!

Cheers,

Cloggy

Attachments

Login to view attachments
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 17th Mar 2006 23:34
I don't suppose you could also include a d3d make picnic-hamper command?

No?

Didn't think so. Worth asking though.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 19th Mar 2006 00:48
The latest version is available here http://www.cloggj.f2s.com/DBPro/

Here is an update log.


Any issues please let me know.

Cheers,

Cloggy
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 19th Mar 2006 13:49
Will the latest version work with v5.9? I haven't upgraded to the u6 betas yet.

I'm going to try and use the new batch dot3d commands to see if I can draw more realistic rings around planets.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 19th Mar 2006 17:59
It should work with v5.9. But you would still need to have the latest DirectX version installed, the same version that is required for v6b3.

Cheers,

Cloggy
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 19th Mar 2006 23:48
Aw crap. Oh well - I'll wait until I upgrade to u6.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 20th Mar 2006 00:04
@Philip: If you would, please try the attached version of the plugin. It's a DLL that shouldn't rely on the latest DX, though since I'm trying out the U6 Betas I can't test it for sure. The ZIP only includes the DLL, if you need the new docs or keywords then grab them from the latest release.

Attachments

Login to view attachments
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 20th Mar 2006 00:10
SilentS,

You beat me to it

Just compiled a version on my work machine for 5.9!

Cheers,

Cloggy
Newbie5UK
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 20th Mar 2006 14:55
Cloggy, just in case you don't read my reply in the main DBPRO forum... a massive THANKS.. your DLL works perfectly and gave me a X4 increase in FPS..

Keen to keep track of any further update you do....

Thanks Again
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 20th Mar 2006 14:57
No Problem, just glad people find it useful.

Cheers,

Cloggy
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 20th Mar 2006 16:16 Edited at: 21st Mar 2006 09:26
Just thought I'd let you guys know that I've been working on tidying up the current source, and I've been revamping some commands.

I should note that this is not completely official yet, but I'm hoping it will be.

First, the cons, alpha ranges will now only be 0 to 255, this is to simplify the functions, and to keep inline with the way DBP works.

And now onto the pros, first off the functions are being revamped internally so that variable usage is being kept to the minimum, and processes optimized. This should mean equal or better performance.

Next, my work so far has been concentrated on the 2D stuff, and with this, functions that were lacking an overriding colour parameter have been added. I haven't compared parameters to the current version, but there may be some breaking changes.

Finally, the latest addition to the source is batching for 2D dots. This new way of doing things will enable any size batch, and will optimize memory usage of the batch commands.

Initial benchmarks are indicating great results. Drawing 100,000 default dots (using the global drawing colour), all tests being run 5 times and the results averaged, the results are...

DBP: 1879ms
D3D_Dot: 281ms
D3D Batch Dots: 15ms

Work will carry on, on adding this batch process to various other 2D functions, and their 3D counterparts.

The new batching commands syntax are as follows:

D3D_Batch_Set_Dot2D batchSize - This will setup your batch processing with the maximum batch, this can be called whenever you want but any previous batches for dots will be destroyed.

D3D_Batch_Add_Dot2D X, Y, [Colour: Optional] - Add a dot to the batch

D3D_Batch_Draw_Dot2D clearBatch - This will draw all added dots, and will, with clearBatch set to 1, delete the batch after use. Clearing the batch will mean having the call the Set command again, not clearing it will enable you to reuse the last created batch.

[EDIT]
No idea what I must have been feeling like when I wrote that, just fixed up the English. Though it may still have some errors since my blood sugars' a little low atm.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 20th Mar 2006 18:16 Edited at: 21st Mar 2006 00:04
@SilentS and Cloggy

I'm putting you guys in my will.

[edit]

I've tried the version of the dll posted by SilentS that doesn't rely on the latest DirectX. It works a-ok on my computer but I haven't tried the new batch commands yet - just the example proggy that comes with the plugin. Hang on.

[edit2]

Yup, tried the batch dot3d commands and the new ellipse commands. Both work fine. I have to hit the sack now but I guess the rest of the commands will also work fine. I'll try and do some more testing tomorrow.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "I highly recommend Philip's Vector Tutorials" (RiiDii)
Humanoid
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Finland
Posted: 21st Mar 2006 09:52
super fantastic dll, good work Cloggy

Suomi Finland PERKELE!
<AMD athlon 64 3000+> <Asus A8N-E nForce4 ultra> <GF6600LE PCI-E> <1GB ram>
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 21st Mar 2006 19:19
Wonderful, I got an average/consistent 10fps increase using the new batch functions.

I'm looking forward to see those SilentS' batch 2d functions, they seem extremely interesting.

No doubt you guys deserve to be credited.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 21st Mar 2006 23:14
I agree. The new batch functions are great.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "I highly recommend Philip's Vector Tutorials" (RiiDii)
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 21st Mar 2006 23:25
Just a quick update. The whole project is currently being restructured by SilentS. The 3d batch commands are likely to change slightly in order for them to work the same way as the 2d batch commands. This will give the flexibility of creating a single static set of objects which bring obvious speed advantages.

I ran a test using the 2d Batch dot command and rendered 1 million dots in 87ms! A bit faster than DBP which took 17000ms.

Not sure when this update will be available. But I'm sure it will be worth the wait.

This really is a joint effort now and I'd like to publically thank SilentS for all his work so far.

Cheers,

Cloggy
Humanoid
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Finland
Posted: 22nd Mar 2006 00:19
Feature request:

D3D_Batch_Circle3D
D3D_Draw_Batch_Circle3D

and

D3D_Batch_Ellipse3D
D3D_Draw_Batch_Ellipse3D

maybe next update???

Suomi Finland PERKELE!
<AMD athlon 64 3000+> <Asus A8N-E nForce4 ultra> <GF6600LE PCI-E> <1GB ram>
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 22nd Mar 2006 11:05
Nice to hear people are enjoying it, and it's working well for them.

I'm going to try and get the latest code done by Friday night, it's not too much work, copy and paste the old code then take a good look at it to see where I can remove any unnecessary variable usage.

@Humanoid: I'm going to have to experiment will those commands, the way they work makes it difficult to add batching similar to the rest.

First off, dots and lines have a static amount of points per entity, so any required memory can be easily allocated. The circle and ellipse commands do have a static point count, currently 128, but they call into a generic polygon command to do the drawing.

If this was the only problem then it'd be easy just to setup another specifically for handling batches, but the way we draw these entitys is already "optimized".

I'm not sure if reverting to the original way of drawing for use in a batch environment would add any benefits, it may even slow things down.

I'll take a look and see how things turn out.



I do have one last thing, attached is a small benchmark for the batch 2D dots commands, if you could run it and let me know if they're any problems that'd be great. The only potential problem is if you're running out of memory, in that case you'd probably get an erroneous result for the batch version.

The benchmark will draw 100,000 dots and average the time over 3 runs. It should take less than 10 seconds to run depending on hardware.

Attachments

Login to view attachments
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 22nd Mar 2006 16:22
DBP: 1833ms
D3D: 255ms
D3D (batch): 10ms

On amd 3000xp & Radeon 9700pro.

I think it would be great if we could enable zdepth for 2d dots, so they can appear behind 3d objects (like draw them to back). That will make them more useful and versatile. However, right now I don't have any idea about how to achieve this.
qwerty823
18
Years of Service
User Offline
Joined: 17th Jan 2006
Location:
Posted: 28th Mar 2006 02:10
Could we get d3d commands to calculate the text width/height when using the boxtext command? This way if we want to do multiline text with different colors, we could see what size each line takes up when it wraps inside the box. Thanks!

Login to post a reply

Server time is: 2024-11-21 16:53:23
Your offset time is: 2024-11-21 16:53:23