+ | Patching opti's problem

This commit is contained in:
TheRedShip
2025-01-19 15:48:25 +01:00
parent d0d67b8bd7
commit 71df788350
6 changed files with 2636 additions and 2870 deletions

5486
fps.txt

File diff suppressed because it is too large Load Diff

View File

@ -3,22 +3,22 @@ Pos=60,60
Size=400,400
[Window][Camera]
Pos=1652,11
Pos=1646,5
Size=259,200
[Window][Material]
Pos=1648,207
Size=266,285
Size=266,299
[Window][Fog settings]
Pos=1643,500
Size=247,157
Pos=1649,509
Size=247,130
[Window][Debug]
Pos=1642,668
Size=260,143
[Window][Debug BVH]
Pos=1639,664
Pos=1646,642
Size=274,205

View File

@ -186,6 +186,7 @@ vec3 pathtrace(Ray ray, inout uint rng_state)
break;
ray = newRay(hit, ray, rng_state);
ray.inv_direction = 1.0 / ray.direction;
}
return (color * light);

View File

@ -95,6 +95,7 @@ struct Ray
{
vec3 origin;
vec3 direction;
vec3 inv_direction;
};
struct hitInfo

View File

@ -20,8 +20,8 @@ int main(int argc, char **argv)
return (1);
Window window(&scene, WIDTH, HEIGHT, "RT_GPU", 0);
Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl");
// Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl");
// Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl");
Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl");
GLint max_gpu_size;
glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_gpu_size);
@ -122,7 +122,7 @@ int main(int argc, char **argv)
Camera *camera = scene.getCamera();
// performance profiling
if (false)
if (true)
{
float time = (float)(glfwGetTime()) ;

View File

@ -46,7 +46,7 @@ void BVH::updateBounds(std::vector<GPUTriangle> &primitives)
void BVH::subdivide(std::vector<GPUTriangle> &primitives)
{
if (_primitive_count <= 4)
if (_primitive_count <= 100)
return ;
glm::vec3 extent = _aabb.max - _aabb.min;