Author Topic: Using Direct X  (Read 2222 times)

YellowShadow

  • Guest
Using Direct X
« on: February 04, 2007, 11:18:25 pm »
I know that Crystal Space has support for Direct3D/DirectX so would it be possible for me to change the source code to use Direct3D/DirectX?


-YellowShadow

Xordan

  • Crystal Space Developer
  • Forum Addict
  • *
  • Posts: 3845
  • For God and the Empire
    • View Profile
Re: Using Direct X
« Reply #1 on: February 04, 2007, 11:20:29 pm »
With enough time, you can do anything. So yes.

However, I'm not sure how good the support is in CS for it (DirectX).

YellowShadow

  • Guest
Re: Using Direct X
« Reply #2 on: February 04, 2007, 11:23:38 pm »
Hmm, I'll check on that. Also is PlaneShift made with OpenGL or does it have an option to use Direct X or OpenGL.

Xordan

  • Crystal Space Developer
  • Forum Addict
  • *
  • Posts: 3845
  • For God and the Empire
    • View Profile
Re: Using Direct X
« Reply #3 on: February 04, 2007, 11:39:54 pm »
Atm we only use OpenGL.

YellowShadow

  • Guest
Re: Using Direct X
« Reply #4 on: February 05, 2007, 12:15:00 am »
Okay. I'll try my best to implent DX and see what happens.

Ralleyon

  • Hydlaa Citizen
  • *
  • Posts: 304
  • Protector in the Survivors of Vaern
    • View Profile
Re: Using Direct X
« Reply #5 on: February 06, 2007, 12:49:13 pm »
Currently, PlaneShift supports 3 major platforms: Windows, Linux and MacOS. If you switch to DirectX completely, it reduces the player base to Windows only which wouldn't be fair. If it is only as an alternative, and only for Windows, sure, go ahead. But is it really worth the effort? :)
To see the world in a grain of sand
And Heaven in a wild flower,
Hold Infinity in the palm of your hand
And Eternity in an hour.
     
   [William Blake - Auguries of Innocence]

ThomPhoenix

  • Testers
  • Forum Addict
  • *
  • Posts: 2678
  • A Phoenix, what'd you expect?
    • View Profile
Re: Using Direct X
« Reply #6 on: February 06, 2007, 01:09:43 pm »
I don't see the benefits of Planeshift using DirectX, would you like to explain the reasons why you think PS needs DirectX support?
We're not evil. We're simply amazing.

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
Re: Using Direct X
« Reply #7 on: February 06, 2007, 01:37:19 pm »
Crystal Space currently does not support Direct3D, although it has some kind of (preliminary) support for Direct Draw 8 2D rendering (last reference in history.old is dated 3-Jun-2001). It is listed on current TODO list as low priority optional feature.

Quote from: Crystal Space Docs
     * Direct3D: Not currently supported. (If you would like to write a
       Direct3D renderer, please contact us.)

If You want Direct3D in Planeshift, write appropriate plugin for CS.

Then in Planeshift switching to DirectX/Direct3D would require only some changes in psclient.cfg, for example:

System.PlugIns.iGraphics3D = crystalspace.graphics3d.Direct3D
Video.DDraw.Canvas = crystalspace.graphics2d.ddraw

No need to mangle PS code :).
"Close the world, txEn eht nepO."

YellowShadow

  • Guest
Re: Using Direct X
« Reply #8 on: February 06, 2007, 10:29:16 pm »
Wait what there is no Direct3D renderer!?!?!?!. Psh, nice Crystal space.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Using Direct X
« Reply #9 on: February 07, 2007, 06:54:25 am »
The great advantage of OpenGL is: Operating System independency.

PlaneShift does not support the most complex 3D effects, so it runs fine on a great variety of hardware (e.g. smooth enough on a GeForce2 GTS and 800 MHz AMD Duron in 1280x960 pixels resolution) via the OpenGL based, mainly OS independent, CrystalSpace 3D engine.

Switching to any DirectX version specific API will have several disadvantages:

- DirectX is only well supported under Windows. Linux support under WineX is limited (maybe even wrapped to OpenGL?).
- The several DirectX version APIs are not completely compatible to each others.
- Direct3D is not as flexible as OpenGL: in OpenGL, you can use or ignore some "extensions"; for Direct3D, you may have to select another API version for better looking effects. But ... how much graphic effects does a roleplaying game really need? So much that you would risk losing good friends with outdated hardware?

There is, however, one part of the DirectX API which is supported in the Win32 version: DirectSound. An OS independent audio system, like OpenAL, is unfortunately not yet as usual as the OS independent graphics system, OpenGL.

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Induane

  • Veteran
  • *
  • Posts: 1287
  • What should I put here?
    • View Profile
    • Vaalnor Inc.
Re: Using Direct X
« Reply #10 on: February 07, 2007, 07:33:30 am »
Quote
Wait what there is no Direct3D renderer!?!?!?!. Psh, nice Crystal space.

LigH has it right.  When creating a 3d engine thats designed to be 100% portable across all major platforms then directx is out.  Its one of those features that doesn't deserve any priority.  In effect spending all kinds of time with a directx renderer makes no sense at all.  It would totally limit the scope and purpose of the entire crystalspace project.  Since PS relies on crystalspace for its 3d engine, its simply not feasible to add directx rendering without as wired_crawler said, creating a whole new rendering plugin.  I'm not sure what Psh, nice crystalspace means...  it seems that they made the appropriate, intelligent, and overall correct choice.  There simply aren't that many things about directx that make it that worthwhile.  Also, since windows won't be making directx 10 for windows, its further limiting itself to windows vista... so its not even very open on windows - it limits what windows versions you can run too.  OpenGL 2.0 specs have been out for a bit, and once drivers are taking advantage of that it will be out ahead of DX in many ways featurewise anyways.  Both have their feature advantages but I'm really not sure an intelligent person could justify making directx a priority given the goals of the project, and balking at them for not having a directx renderer doesn't help much either.

Xordan

  • Crystal Space Developer
  • Forum Addict
  • *
  • Posts: 3845
  • For God and the Empire
    • View Profile
Re: Using Direct X
« Reply #11 on: February 07, 2007, 04:41:37 pm »
There is, however, one part of the DirectX API which is supported in the Win32 version: DirectSound. An OS independent audio system, like OpenAL, is unfortunately not yet as usual as the OS independent graphics system, OpenGL.

MS is dropping hardware accelerated Direct3D sound and going for OpenAL (still hardware accelerated) pretty much now (with Vista). So OpenAL is going to become much wider used than OpenGL very quickly.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Using Direct X
« Reply #12 on: February 08, 2007, 02:11:28 am »
:D Good news, Xordan!

And if there are "generic" OpenAL drivers available (e.g. DSound wrappers), then the change will be easy...


Oh, did I say "if"? -- OpenAL driver downloads, supported platforms and technologies

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

konzy

  • Wayfarer
  • *
  • Posts: 3
    • View Profile
Re: Using Direct X
« Reply #13 on: March 14, 2007, 07:41:28 pm »
MS is dropping support for XP at year end 2007 many will be switching simply for the sexy backend of vista and its updates.  <sarcasm> As all the vista users would agree, making opengl play nice with vista if fun! </sarcasm>

Xordan

  • Crystal Space Developer
  • Forum Addict
  • *
  • Posts: 3845
  • For God and the Empire
    • View Profile
Re: Using Direct X
« Reply #14 on: March 14, 2007, 08:44:35 pm »
The current opengl performance problems with Vista are due to the graphics drivers, not Vista itself. So it's not MS's fault, blame the graphics vendors :P