Can you change the Renderer Type In-Game

Hey! I'm working on making my game's settings as customizable as possible and i was wondering if i can somehow change the Renderer Type in-game. What i mean is, I'm able to change from webgl to canvas through the Community Basic plugin but I'd like to be able to do it with a script call. I am aware canvas mode can present more problems than it's worth, but i know it can help with performance in integrated. My game is fairly simple so in doubtful it would cause too many problems.

I'm assuming a restart would be necessary to make the changes take place, and I'm fine with that! I just wanna know if there's some script call for it. If not, then is there someway i could change the values of the plugin parameter through a script call?

Cheers in advance!
open the community plugin file in a text editor and look through it to learn which call/function it uses
open the community plugin file in a text editor and look through it to learn which call/function it uses
I've been trying to but i didn't understand which one it is, all the script calls i tried did not work. I'm fairly new to javascript so I defo know I'm missing something here.
It looks like the default engine will attempt to automatically detect which renderer is best for the user's system.

Unless there's some reason that you think specifying it back and forth is more beneficial than that, I would just take out the Community Basics (or, if you're using it for other things, leave it on "auto").

Especially if your game really is pretty simple, it shouldn't matter much.
It looks like the default engine will attempt to automatically detect which renderer is best for the user's system.

Unless there's some reason that you think specifying it back and forth is more beneficial than that, I would just take out the Community Basics (or, if you're using it for other things, leave it on "auto").

Especially if your game really is pretty simple, it shouldn't matter much.
That's fair, however it seems that the system's renderer of choice is not always reliable. I've been using an old computer with an integrated graphics card to test my game and learn how to improve performance more, and yet the engine chooses webgl, despite canvas providing far better performance on it.

Due to this i think it'd be more beneficial to let the person choose, it can be inconvenient for people with weaker computers, and as someone who's been in their shoes, i wanna make it as convenient as possible for them.
It looks like the part of Community Basic that does this is:

JavaScript:
SceneManager.preferableRendererType = function() {
        if (Utils.isOptionValid('canvas')) {
            return 'canvas';
        } else if (Utils.isOptionValid('webgl')) {
            return 'webgl';
        } else if (renderingMode === 'canvas') {
            return 'canvas';
        } else if (renderingMode === 'webgl') {
            return 'webgl';
        } else {
            return 'auto';
        }
    };

So probably the best way to handle it would be to make a plugin that adds an option (in say Game_System) and then use the value from that as the return value of preferableRendererType. Then when you want to change it, just set the system option to the desired value.

Note that it's impossible to edit Community Basic's parameters directly; after parsing, the variables they're stored in are within an IIFE (Immediately-Invoked Function Expression) meaning they exist only inside the scope of that function and can't be referenced or changed anywhere else.
It looks like the part of Community Basic that does this is:

JavaScript:
SceneManager.preferableRendererType = function() {
        if (Utils.isOptionValid('canvas')) {
            return 'canvas';
        } else if (Utils.isOptionValid('webgl')) {
            return 'webgl';
        } else if (renderingMode === 'canvas') {
            return 'canvas';
        } else if (renderingMode === 'webgl') {
            return 'webgl';
        } else {
            return 'auto';
        }
    };

So probably the best way to handle it would be to make a plugin that adds an option (in say Game_System) and then use the value from that as the return value of preferableRendererType. Then when you want to change it, just set the system option to the desired value.

Note that it's impossible to edit Community Basic's parameters directly; after parsing, the variables they're stored in are within an IIFE (Immediately-Invoked Function Expression) meaning they exist only inside the scope of that function and can't be referenced or changed anywhere else.
I've been trying to but to no avail, i have a plugin that adds the new option, all i need is the correct call, which I'm afraid i couldn't figure out on my own. However i try it always ends up doing nothing.
I've been trying to but to no avail, i have a plugin that adds the new option, all i need is the correct call, which I'm afraid i couldn't figure out on my own. However i try it always ends up doing nothing.
So say your Game_System property is "_rendererMode" for example. Your script call would just be like

$gameSystem._rendererMode = "webgl";

And you'd have an overwrite of SceneManager.preferableRendererType that just returns $gameSystem._rendererMode.
THANK YOU! That finally worked, i appreciate everybody involved in helping with this. Thread can now be closed.

Original thread: https://forums.rpgmakerweb.com/threads/can-you-change-the-renderer-type-in-game.155357/