Merged changes in the trunk up to revision 54594.
This commit is contained in:
@@ -1042,6 +1042,10 @@ static void image_mipmap_test(Tex *tex, ImBuf *ibuf)
|
||||
IMB_makemipmap(ibuf, tex->imaflag & TEX_GAUSS_MIP);
|
||||
BLI_unlock_thread(LOCK_IMAGE);
|
||||
}
|
||||
/* if no mipmap could be made, fall back on non-mipmap render */
|
||||
if (ibuf->mipmap[0] == NULL) {
|
||||
tex->imaflag &= ~TEX_MIPMAP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -938,17 +938,18 @@ static void build_permutation_table(unsigned short permutation[], unsigned short
|
||||
permutation[i] = temp_permutation[entry];
|
||||
|
||||
/* delete entry */
|
||||
for(k = entry; k < nr_entries_left - 1; k++)
|
||||
for (k = entry; k < nr_entries_left - 1; k++) {
|
||||
temp_permutation[k] = temp_permutation[k + 1];
|
||||
}
|
||||
}
|
||||
|
||||
/* verify permutation table
|
||||
* every entry must appear exactly once
|
||||
*/
|
||||
#if 0
|
||||
for(i = 0; i < number_of_rays; i++) temp_permutation[i] = 0;
|
||||
for(i = 0; i < number_of_rays; i++) ++temp_permutation[permutation[i]];
|
||||
for(i = 0; i < number_of_rays; i++) BLI_assert(temp_permutation[i] == 1);
|
||||
for (i = 0; i < number_of_rays; i++) temp_permutation[i] = 0;
|
||||
for (i = 0; i < number_of_rays; i++) ++temp_permutation[permutation[i]];
|
||||
for (i = 0; i < number_of_rays; i++) BLI_assert(temp_permutation[i] == 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1338,6 +1338,7 @@ static void render_scene(Render *re, Scene *sce, int cfra)
|
||||
resc->main = re->main;
|
||||
resc->scene = sce;
|
||||
resc->lay = sce->lay;
|
||||
resc->scene_color_manage = BKE_scene_check_color_management_enabled(sce);
|
||||
|
||||
/* ensure scene has depsgraph, base flags etc OK */
|
||||
BKE_scene_set_background(re->main, sce);
|
||||
|
||||
@@ -1101,6 +1101,10 @@ ImBuf *render_result_rect_to_ibuf(RenderResult *rr, RenderData *rd)
|
||||
if (BKE_imtype_valid_depths(rd->im_format.imtype) & (R_IMF_CHAN_DEPTH_12 | R_IMF_CHAN_DEPTH_16 | R_IMF_CHAN_DEPTH_24 | R_IMF_CHAN_DEPTH_32)) {
|
||||
IMB_float_from_rect(ibuf);
|
||||
}
|
||||
else {
|
||||
/* ensure no float buffer remained from previous frame */
|
||||
ibuf->rect_float = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* color -> grayscale */
|
||||
|
||||
@@ -171,9 +171,9 @@ static void tex_normal_derivate(Tex *tex, TexResult *texres)
|
||||
do_colorband(tex->coba, texres->nor[2], col);
|
||||
fac3= (col[0]+col[1]+col[2]);
|
||||
|
||||
texres->nor[0]= 0.3333f*(fac0 - fac1);
|
||||
texres->nor[1]= 0.3333f*(fac0 - fac2);
|
||||
texres->nor[2]= 0.3333f*(fac0 - fac3);
|
||||
texres->nor[0]= (fac0 - fac1) / 3.0f;
|
||||
texres->nor[1]= (fac0 - fac2) / 3.0f;
|
||||
texres->nor[2]= (fac0 - fac3) / 3.0f;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1754,7 +1754,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
|
||||
/* center, main return value */
|
||||
texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
|
||||
rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres, pool);
|
||||
cd = fromrgb ? (texres->tr + texres->tg + texres->tb)*0.33333333f : texres->tin;
|
||||
cd = fromrgb ? (texres->tr + texres->tg + texres->tb) / 3.0f : texres->tin;
|
||||
|
||||
if (mtex->texco == TEXCO_UV) {
|
||||
/* for the uv case, use the same value for both du/dv,
|
||||
@@ -1768,7 +1768,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
|
||||
tco[2] = 0.f;
|
||||
texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
|
||||
multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
|
||||
ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
|
||||
ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
|
||||
|
||||
/* +v val */
|
||||
tco[0] = co[0] + compat_bump->dudnv*du;
|
||||
@@ -1776,7 +1776,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
|
||||
tco[2] = 0.f;
|
||||
texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
|
||||
multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
|
||||
vd = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
|
||||
vd = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
|
||||
}
|
||||
else {
|
||||
float tu[3], tv[3];
|
||||
@@ -1810,7 +1810,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
|
||||
tco[2] = co[2] + tu[2]*du;
|
||||
texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
|
||||
multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
|
||||
ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
|
||||
ud = idu*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
|
||||
|
||||
/* +v val */
|
||||
tco[0] = co[0] + tv[0]*dv;
|
||||
@@ -1818,7 +1818,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
|
||||
tco[2] = co[2] + tv[2]*dv;
|
||||
texco_mapping(shi, tex, mtex, tco, dx, dy, texv, dxt, dyt);
|
||||
multitex_mtex(shi, mtex, texv, dxt, dyt, &ttexr, pool);
|
||||
vd = idv*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb)*0.33333333f : ttexr.tin));
|
||||
vd = idv*(cd - (fromrgb ? (ttexr.tr + ttexr.tg + ttexr.tb) / 3.0f : ttexr.tin));
|
||||
}
|
||||
|
||||
/* bumped normal */
|
||||
|
||||
@@ -185,7 +185,7 @@ static void load_frame_image_sequence(VoxelData *vd, Tex *tex)
|
||||
for (y = 0; y < ibuf->y; y++) {
|
||||
for (x = 0; x < ibuf->x; x++) {
|
||||
/* currently averaged to monchrome */
|
||||
vd->dataset[BLI_VOXEL_INDEX(x, y, z, vd->resol)] = (rf[0] + rf[1] + rf[2]) * 0.333f;
|
||||
vd->dataset[BLI_VOXEL_INDEX(x, y, z, vd->resol)] = (rf[0] + rf[1] + rf[2]) / 3.0f;
|
||||
rf += 4;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user