PDA

View Full Version : HW acceleration (un)DelphiX



ijcro
28-01-2005, 09:26 AM
Hallo

Do you have interest in test HW acceleration module for (un)DelphiX ?

First demo program is here http://www.micrel.cz/Dx/delphix.exe.

There is small description:



* FEATURES:
a) Implement Hardware acceleration for critical function like DrawAlpha {Blend},
DrawSub and DrawAdd for both way DXIMAGELIST and DIRECTDRAWSURFACE with rotation too.
b) Automatic adjustement for texture size different 2^n.
c) Minimum current source code change, all accelerated code added into:
DXDraw.BeginScene;
//code here
DXDraw.EndScene;
d) DelphiX facade continue using still.

* HOW TO USE
a) Design code like as DelphiX and drawing routine put into
DXDraw.BeginScene;
//code here
DXDraw.EndScene;
b) setup options in code or property for turn-on acceleration like
if NOT (doDirectX7Mode in DXDraw1.Options) Then
DXDraw1.Options := DXDraw1.Options + [doDirectX7Mode];
if NOT (doHardware in DXDraw1.Options) then
DXDraw1.Options := DXDraw1.Options + [doHardware];
if NOT (do3D in DXDraw1.Options) then
DXDraw1.Options := DXDraw1.Options + [do3D];
if doSystemMemory in DXDraw1.Options then
DXDraw1.Options := DXDraw1.Options - [doSystemMemory];

* KNOWN BUGS:
1/ On some adapteurs no good shows transparent area when DIRECTDRAWSURFACE is
called in 16<-32 bit color deepth (16 bitcount typical).
2/ Functions Fill- and WaveX- are unsupported now.

When yes, please send me it to undelphixtest@micrel.cz .
Thank for your time.

ijcro
01-02-2005, 07:16 PM
Hi,

In new version of demo is Fill- and WaveX- supported now :D :D :D . You can download it. :lol:

ijcro
02-02-2005, 09:31 PM
Ahoy
Works finishing...
here is real application for test:
http://www.micrel.cz/Dx/lens_flare.exe
Do you like it ?

When I saw than no echo for my announcing, I first thought that is DelphiX totally death and all works have to suspend. I shocked. Nothing interrest in my work than nobody have no use of help :( . But in second I said, when allmost way complete, sorry I will finish it. Now is code recovering finished, I will test it and I thing after week released. When no other opinion by me, it will be too hard.... :wink:

Bye, Bye

Traveler
03-02-2005, 09:07 AM
Hi ijcro,

Thanks for all the hard work! I totally understand what you say about the lack of responce. I too have wondered about that issue when I released the sourcecode of my game and got absolutely no comments (good or bad) whatsoever. However, since the release about one month ago it has been downloaded nearly 150 times so I guess it still is appreciated.

Back to your work. I have tried both samples. The pc I tried it on doesn't have a great gfx card (radeon 7000) but it ran great. At startup the flare sample gave about 5 fps, but once spacebar was pressed (thus hardware accel) it jumped to 189 fps!

The first sample has something odd going on. I see a transpararent red bar with a opaque white bar right next to it, on top of the background image. I could be wrong but i don't think it should be there. Also I get an access violation when I try to resize the window.

Overall I'm quite impressed by the speed increase. Again nice job, and please do continue! To others: please try the samples if you're into DelphiX and give comments! Otherwise, initiatives like these will stop sooner or later.

nzo2
06-02-2005, 11:23 PM
I looked at the sample a week or so ago, and emailed you directly with my positive comments. I am VERY impressed with the hardware accelerated improvements, and am very keen to see the framework you are (hopefully still) about to release.
I agree that this (delphiX) forum is very quiet (for posters, if not lurkers) and yes, I get 500 people downloading my stuff with about 3 people actually bothering to respond with any feedback.
(Incidentally, you didn't respond to my email :roll: anyway!)

There is only Traveller and a few others who appear to actively contribute to this forum I think?

oh- I emailed from your site to undelphix@micrel.cz, not the email address you posted in this thread

nzo2
06-02-2005, 11:29 PM
I totally understand what you say about the lack of responce. I too have wondered about that issue when I released the sourcecode of my game and got absolutely no comments (good or bad) whatsoever.

Ahem.. Your source helped me with my timing problem, which Idid thank you for :)

Incubii
07-02-2005, 01:53 AM
Just tried out the delphix.exe. thats very impressive!

Traveler
07-02-2005, 09:05 AM
Ahem.. Your source helped me with my timing problem, which Idid thank you for

I stand corrected :)

