Add some colour to the black areas on the textureAtlas so that I can see if they're being indexed.
They are.
Remove some spaces for readability/comparison to original texture sampling function.
Pasted in Ysaneyas original function and tried it out directly.
Changed the slope calculation, stopped inverting it and multiplying by 2.0!!!
Now we're getting somwhere!