diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-23 17:04:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-23 17:04:01 +0400 |
commit | 9494340dae7dd5e3ee070d8e550596a440648870 (patch) | |
tree | e73e1b3ede7373db7b8e26db687941b4669b9244 /source/blender/render | |
parent | 74e21161e327a0f91ecef0f8dd1bce65c9e2ef4b (diff) | |
parent | a7891da84bfad1f0cd0f3fc825e7f4dedf469a00 (diff) |
svn merge ^/trunk/blender -r40432:40491
Diffstat (limited to 'source/blender/render')
5 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 5c5162d268b..93038984115 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -226,8 +226,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3]) } /* shadow */ - if(i> -0.41f) { /* heuristic valua! */ - shadfac= 1.0; + if(i> -0.41f) { /* heuristic valua! */ if(lar->shb) { shadfac = testshadowbuf(&R, lar->shb, rco, dco, dco, inp, 0.0f); if(shadfac==0.0f) continue; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 641fec90cf3..8d953ccc73d 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -747,7 +747,7 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex { PluginTex *pit; int rgbnor=0; - float result[ 8 ]; + float result[8]= {0.0f}; texres->tin= 0.0; @@ -1906,6 +1906,8 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T const int fromrgb = ((tex->type == TEX_IMAGE) || ((tex->flag & TEX_COLORBAND)!=0)); float Hscale = Tnor*mtex->norfac; int dimx=512, dimy=512; + const int imag_tspace_dimension_x = 1024; // only used for texture space variant + float aspect = 1.0f; // 2 channels for 2D texture and 3 for 3D textures. const int nr_channels = (mtex->texco == TEXCO_UV)? 2 : 3; @@ -1938,6 +1940,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T if (ibuf) { dimx = ibuf->x; dimy = ibuf->y; + aspect = ((float) dimy) / dimx; } } @@ -2111,12 +2114,13 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T if(tex->ima) { // crazy hack solution that gives results similar to normal mapping - part 2 float vec[2]; + const float imag_tspace_dimension_y = aspect*imag_tspace_dimension_x; - vec[0] = dimx*dxt[0]; - vec[1] = dimy*dxt[1]; + vec[0] = imag_tspace_dimension_x*dxt[0]; + vec[1] = imag_tspace_dimension_y*dxt[1]; dHdx *= 1.0f/len_v2(vec); - vec[0] = dimx*dyt[0]; - vec[1] = dimy*dyt[1]; + vec[0] = imag_tspace_dimension_x*dyt[0]; + vec[1] = imag_tspace_dimension_y*dyt[1]; dHdy *= 1.0f/len_v2(vec); } } diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index d8231c7e7d4..956a3d4de7c 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -1368,7 +1368,7 @@ void shade_samples_do_AO(ShadeSample *ssamp) if(((shi->passflag & SCE_PASS_COMBINED) && (shi->combinedflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT))) || (shi->passflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT))) - for(sample=0, shi= ssamp->shi; sample<ssamp->tot; shi++, sample++) + for(sample=0; sample<ssamp->tot; shi++, sample++) if(!(shi->mode & MA_SHLESS)) ambient_occlusion(shi); /* stores in shi->ao[] */ } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 41d12c6065e..c808d930e7c 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -726,7 +726,7 @@ static float Toon_Diff( float *n, float *l, float *UNUSED(v), float size, float /* in latter case, only last multiplication uses 'nl' */ static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough ) { - float i/*, nh*/, nv, vh, realnl, h[3]; + float i/*, nh*/, nv /*, vh */, realnl, h[3]; float a, b, t, A, B; float Lit_A, View_A, Lit_B[3], View_B[3]; @@ -745,8 +745,8 @@ static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough if(realnl<=0.0f) return 0.0f; if(nl<0.0f) return 0.0f; /* value from area light */ - vh= v[0]*h[0]+v[1]*h[1]+v[2]*h[2]; /* Dot product between view vector and halfway vector */ - if(vh<=0.0f) vh= 0.0f; + /* vh= v[0]*h[0]+v[1]*h[1]+v[2]*h[2]; */ /* Dot product between view vector and halfway vector */ + /* if(vh<=0.0f) vh= 0.0f; */ Lit_A = saacos(realnl); View_A = saacos( nv ); diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index b63ece80119..464cbf72326 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -389,7 +389,7 @@ int voxeldatatex(struct Tex *tex, const float texvec[3], struct TexResult *texre VoxelData *vd = tex->vd; float co[3], offset[3] = {0.5, 0.5, 0.5}; - if ((!vd) || (vd->dataset==NULL)) { + if (vd->dataset==NULL) { texres->tin = 0.0f; return 0; } |