Author Topic: DX9 Implemented  (Read 3951 times)

0 Members and 1 Guest are viewing this topic.

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Mostly.

I've succeeded in converting all DX8 code to DX9 code, compiling it, and having the DX9 object and drivers and window being created. But i can't test whether or not there are rendering errors because the stupid LUA scripting keeps throwing an error, even after i remove USE_LUA. Help?

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
What error?
-C

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Vector subscript out of range. I simply assumed it was a stupid error relating to how i compiled it but its not going away...

I believe it occurs somewhere around the LUA initialization code. Let me go isolate it.

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
ITs definatly the scripting. It occurs in CreateLuaState(), somewhere, but i can't isolate the exact line of code because i haven't quite gotten the hang of the weirded SCP lib code and it won't use the stupid debug information. That, and the game refuses outright to go into windowed mode which makes it AWFULLY hard to debug it.

 

Offline ni1s

  • 26
Could you post the diff so others could play with it?

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Sure, here's everything you need (including the dx9 libs and headers)

fs2_dx9.zip

Just unzip that into your fs2_source folder and it'll overwrite whatever code files i changed. Now, to get it to compile you have to add a few directories... In the code project you need to add    ..\..\dx9\include    to the paths. Then you need to add ..\..\dx9\lib\x86 to the freespace2 project, and you need to rename all the dx8 libs to dx9 libs (just change the number from 8 to 9, IE: dxerr8.lib -> dxerr9.lib). At this point it should compile file and since you guys are way better at getting things to work then i am, maybe you can get farther :D

One word of warning - DO NOT RUN IN 16-BITS PER PIXEL. It just doesn't work - use 32 bpp. I'll fix it later, i'm  more concerned about getting it to work right now (You might also see some messy code too - i'll clean some of it up later). Also, a fair number of registry settings need to be revised so that they still say directX8 instead of directX9 (in the code for reading the registry), because the launcher writes everything as directX8.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Also, a fair number of registry settings need to be revised so that they still say directX8 instead of directX9 (in the code for reading the registry), because the launcher writes everything as directX8.

They should say DirectX if they're something non-version specific, so we don't have to revise them again when we move to the next version of DirectX (if we do).
-C

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
...Well in that case, almost every signle one of those values should be DirectX because there are very very few version specific things. I'm not entirely sure which thing is which, though, so i'll leave that to a more experienced SCP coder.

I sidestepped this whole problem, apparently without breakage, by commenting out the LUA init. Obviously LUA script aren't going to work anymore but i succeeded in reaching the pilot screen and navigating through most of FS2_open. I'm going to do a few more tests now. DX9 appears to be working! :D

EDIT: Gah, now it has a problem with one of the turrets of a model... Whats most annoying is that none of these errors are at all DX related.

EDIT2: HOOOOOOOOOORAAAAAAAAAAAAAAAAAH! DX9 is rendering! And that turret problem seems to have gone away. However, for one, it starts out smooth but the more data it loads the slower it gets. It seems like its running in software mode. But everything seems to be at least rendering correctly... Except i can't take screenshots? :wtf:

Also the main hall and menus in general are all red-tinted. Any idea why that would happen?





 

Offline starfox

  • 28
hmmm, "fs2_dx9.zip" link seems to be down.
Rig:
A8N-SLI Premium
AMD 64 X2 4200+
GF 7950 GT
X-FI ExtremeMusic
HEC 550W
2 Gt RAM
Win XP

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
This is odd, but it works: (for me)

Click here:
http://www.sectorgame.com/blackhole/storage/

Then click on the fs2_dx9.zip file... it fails with the direct link, but if you go to the parent directory, then click the file, it works?  :wtf: Whatever.

BTW, this error is @ work w/ IE6... FF or IE7 might not have a problem.

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Eh, Hunter's host is having problems. --> Reuploaded <--

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Hmm... I'm having no problems with using my workaround, but even FF won't d'l from a direct link... strange.  Anyways, If anyone has problems, try downloading from here... (I could not use the "Reuploaded" link.)

http://in.solit.us/archives/download/50424

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Note - I'm now totally restructuring the directX initialization because for some reason its going into software mode which obviously is unacceptable. They're also using a whole lot of unnessacary crap that probably had to do with DX8 or DX5. Not only that but i need to rewrite several rendering functions because they're optimizing things that screw things up in DX9.

EDIT: Well, i succeeded in redoing the DX initialization (and confirmed its using pure hardware), but its STILL lagging up and its STILL got red blotches everywhere and in general not functioning properly.
« Last Edit: June 16, 2007, 02:54:13 pm by blackhole »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
for the red coloring check, vertex color, vertex flags about color, (DX)materials. that would be everything I can think of off the top of my head.

so are we actualy moving to DX9 finaly?
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Well, hopefully we are, assuming that my knowledge is enough to solve all the DX9 related problems. I checked the vertex color and DX materials but they appeared to be all black... I'll do some more checking today.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Looking at a diff of the code, you haven't addressed any of the problems that made us disable D3D in the first place, but you did introduce about a dozen new bugs.  Considering how little you actually changed, that's really not a good sign.  I recommend that you stop whatever else you are doing, diff the code, and correct all of the problems before moving on.  The more that you change the harder it will be to find those problem later.

And a few of the reasons that D3D was disabled in the first place, and the DX9 code will have to fix in order for us to accept it:
 - doesn't handle mipmaps properly
 - doesn't handle alpha channel images properly
 - doesn't handle envmaps properly
 - doesn't work with movies, neither MVE or Theora
 - has memory leaks/issues like crazy
 - is so messy that no one else can figure out the code

  

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Well i was expecting for these rendering issues to come up, considering that we're upgrading from DX8 to DX9. I was planning on addressing those upgrade issues first, then moving on to fixing the other errors. i'm trying to fix the issues right now, and restructuring the creation of the DX9 object was a strategy to fix any possible problems with the initialization of the DX9 object.

This is obviously not a few days worth of work, so i'll get back to you when i've made significant progress. Problem being i've got some finals coming up so work will be slow.