ijcro
07-02-2005, 10:32 AM
Ahoy,

crasch site?

Last downloads from http://turbo.gamedev.net/undelphix.asp or http://www.micrel.cz/Dx/delphix_2005_02_11.rar 8) .

NOTE: :idea: HW acceleration works :oops: in 16 or 32 color depth only :idea: .

Regards

ijcro
22-02-2005, 07:49 PM
I saw that no suggest, no experience, no impression... :cry:

Phe@r
12-03-2005, 02:38 PM
Hi

I downloaded your version of delphix and replaced my undelphix 7 with your version of delphix. everything worked fine so far, but:

I tried to compile and run my delphix game. It compiled, started and then I got never-ending exceptions and some sprites had been missing during gameplay. It's a 2D-game using the spriteengine and 32bit-images out of the DXImagelist. I activated dohardware, do3d and dodirectx7mode. If I deactivate do3d, it crashes without any chances to close it (except the delphi debugger, of course).

Any ideas what to do now? Hopefully :cry:

Greetz!

PS: I downloaded http://www.micrel.cz/Dx/delphix_2005_02_11.rar, is it the correct file?

blackvoid
13-03-2005, 11:51 AM
Nice work!!!

Our game uses DXDraw and DXSpriteEngine. I have a few questions.
- Does HW acceleration also accelerate DxDraw and the sprite engine?
- Is alpha blending faster in DxDraw as well?

Thanks....

ijcro
13-03-2005, 01:21 PM
I tried to compile and run my delphix game. It compiled, started and then I got never-ending exceptions and some sprites had been missing during gameplay. It's a 2D-game using the spriteengine and 32bit-images out of the DXImagelist. I activated dohardware, do3d and dodirectx7mode. If I deactivate do3d, it crashes without any chances to close it (except the delphi debugger, of course).
PS: I downloaded http://www.micrel.cz/Dx/delphix_2005_02_11.rar, is it the correct file?

Hi you have correct file!
I made acceleration under cover (un)DelphiX, no changes in Hori's engine. Correct bug only (please see to pixelcheck routine) and added new features (so its no "new" since not in one compilation).
I can try your code, that you have isolate it an you can send me to test please.



- Does HW acceleration also accelerate DxDraw and the sprite engine?
- Is alpha blending faster in DxDraw as well?


Under sprite engine are standard render routines, and routines Add, Sub and Alpha can be accelerated in the same way that other. I think than fullscreen may be required (- you have to try)

The alpha blending is produced in one routine.

ijcro
31-03-2005, 06:54 PM
Main library was updated 28.3.2005, minor bug fixed (image unchanged if downloaded during runtime into DXImageList when hardware acceleration turn on). The pack can be downloaded from my pages (http://www.micrel.cz/Dx). Thanks and sorry

sardaukar
17-04-2005, 04:06 PM
Just wanted to say a big thanks :). Its great someone cares and are ready to pickup the glove and DX a a tweak now and then.

:D :D :D

ijcro
05-06-2005, 07:52 PM
Library updates Jun 6 2005, published on my page and TURBO too.
Regards

WILL
06-06-2005, 01:57 AM
Ah, I was just going to make news post on this too. :) Read it earlier today on Turbo.

Next time drop me an email. I'll respond much quicker to getting the word out.

User137
07-06-2005, 01:58 AM
I tested engine a bit, noted that speed increase is about 10x, going over 900fps in blending sample.
Fullscreen mode in your base project gives access violation if i before or after alt+enter press space to use hardware.

I'm still unable to use hardware acceleration with old flexbattle game. It renders images using normal, rotate and blending functions in custom TDirectDrawSurface. Then clips player splitscreen parts from it. All graphics, except the ones using rotate and blendings show ok. Player itself uses rotate, so main character is invisible now :?

User137
07-06-2005, 02:17 PM
I made a simple application trying to represent my problem:
http://cs.uku.fi/~valo/SurfaceTest.zip
You can drag the view with mouse button pressed.
Mouse lags in that demo for some reason, i believe it's one other DelphiX bug. Lag stops if i limit interval.

