Changes

Jump to: navigation, search

TeamDS

35 bytes added, 22:57, 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 using lots of sqrtf for comparing distances to see if one is larger than the other. When 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 compare. This way we only need to use sqrtf once per pixel! Below is the optimized kernel:
<syntaxhighlight lang="cpp">
116
edits

Navigation menu