void QtShaderWindow::load(const std::string& filePath) { RafShaderHeader raf; raf.load(filePath); const RJNode& shaderJson = raf.getCustomJsonHeaderRef(); if(shaderJson.is_object()) { setShaderCode(VERTEX_SHADER_SOURCE_NAME, shaderJson["vtx"]); setShaderCode(TESS_CONTROL_SHADER_SOURCE_NAME, shaderJson["tcl"]); setShaderCode(TESS_EVALUATION_SHADER_SOURCE_NAME, shaderJson["tel"]); setShaderCode(GEOMETRY_SHADER_SOURCE_NAME, shaderJson["geo"]); setShaderCode(FRAGMENT_SHADER_SOURCE_NAME, shaderJson["fra"]); setShaderCode(COMPUTE_SHADER_SOURCE_NAME, shaderJson["com"]); } // Force display first item onSourcesListClicked(m_sourcesListWidget->model()->index(0, 0)); rLogInfo(g_log, "Shader \"" << filePath << "\" loaded"); }
void RenderSurface::initialize() { setShaderCode(fragmentShaderSource); }