diff options
author | Matt Ebb <matt@mke3.net> | 2010-03-11 10:43:49 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-03-11 10:43:49 +0300 |
commit | 69a7060678e96b53548a14f22a83510f4d9edcd0 (patch) | |
tree | fb71d769da6be215a184099a7e059f431066982c /source/blender/render | |
parent | 5ec57e80b059be1989bcf4df3ab9f235669f34cc (diff) |
Restored Environment maps
* Fixed up RNA and UI
* Brought back 'Save' and 'Clear' operators (in the little triangle menu in
environment map properties)
* While I was at it, noticed that environment maps were only using 8bit
colour, changed it to use full 32bit float instead for proper HDR colour etc,
so environment map reflections have the correct colour range
--> http://mke3.net/blender/devel/2.5/env_hdr.jpg
This fixes [#20904] Environment Map does not render; also missing panel
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/envmap.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 5a69bcb45bd..c455a229d63 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -81,7 +81,7 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf) } else { for(part=0; part<6; part++) { - env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect, 0); + env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect|IB_rectfloat, 0); } IMB_rectcpy(env->cube[0], ibuf, 0, 0, 0, 0, dx, dx); @@ -442,17 +442,18 @@ static void render_envmap(Render *re, EnvMap *env) if(re->test_break(re->tbh)==0) { RenderLayer *rl= envre->result->layers.first; int y; - char *alpha; + float *alpha; - ibuf= IMB_allocImBuf(envre->rectx, envre->recty, 24, IB_rect, 0); - ibuf->rect_float= rl->rectf; - IMB_rect_from_float(ibuf); - ibuf->rect_float= NULL; + ibuf= IMB_allocImBuf(envre->rectx, envre->recty, 24, IB_rect|IB_rectfloat, 0); + memcpy(ibuf->rect_float, rl->rectf, ibuf->channels * ibuf->x * ibuf->y * sizeof(float)); + + if (re->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) + ibuf->profile = IB_PROFILE_LINEAR_RGB; /* envmap renders without alpha */ - alpha= ((char *)ibuf->rect)+3; + alpha= ((float *)ibuf->rect_float)+3; for(y= ibuf->x*ibuf->y - 1; y>=0; y--, alpha+=4) - *alpha= 255; + *alpha= 1.0; env->cube[part]= ibuf; } |