DEFINE_UI_PARAMS(ratio, Percent, DCTLUI_SLIDER_FLOAT, 2.35, 1.0, 100.0, 0.01) DEFINE_UI_PARAMS(r, Red, DCTLUI_SLIDER_FLOAT, 1, 0.0, 1.0, 0.1) DEFINE_UI_PARAMS(g, Green, DCTLUI_SLIDER_FLOAT, 0, 0.0, 1.0, 0.1) DEFINE_UI_PARAMS(b, Blue, DCTLUI_SLIDER_FLOAT, 0, 0.0, 1.0, 0.1) __DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B) { float percent = ratio / 100; float letterbox_width = (p_Width * percent) / 2 ; int size = round(letterbox_width); if ((p_X < size) || (p_X > p_Width-size)) { return (make_float3(r, g, b)); } else { return (make_float3(p_R, p_G, p_B)); } }