i want to implement the barrel shader for the oculus rift in javascript.
according to this video (http://youtu.be/B7qrgrrHry0?t=11m26s) the radius function for barrel distortion is:
newr = 0.24*r^4+0.22*r^2+1
The result:
Reference Image: After Shader:
if i change the function to newr = r
i get the orginal image.
If I set the function to: newr = 0.022*r^2
i get:
This one is close but not the right solution (tested with oculus)
So its not the fault of the programm...the radius function is the problem.
Here you can try it in a fiddle: http://jsfiddle.net/s175ozts/2/
Why does the orginal function not work??
thanks :)