[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22796] branches/blender2.5/blender/source /blender/render/intern: * Hopefully fix some weird merging business
Matt Ebb
matt at mke3.net
Wed Aug 26 08:51:27 CEST 2009
Revision: 22796
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22796
Author: broken
Date: 2009-08-26 08:51:26 +0200 (Wed, 26 Aug 2009)
Log Message:
-----------
* Hopefully fix some weird merging business
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/render/intern/include/volume_precache.h
branches/blender2.5/blender/source/blender/render/intern/source/volumetric.c
Modified: branches/blender2.5/blender/source/blender/render/intern/include/volume_precache.h
===================================================================
--- branches/blender2.5/blender/source/blender/render/intern/include/volume_precache.h 2009-08-26 06:17:39 UTC (rev 22795)
+++ branches/blender2.5/blender/source/blender/render/intern/include/volume_precache.h 2009-08-26 06:51:26 UTC (rev 22796)
@@ -1,4 +1,3 @@
-<<<<<<< .mine
/**
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -31,39 +30,4 @@
void free_volume_precache(Render *re);
int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co);
-#define VOL_MS_TIMESTEP 0.1f=======
-/**
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Matt Ebb.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-void volume_precache(Render *re);
-void free_volume_precache(Render *re);
-int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co);
-int using_lightcache(Material *ma);
-
-#define VOL_MS_TIMESTEP 0.1f
->>>>>>> .r22793
+#define VOL_MS_TIMESTEP 0.1f
\ No newline at end of file
Modified: branches/blender2.5/blender/source/blender/render/intern/source/volumetric.c
===================================================================
--- branches/blender2.5/blender/source/blender/render/intern/source/volumetric.c 2009-08-26 06:17:39 UTC (rev 22795)
+++ branches/blender2.5/blender/source/blender/render/intern/source/volumetric.c 2009-08-26 06:51:26 UTC (rev 22796)
@@ -1,4 +1,3 @@
-<<<<<<< .mine
/**
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -686,693 +685,4 @@
volume_trace(shi, shr, VOL_SHADE_INSIDE);
shi->mat = mat_backup;
-}=======
-/**
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary)
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <float.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_rand.h"
-#include "BLI_voxel.h"
-
-#include "RE_shader_ext.h"
-#include "RE_raytrace.h"
-
-#include "DNA_material_types.h"
-#include "DNA_group_types.h"
-#include "DNA_lamp_types.h"
-
-#include "BKE_global.h"
-
-#include "render_types.h"
-#include "pixelshading.h"
-#include "shading.h"
-#include "texture.h"
-#include "volumetric.h"
-#include "volume_precache.h"
-
-#if defined( _MSC_VER ) && !defined( __cplusplus )
-# define inline __inline
-#endif // defined( _MSC_VER ) && !defined( __cplusplus )
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */
-/* only to be used here in this file, it's for speed */
-extern struct Render R;
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-
-/* tracing */
-
-static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type)
-{
- float maxsize = RE_ray_tree_max_size(R.raytree);
-
- /* XXX TODO - get raytrace max distance from object instance's bounding box */
- /* need to account for scaling only, but keep coords in camera space...
- * below code is WIP and doesn't work!
- VecSubf(bb_dim, shi->obi->obr->boundbox[1], shi->obi->obr->boundbox[2]);
- Mat3MulVecfl(shi->obi->nmat, bb_dim);
- maxsize = VecLength(bb_dim);
- */
-
- VECCOPY(isect->start, co);
- isect->end[0] = co[0] + vec[0] * maxsize;
- isect->end[1] = co[1] + vec[1] * maxsize;
- isect->end[2] = co[2] + vec[2] * maxsize;
-
- isect->mode= RE_RAY_MIRROR;
- isect->oborig= RAY_OBJECT_SET(&R, shi->obi);
- isect->face_last= NULL;
- isect->ob_last= 0;
- isect->lay= -1;
-
- if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr;
- else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL;
-
- if(RE_ray_tree_intersect(R.raytree, isect))
- {
- hitco[0] = isect->start[0] + isect->labda*isect->vec[0];
- hitco[1] = isect->start[1] + isect->labda*isect->vec[1];
- hitco[2] = isect->start[2] + isect->labda*isect->vec[2];
- return 1;
- } else {
- return 0;
- }
-}
-
-static void shade_intersection(ShadeInput *shi, float *col, Isect *is)
-{
- ShadeInput shi_new;
- ShadeResult shr_new;
-
- memset(&shi_new, 0, sizeof(ShadeInput));
-
- shi_new.mask= shi->mask;
- shi_new.osatex= shi->osatex;
- shi_new.thread= shi->thread;
- shi_new.depth = shi->depth + 1;
- shi_new.volume_depth= shi->volume_depth + 1;
- shi_new.xs= shi->xs;
- shi_new.ys= shi->ys;
- shi_new.lay= shi->lay;
- shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */
- shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */
- shi_new.light_override= shi->light_override;
- shi_new.mat_override= shi->mat_override;
-
- VECCOPY(shi_new.camera_co, is->start);
-
- memset(&shr_new, 0, sizeof(ShadeResult));
-
- /* hardcoded limit of 100 for now - prevents problems in weird geometry */
- if (shi->volume_depth < 100) {
- shade_ray(is, &shi_new, &shr_new);
- }
-
- VecCopyf(col, shr_new.combined);
- col[3] = shr_new.alpha;
-}
-
-static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col)
-{
- Isect isect;
- float maxsize = RE_ray_tree_max_size(R.raytree);
-
- VECCOPY(isect.start, co);
- isect.end[0] = isect.start[0] + shi->view[0] * maxsize;
- isect.end[1] = isect.start[1] + shi->view[1] * maxsize;
- isect.end[2] = isect.start[2] + shi->view[2] * maxsize;
-
- isect.faceorig= (RayFace *)vlr;
-
- isect.mode= RE_RAY_MIRROR;
- isect.oborig= RAY_OBJECT_SET(&R, shi->obi);
- isect.face_last= NULL;
- isect.ob_last= 0;
- isect.lay= -1;
-
- /* check to see if there's anything behind the volume, otherwise shade the sky */
- if(RE_ray_tree_intersect(R.raytree, &isect)) {
- shade_intersection(shi, col, &isect);
- } else {
- shadeSkyView(col, co, shi->view, NULL, shi->thread);
- shadeSunView(col, shi->view);
- }
-}
-
-/* input shader data */
-
-float vol_get_stepsize(struct ShadeInput *shi, int context)
-{
- if (shi->mat->vol.stepsize_type == MA_VOL_STEP_RANDOMIZED) {
- /* range between 0.75 and 1.25 */
- const float rnd = 0.5f * BLI_thread_frand(shi->thread) + 0.75f;
-
- if (context == STEPSIZE_VIEW)
- return shi->mat->vol.stepsize * rnd;
- else if (context == STEPSIZE_SHADE)
- return shi->mat->vol.shade_stepsize * rnd;
- }
- else { // MA_VOL_STEP_CONSTANT
-
- if (context == STEPSIZE_VIEW)
- return shi->mat->vol.stepsize;
- else if (context == STEPSIZE_SHADE)
- return shi->mat->vol.shade_stepsize;
- }
-
- return shi->mat->vol.stepsize;
-}
-
-/* trilinear interpolation */
-static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co)
-{
- VolumePrecache *vp = shi->obi->volume_precache;
- float bbmin[3], bbmax[3], dim[3];
- float sample_co[3];
-
- if (!vp) return;
-
- /* convert input coords to 0.0, 1.0 */
- VECCOPY(bbmin, shi->obi->obr->boundbox[0]);
- VECCOPY(bbmax, shi->obi->obr->boundbox[1]);
- VecSubf(dim, bbmax, bbmin);
-
- sample_co[0] = ((co[0] - bbmin[0]) / dim[0]);
- sample_co[1] = ((co[1] - bbmin[1]) / dim[1]);
- sample_co[2] = ((co[2] - bbmin[2]) / dim[2]);
-
- scatter_col[0] = voxel_sample_trilinear(vp->data_r, vp->res, sample_co);
- scatter_col[1] = voxel_sample_trilinear(vp->data_g, vp->res, sample_co);
- scatter_col[2] = voxel_sample_trilinear(vp->data_b, vp->res, sample_co);
-}
-
-float vol_get_density(struct ShadeInput *shi, float *co)
-{
- float density = shi->mat->vol.density;
- float density_scale = shi->mat->vol.density_scale;
- float col[3] = {0.0, 0.0, 0.0};
-
- do_volume_tex(shi, co, MAP_DENSITY, col, &density);
-
- return density * density_scale;
-}
-
-/* scattering multiplier, values above 1.0 are non-physical,
- * but can be useful to tweak lighting */
-float vol_get_scattering_fac(ShadeInput *shi, float *co)
-{
- float scatter = shi->mat->vol.scattering;
- float col[3] = {0.0, 0.0, 0.0};
-
- do_volume_tex(shi, co, MAP_SCATTERING, col, &scatter);
-
- return scatter;
-}
-
-/* compute emission component, amount of radiance to add per segment
- * can be textured with 'emit' */
-void vol_get_emission(ShadeInput *shi, float *emission_col, float *co, float density)
-{
- float emission = shi->mat->vol.emission;
- VECCOPY(emission_col, shi->mat->vol.emission_col);
-
- do_volume_tex(shi, co, MAP_EMISSION+MAP_EMISSION_COL, emission_col, &emission);
-
- emission_col[0] = emission_col[0] * emission * density;
- emission_col[1] = emission_col[1] * emission * density;
- emission_col[2] = emission_col[2] * emission * density;
-}
-
-void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co)
-{
- float absorption = shi->mat->vol.absorption;
- VECCOPY(absorb_col, shi->mat->vol.absorption_col);
-
- do_volume_tex(shi, co, MAP_ABSORPTION+MAP_ABSORPTION_COL, absorb_col, &absorption);
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list