- when not F10->"Ray" option is set, materials with "Ray Transp" will

render solid now (no alpha).
- This gives nicer previews, but also makes envmaps look better, since
  environment maps are rendered without raytracing
- I decided not to raytrace envmaps mainly because of speed... if you use
  environment maps you want something quick... otherwise just use ray_mir
  material here!
This commit is contained in:
Ton Roosendaal
2004-01-23 22:33:33 +00:00
parent 1b3145c575
commit 9c6662e4e0
3 changed files with 13 additions and 2 deletions

View File

@@ -502,10 +502,13 @@ void render_envmap(EnvMap *env)
void make_envmaps()
{
Tex *tex;
int do_init= 0, depth= 0;
int do_init= 0, depth= 0, trace;
if (!(R.r.mode & R_ENVMAP)) return;
/* we dont raytrace, disabling the flag will cause ray_transp render solid */
trace= (R.r.mode & R_RAYTRACE);
R.r.mode &= ~R_RAYTRACE;
/* 5 = hardcoded max recursion level */
while(depth<5) {
@@ -556,6 +559,9 @@ void make_envmaps()
RE_local_clear_render_display(R.win);
allqueue(REDRAWBUTSSHADING, 0); // bad!
}
// restore
R.r.mode |= trace;
}
/* ------------------------------------------------------------------------- */

View File

@@ -81,6 +81,7 @@ void prepareScene()
/* octree */
if(R.r.mode & R_RAYTRACE) makeoctree();
}
}

View File

@@ -2475,6 +2475,10 @@ void *shadepixel(float x, float y, int vlaknr, int mask, float *col)
ray_trace(&shi, &shr, mask);
}
}
else {
// doesnt look 'correct', but is better for preview, plus envmaps dont raytrace this
if(shi.mat->mode & MA_RAYTRANSP) shr.alpha= 1.0;
}
VecAddf(col, shr.diff, shr.spec);