[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11376]

Levi Schooley redfox at hhofministries.org
Fri Jul 27 20:19:16 CEST 2007


Hello,

This may be a problem unique to me, but I discovered after a merge with my soc
branch that the raytrace.c file would not compile (scons + msvc). I was not able
to capture the first error (cmd.exe only shows so many), but the errors occurring
most often were like:
source\blender\render\intern\source\raytrace.c(533) : error C2109: subscript
requires array or pointer type
and
source\blender\render\intern\source\raytrace.c(538) : warning C4047: '!=' : 'int'
differs in levels of indirection from 'void *'

I removed the double semicolon at the beginning of the RE_ray_tree_add_face()
function, and the problem seemed to go away.

Thanks!
Levi



On Thu Jul 26 6:38 , Brecht Van Lommel <brechtvanlommel at pandora.be> sent:

>Revision: 11376
>
http://projects.blender.org/plugins/scmsvn/viewcvs.php\?view=rev&root=bf-blender&revision=11376
>Author: blendix
>Date: 2007-07-26 15:38:24 +0200 (Thu, 26 Jul 2007)
>
>Log Message:
>-----------
>
>Refactor the raytracing code to split the tracing and shading parts into
>two separate files, raytrace.c and rayshade.c. The tracing code can now
>be used separately from the renderer (will be used in a later commit),
>and the raytracing acceleration structure can now also be easily replaced,
>if someone wants to experiment with that.
>
>Modified Paths:
>--------------
> trunk/blender/source/blender/render/intern/include/render_types.h
> trunk/blender/source/blender/render/intern/include/rendercore.h
> trunk/blender/source/blender/render/intern/source/convertblender.c
> trunk/blender/source/blender/render/intern/source/envmap.c
>
>Added Paths:
>-----------
> trunk/blender/source/blender/render/extern/include/RE_raytrace.h
> trunk/blender/source/blender/render/intern/source/rayshade.c
> trunk/blender/source/blender/render/intern/source/raytrace.c
>
>Removed Paths:
>-------------
> trunk/blender/source/blender/render/intern/source/ray.c
>
>Added: trunk/blender/source/blender/render/extern/include/RE_raytrace.h
>===================================================================
>--- trunk/blender/source/blender/render/extern/include/RE_raytrace.h
(rev 0)
>+++ trunk/blender/source/blender/render/extern/include/RE_raytrace.h 2007-07-26
13:38:24 UTC (rev 11376)
>@@ -0,0 +1,90 @@
>+/**
>+ * $Id$
>+ *
>+ * ***** 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) 2007 Blender Foundation.
>+ * All rights reserved.
>+ *
>+ * The Original Code is: all of this file.
>+ *
>+ * Contributor(s): none yet.
>+ *
>+ * ***** END GPL LICENSE BLOCK *****
>+ * RE_raytrace.h: ray tracing api, can be used independently from the renderer.
>+ */
>+
>+#ifndef RE_RAYTRACE_H
>+#define RE_RAYTRACE_H
>+
>+/* ray types */
>+#define RE_RAY_SHADOW 0
>+#define RE_RAY_MIRROR 1
>+#define RE_RAY_SHADOW_TRA 2
>+
>+/* spatial tree for raytracing acceleration */
>+typedef void RayTree;
>+/* abstraction of face type */
>+typedef void RayFace;
>+
>+/* struct for intersection data */
>+typedef struct Isect {
>+ float start[3]; /* start+vec = end, in ray_tree_intersect */
>+ float vec[3];
>+ float end[3];
>+
>+ float labda, u, v; /* distance to hitpoint, uv weights */
>+
>+ RayFace *face; /* face is where to intersect with */
>+ RayFace *faceorig; /* start face */
>+ RayFace *face_last; /* for shadow optimize, last intersected face */
>+
>+ short isect; /* which half of quad */
>+ short mode; /* RE_RAYSHADOW, RE_RAYMIRROR, RE_RAYSHADOW_TRA */
>+ int lay; /* -1 default, set for layer lamps */
>+
>+ /* only used externally */
>+ float col[4]; /* RGBA for shadow_tra */
>+
>+ /* octree only */
>+ RayFace *facecontr;
>+ float ddalabda;
>+ short faceisect; /* flag if facecontr was done or not */
>+} Isect;
>+
>+/* function callbacks for face type abstraction */
>+typedef void (*RayCoordsFunc)(RayFace *face,
>+ float **v1, float **v2, float **v3, float **v4);
>+typedef int (*RayCheckFunc)(Isect *is, RayFace *face);
>+
>+/* tree building and freeing */
>+RayTree *RE_ray_tree_create(int ocres, int totface, float *min, float *max,
>+ RayCoordsFunc coordfunc, RayCheckFunc checkfunc);
>+void RE_ray_tree_add_face(RayTree *tree, RayFace *face);
>+void RE_ray_tree_done(RayTree *tree);
>+void RE_ray_tree_free(RayTree *tree);
>+
>+/* intersection with full tree and single face */
>+int RE_ray_tree_intersect(RayTree *tree, Isect *is);
>+int RE_ray_face_intersection(Isect *is, RayCoordsFunc coordsfunc);
>+
>+/* retrieve the diameter of the tree structure, for setting intersection
>+ end distance */
>+float RE_ray_tree_max_size(RayTree *tree);
>+
>+#endif /*__RE_RAYTRACE_H__*/
>+
>
>Modified: trunk/blender/source/blender/render/intern/include/render_types.h
>===================================================================
>--- trunk/blender/source/blender/render/intern/include/render_types.h 2007-07-26
12:15:55 UTC (rev 11375)
>+++ trunk/blender/source/blender/render/intern/include/render_types.h 2007-07-26
13:38:24 UTC (rev 11376)
>@@ -46,7 +46,6 @@
> struct MemArena;
> struct VertTableNode;
> struct VlakTableNode;
>-struct Octree;
> struct GHash;
>
> #define TABLEINITSIZE 1024
>@@ -84,16 +83,6 @@
> char *clipflag; /* clipflags for part zbuffering */
> } RenderPart;
>
>-typedef struct Octree {
>- struct Branch **adrbranch;
>- struct Node **adrnode;
>- float ocsize; /* ocsize: mult factor, max size octree */
>- float ocfacx,ocfacy,ocfacz;
>- float min[3], max[3];
>- int ocres;
>- int branchcount, nodecount;
>-} Octree;
>-
> /* controls state of render, everything that's read-only during render stage */
> struct Render
> {
>@@ -150,7 +139,7 @@
> ListBase parts;
>
> /* octree tables and variables for raytrace */
>- Octree oc;
>+ void *raytree;
>
> /* use this instead of R.r.cfra */
> float cfra;
>
>Modified: trunk/blender/source/blender/render/intern/include/rendercore.h
>===================================================================
>--- trunk/blender/source/blender/render/intern/include/rendercore.h 2007-07-26
12:15:55 UTC (rev 11375)
>+++ trunk/blender/source/blender/render/intern/include/rendercore.h 2007-07-26
13:38:24 UTC (rev 11376)
>@@ -91,8 +91,8 @@
>
> /* -------- ray.c ------- */
>
>-extern void freeoctree(Render *re);
>-extern void makeoctree(Render *re);
>+extern void freeraytree(Render *re);
>+extern void makeraytree(Render *re);
>
> extern void ray_shadow(ShadeInput *, LampRen *, float *);
> extern void ray_trace(ShadeInput *, ShadeResult *);
>
>Modified: trunk/blender/source/blender/render/intern/source/convertblender.c
>===================================================================
>--- trunk/blender/source/blender/render/intern/source/convertblender.c
2007-07-26 12:15:55 UTC (rev 11375)
>+++ trunk/blender/source/blender/render/intern/source/convertblender.c
2007-07-26 13:38:24 UTC (rev 11376)
>@@ -2988,7 +2988,7 @@
> re->scene->world->aotables= NULL;
> }
>
>- if(re->r.mode & R_RAYTRACE) freeoctree(re);
>+ if(re->r.mode & R_RAYTRACE) freeraytree(re);
>
> free_sss(re);
>
>@@ -3461,17 +3461,17 @@
> }
> }
>
>- /* yafray: 'direct' radiosity, environment maps and octree init not needed
for yafray render */
>+ /* yafray: 'direct' radiosity, environment maps and raytree init not needed
for yafray render */
> /* although radio mode could be useful at some point, later */
> if (re->r.renderer==R_INTERN) {
> /* RADIO (uses no R anymore) */
> if(!re->test_break())
> if(re->r.mode & R_RADIO) do_radio_render(re);
>
>- /* octree */
>+ /* raytree */
> if(!re->test_break()) {
> if(re->r.mode & R_RAYTRACE) {
>- makeoctree(re);
>+ makeraytree(re);
> }
> }
> /* ENVIRONMENT MAPS */
>@@ -4048,10 +4048,10 @@
> }
>
> if(type!=RE_BAKE_LIGHT) {
>- /* octree */
>+ /* raytree */
> if(!re->test_break()) {
> if(re->r.mode & R_RAYTRACE) {
>- makeoctree(re);
>+ makeraytree(re);
> }
> }
> }
>
>Modified: trunk/blender/source/blender/render/intern/source/envmap.c
>===================================================================
>--- trunk/blender/source/blender/render/intern/source/envmap.c 2007-07-26
12:15:55 UTC (rev 11375)
>+++ trunk/blender/source/blender/render/intern/source/envmap.c 2007-07-26
13:38:24 UTC (rev 11376)
>@@ -157,7 +157,7 @@
> envre->vlaknodeslen= re->vlaknodeslen;
> envre->vlaknodes= re->vlaknodes;
> envre->customdata_names= re->customdata_names;
>- envre->oc= re->oc;
>+ envre->raytree= re->raytree;
>
> return envre;
> }
>@@ -177,8 +177,7 @@
> envre->vlaknodeslen= 0;
> envre->vlaknodes= NULL;
> envre->customdata_names.first= envre->customdata_names.last= NULL;
>- envre->oc.adrbranch= NULL;
>- envre->oc.adrnode= NULL;
>+ envre->raytree= NULL;
>
> RE_FreeRender(envre);
> }
>
>Deleted: trunk/blender/source/blender/render/intern/source/ray.c
>===================================================================
>--- trunk/blender/source/blender/render/intern/source/ray.c 2007-07-26 12:15:55
UTC (rev 11375)
>+++ trunk/blender/source/blender/render/intern/source/ray.c 2007-07-26 13:38:24
UTC (rev 11376)
>@@ -1,2469 +0,0 @@
>-/**
>- * $Id$
>- *
>- * ***** 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) 1990-1998 NeoGeo BV.
>- * All rights reserved.
>- *
>- * Contributors: 2004/2005 Blender Foundation, full recode
>- *
>- * ***** END GPL LICENSE BLOCK *****
>- */
>-
>-
>-#include
>-#include
>-#include
>-#include
>-
>-#include "MEM_guardedalloc.h"
>-
>-#include "DNA_material_types.h"
>-#include "DNA_lamp_types.h"
>-
>-#include "BKE_global.h"
>-#include "BKE_node.h"
>-#include "BKE_utildefines.h"
>-
>-#include "BLI_arithb.h"
>-#include "BLI_rand.h"
>-#include "BLI_jitter.h"
>-
>-#include "PIL_time.h"
>-
>-#include "render_types.h"
>-#include "renderpipeline.h"
>-#include "rendercore.h"
>-#include "renderdatabase.h"
>-#include "pixelblending.h"
>-#include "pixelshading.h"
>-#include "shading.h"
>-#include "texture.h"
>-
>-#define DDA_SHADOW 0
>-#define DDA_MIRROR 1
>-#define DDA_SHADOW_TRA 2
>-
>-#define RAY_TRA 1
>-#define RAY_TRAFLIP 2
>-
>-#define DEPTH_SHADOW_TRA 10
>-
>-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
>-/* 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;
>-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
>-
>-/* ********** structs *************** */
>-
>-#define BRANCH_ARRAY 1024
>-#define NODE_ARRAY 4096
>-
>-typedef struct Isect {
>- float start[3], vec[3], end[3]; /* start+vec = end, in d3dda */
>- float labda, u, v;
>- struct VlakRen *vlr, *vlrcontr, *vlrorig; /* vlr is where to intersect with */
>- short isect, mode; /* isect: which half of quad, mode: DDA_SHADOW, DDA_MIRROR,
DDA_SHADOW_TRA */
>- float ddalabda;
>- float col[4]; /* RGBA for shadow_tra */
>- int lay; /* -1 default, set for layer lamps */
>- short vlrisect; /* flag whether vlrcontr was done or not */
>- /* for optimize, last intersected face */
>- VlakRen *vlr_last;
>-} Isect;
>-
>-typedef struct Branch
>-{
>- struct Branch *b[8];
>-} Branch;
>-
>-typedef struct OcVal
>-{
>- short ocx, ocy, ocz;
>-} OcVal;
>-
>-typedef struct Node
>-{
>- struct VlakRen *v[8];
>- struct OcVal ov[8];
>- struct Node *next;
>
>@@ Diff output truncated at 10240 characters. @@
>
>_______________________________________________
>Bf-blender-cvs mailing list
>Bf-blender-cvs at blender.org
>http://lists.blender.org/mailman/listinfo/bf-blender-cvs
> 


More information about the Bf-committers mailing list