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

:^)
Regular
Joined
Oct 4, 2020
Messages
83
Reaction score
95
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

Regular
Regular
Joined
Jul 20, 2020
Messages
1,061
Reaction score
550
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

Regular
Regular
Joined
Mar 5, 2013
Messages
39,926
Reaction score
11,873
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 Posts

Latest Profile Posts

Time for the next chance for y'all to affect my advent calendar! Where should Day 7's sprite come from: land, sea, or demon realm? :rwink:
Throné's final boss is weird. He is a guy holding a baby while fighting off attackers. I think his name was Santos. I might be thinking of someone else.
I think I've just about finished fighting the fight with the tileset I was most intimidated by for game jam. No pictures yet, the map isn't presentable, but I think the tileset will work! I'm very relieved XD
Twitch! At it again with more gamedev for a couple hours, followed by some Valheim with my friend. Feel free to drop by~
these 80+ gb updates on several years old games are the absolute worst. I just want to play for an hour or so before bed to unwind. Sorry, gotta spend that time downloading an update. Then my mods will be broken so I'll have to start over or wait for those to be updated to. Is a complete game within three years of the pay to be a beta tester period really to much to ask?

Forum statistics

Threads
136,782
Messages
1,269,874
Members
180,523
Latest member
Reimu
Top