3 ms·
I refuse to even look at this. I've seen ray tracing in a PDF before but this is too far.
by xyzzy_plugh 6y ago
I refuse to even look at this. I've seen ray tracing in a PDF before but this is too far.
- tgv 6y agoLet me tell you one detail: since cmake doesn't have floats, they use fixed point arithmetic. LOOK AT IT. You know you want too! function(sqrt x res) div_by_2(${x} guess) foreach(counter RANGE 4) if(${guess} EQUAL 0) set("${res}" 0 PARENT_SCOPE) return() endif() div(${x} ${guess} tmp) add(${tmp} ${guess} tmp) div_by_2(${tmp} guess) endforeach() set("${res}" "${guess}" PARENT_SCOPE) endfunction()
- Someone 6y agoIMO, this isn’t that impressive. Turns out that CMake has a scripting language that can be used to implement a ray tracer, and do that multi-threaded. The model being rendered also is hard-coded in the ray tracer. I expected a monstrosity that had multiple targets for every pixel (“ray arriving at (x,y)”, “ray arriving at (x,y) after one bounce”, etc), with some magic to merge all the outputs of the last bounce into an image, say by generating a huge html table, with each cell having a different background color.
- delta64 6y ago> The model being rendered also is hard-coded in the ray tracer. This is true - but there's no reason why it couldn't be modified to read in a scene description. It's more a proof of concept than anything else.