+ | Refraction index dieletric material

This commit is contained in:
TheRedShip
2025-01-06 12:15:03 +01:00
parent 00af3314d8
commit 5a6fd1f9ef
8 changed files with 85 additions and 13 deletions

View File

@ -48,13 +48,26 @@ const char *loadFileWithIncludes(const std::string& path)
}
void printWithLineNumbers(const char *str)
{
if (!str)
return;
std::istringstream stream(str);
std::string line;
int lineNumber = 1;
while (std::getline(stream, line))
std::cout << lineNumber++ << ": " << line << std::endl;
}
Shader::Shader(std::string vertexPath, std::string fragmentPath, std::string computePath)
{
const char *vertexCode = loadFileWithIncludes(vertexPath);
const char *fragmentCode = loadFileWithIncludes(fragmentPath);
const char *computeCode = loadFileWithIncludes(computePath);
std::cout << computeCode << std::endl;
printWithLineNumbers(computeCode);
_vertex = glCreateShader(GL_VERTEX_SHADER);