Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_material.c
| Context not available. | |||||
| } GPUColorBandBuilder; | } GPUColorBandBuilder; | ||||
| struct GPUMaterial { | struct GPUMaterial { | ||||
| Scene *scene; /* DEPRECATED was only usefull for lamps */ | Scene *scene; /* DEPRECATED was only useful for lamps */ | ||||
| Material *ma; | Material *ma; | ||||
| /* material for mesh surface, worlds or something else. | /* material for mesh surface, worlds or something else. | ||||
| Context not available. | |||||
| /* Functions */ | /* Functions */ | ||||
| /* Returns the adress of the future pointer to coba_tex */ | /* Returns the address of the future pointer to coba_tex */ | ||||
| GPUTexture **gpu_material_ramp_texture_row_set(GPUMaterial *mat, int size, float *pixels, float *row) | GPUTexture **gpu_material_ramp_texture_row_set(GPUMaterial *mat, int size, float *pixels, float *row) | ||||
| { | { | ||||
| /* In order to put all the colorbands into one 1D array texture, | /* In order to put all the colorbands into one 1D array texture, | ||||
| Context not available. | |||||
| /* Distance from surface. */ | /* Distance from surface. */ | ||||
| float d = kd->max_radius * ((float)i + 0.00001f) / ((float)resolution); | float d = kd->max_radius * ((float)i + 0.00001f) / ((float)resolution); | ||||
| /* For each distance d we compute the radiance incomming from an hypothetic parallel plane. */ | /* For each distance d we compute the radiance incoming from an hypothetic parallel plane. */ | ||||
| /* Compute radius of the footprint on the hypothetic plane */ | /* Compute radius of the footprint on the hypothetic plane */ | ||||
| float r_fp = sqrtf(kd->max_radius * kd->max_radius - d * d); | float r_fp = sqrtf(kd->max_radius * kd->max_radius - d * d); | ||||
| float r_step = r_fp / INTEGRAL_RESOLUTION; | float r_step = r_fp / INTEGRAL_RESOLUTION; | ||||
| Context not available. | |||||
| profile[1] = eval_profile(dist, falloff_type, sharpness, kd->param[1]); | profile[1] = eval_profile(dist, falloff_type, sharpness, kd->param[1]); | ||||
| profile[2] = eval_profile(dist, falloff_type, sharpness, kd->param[2]); | profile[2] = eval_profile(dist, falloff_type, sharpness, kd->param[2]); | ||||
| /* Since the profile and configuration are radially symetrical we | /* Since the profile and configuration are radially symmetrical we | ||||
| * can just evaluate it once and weight it accordingly */ | * can just evaluate it once and weight it accordingly */ | ||||
| float r_next = r + r_step; | float r_next = r + r_step; | ||||
| float disk_area = (M_PI * r_next * r_next) - (M_PI * r * r); | float disk_area = (M_PI * r_next * r_next) - (M_PI * r * r); | ||||
| Context not available. | |||||