Search Unity

Question Change graphics API at launch (if changed in-game then requiring restart) or at runtime

Discussion in 'General Graphics' started by Muke24, Aug 4, 2020.

  1. Muke24

    Muke24

    Joined:
    Nov 6, 2019
    Posts:
    7
    So, I am currently developing a game that will use both the Universal Render Pipeline and the High Definition Render Pipeline where players may toggle to "Standard Graphics" or "HD Graphics". The main reason I am trying to implement this is for the game to support Raytracing, which means DirectX 12 is needed. I want to be able to let the players choice which version of directX they desire. I have read a possible way but I am not sure if it would work, and would like someone who has possibly done it to tell me how to get it working.

    https://www.geeks3d.com/forums/inde...SSID=2a04807d43ef525753cbbab0d30cbce8#msg6958

    The link above shows a way to force the API version at startup, so I was thinking if I could possibly change the batch file up a bit to work the way I'm intending. A way I was thinking is a drop down within the in game settings where the player may change to DirectX11 or DirectX12, and it would restart the game by storing which API was selected somewhere, closing the game and running the batch file which will read which API was selected then force it to run with that API.

    I do know some will say to just use DirectX 12, which I will do if there is no possible way to do this, but I wanted to see if this is possible.

    Would anyone know if this would work, and how I could do it as I am not experienced enough with batch.

    I'm using Unity 2020.1.

    Thanks.
     
    Last edited: Aug 5, 2020
    AntonioModer likes this.
  2. akashdarshan99

    akashdarshan99

    Joined:
    Feb 26, 2020
    Posts:
    8
    Unity should provide an option to read the data from player prefs instead of expecting a launch argument.
    Launch argument is pretty stupid and prevents a direct way to take end user's input if they prefer DirectX12 or 11 or vulkan. The only feasible approach for achieving multiple graphics api switch is to use an external app to launch the game which seems really hacky