* | Push for render sponza on server

This commit is contained in:
TheRedShip
2025-02-18 00:34:13 +01:00
parent 62852a51dc
commit b3bc2cc659
53 changed files with 222071 additions and 821720 deletions

View File

@ -38,22 +38,13 @@ int main(int argc, char **argv)
setupScreenTriangle(&VAO);
std::vector<GLuint> textures = generateTextures(8);
//0 output
//1 output_accumulation
//2 denoising
//3 normal
//4 position
//5 light
//6 light_accum
//7 color
ShaderProgram raytracing_program;
Shader compute = Shader(GL_COMPUTE_SHADER, "shaders/compute.glsl");
int maxTextureUnits; glGetIntegerv(GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
compute.setDefine("TEXTURE_MAX", std::to_string(maxTextureUnits / 2));
compute.reload();
std::cout << "Max texture units: " << maxTextureUnits << std::endl;
// compute.setDefine("TEXTURE_MAX", std::to_string(maxTextureUnits / 2));
// compute.reload();
raytracing_program.attachShader(&compute);
raytracing_program.link();

View File

@ -48,6 +48,14 @@ void drawScreenTriangle(GLuint VAO, GLuint output_texture, GLuint program)
glDrawArrays(GL_TRIANGLES, 0, 1 * 3); // size 1
}
//0 output
//1 output_accumulation
//2 denoising
//3 normal
//4 position
//5 light
//6 light_accum
//7 color
std::vector<GLuint> generateTextures(unsigned int textures_count)
{
std::vector<GLuint> textures(textures_count);

View File

@ -27,8 +27,6 @@ void Camera::updateCameraVectors()
{
glm::vec3 frontTemp;
std::cout << _yaw << std::endl;
frontTemp.x = cos(glm::radians(_yaw)) * cos(glm::radians(_pitch));
frontTemp.y = sin(glm::radians(_pitch));
frontTemp.z = sin(glm::radians(_yaw)) * cos(glm::radians(_pitch));

View File

@ -252,7 +252,7 @@ void ObjParser::parseMtl(std::stringstream &input_line, Scene &scene)
mat->emission_texture_index = -1;
mat->refraction = 1.0f;
mat->roughness = 1.0f;
mat->metallic = 1.0f;
// mat->metallic = 1.0f;
mat->color = glm::vec3(1.0f, 1.0f, 1.0f);
continue;
}

View File

@ -554,7 +554,8 @@ void Renderer::makeMovement(float timeFromStart, float curSplitTimeReset)
pathTime = (to.time - from.time) * 60;
normalTime = 1 - ((pathTime - timeFromStart) / pathTime);
pos = hermiteInterpolate((glm::vec3 [4]){prev.pos, from.pos, to.pos, next.pos}, normalTime);
glm::vec3 points[4] = {prev.pos, from.pos, to.pos, next.pos};
pos = hermiteInterpolate(points, normalTime);
smallDistPrev = glm::distance((to.dir - from.dir) / glm::vec2(pathTime), (from.dir - prev.dir) / glm::vec2((from.time - prev.time) * 60)) < 40;
smallDistNext = glm::distance((to.dir - from.dir) / glm::vec2(pathTime), (next.dir - to.dir) / glm::vec2((next.time - to.time) * 60)) < 40;