- Better fake for displace preview.

This commit is contained in:
Robert Wenzlaff 2004-01-11 00:39:17 +00:00
parent 3406d3a939
commit bbe7d8d08e
2 changed files with 4 additions and 6 deletions

@ -1214,8 +1214,7 @@ void do_material_tex(ShadeInput *shi)
if( mtex->mapto & MAP_DISPLACE ) {
/* Now that most textures offer both Nor and Intensity, allow */
/* both to work, and let user select with slider. However Nor slider */
/* goes to 5.0 while var only goes to 1.0, so we introduce a factor of 0.2 */
/* both to work, and let user select with slider. */
if(tex->nor) {
if(mtex->maptoneg & MAP_DISPLACE) tex->norfac= -mtex->norfac;
else tex->norfac= mtex->norfac;

@ -790,10 +790,9 @@ 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]+=5.0*(shi->displace[1]+shi->displace[2]);
shi->vn[1]+=5.0*(shi->displace[0]+shi->displace[2]);
shi->vn[2]+=5.0*(shi->displace[0]+shi->displace[1]);
Normalise(shi->vn);
shi->vn[0]-=2.0*shi->displace[0];
shi->vn[1]-=2.0*shi->displace[1];
shi->vn[2]+=2.0*shi->displace[2];
}
if(mat->mode & (MA_ZTRA|MA_RAYTRANSP))