diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-16 22:38:03 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-16 22:38:03 +0400 |
commit | 92436c94d3adbbfc285bd7b3041db36e66dae5d5 (patch) | |
tree | 2083c8ad4fa810a781e9631161aa88b12008453d /source/blender/render | |
parent | 90ed5ea4ea278b4aadf9187e4e2b92ef3221001b (diff) | |
parent | fda8927d01ba719963154a56b45952ee541a869d (diff) |
Merged changes in the trunk up to revision 54594.
Diffstat (limited to 'source/blender/render')
6 files changed, 23 insertions, 13 deletions
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 55dadc14989..12286fc9999 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -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; + } } } diff --git a/source/blender/render/intern/source/multires_bake.c b/source/blender/render/intern/source/multires_bake.c index 89f67335c39..ea42049989b 100644 --- a/source/blender/render/intern/source/multires_bake.c +++ b/source/blender/render/intern/source/multires_bake.c @@ -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 } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 73c3b1c9366..05601a6b5e6 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -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); diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index 11c6356f9c5..be1a3806e43 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -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 */ diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 3ea94981cac..15ca865643b 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -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 */ diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 77d6644479a..92099060bf5 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -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; } } |