diff options
author | Thomas Dinges <blender@dingto.org> | 2013-11-20 22:09:24 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-11-20 22:13:41 +0400 |
commit | 30512d7c5586189d02e2b2e71d0d5257b0713a16 (patch) | |
tree | 02334b133a038c3127abcec82d5738e54ce59347 /source/blender/render | |
parent | d232486b4093fbc306dadbc21bd3fde81284364d (diff) |
Blender Internal:
* Remove Stars feature. This was a quite minimalistic feature and there are
better alternatives with more control (particles for example).
Removal discussed during BCon13 developer meeting and already years before, time to do it..
Reviewed By: brecht
Differential Revision: http://developer.blender.org/D17
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/extern/include/RE_pipeline.h | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 176 |
2 files changed, 0 insertions, 180 deletions
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 79826a63690..109524c9814 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -247,10 +247,6 @@ int RE_WriteEnvmapResult(struct ReportList *reports, struct Scene *scene, struct /* do a full sample buffer compo */ void RE_MergeFullSample(struct Render *re, struct Main *bmain, struct Scene *sce, struct bNodeTree *ntree); -/* ancient stars function... go away! */ -void RE_make_stars(struct Render *re, struct Scene *scenev3d, void (*initfunc)(void), - void (*vertexfunc)(const float *), void (*termfunc)(void)); - /* display and event callbacks */ void RE_display_init_cb (struct Render *re, void *handle, void (*f)(void *handle, RenderResult *rr)); void RE_display_clear_cb(struct Render *re, void *handle, void (*f)(void *handle, RenderResult *rr)); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index b4873e7d310..c5c804e9700 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -160,175 +160,6 @@ static HaloRen *initstar(Render *re, ObjectRen *obr, const float vec[3], float h return har; } -/* there must be a 'fixed' amount of stars generated between - * near and far - * all stars must by preference lie on the far and solely - * differ in clarity/color - */ - -void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void), - void (*vertexfunc)(const float *), void (*termfunc)(void)) -{ - extern unsigned char hash[512]; - ObjectRen *obr= NULL; - World *wrld= NULL; - HaloRen *har; - Scene *scene; - Object *camera; - Camera *cam; - RNG *rng; - double dblrand, hlfrand; - float vec[4], fx, fy, fz; - float fac, starmindist, clipend; - float mat[4][4], stargrid, maxrand, maxjit, force, alpha; - int x, y, z, sx, sy, sz, ex, ey, ez, done = FALSE; - unsigned int totstar= 0; - - if (initfunc) { - scene= scenev3d; - wrld= scene->world; - } - else { - scene= re->scene; - wrld= &(re->wrld); - } - - stargrid = wrld->stardist; /* distance between stars */ - maxrand = 2.0; /* amount a star can be shifted (in grid units) */ - maxjit = (wrld->starcolnoise); /* amount a color is being shifted */ - - /* size of stars */ - force = ( wrld->starsize ); - - /* minimal free space (starting at camera) */ - starmindist= wrld->starmindist; - - if (stargrid <= 0.10f) return; - - if (re) re->flag |= R_HALO; - else stargrid *= 1.0f; /* then it draws fewer */ - - if (re) invert_m4_m4(mat, re->viewmat); - else unit_m4(mat); - - /* BOUNDING BOX CALCULATION - * bbox goes from z = loc_near_var | loc_far_var, - * x = -z | +z, - * y = -z | +z - */ - - camera= re ? RE_GetCamera(re) : scene->camera; - - if (camera==NULL || camera->type != OB_CAMERA) - return; - - cam = camera->data; - clipend = cam->clipend; - - /* convert to grid coordinates */ - - sx = ((mat[3][0] - clipend) / stargrid) - maxrand; - sy = ((mat[3][1] - clipend) / stargrid) - maxrand; - sz = ((mat[3][2] - clipend) / stargrid) - maxrand; - - ex = ((mat[3][0] + clipend) / stargrid) + maxrand; - ey = ((mat[3][1] + clipend) / stargrid) + maxrand; - ez = ((mat[3][2] + clipend) / stargrid) + maxrand; - - dblrand = maxrand * stargrid; - hlfrand = 2.0 * dblrand; - - if (initfunc) { - initfunc(); - } - - if (re) /* add render object for stars */ - obr= RE_addRenderObject(re, NULL, NULL, 0, 0, 0); - - rng = BLI_rng_new(0); - - for (x = sx, fx = sx * stargrid; x <= ex; x++, fx += stargrid) { - for (y = sy, fy = sy * stargrid; y <= ey; y++, fy += stargrid) { - for (z = sz, fz = sz * stargrid; z <= ez; z++, fz += stargrid) { - - BLI_rng_seed(rng, (hash[z & 0xff] << 24) + (hash[y & 0xff] << 16) + (hash[x & 0xff] << 8)); - vec[0] = fx + (hlfrand * BLI_rng_get_double(rng)) - dblrand; - vec[1] = fy + (hlfrand * BLI_rng_get_double(rng)) - dblrand; - vec[2] = fz + (hlfrand * BLI_rng_get_double(rng)) - dblrand; - vec[3] = 1.0; - - if (vertexfunc) { - if (done & 1) vertexfunc(vec); - done++; - } - else { - if (re) - mul_m4_v3(re->viewmat, vec); - - /* in vec are global coordinates - * calculate distance to camera - * and using that, define the alpha - */ - alpha = len_v3(vec); - - if (alpha >= clipend) alpha = 0.0; - else if (alpha <= starmindist) alpha = 0.0; - else if (alpha <= 2.0f * starmindist) { - alpha = (alpha - starmindist) / starmindist; - } - else { - alpha -= 2.0f * starmindist; - alpha /= (clipend - 2.0f * starmindist); - alpha = 1.0f - alpha; - } - - - if (alpha != 0.0f) { - fac = force * BLI_rng_get_double(rng); - - har = initstar(re, obr, vec, fac); - - if (har) { - har->alfa = sqrt(sqrt(alpha)); - har->add= 255; - har->r = har->g = har->b = 1.0; - if (maxjit) { - har->r += ((maxjit * BLI_rng_get_double(rng)) ) - maxjit; - har->g += ((maxjit * BLI_rng_get_double(rng)) ) - maxjit; - har->b += ((maxjit * BLI_rng_get_double(rng)) ) - maxjit; - } - har->hard = 32; - har->lay= -1; - har->type |= HA_ONLYSKY; - done++; - } - } - } - - /* break out of the loop if generating stars takes too long */ - if (re && !(totstar % 1000000)) { - if (re->test_break(re->tbh)) { - x= ex + 1; - y= ey + 1; - z= ez + 1; - } - } - - totstar++; - } - /* do not call blender_test_break() here, since it is used in UI as well, confusing the callback system */ - /* main cause is G.is_break of course, a global again... (ton) */ - } - } - if (termfunc) termfunc(); - - if (obr) - re->tothalo += obr->tothalo; - - BLI_rng_free(rng); -} - - /* ------------------------------------------------------------------------- */ /* tool functions/defines for ad hoc simplification and possible future * cleanup */ @@ -5370,13 +5201,6 @@ void RE_Database_Preprocess(Render *re) /* don't sort stars */ tothalo= re->tothalo; - if (!re->test_break(re->tbh)) { - if (re->wrld.mode & WO_STARS) { - re->i.infostr = IFACE_("Creating Starfield"); - re->stats_draw(re->sdh, &re->i); - RE_make_stars(re, NULL, NULL, NULL, NULL); - } - } sort_halos(re, tothalo); init_camera_inside_volumes(re); |