Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/texture_image.c
| Show First 20 Lines • Show All 1,952 Lines • ▼ Show 20 Lines | else { | ||||
| texres->tin = texres->ta; | texres->tin = texres->ta; | ||||
| } | } | ||||
| if (tex->flag & TEX_NEGALPHA) { | if (tex->flag & TEX_NEGALPHA) { | ||||
| texres->ta = 1.0f - texres->ta; | texres->ta = 1.0f - texres->ta; | ||||
| } | } | ||||
| if (texres->nor && (tex->imaflag & TEX_NORMALMAP)) { | if (texres->nor && (tex->imaflag & TEX_NORMALMAP)) { | ||||
| /* qdn: normal from color | /* Normal from color: | ||||
| * The invert of the red channel is to make | * The invert of the red channel is to make the normal map compliant with the outside world. | ||||
| * the normal map compliant with the outside world. | * It needs to be done because in Blender the normal used in the renderer points inward. | ||||
| * It needs to be done because in Blender | * It is generated this way in #calc_vertexnormals(). | ||||
| * the normal used in the renderer points inward. It is generated | * Should this ever change this negate must be removed. */ | ||||
| * this way in calc_vertexnormals(). Should this ever change | |||||
| * this negate must be removed. */ | |||||
| texres->nor[0] = -2.0f * (texres->tr - 0.5f); | texres->nor[0] = -2.0f * (texres->tr - 0.5f); | ||||
| texres->nor[1] = 2.0f * (texres->tg - 0.5f); | texres->nor[1] = 2.0f * (texres->tg - 0.5f); | ||||
| texres->nor[2] = 2.0f * (texres->tb - 0.5f); | texres->nor[2] = 2.0f * (texres->tb - 0.5f); | ||||
| } | } | ||||
| /* de-premul, this is being pre-multiplied in shade_input_do_shade() */ | /* de-premul, this is being pre-multiplied in shade_input_do_shade() */ | ||||
| /* do not de-premul for generated alpha, it is already in straight */ | /* do not de-premul for generated alpha, it is already in straight */ | ||||
| if (texres->ta != 1.0f && texres->ta > 1e-4f && !(tex->imaflag & TEX_CALCALPHA)) { | if (texres->ta != 1.0f && texres->ta > 1e-4f && !(tex->imaflag & TEX_CALCALPHA)) { | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||