Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_curves.c
| Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | static int gpu_shader_curve_rgb(GPUMaterial *mat, | ||||
| float range_rgba[4]; | float range_rgba[4]; | ||||
| for (int a = 0; a < CM_TOT; a++) { | for (int a = 0; a < CM_TOT; a++) { | ||||
| const CurveMap *cm = &cumap->cm[a]; | const CurveMap *cm = &cumap->cm[a]; | ||||
| ext_rgba[a][0] = cm->mintable; | ext_rgba[a][0] = cm->mintable; | ||||
| ext_rgba[a][2] = cm->maxtable; | ext_rgba[a][2] = cm->maxtable; | ||||
| range_rgba[a] = 1.0f / max_ff(1e-8f, cm->maxtable - cm->mintable); | range_rgba[a] = 1.0f / max_ff(1e-8f, cm->maxtable - cm->mintable); | ||||
| /* Compute extrapolation gradients. */ | /* Compute extrapolation gradients. */ | ||||
| if ((cm->flag & CUMA_EXTEND_EXTRAPOLATE) != 0) { | if ((cumap->flag & CUMA_EXTEND_EXTRAPOLATE) != 0) { | ||||
| ext_rgba[a][1] = (cm->ext_in[0] != 0.0f) ? | ext_rgba[a][1] = (cm->ext_in[0] != 0.0f) ? | ||||
| (cm->ext_in[1] / (cm->ext_in[0] * range_rgba[a])) : | (cm->ext_in[1] / (cm->ext_in[0] * range_rgba[a])) : | ||||
| 1e8f; | 1e8f; | ||||
| ext_rgba[a][3] = (cm->ext_out[0] != 0.0f) ? | ext_rgba[a][3] = (cm->ext_out[0] != 0.0f) ? | ||||
| (cm->ext_out[1] / (cm->ext_out[0] * range_rgba[a])) : | (cm->ext_out[1] / (cm->ext_out[0] * range_rgba[a])) : | ||||
| 1e8f; | 1e8f; | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines | |||||