Merge branch 'master' into blender2.8

This commit is contained in:
2017-12-07 23:53:03 +11:00
46 changed files with 591 additions and 464 deletions

View File

@@ -48,6 +48,7 @@
#include "DNA_particle_types.h"
#include "DNA_texture_types.h"
#include "BKE_colorband.h"
#include "BKE_deform.h"
#include "BKE_DerivedMesh.h"
#include "BKE_lattice.h"
@@ -55,7 +56,6 @@
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_scene.h"
#include "BKE_texture.h"
#include "BKE_colortools.h"
#include "DEG_depsgraph.h"
@@ -786,7 +786,7 @@ static int pointdensity_color(PointDensity *pd, TexResult *texres, float age, co
switch (pd->color_source) {
case TEX_PD_COLOR_PARTAGE:
if (pd->coba) {
if (do_colorband(pd->coba, age, rgba)) {
if (BKE_colorband_evaluate(pd->coba, age, rgba)) {
texres->talpha = true;
copy_v3_v3(&texres->tr, rgba);
texres->tin *= rgba[3];
@@ -799,7 +799,7 @@ static int pointdensity_color(PointDensity *pd, TexResult *texres, float age, co
float speed = len_v3(vec) * pd->speed_scale;
if (pd->coba) {
if (do_colorband(pd->coba, speed, rgba)) {
if (BKE_colorband_evaluate(pd->coba, speed, rgba)) {
texres->talpha = true;
copy_v3_v3(&texres->tr, rgba);
texres->tin *= rgba[3];
@@ -831,7 +831,7 @@ static int pointdensity_color(PointDensity *pd, TexResult *texres, float age, co
break;
case TEX_PD_COLOR_VERTWEIGHT:
texres->talpha = true;
if (pd->coba && do_colorband(pd->coba, col[0], rgba)) {
if (pd->coba && BKE_colorband_evaluate(pd->coba, col[0], rgba)) {
copy_v3_v3(&texres->tr, rgba);
texres->tin *= rgba[3];
}

View File

@@ -54,6 +54,7 @@
#include "BKE_node.h"
#include "BKE_animsys.h"
#include "BKE_colorband.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
#include "BKE_main.h"
@@ -161,15 +162,15 @@ static void tex_normal_derivate(Tex *tex, TexResult *texres)
{
if (tex->flag & TEX_COLORBAND) {
float col[4];
if (do_colorband(tex->coba, texres->tin, col)) {
if (BKE_colorband_evaluate(tex->coba, texres->tin, col)) {
float fac0, fac1, fac2, fac3;
fac0= (col[0]+col[1]+col[2]);
do_colorband(tex->coba, texres->nor[0], col);
BKE_colorband_evaluate(tex->coba, texres->nor[0], col);
fac1= (col[0]+col[1]+col[2]);
do_colorband(tex->coba, texres->nor[1], col);
BKE_colorband_evaluate(tex->coba, texres->nor[1], col);
fac2= (col[0]+col[1]+col[2]);
do_colorband(tex->coba, texres->nor[2], col);
BKE_colorband_evaluate(tex->coba, texres->nor[2], col);
fac3= (col[0]+col[1]+col[2]);
texres->nor[0]= (fac0 - fac1) / 3.0f;
@@ -1218,7 +1219,7 @@ static int multitex(Tex *tex,
if (tex->flag & TEX_COLORBAND) {
float col[4];
if (do_colorband(tex->coba, texres->tin, col)) {
if (BKE_colorband_evaluate(tex->coba, texres->tin, col)) {
texres->talpha = true;
texres->tr= col[0];
texres->tg= col[1];

View File

@@ -27,7 +27,6 @@
* \ingroup render
*/
#include <stdio.h>
#include <float.h>
#include <math.h>
@@ -36,10 +35,9 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_colorband.h"
#include "BKE_colortools.h"
#include "BKE_material.h"
#include "BKE_texture.h"
#include "DNA_group_types.h"
#include "DNA_lamp_types.h"
@@ -942,7 +940,7 @@ static void ramp_diffuse_result(float *diff, ShadeInput *shi)
if (ma->ramp_col) {
if (ma->rampin_col==MA_RAMP_IN_RESULT) {
float fac = IMB_colormanagement_get_luminance(diff);
do_colorband(ma->ramp_col, fac, col);
BKE_colorband_evaluate(ma->ramp_col, fac, col);
/* blending method */
fac= col[3]*ma->rampfac_col;
@@ -986,7 +984,7 @@ static void add_to_diffuse(float diff[3], const ShadeInput *shi, const float is,
break;
}
do_colorband(ma->ramp_col, fac, col);
BKE_colorband_evaluate(ma->ramp_col, fac, col);
/* blending method */
fac = col[3] * ma->rampfac_col;
@@ -1015,7 +1013,7 @@ static void ramp_spec_result(float spec_col[3], ShadeInput *shi)
float col[4];
float fac = IMB_colormanagement_get_luminance(spec_col);
do_colorband(ma->ramp_spec, fac, col);
BKE_colorband_evaluate(ma->ramp_spec, fac, col);
/* blending method */
fac= col[3]*ma->rampfac_spec;
@@ -1055,7 +1053,7 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float spec[3])
break;
}
do_colorband(ma->ramp_spec, fac, col);
BKE_colorband_evaluate(ma->ramp_spec, fac, col);
/* blending method */
fac= col[3]*ma->rampfac_spec;