- Normalized normal vector after perterbing normals to stop
artifacts in displace preview.
This commit is contained in:
@@ -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] ;
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user