There should be showing a rotating Add blended texture, but for now it shows only if i take hw acceleration off, only lagging as hell :(

Edit: OH! One suggestion: Could you make there a bi-linear texture toggle in DXImageList items? I noted bi-linear textures are used in StretchDraw only. It could be expanded to rotate and other functions too.

ijcro
09-06-2005, 09:37 PM
Okay
I now released version with full compatibility for Delphi 3 (from my page only source or next day from Turbo pages).

You can try it, this have different interface.

I downloaded your file I will try it and send any solution for you. Thanks

ijcro
10-06-2005, 11:43 AM
I am affraid that is problem. :( For HW acceleration cannot be different surface. :( When I first designed code that no good works.



I made a simple application trying to represent my problem:
http://cs.uku.fi/~valo/SurfaceTest.zip
You can drag the view with mouse button pressed.
Mouse lags in that demo for some reason, i believe it's one other DelphiX bug. Lag stops if i limit interval.

There should be showing a rotating Add blended texture, but for now it shows only if i take hw acceleration off, only lagging as hell :(

Edit: OH! One suggestion: Could you make there a bi-linear texture toggle in DXImageList items? I noted bi-linear textures are used in StretchDraw only. It could be expanded to rotate and other functions too.

ijcro
13-06-2005, 06:16 AM
New version (1.04) (un)DelphiX released.
Fixies:
Fixbug in 8,16 and 32 bit graphic to texture.
Fixbug in detect Transparent area (in DDS too as Pixels[0,0] default).
Added pure acceleration for Draw() procedures.

Source can be downloaded from my pages.

Regards

ijcro
21-06-2005, 08:45 PM
New version (1.05) (un)DelphiX released.

Fix-bug Draw() function - added to conditionals.

Any comment welcome.

Regards

PerIvar
22-06-2005, 10:42 AM
Nice :) Gonna test it out as soon as I get home from work.

Thanks for superb updates!! :) Your doing a really good job!

ijcro
28-06-2005, 11:49 AM
:?: Do anyone have (develop) a project under (un)Delphi with hardware acceleration? :?:

I am not game creator :cry: an I like see :shock: any game screenshot or other, sory :lol:

Regards

cairnswm
28-06-2005, 01:25 PM
I dont :(

Maybe you should download my little barbar game and try and convert it. Its really easy and you can then use it as a demo for your engine.

cairnswm
01-07-2005, 04:32 AM
On another web site I am having a discussion about Delphi and Games. One of the guys said:


I am using the latest UnDelphiX for work, and game programming. I use it for displaying ECG'S on the screen in realtime (scrolling, zooming etc...). For my games, I am working on a Spacewar/Starcontrol clone, where 2 spaceships fight each other with a variety of weapons.


So the new hardware accelerated DelphiX is being used.

WILL
01-07-2005, 07:15 AM
Hmm... cool. Can you see if he'd wantto email me about his project/company he works for? I'd love to add a new contact to my little network of sites, developers and projects.

They fact that UnDelphiX has been pretty much brought up to date is probably more than enough reason for people to start using it again. I think that Jaro has pretty much become the new (Un)DelphiX development maintainer. Maybe the first since Hori abandoned it back in mid-2001.

cairnswm
01-07-2005, 08:40 AM
Just remember that DelphiX is not open source and Hori has not given any permission to anyone to make chnages to the code.

While propobably not an issue this does mean that the new undelphiX with hardware optimisations is effectivly using pirated copyrighted code.

WILL
01-07-2005, 09:24 AM
Hmm... I think the terminology you are using is slightly flawed. DelphiX is open source(he released his source with the package, it's open and free to you to modify and use as you see fit), however it is not released under any kind of standard GPL, but rather a small clause in the documentation of his distribution package.

Just going over the latest DelphiX release ReadMe.txt file, it reads exactly under 'TERMS OF USE';


Every part of DelphiX is Copyright (C) 1999 Hiroyuki Hori but you are licensed to use DelphiX to create software; DelphiX is freeware. Any software created using DelphiX may be distributed without fee to the author.

You may not, however, distribute anything contained in the DXHeader folder, the FFEffects folder, or the Samples folder.

The author of DelphiX assumes no liability for damages caused under any circumstances whatsoever, and is under no obligation. Use of the software indicates acceptance of all conditions contained in this document. If you do not agree to these terms, you must delete this software immediately.

You may distribute the archive in which DelphiX is distributed, but under no circumstances must this archive be changed. Distributing a modified archive is a violation of the software license.

Now as you can see from reading this, clearly the UnDelphi releases have been violating these rules a bit, but have been doing so for a while now. How serious Mr. Hori takes this is unknown, he sort of disappeared some time ago...

However, there some steps can be made to be safe and legitimize the future releases for the UnDelphiX distributions to prevent complications.


Lets take a look at the rules that are actually being broken:

Paragraph #2) He clearly states which folders of sourceyou may not redistribute. DXHeader, FFEffects, and Samples. Do not distribute any of these files and make replacements for ones you will still need and you have complied with this rule. New demos and Force Feedback effects will have to be made. The DXHeader folder no longer exists so nothing else needed there.

Paragraph #4) This one is a bit tricky to work around, but if all the source files are modified and reworked enough to be considered completely new sources then I guess it qualifies. This one is always sketchy considering that people reuse code form other places all the time. How many ways can you display "Hello World!" in a DOS text mode?


Well all this has not been a problem for so long, heck even a few commercial games have made and sold using a modified version of the original DelphiX sources. I think he put those rules in with the idea that he was still working on it. And in essence Jaro and others before him have been making new software packages from the DelphiX source and releasing those. I know, that one is kinda sketchy, but I beleive that it's still within the spirit of the rules as he meant them.

If all else fails and this does not work to comply with his clause then you could always get permission from him to continue the project yourself. Failing that... there is always "Innocent until proven guilty" :lol:

Traveler
01-07-2005, 11:13 AM
Just remember that DelphiX is not open source and Hori has not given any permission to anyone to make chnages to the code.

While propbably not an issue this does mean that the new undelphiX with hardware optimisations is effectivly using pirated copyrighted code.

In principle you are correct. However, I do agree with WILL on this. Jaro (and others) have continued where Hori has stopped. Without them, DelphiX would have been dead a long time ago.
I can't say this for sure of course, but if I would be Hori, I'd be very grateful that someone has taken the time and effort to bright DelphiX to where it is now.

On the other hand, its easy talking afterwards, when all the good things have been done.

sardaukar
26-07-2005, 12:24 PM
I'll definitly be brushing up my old delphix project. Great work!!!!

I know noz whom create "robotron" also used your delphix version for it.

User137
06-08-2005, 01:48 PM
1 bug found again :)

DrawRotateSub function draws added image, not subbed. This sub works fine if i remove check from DXDraw.options.do3D (not hw accelerated then). Also noticed that if rotated image is transparent, it doesn't get bi-linear filtering.

ijcro
08-08-2005, 09:30 AM
1 bug found again :)

DrawRotateSub function draws added image, not subbed. This sub works fine if i remove check from DXDraw.options.do3D (not hw accelerated then). Also noticed that if rotated image is transparent, it doesn't get bi-linear filtering.

OK, please check it on demonstrate program DelphiX (as reference program) form my page.
Some problems occurred when actual format of picture no corespond format of screen.

Regards

wodzu
06-01-2006, 01:08 AM
Greetings,

I've installed Your version of DelphiX.
I putted one TDXDraw component.
I putted one TDXSrpiteEngine component.
I pressed F9.
I got error message: "Project XXX raised exception class EReadError with message 'Property Items doesn not exist' "

Could You check it?
Does Pixelcheck Collison method really works in Your version of DelphiX?

Regards,

Wodzu

wodzu
06-01-2006, 12:33 PM
Hello again.

I must sorry You for my previous post. Everything is now OK. I just left the old Library Patches to UnDelphiX :oops:

I will test Your extensions in project which I am making now.

Regards,

Wodzu

User137
08-01-2006, 01:28 AM
Some time ago i posted this on delphigamedev so perhaps i'll link it here:
http://www.delphigamedev.com/forums/viewtopic.php?t=292

The thing was about fixing some of the known DelphiX bugs and adding there something new. Still the problem with textures is unsolved, however access violation is gone forever. It occures when DXDraw is resized or Ctrl+Alt+Del is pressed (so you can't escape it with anything else than fixing the core).

And forgot to mention, 1024x256 textures don't work, but 512x512 do, when patternsize is 256x256 on both cases :P I don't know why but to me it looks like delphix loads that 1024x256 and stretches it to power of 2 -> 1024x1024 and then use same texture for all patterns just with different texture coordinates. I'd find it wiser to make own texture for each pattern...

ijcro
24-03-2006, 11:49 AM
...
And forgot to mention, 1024x256 textures don't work, but 512x512 do, when patternsize is 256x256 on both cases :P I don't know why but to me it looks like delphix loads that 1024x256 and stretches it to power of 2 -> 1024x1024 and then use same texture for all patterns just with different texture coordinates. I'd find it wiser to make own texture for each pattern...

Its solved in 1.06 up to 2048x2048 px

Speeeder
16-04-2006, 11:17 PM
Well modified DXDraws, and added DrawAddCol, DrawSubCol, DrawAlphaCol and DrawRotateModeCol into TDirectDrawSurface and got rid of those two warnings... Guess this is easy and not much of a work, but in any case if you'd just prefer to skip working on this, Ijcro, drop me a line to pack DXDraws and put it up somewhere...