GLSL performance - function return value/type
问题 I'm using bicubic filtering to smoothen my heightmap, I implemented it in GLSL: Bicubic interpolation: (see interpolate() function bellow) float interpolateBicubic(sampler2D tex, vec2 t) { vec2 offBot = vec2(0,-1); vec2 offTop = vec2(0,1); vec2 offRight = vec2(1,0); vec2 offLeft = vec2(-1,0); vec2 f = fract(t.xy * 1025); vec2 bot0 = (floor(t.xy * 1025)+offBot+offLeft)/1025; vec2 bot1 = (floor(t.xy * 1025)+offBot)/1025; vec2 bot2 = (floor(t.xy * 1025)+offBot+offRight)/1025; vec2 bot3 = (floor