Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/render_texture.c
| Context not available. | |||||
| /* use texres for the center sample, set rgbnor */ | /* use texres for the center sample, set rgbnor */ | ||||
| rgbnor = multitex_mtex(shi, mtex, STll, dxt, dyt, texres, pool, skip_load_image); | rgbnor = multitex_mtex(shi, mtex, STll, dxt, dyt, texres, pool, skip_load_image); | ||||
| Hll = (fromrgb) ? rgb_to_grayscale(&texres->tr) : texres->tin; | Hll = (fromrgb) ? IMB_colormanagement_get_luminance(&texres->tr) : | ||||
| texres->tin; | |||||
| /* use ttexr for the other 2 taps */ | /* use ttexr for the other 2 taps */ | ||||
| multitex_mtex(shi, mtex, STlr, dxt, dyt, &ttexr, pool, skip_load_image); | multitex_mtex(shi, mtex, STlr, dxt, dyt, &ttexr, pool, skip_load_image); | ||||
| Hlr = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin; | Hlr = (fromrgb) ? IMB_colormanagement_get_luminance(&ttexr.tr) : ttexr.tin; | ||||
| multitex_mtex(shi, mtex, STul, dxt, dyt, &ttexr, pool, skip_load_image); | multitex_mtex(shi, mtex, STul, dxt, dyt, &ttexr, pool, skip_load_image); | ||||
| Hul = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin; | Hul = (fromrgb) ? IMB_colormanagement_get_luminance(&ttexr.tr) : ttexr.tin; | ||||
| dHdx = Hscale*(Hlr - Hll); | dHdx = Hscale*(Hlr - Hll); | ||||
| dHdy = Hscale*(Hul - Hll); | dHdy = Hscale*(Hul - Hll); | ||||
| Context not available. | |||||
| /* use ttexr for the other taps */ | /* use ttexr for the other taps */ | ||||
| multitex_mtex(shi, mtex, STl, dxt, dyt, &ttexr, pool, skip_load_image); | multitex_mtex(shi, mtex, STl, dxt, dyt, &ttexr, pool, skip_load_image); | ||||
| Hl = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin; | Hl = (fromrgb) ? IMB_colormanagement_get_luminance(&ttexr.tr) : ttexr.tin; | ||||
| multitex_mtex(shi, mtex, STr, dxt, dyt, &ttexr, pool, skip_load_image); | multitex_mtex(shi, mtex, STr, dxt, dyt, &ttexr, pool, skip_load_image); | ||||
| Hr = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin; | Hr = (fromrgb) ? IMB_colormanagement_get_luminance(&ttexr.tr) : ttexr.tin; | ||||
| multitex_mtex(shi, mtex, STd, dxt, dyt, &ttexr, pool, skip_load_image); | multitex_mtex(shi, mtex, STd, dxt, dyt, &ttexr, pool, skip_load_image); | ||||
| Hd = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin; | Hd = (fromrgb) ? IMB_colormanagement_get_luminance(&ttexr.tr) : ttexr.tin; | ||||
| multitex_mtex(shi, mtex, STu, dxt, dyt, &ttexr, pool, skip_load_image); | multitex_mtex(shi, mtex, STu, dxt, dyt, &ttexr, pool, skip_load_image); | ||||
| Hu = (fromrgb) ? rgb_to_grayscale(&ttexr.tr) : ttexr.tin; | Hu = (fromrgb) ? IMB_colormanagement_get_luminance(&ttexr.tr) : ttexr.tin; | ||||
| dHdx = Hscale*(Hr - Hl); | dHdx = Hscale*(Hr - Hl); | ||||
| dHdy = Hscale*(Hu - Hd); | dHdy = Hscale*(Hu - Hd); | ||||
| Context not available. | |||||
| /* texture output */ | /* texture output */ | ||||
| if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) { | if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) { | ||||
| texres.tin = rgb_to_grayscale(&texres.tr); | texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| rgbnor -= TEX_RGB; | rgbnor -= TEX_RGB; | ||||
| } | } | ||||
| if (mtex->texflag & MTEX_NEGATIVE) { | if (mtex->texflag & MTEX_NEGATIVE) { | ||||
| Context not available. | |||||
| } | } | ||||
| if (rgbnor & TEX_RGB) { | if (rgbnor & TEX_RGB) { | ||||
| texres.tin = rgb_to_grayscale(&texres.tr); | texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| } | } | ||||
| factt= (0.5f-texres.tin)*mtex->dispfac*stencilTin; facmm= 1.0f-factt; | factt= (0.5f-texres.tin)*mtex->dispfac*stencilTin; facmm= 1.0f-factt; | ||||
| Context not available. | |||||
| if (rgbnor & TEX_RGB) { | if (rgbnor & TEX_RGB) { | ||||
| if (texres.talpha) texres.tin = texres.ta; | if (texres.talpha) texres.tin = texres.ta; | ||||
| else texres.tin = rgb_to_grayscale(&texres.tr); | else texres.tin =IMB_colormanagement_get_luminance(&texres.tr); | ||||
| } | } | ||||
| if (mtex->mapto & MAP_REF) { | if (mtex->mapto & MAP_REF) { | ||||
| Context not available. | |||||
| /* texture output */ | /* texture output */ | ||||
| if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) { | if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) { | ||||
| texres.tin = rgb_to_grayscale(&texres.tr); | texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| rgbnor -= TEX_RGB; | rgbnor -= TEX_RGB; | ||||
| } | } | ||||
| if (mtex->texflag & MTEX_NEGATIVE) { | if (mtex->texflag & MTEX_NEGATIVE) { | ||||
| Context not available. | |||||
| /* convert RGB to intensity if intensity info isn't provided */ | /* convert RGB to intensity if intensity info isn't provided */ | ||||
| if (rgbnor & TEX_RGB) { | if (rgbnor & TEX_RGB) { | ||||
| if (texres.talpha) texres.tin = texres.ta; | if (texres.talpha) texres.tin = texres.ta; | ||||
| else texres.tin = rgb_to_grayscale(&texres.tr); | else texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| } | } | ||||
| if ((mapto_flag & MAP_EMISSION) && (mtex->mapto & MAP_EMISSION)) { | if ((mapto_flag & MAP_EMISSION) && (mtex->mapto & MAP_EMISSION)) { | ||||
| Context not available. | |||||
| /* texture output */ | /* texture output */ | ||||
| if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { | if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { | ||||
| texres.tin = rgb_to_bw(&texres.tr); | texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| rgb= 0; | rgb= 0; | ||||
| } | } | ||||
| if (mtex->texflag & MTEX_NEGATIVE) { | if (mtex->texflag & MTEX_NEGATIVE) { | ||||
| Context not available. | |||||
| texres.tin = texres.ta; | texres.tin = texres.ta; | ||||
| } | } | ||||
| else { | else { | ||||
| texres.tin = rgb_to_bw(&texres.tr); | texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| /* texture output */ | /* texture output */ | ||||
| if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { | if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { | ||||
| texres.tin = rgb_to_bw(&texres.tr); | texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| rgb= 0; | rgb= 0; | ||||
| } | } | ||||
| if (mtex->texflag & MTEX_NEGATIVE) { | if (mtex->texflag & MTEX_NEGATIVE) { | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| if (mtex->mapto & WOMAP_BLEND) { | if (mtex->mapto & WOMAP_BLEND) { | ||||
| if (rgb) texres.tin = rgb_to_bw(&texres.tr); | if (rgb) texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| *blend= texture_value_blend(mtex->def_var, *blend, texres.tin, mtex->blendfac, mtex->blendtype); | *blend= texture_value_blend(mtex->def_var, *blend, texres.tin, mtex->blendfac, mtex->blendtype); | ||||
| } | } | ||||
| Context not available. | |||||
| /* texture output */ | /* texture output */ | ||||
| if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { | if (rgb && (mtex->texflag & MTEX_RGBTOINT)) { | ||||
| texres.tin = rgb_to_bw(&texres.tr); | texres.tin = IMB_colormanagement_get_luminance(&texres.tr); | ||||
| rgb= 0; | rgb= 0; | ||||
| } | } | ||||
| if (mtex->texflag & MTEX_NEGATIVE) { | if (mtex->texflag & MTEX_NEGATIVE) { | ||||
| Context not available. | |||||
| rgb = multitex(tex, texvec, dxt, dyt, 0, &texr, thread, mtex->which_output, pool, skip_load_image); | rgb = multitex(tex, texvec, dxt, dyt, 0, &texr, thread, mtex->which_output, pool, skip_load_image); | ||||
| if (rgb) { | if (rgb) { | ||||
| texr.tin = rgb_to_bw(&texr.tr); | texr.tin = IMB_colormanagement_get_luminance(&texr.tr); | ||||
| } | } | ||||
| else { | else { | ||||
| texr.tr= mtex->r; | texr.tr= mtex->r; | ||||
| Context not available. | |||||