Open main menu

CDOT Wiki β

Changes

TeamDS

386 bytes added, 22:53, 11 April 2017
GPU Optimized Phase 1
=== GPU Optimized Phase 1 ===
 
First step of optimizing is by finding a way to use less sqrtf function. It turns out that we are only comparing distances if one is larger than the other. When squaring two numbers, it does not change which is the larger number. We can take advantage of this by comparing the squared distance, not using sqrtf function then compare. This way we only need to use sqrtf once per pixel!
<syntaxhighlight lang="cpp">
116
edits