Looks fine to me. You should not have to do any range clamping yourself. Perhaps the bug is in static void cgGradientCallback(void *info, const float *inValues, float *outColor) { ... } else if (!(inValue < stops[stopsCount-1].offset)) { outColor = stops[stopsCount-1].colorArray; // How does this work again !!! } else { }
Created attachment 3470 [details] Fixes forgotten memcpy