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
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Jul 2010 04:48
To the rescue... you hope!

I've only gone back to JoeOh's 9th May post, but hopefully I can help a little.

First the view port size - I know you've got a workaround for it, but here's how to fix it properly: the plug-in should not be using the window width/height from the globstruct, but should be using the active surface from globstruct and querying that (I'm not going to write the code here, just giving directions):
Use g_pGlob->pCurrentBitmapSurface->GetDesc() to get the surface description, and use the width/height from there.

Also remember that your new commands will only affect the viewport for the current render target - every time you switch surfaces, so will the viewport, so those new commands may cause some confusion.

Next, PICK OBJECT - as far as I can see from the code, as long as the view and projection matrices are correctly set for the camera, then the pick object should work correctly (I haven't looked at Cloggy's code - I will download it and take a look at some point).

Have you tried the PICK OBJECT command with the extra parameter - set the last parameter to 1 and see if it does anything for you.

In addition, it'd be nice if someone could throw together some code that I could use for testing this - I don't use this plug-in much.

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 10th Jul 2010 06:15 Edited at: 10th Jul 2010 07:05
Quote: "In addition, it'd be nice if someone could throw together some code that I could use for testing this - I don't use this plug-in much"


IMHO it should replace the current DBPro text and drawing commands. The FPS increase is rediculous.

So IanM, do you have some kind of program that searches for your name on the threads or do you actually read each one? I am surprised I got your attention at all!

Here is the code I came up with for the viewport. I am not sure if I know enough c++ to do what you want. I am just making stuff up and surprised it is actually working...


Then each drawing command checks for that custom viewport:


I really like being able to specify the bounds as well so you can can "clip" your drawing commands to a certain area, but the code for when g_bCustomViewport is false could be fixed with your surface command suggestion.

Edit: I can try to cook up some code for testing the surface thingy, but I have not ventured into 3D yet so the ortho projection example is up to the other guys.

Edit2: I cannot come up with an example showing text being drawn wrong on different surfaces since it is actually working properly now (using Cloggy's DLL, not mine). Also, the built in Text command appears to have gotten an upgrade as well, as the FPS difference no longer exists. You change something in the latest 7.5 update?

Edit3: This is the code that they were using earlier to test the plugin. The fix Cloggy implemented fixed this example for most people, Agent still had the problem even after it was fixed (See his screenshot at the top of this page)


Edit4: Also, Cloggy updated the plugin in this post which fixed alot of problems. This new version is 3.7.1.1. The source code on the website is 3.7.1, which lacks the fixes he describes in that post.

And, if you do manage to fix all these problems, can you re-post the source code for us curious types?

Wilf
Valued Member
17
Years of Service
User Offline
Joined: 1st Jun 2006
Location: Gone to Unity.
Posted: 13th Jul 2010 15:33
Heres some code to test the Pick Object issue. Changing the last parameter to 1 does not seem to help.

Although the cursor box does moves slightly with the mouse cursor in ortho view, it does not move as much as in normal projection.

Wilf
Valued Member
17
Years of Service
User Offline
Joined: 1st Jun 2006
Location: Gone to Unity.
Posted: 23rd Jul 2010 10:29
Any ideas chaps?
I'm trying to have a isometric 3d camera, with a cursor to select units. Think Xcom in 3d:
RedFlames
16
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 23rd Jul 2010 13:02 Edited at: 23rd Jul 2010 13:04

This is my quick try to use "Pick screen" instead.
Some kind of raycast could be done using sparky's, instead I used DBP Collision here.

But it gives you the same result -> not working as expected.
Silverman
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 27th Jul 2010 16:43 Edited at: 27th Jul 2010 16:52
Hi,

try this :


@+

AMD Athlon(tm)XP 3200+ (2.2GHz) / DDR pc3200 (1024Mo) / Nvidia 6800GT (driver 178.24 WHQL)/ XP Pro SP3 / DirectX 9.0c (February 2010)/ DBClassic v1.13 / DBPro v7.4
Agent
19
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 20th Sep 2010 11:51
Hello, it's me once again.

Well it's been ten months now since I first raised the issue with Cloggy. I've been toying with it on and off ever since but I'm still having no luck.

Is Cloggy still alive? There's just no way I can proceed until he updates the DLL with Ian's suggestion
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 20th Sep 2010 20:45
Quote: "Hello, it's me once again.

Well it's been ten months now since I first raised the issue with Cloggy. I've been toying with it on and off ever since but I'm still having no luck.

Is Cloggy still alive? There's just no way I can proceed until he updates the DLL with Ian's suggestion "

Can you tell me what the exact problem is, what is the latest version of Cloggy's dll, do you have some sample code for testing purposes. If nobody else wants to update the plugin, i can.

Agent
19
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 20th Sep 2010 22:09
Hi Brendy,

Well, the problem appears to be text scaling when the bitmap to which the text is drawn is of size unequal to the screen resolution.

If the bitmap we're drawing text to is smaller than the screen resolution, the text will be proportionally smaller than expected, and its draw coordinates will scale similarly.

As far as I can tell, only nVidia graphics cards are affected by the problem, but this hasn't been clarified or confirmed by Cloggy. Perhaps there's some way to get around this at code level or by the plugin's developer at DLL-level.

My original post begins halfway down page 12 of this thread, if you want to follow along with the conversation. Perhaps 10 posts back and forth between me and cloggy between the 12th and 14th pages of the thread take place, clarifying the issue and testing a few things.

If there's anything you can do to help, it will be much appreciated.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Dec 2010 14:46
Well, this plugin has helped me. I am normally averse to using them, as it can add complications down the line. But DB text can be slow, especially if you are changing the text size a fair bit on the fly. So I decided to give this a whirl. Where 10 lines of text was beginning to slow my app down (surprised me how badly). Using this plugin and replacing the DB native text has returned the game back to normal speed.
Big Thumbs up!!!

http://s6.bitefight.org/c.php?uid=103081
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 3rd Jan 2011 21:01
i have a problem. when trying to use this awesome dll i cant change my resoultion ( need to do it for the vsync ) it hangs indefinitely and esc is not responsive, nothing can be done to exit except ctrl_alt_del i need both the dll. and the vsync

the code is here


the full source can be found here (it doesnt have the vsync for obvious reasons )
http://forum.thegamecreators.com/?m=forum_view&t=178440&b=5
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Jan 2011 11:51
I use this plugin in almost every game I write. It's the bees knees

Ermes
20
Years of Service
User Offline
Joined: 27th May 2003
Location: ITALIA
Posted: 7th Jan 2011 23:24
i've found a strange behaviour of this dll.

without calling any commands, only with the first command to declare you are using this plugin, my game drops from 240 fps to 180.

i don't know why but yes, no more losses when i draw line, circle and so on, but for me it's like this.

going to investigate, actually i use sprites.



[img][/img]
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 9th Feb 2011 17:19
Hi Cloggy

I think I've found another problem with the D3D plugin.

I've been using it in conjunction with Sven B's Imagekit plug in and IanM's Matrix 1 to create outlines and shadows for text, but it seems to be creating some funny visual artifacts when transparency is used to display the image.

I did post about it here>link< but Baxslash suggested I posted here as well.

This snippet demonstrates the problem a lot better than my description above. lol



gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Feb 2011 22:53
hey =PRoF= I tried to run the posed example but even with the D3D Plugin

this line was not under stood

ik create render target 1,400,200

ummm it seems I may need to install the 2d plug in kit to make that work

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Feb 2011 23:12
umm nope not the 2d plugin kit

that command line is still not be accepted

If a thought is Just a thought ~ so whats the main thought ?
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 14th Feb 2011 00:21
@Resourceful:
That code snippet needs the following plugins to work

Cloggy's d3d plugin
IanM's Matrix1 plugin
Sven B's Imagekit plugin.

Sorry, I should have made that clearer.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Feb 2011 00:24 Edited at: 14th Feb 2011 01:24
thanks for the replay now
I know I just need one more and I should be set

hiccups happen that's why it's called programing

Sven B's Imagekit plugin.
you can get the plug in from this post the other 2 are easy to find
this one was not so I had to use the google search engine to find

old one
http://forum.thegamecreators.com/?m=forum_view&t=158832&b=8

new one
http://forum.thegamecreators.com/?m=forum_view&t=177340&b=5

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Feb 2011 00:37
still no for

" ik create render target 1,400,200 "

there must be anther dll needed or
the latest version of

D3DFunc v3.7.1 has excluded that command

dbp dose not understand how to use that command

If a thought is Just a thought ~ so whats the main thought ?
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 14th Feb 2011 01:07 Edited at: 14th Feb 2011 01:07
@Resourceful:

Your using an old Image kit version.

Download the newest one from here...

>link<

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Feb 2011 01:42
thanks that did the trick

now thats needed for DBP is for

"Dark Physics" needs to be updated with
the choice of color for liquids other than just blue
and I think the code for that needs to speed up since it
slows things down when you use more than one blob

the ability to turn an object into cloth that can be torn
I've got and idea a program to use the current code for cloth command
but it's going to take some tweaking to get it right

and making a item into soft body takes downloading a program
nvidia and loading the file with the object

--> "PhysXViewer" free

other than that with what The Game Creators are selling and whats
free on the forum give or take that some commands do not like working
with each other for various reasons

I'd prefer not try and learn Dark GDk
learning to program in DBP has been a trip so far

If a thought is Just a thought ~ so whats the main thought ?
Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 7th Mar 2011 18:08
I think I have found him on Twitter..Ive contacted him, maybe he will come back to help us for alittle bit


@Cloggy, I am having an issue with the GDK version, it seems that a user has fixed the same issue by allowing D3D to have a setviewport command, my problem is, I have to do this



For it to correctly work in my program, what I have noticed is that upon doing that I take a major performance hit to have it correctly show up, if I dont and just call it once the text is not formed correctly and causes drawing issues...so its something along the lines of the viewport not being right...


Making dreams possible, one line at a time...
GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 7th Mar 2011 19:41
Quote: " it seems that a user has fixed the same issue by allowing D3D to have a setviewport command"


Hey! Thats me!

BTW if Cloggy does come back I would love for the viewport commands to be kept operational. They really help with UIs, minimaps, and a whole array of other things where you want to draw something big into a smaller space WITHOUT it overlapping stuff outside the smaller space as well.

@Cloggy, the changes I made can be viewed at the url below. I could give you the code changes I made, but they are so trivial that I am sure you could replicate them.
http://forum.thegamecreators.com/?m=forum_view&t=69221&b=5&msg=2032998#m2032998

Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 7th Mar 2011 22:09
I talked to cloggy and hes just been busy, havent had alot of time for DBPro, but hes recently released the source to the GDK version on his website

Link: http://www.dbdepot.co.uk/d3dfunc.html

Enjoy


Making dreams possible, one line at a time...
GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 7th Mar 2011 23:57
Quote: "but hes recently released the source to the GDK version on his website"


I don't see it there. Also, he is missing the source and release of 3.7.1.1. I think he only partially released it in the forums but never added it to his site.

Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 8th Mar 2011 03:58
http://www.dbdepot.co.uk/downloads/D3DFuncGDK%20Source%20V3.7.1.zip - Thats the GDK source


Making dreams possible, one line at a time...
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 29th Apr 2011 19:50
Just posting this as a heads up to Cloggy when he gets time to read this (I'm sure he's a busy guy!)

There's a crash in this plugin that happens when the resolution is changed in fullscreen exclusive mode.

More details here:

http://forum.thegamecreators.com/?m=forum_view&t=184395&b=1

Thanks

Jambo
Burning Feet Man
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 22nd May 2011 09:19
Dang, just did some reading up in this thread.

After spending the day coding, I'm finding that Pick Object definitely doesn't work well when combined with d3d_set_ortho_projection, even after trying some of the techniques discussed in this thread.

Not that it's the end of the world, as I can code around this, but if anyone does have a solution, do tell.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 28th May 2011 05:25 Edited at: 30th Aug 2013 05:17
I also briefly looked in to the Ortho projection issue. Not sure I can do anything there. Definitely need to know more about D3D to change any of that. I did notice that d3d_func has a "d3d_pick_camera" function but I have no clue what it does.

Edit: Since this thread is locked, I cannot add my newest version, but luckily I can still edit this post! I have obtained the source code for 3.7.1.1 from Cloggy, which fixed the memory leak issues, and added my viewport commands back in. I ran a quick test and found it working correctly.

Attached is a RAR file which contains two versions of the plugin. The first (3.8.0.0) is Cloggy's code with my viewport commands. He changed the way font sizes are calculated so that they are on-par with windows, or something (See page 12 of this thread and look for Cloggy's post with a ton of screenshots). That is great!, except all my projects now have the wrong font sizes. Therefore, the RAR also contains 3.8.0.0f, which changes the font size calculation back to what it used to be, for "backwards compatibility".

EDIT: There was a problem with running the d3d_init command with a font number greater than 20. It is fixed with 3.8.1.0, now attached.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-29 12:30:48
Your offset time is: 2024-03-29 12:30:48