Lolizlol

Warper
Member
Joined
Oct 13, 2021
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Is there any way I can switch the graphics renderer to DirectX (or is it already DirectX?)
 

MoonBunny

:^)
Veteran
Joined
Oct 4, 2020
Messages
83
Reaction score
94
First Language
English
Primarily Uses
RMMV
From my understanding, you can either render with Canvas or WebGL. Is there a reason you specifically want DirectX?
 

burbigo3

Villager
Member
Joined
Aug 18, 2020
Messages
12
Reaction score
2
First Language
French
Primarily Uses
Other
I usually do this with Canvas
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
1,015
Reaction score
503
First Language
PT-BR
Primarily Uses
RM2k3
Hello welcome!

Games made with MV, MZ or VN Maker use WebGL because they work inside a Chromium-based WebKit, at least that's what I noticed looking at the console.

DirectX does not support web pages.

DirectX was used from Rm2k to RmVXA, I believe the previous ones didn't.

Remember that after having resurrected the Rm2k3 its renderer was replaced by GDI precisely because of the newer machines:


DirectX stopped in version 9 and has had no further updates, so it will probably not have browser support.
 

ThinkN

Villager
Member
Joined
Aug 11, 2020
Messages
15
Reaction score
18
First Language
English
Primarily Uses
RMMV
This is a fun, complex question.

The short answer is there is no reason to change anything, the system will choose the best renderer on its own.

If you're playing on Windows, your exported games are likely running DirectX by default, albeit in a very indirect way.

For a more in-depth exploration, it's worth reviewing the stack of technology:

  1. RPGMZ games are written in JavaScript
  2. For most graphics (excluding text*), it uses the library PixiJS
  3. PixiJS uses a combination of JavaScript and shaders written in GLSL to interface with an API called WebGL
  4. WebGL is based on OpenGL, a competitor to DirectX
  5. When you run a game, all those lines of code need to be interpreted by an engine and transformed into code that can be understood by your CPU and GPU
  6. RPGMZ games can run in a browser, or if you export it for Windows/Mac/Linux, it runs in a browser-like environment called nwjs
  7. nwjs is made up from components of Chromium (the open-source version of Google's Chrome browser)
  8. The graphical API layer of Chromium is ANGLE
  9. ANGLE translates OpenGL calls to whichever API is supported by the platform it runs on
  10. The default on most Windows machines is to use Direct3D 11, a subset of DirectX

* Chromium also uses ANGLE for its canvas implementation. So even the graphics functions using Canvas instead of WebGL are translated through ANGLE.

Can you change the rendering back-end?

I think so, although I haven't tested this.

nwjs supports most Chromium command line switches via the package.json file.

It looks like the "use-angle" switch accepts these values:
  • d3d9
  • d3d11
  • warp
  • gl
  • gles

So to indicate you want Direct3D as your preferred renderer, you would insert "--use-angle=d3d11" in the "chromium-args" field of your game's package.json file.

Is it worth doing this? No, probably not. But it's fun to learn about the convoluted world of web technology.

Edit notice: I edited a few lines to make it clear I'm focused on the technology of exported games, not on the Maker itself.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,004
Reaction score
10,561
First Language
German
Primarily Uses
RMMV
Another aspect here (and the reason why DirectX was abandoned after VXA) is that DirectX is Windows-Only (or at least was at that time).

You have to ditch DirectX if you want compatibility on non-Windows computers. There have been some implementations to get DirectX simulated on other operating systems, but those are rarely stable because they are rarely done by Microsoft themselves (Microsoft cares only about Windows) and the programmers rarely have the internal access to replicate DirectX completely correct.

So even if you manage to switch your project/game to DirectX it will only result in the deployment to other devices/OS no longer working.
 

Latest Threads

Latest Profile Posts

Finally sat down and made a template of my world map in Inkarnate. Now to translate this to MV.
Oof. Literally got a "whose code is this, 'cause it sucks" in one of my projects.
Lunesis has started a trend of doing homages to me by putting a trilobite fossil in your game somewhere and I have to say I love this and encourage everyone who wants to credit me to do it too. XD
Made a plugin that allows you to randomly transmute items into other items weeeeeeee
Rebuilding isn't going terribly so far. I caught some things that I was definitely overcomplicating in the original project. Here's to hoping the plugins play nice when testing starts.

Forum statistics

Threads
129,942
Messages
1,206,469
Members
171,148
Latest member
Pptgames
Top