Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/shadeoutput.c
| Context not available. | |||||
| if (ma->ramp_col) { | if (ma->ramp_col) { | ||||
| if (ma->rampin_col==MA_RAMP_IN_RESULT) { | if (ma->rampin_col==MA_RAMP_IN_RESULT) { | ||||
| float fac = rgb_to_grayscale(diff); | float fac = rgb_to_luma(diff); | ||||
| do_colorband(ma->ramp_col, fac, col); | do_colorband(ma->ramp_col, fac, col); | ||||
| /* blending method */ | /* blending method */ | ||||
| Context not available. | |||||
| if (ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) { | if (ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) { | ||||
| float col[4]; | float col[4]; | ||||
| float fac = rgb_to_grayscale(spec_col); | float fac = rgb_to_luma(spec_col); | ||||
| do_colorband(ma->ramp_spec, fac, col); | do_colorband(ma->ramp_spec, fac, col); | ||||
| Context not available. | |||||
| if (shi->mat->shadowonly_flag == MA_SO_OLD) { | if (shi->mat->shadowonly_flag == MA_SO_OLD) { | ||||
| /* Old "Shadows Only" */ | /* Old "Shadows Only" */ | ||||
| accum+= (1.0f-visifac) + (visifac)*rgb_to_grayscale(shadfac)*shadfac[3]; | accum+= (1.0f-visifac) + (visifac)*rgb_to_luma(shadfac)*shadfac[3]; | ||||
| } | } | ||||
| else { | else { | ||||
| shaded += rgb_to_grayscale(shadfac)*shadfac[3] * visifac * lar->energy; | shaded += rgb_to_luma(shadfac)*shadfac[3] * visifac * lar->energy; | ||||
| if (shi->mat->shadowonly_flag == MA_SO_SHADOW) { | if (shi->mat->shadowonly_flag == MA_SO_SHADOW) { | ||||
| lightness += visifac * lar->energy; | lightness += visifac * lar->energy; | ||||
| Context not available. | |||||
| if (R.wrld.aomix==WO_AOADD) { | if (R.wrld.aomix==WO_AOADD) { | ||||
| if (shi->mat->shadowonly_flag == MA_SO_OLD) { | if (shi->mat->shadowonly_flag == MA_SO_OLD) { | ||||
| f= f*(1.0f - rgb_to_grayscale(shi->ao)); | f= f*(1.0f - rgb_to_luma(shi->ao)); | ||||
| shr->alpha= (shr->alpha + f)*f; | shr->alpha= (shr->alpha + f)*f; | ||||
| } | } | ||||
| else { | else { | ||||
| shr->alpha -= f*rgb_to_grayscale(shi->ao); | shr->alpha -= f*rgb_to_luma(shi->ao); | ||||
| if (shr->alpha<0.0f) shr->alpha=0.0f; | if (shr->alpha<0.0f) shr->alpha=0.0f; | ||||
| } | } | ||||
| } | } | ||||
| else /* AO Multiply */ | else /* AO Multiply */ | ||||
| shr->alpha= (1.0f - f)*shr->alpha + f*(1.0f - (1.0f - shr->alpha)*rgb_to_grayscale(shi->ao)); | shr->alpha= (1.0f - f)*shr->alpha + f*(1.0f - (1.0f - shr->alpha)*rgb_to_luma(shi->ao)); | ||||
| } | } | ||||
| if (R.wrld.mode & WO_ENV_LIGHT) { | if (R.wrld.mode & WO_ENV_LIGHT) { | ||||
| if (shi->mat->shadowonly_flag == MA_SO_OLD) { | if (shi->mat->shadowonly_flag == MA_SO_OLD) { | ||||
| f= R.wrld.ao_env_energy*shi->amb*(1.0f - rgb_to_grayscale(shi->env)); | f= R.wrld.ao_env_energy*shi->amb*(1.0f - rgb_to_luma(shi->env)); | ||||
| shr->alpha= (shr->alpha + f)*f; | shr->alpha= (shr->alpha + f)*f; | ||||
| } | } | ||||
| else { | else { | ||||
| f= R.wrld.ao_env_energy*shi->amb; | f= R.wrld.ao_env_energy*shi->amb; | ||||
| shr->alpha -= f*rgb_to_grayscale(shi->env); | shr->alpha -= f*rgb_to_luma(shi->env); | ||||
| if (shr->alpha<0.0f) shr->alpha=0.0f; | if (shr->alpha<0.0f) shr->alpha=0.0f; | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||