Commit 5bb79eab authored by Johannes Braun's avatar Johannes Braun
Browse files

I have no clue

parent 4d3d14d0
...@@ -4,7 +4,7 @@ Size=353,64 ...@@ -4,7 +4,7 @@ Size=353,64
Collapsed=0 Collapsed=0
[Scene] [Scene]
Pos=4,66 Pos=4,67
Size=352,837 Size=352,837
Collapsed=0 Collapsed=0
......
...@@ -124,11 +124,6 @@ uint lineIndex(const in Ray ray, const in Mesh mesh, int ls_index, float tmin, f ...@@ -124,11 +124,6 @@ uint lineIndex(const in Ray ray, const in Mesh mesh, int ls_index, float tmin, f
uint start = (entry_info.patch_index.y + entry_info.patch_index.x * start_height) * end_width * end_height; uint start = (entry_info.patch_index.y + entry_info.patch_index.x * start_height) * end_width * end_height;
uint end = (exit_info.patch_index.y + exit_info.patch_index.x * end_height); uint end = (exit_info.patch_index.y + exit_info.patch_index.x * end_height);
uint cunt = linespace.line_count;
if((offset + start+end) * 2 + 1 > cunt)
return 0;
return offset + start + end; return offset + start + end;
} }
...@@ -152,7 +147,7 @@ bool traverseLineSpace(const in Mesh mesh, int index, const in Ray local_ray, co ...@@ -152,7 +147,7 @@ bool traverseLineSpace(const in Mesh mesh, int index, const in Ray local_ray, co
bool swapped = false; bool swapped = false;
uint line_id = lineIndex(loc, mesh, index, tmin, tmax, face_tmin, face_tmax, swapped); uint line_id = lineIndex(loc, mesh, index, tmin, tmax, face_tmin, face_tmax, swapped);
Line line_near = mesh.linespaces[index].lines[line_id * 2]; Line line_near = mesh.linespaces[index].lines[line_id * 2];
Line line_far = mesh.linespaces[index].lines[line_id * 2 + 1]; Line line_far = mesh.linespaces[index].lines[line_id * 2 + 1];
......
...@@ -228,11 +228,12 @@ void main() ...@@ -228,11 +228,12 @@ void main()
bounce.bounce_amount = int[num_effects](0,0,0,0); bounce.bounce_amount = int[num_effects](0,0,0,0);
bounce.color = vec3(0); bounce.color = vec3(0);
bounce.radiance = vec3(1); bounce.radiance = vec3(1);
bounce.shade();
// Nifty for-loop trick. :P // Nifty for-loop trick. :P
// Will execute the bounce.shade() method at the very beginning (to shade the primary ray) and then // Will execute the bounce.shade() method at the very beginning (to shade the primary ray) and then
// continue with first-trace-then-shade until either shade returns false (not hitting something or constribution too low) // continue with first-trace-then-shade until either shade returns false (not hitting something or constribution too low)
// or we exceed the global bounce limit. // or we exceed the global bounce limit.
if(false)
for (bounce.count = 1; bounce.shade() && bounce.count <= u_render_config.num_bounces; ++bounce.count) { for (bounce.count = 1; bounce.shade() && bounce.count <= u_render_config.num_bounces; ++bounce.count) {
bounce.trace(); bounce.trace();
} }
......
...@@ -57,7 +57,7 @@ namespace glare::raytrace ...@@ -57,7 +57,7 @@ namespace glare::raytrace
m_vertex_buffer->makeResident(gl::Access::eReadOnly); m_vertex_buffer->makeResident(gl::Access::eReadOnly);
m_triangle_buffer->makeResident(gl::Access::eReadOnly); m_triangle_buffer->makeResident(gl::Access::eReadOnly);
int subdiv_grid = 1; int subdiv_grid = 2;
auto subdiv = m_bounds.computeSubdivision(subdiv_grid); auto subdiv = m_bounds.computeSubdivision(subdiv_grid);
int count = subdiv.resolution.x * subdiv.resolution.y * subdiv.resolution.z; int count = subdiv.resolution.x * subdiv.resolution.y * subdiv.resolution.z;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment