- Normalized normal vector after perterbing normals to stop

artifacts in displace preview.
This commit is contained in:
Robert Wenzlaff
2004-01-11 19:53:20 +00:00
parent 3f98fc4d61
commit 1b233917ad
2 changed files with 5 additions and 4 deletions

View File

@@ -3187,7 +3187,7 @@ void displace_render_vert(ShadeInput *shi, VertRen *vr, float *scale)
shi->displace[0]= shi->displace[1]= shi->displace[2]= 0.0;
do_material_tex(shi);
/* 0.5 could become button once? */
vr->co[0] += 0.5 * shi->displace[0] * scale[0] ;
vr->co[1] += 0.5 * shi->displace[1] * scale[1] ;

View File

@@ -790,9 +790,10 @@ static void shade_preview_pixel(ShadeInput *shi, float *vec, int x, int y,char *
alpha= mat->alpha;
if(mat->mapto & MAP_DISPLACE) { /* Quick hack of fake displacement preview */
shi->vn[0]-=2.0*shi->displace[0];
shi->vn[1]-=2.0*shi->displace[1];
shi->vn[2]+=2.0*shi->displace[2];
shi->vn[0]-=2.0*shi->displace[2];
shi->vn[1]-=2.0*shi->displace[0];
shi->vn[2]+=2.0*shi->displace[1];
Normalise(shi->vn);
}
if(mat->mode & (MA_ZTRA|MA_RAYTRANSP))