From Eeshlo: fixed bug with dupliverted lamps not exporting. Also now it

skips envmaps, octree and radiosity when yafray is enabled.
This commit is contained in:
Alejandro Conty Estevez
2004-01-09 08:31:23 +00:00
parent cef4ef250c
commit aba8ca4440
2 changed files with 26 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
/**
/**
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
@@ -69,29 +69,37 @@ void prepareScene()
if(R.la[a]->shb) makeshadowbuf(R.la[a]);
}
/* RADIO */
if(R.r.mode & R_RADIO) do_radio_render();
/* yafray: 'direct' radiosity, environment maps and octree init not needed for yafray render */
/* although radio mode could be useful at some point, later */
if ((R.r.mode & R_YAFRAY)==0) {
/* ENVIRONMENT MAPS */
make_envmaps();
/* octree */
if(R.r.mode & R_RAYTRACE) makeoctree();
/* RADIO */
if(R.r.mode & R_RADIO) do_radio_render();
/* ENVIRONMENT MAPS */
make_envmaps();
/* octree */
if(R.r.mode & R_RAYTRACE) makeoctree();
}
}
void finalizeScene(void)
{
extern void freeoctree(void);
/* Among other things, it releases the shadow buffers. */
RE_local_free_renderdata();
if(R.r.mode & R_RAYTRACE) freeoctree();
/* yafray: freeoctree not needed after yafray render, not initialized, see above */
if ((R.r.mode & R_YAFRAY)==0) {
if(R.r.mode & R_RAYTRACE) freeoctree();
}
}
void doClipping( void (*projectfunc)(float *, float *) )
{
setzbufvlaggen(projectfunc);
setzbufvlaggen(projectfunc);
}
/* eof */

View File

@@ -2945,8 +2945,9 @@ void RE_rotateBlenderScene(void)
This is based on the assumption that OB_DONE is only set for duplivert objects,
before scene conversion, there are no other flags set to indicate it's use as far as I know...
A special flag only used by yafray is set to indicate this object is the 'source' object
of which all other duplivert objects are an instance of. */
if (R.r.mode & R_YAFRAY) {
of which all other duplivert objects are an instance of.
Correction: NOT done for lamps, these are included as separate objects, see below */
if ((ob->type!=OB_LAMP) && (R.r.mode & R_YAFRAY)) {
printf("Adding %s to renderlist\n", ob->id.name);
ob->flag &= ~OB_DONE;
init_render_object(ob);
@@ -2995,8 +2996,9 @@ void RE_rotateBlenderScene(void)
if(obd->type!=OB_MBALL) {
/* yafray: special handling of duplivert objects for yafray:
only the matrix is stored, together with the source object name.
Since the original object is needed as well, it is included in the renderlist (see above) */
if (R.r.mode & R_YAFRAY) {
Since the original object is needed as well, it is included in the renderlist (see above)
correction: NOT done for lamps, these need to be included as normal lamps separately */
if ((obd->type!=OB_LAMP) && (R.r.mode & R_YAFRAY)) {
printf("Adding dupli matrix for object %s\n", obd->id.name);
YAF_addDupliMtx(obd);
}
@@ -3218,7 +3220,7 @@ void displace_render_face(VlakRen *vlr, float *scale)
/* We want to split the quad along the opposite verts that are */
/* closest in displace value. This will help smooth edges. */
if ( fabs(vlr->v1->accum - vlr->v3->accum) > fabs(vlr->v2->accum - vlr->v4->accum))
vlr->flag |= R_DIVIDE_24;
vlr->flag |= R_DIVIDE_24;
else vlr->flag & ~R_DIVIDE_24;
}
}