How to hot-reload a shader

Note this article is for advanced users only. If you are a beginner, please ignore this article.

The Untold Engine has the capability of hot-reloading shaders. To do so, you will need to use the U4DEngine::U4DDebugger class.

//Get an instance of the debugger
U4DEngine::U4DDebugger *debugger=U4DEngine::U4DDebugger::sharedInstance();

//Provide the name of the pipeline. The shaders which will be hot-reloaded are linked to the pipeline. 
//You must also provide the path to the external shader which you are hot-reloading. 
//Don't forget to provide the name of the vertex and fragment shaders 
debugger->reloadShader("minimappipeline", "/path_to_your_shader/minimapHotReloadShader.metal", "vertexMinimapShader", "fragmentMinimapShader");

Last updated