Open main menu

CDOT Wiki β

Changes

TeamDS

14 bytes removed, 21:58, 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 using lots of sqrtf for comparing distances to see if one is larger than the other. However, 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 comparethe actual distance. This way we only need to use sqrtf once per pixel! Below is the optimized kernel:
<syntaxhighlight lang="cpp">
116
edits