add code for spin diffusion calculation (by Samuli)
add 2d texture code (Samuli)