[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26196] branches/render25: Render Branch

Brecht Van Lommel brecht at blender.org
Fri Jan 22 17:17:24 CET 2010


Revision: 26196
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26196
Author:   blendix
Date:     2010-01-22 17:17:24 +0100 (Fri, 22 Jan 2010)

Log Message:
-----------
Render Branch

Some refactoring of blender rendering code, various code changes to clean
up the code and make it easier to extend and fit in the new shading system.
This also deprecates a number of features, so breaks backwards compatibility
already. No new shading system or new features in this commit.

Also, don't report bugs or problems for this branch yet.

Deprecated features:
* World exposure/range.
* Backbuf image.
* Specular transparency.
* Energy Ramps.
* Jittered sampling for AO and Area lamps.
* Warping and stencils in the texture stack.
* Sticky texture coordinates. 

Code changes:
* Many file and function renames, splitting, keeping the working of the
  code intact but making the existing structure more clear.
* Render global R replaced by local variables.
* Shading and pass combining for solid and z-transp is now unified. 
* Render and ShadeInput structs have been split up into nested structs.
* Threaded render no longer uses sleep().
* Lamp shading loop has been reorganized. This will make some renders
  look different, some due to bugs being fixed, and some due to new bugs.
* Texture nodes are now a texture type rather using the "use nodes"
  button.

More details on second part of this page:
http://wiki.blender.org/index.php/BlenderDev/ShadingSystem/Notes

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_data_lamp.py
    branches/render25/release/scripts/ui/properties_texture.py
    branches/render25/release/scripts/ui/properties_world.py
    branches/render25/release/scripts/ui/space_node.py
    branches/render25/source/blender/blenkernel/BKE_material.h
    branches/render25/source/blender/blenkernel/BKE_node.h
    branches/render25/source/blender/blenkernel/intern/displist.c
    branches/render25/source/blender/blenkernel/intern/library.c
    branches/render25/source/blender/blenkernel/intern/material.c
    branches/render25/source/blender/blenkernel/intern/node.c
    branches/render25/source/blender/blenkernel/intern/texture.c
    branches/render25/source/blender/blenkernel/intern/world.c
    branches/render25/source/blender/blenlib/BLI_kdopbvh.h
    branches/render25/source/blender/blenloader/intern/readfile.c
    branches/render25/source/blender/editors/mesh/mesh_data.c
    branches/render25/source/blender/editors/mesh/mesh_intern.h
    branches/render25/source/blender/editors/mesh/mesh_ops.c
    branches/render25/source/blender/editors/object/object_bake.c
    branches/render25/source/blender/editors/render/render_preview.c
    branches/render25/source/blender/editors/screen/screen_edit.c
    branches/render25/source/blender/editors/space_node/drawnode.c
    branches/render25/source/blender/editors/space_node/space_node.c
    branches/render25/source/blender/gpu/CMakeLists.txt
    branches/render25/source/blender/gpu/intern/gpu_material.c
    branches/render25/source/blender/gpu/intern/gpu_shader_material.glsl
    branches/render25/source/blender/gpu/intern/gpu_shader_material.glsl.c
    branches/render25/source/blender/makesdna/DNA_lamp_types.h
    branches/render25/source/blender/makesdna/DNA_material_types.h
    branches/render25/source/blender/makesdna/DNA_scene_types.h
    branches/render25/source/blender/makesdna/DNA_texture_types.h
    branches/render25/source/blender/makesdna/DNA_world_types.h
    branches/render25/source/blender/makesrna/intern/rna_lamp.c
    branches/render25/source/blender/makesrna/intern/rna_material.c
    branches/render25/source/blender/makesrna/intern/rna_object.c
    branches/render25/source/blender/makesrna/intern/rna_render.c
    branches/render25/source/blender/makesrna/intern/rna_texture.c
    branches/render25/source/blender/makesrna/intern/rna_world.c
    branches/render25/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_camera.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_geom.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_material.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_output.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_texture.c
    branches/render25/source/blender/nodes/intern/SHD_util.c
    branches/render25/source/blender/nodes/intern/SHD_util.h
    branches/render25/source/blender/nodes/intern/TEX_util.c
    branches/render25/source/blender/render/extern/include/RE_pipeline.h
    branches/render25/source/blender/render/extern/include/RE_render_ext.h
    branches/render25/source/blender/render/extern/include/RE_shader_ext.h
    branches/render25/source/blender/render/intern/include/envmap.h
    branches/render25/source/blender/render/intern/include/pointdensity.h
    branches/render25/source/blender/render/intern/include/render_types.h
    branches/render25/source/blender/render/intern/include/rendercore.h
    branches/render25/source/blender/render/intern/include/shading.h
    branches/render25/source/blender/render/intern/include/sss.h
    branches/render25/source/blender/render/intern/include/sunsky.h
    branches/render25/source/blender/render/intern/include/texture.h
    branches/render25/source/blender/render/intern/include/volume_precache.h
    branches/render25/source/blender/render/intern/include/volumetric.h
    branches/render25/source/blender/render/intern/include/voxeldata.h
    branches/render25/source/blender/render/intern/include/zbuf.h
    branches/render25/source/blender/render/intern/raytrace/rayobject.cpp
    branches/render25/source/blender/render/intern/source/convertblender.c
    branches/render25/source/blender/render/intern/source/pipeline.c
    branches/render25/source/blender/render/intern/source/rayshade.c
    branches/render25/source/blender/render/intern/source/rendercore.c
    branches/render25/source/blender/render/intern/source/shadeinput.c
    branches/render25/source/blender/render/intern/source/shadeoutput.c
    branches/render25/source/blender/render/intern/source/sss.c
    branches/render25/source/blender/render/intern/source/sunsky.c
    branches/render25/source/blender/render/intern/source/texture.c
    branches/render25/source/blender/render/intern/source/volume_precache.c
    branches/render25/source/blender/render/intern/source/volumetric.c
    branches/render25/source/blender/render/intern/source/zbuf.c

Added Paths:
-----------
    branches/render25/source/blender/render/intern/include/camera.h
    branches/render25/source/blender/render/intern/include/database.h
    branches/render25/source/blender/render/intern/include/diskocclusion.h
    branches/render25/source/blender/render/intern/include/environment.h
    branches/render25/source/blender/render/intern/include/lamp.h
    branches/render25/source/blender/render/intern/include/material.h
    branches/render25/source/blender/render/intern/include/object.h
    branches/render25/source/blender/render/intern/include/object_halo.h
    branches/render25/source/blender/render/intern/include/object_mesh.h
    branches/render25/source/blender/render/intern/include/object_strand.h
    branches/render25/source/blender/render/intern/include/occlusion.h
    branches/render25/source/blender/render/intern/include/part.h
    branches/render25/source/blender/render/intern/include/pixelfilter.h
    branches/render25/source/blender/render/intern/include/raytrace.h
    branches/render25/source/blender/render/intern/include/result.h
    branches/render25/source/blender/render/intern/include/sampler.h
    branches/render25/source/blender/render/intern/include/shadowbuf.h
    branches/render25/source/blender/render/intern/include/strand.h
    branches/render25/source/blender/render/intern/include/texture_stack.h
    branches/render25/source/blender/render/intern/raytrace/rayobject_blibvh.cpp
    branches/render25/source/blender/render/intern/raytrace/rayobject_instance.cpp
    branches/render25/source/blender/render/intern/raytrace/rayobject_octree.cpp
    branches/render25/source/blender/render/intern/raytrace/rayobject_raycounter.cpp
    branches/render25/source/blender/render/intern/source/bake.c
    branches/render25/source/blender/render/intern/source/camera.c
    branches/render25/source/blender/render/intern/source/database.c
    branches/render25/source/blender/render/intern/source/diskocclusion.c
    branches/render25/source/blender/render/intern/source/environment.c
    branches/render25/source/blender/render/intern/source/halo.c
    branches/render25/source/blender/render/intern/source/lamp.c
    branches/render25/source/blender/render/intern/source/material.c
    branches/render25/source/blender/render/intern/source/object.c
    branches/render25/source/blender/render/intern/source/object_halo.c
    branches/render25/source/blender/render/intern/source/object_mesh.c
    branches/render25/source/blender/render/intern/source/object_strand.c
    branches/render25/source/blender/render/intern/source/part.c
    branches/render25/source/blender/render/intern/source/pixelfilter.c
    branches/render25/source/blender/render/intern/source/result.c
    branches/render25/source/blender/render/intern/source/sampler.c
    branches/render25/source/blender/render/intern/source/shadowbuf.c
    branches/render25/source/blender/render/intern/source/texture_envmap.c
    branches/render25/source/blender/render/intern/source/texture_image.c
    branches/render25/source/blender/render/intern/source/texture_pointdensity.c
    branches/render25/source/blender/render/intern/source/texture_stack.c
    branches/render25/source/blender/render/intern/source/texture_voxeldata.c
    branches/render25/source/blender/render/intern/source/vblur.c

Removed Paths:
-------------
    branches/render25/source/blender/render/intern/include/gammaCorrectionTables.h
    branches/render25/source/blender/render/intern/include/initrender.h
    branches/render25/source/blender/render/intern/include/occlusion.h
    branches/render25/source/blender/render/intern/include/pixelblending.h
    branches/render25/source/blender/render/intern/include/pixelshading.h
    branches/render25/source/blender/render/intern/include/renderdatabase.h
    branches/render25/source/blender/render/intern/include/renderpipeline.h
    branches/render25/source/blender/render/intern/include/shadbuf.h
    branches/render25/source/blender/render/intern/include/strand.h
    branches/render25/source/blender/render/intern/source/envmap.c
    branches/render25/source/blender/render/intern/source/gammaCorrectionTables.c
    branches/render25/source/blender/render/intern/source/imagetexture.c
    branches/render25/source/blender/render/intern/source/initrender.c
    branches/render25/source/blender/render/intern/source/occlusion.c
    branches/render25/source/blender/render/intern/source/pixelblending.c
    branches/render25/source/blender/render/intern/source/pixelshading.c
    branches/render25/source/blender/render/intern/source/pointdensity.c
    branches/render25/source/blender/render/intern/source/rayobject_blibvh.c
    branches/render25/source/blender/render/intern/source/rayobject_instance.c
    branches/render25/source/blender/render/intern/source/rayobject_octree.c
    branches/render25/source/blender/render/intern/source/rayobject_raycounter.c
    branches/render25/source/blender/render/intern/source/renderdatabase.c
    branches/render25/source/blender/render/intern/source/shadbuf.c
    branches/render25/source/blender/render/intern/source/strand.c
    branches/render25/source/blender/render/intern/source/voxeldata.c

Modified: branches/render25/release/scripts/ui/properties_data_lamp.py
===================================================================
--- branches/render25/release/scripts/ui/properties_data_lamp.py	2010-01-22 14:59:01 UTC (rev 26195)
+++ branches/render25/release/scripts/ui/properties_data_lamp.py	2010-01-22 16:17:24 UTC (rev 26196)
@@ -248,13 +248,6 @@
                     col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
                     if wide_ui:
                         col = split.column()
-
-                elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
-                    if wide_ui:
-                        col = split.column()
-                    col.prop(lamp, "umbra")
-                    col.prop(lamp, "dither")
-                    col.prop(lamp, "jitter")
                 else:
                     if wide_ui:
                         col = split.column()

Modified: branches/render25/release/scripts/ui/properties_texture.py
===================================================================
--- branches/render25/release/scripts/ui/properties_texture.py	2010-01-22 14:59:01 UTC (rev 26195)
+++ branches/render25/release/scripts/ui/properties_texture.py	2010-01-22 16:17:24 UTC (rev 26196)
@@ -58,7 +58,7 @@
 
     def poll(self, context):
         tex = context.texture
-        return (tex and (tex.type != 'NONE' or tex.use_nodes))
+        return (tex and tex.type != 'NONE')
 
 
 class TEXTURE_PT_preview(TextureButtonsPanel):
@@ -133,7 +133,7 @@
         if tex:
             split = layout.split(percentage=0.2)
 
-            if tex.use_nodes:
+            if tex.type == 'NODES':
                 slot = context.texture_slot
 
                 if slot:
@@ -354,6 +354,8 @@
                 factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color")
                 factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color")
 
+            layout.separator()
+
         elif type(idblock) == bpy.types.Lamp:
             split = layout.split()
 
@@ -364,6 +366,8 @@
                 col = split.column()
             factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
 
+            layout.separator()
+
         elif type(idblock) == bpy.types.World:
             split = layout.split()
 
@@ -376,7 +380,7 @@
             factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up")
             factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
 
-        layout.separator()
+            layout.separator()
 
         split = layout.split()
 
@@ -402,7 +406,7 @@
 
     def poll(self, context):
         tex = context.texture
-        return (tex and tex.type == self.tex_type and not tex.use_nodes)
+        return (tex and tex.type == self.tex_type and not tex.type == 'NODES')
 
 
 class TEXTURE_PT_clouds(TextureTypePanel):

Modified: branches/render25/release/scripts/ui/properties_world.py
===================================================================
--- branches/render25/release/scripts/ui/properties_world.py	2010-01-22 14:59:01 UTC (rev 26195)
+++ branches/render25/release/scripts/ui/properties_world.py	2010-01-22 16:17:24 UTC (rev 26196)
@@ -203,8 +203,6 @@
             if ao.sample_method == 'ADAPTIVE_QMC':
                 sub.prop(ao, "threshold")
                 sub.prop(ao, "adapt_to_speed", slider=True)
-            elif ao.sample_method == 'CONSTANT_JITTERED':
-                sub.prop(ao, "bias")
 
         if ao.gather_method == 'APPROXIMATE':
             if wide_ui:
@@ -239,4 +237,4 @@
 bpy.types.register(WORLD_PT_mist)
 bpy.types.register(WORLD_PT_stars)
 
-bpy.types.register(WORLD_PT_custom_props)
\ No newline at end of file
+bpy.types.register(WORLD_PT_custom_props)

Modified: branches/render25/release/scripts/ui/space_node.py
===================================================================
--- branches/render25/release/scripts/ui/space_node.py	2010-01-22 14:59:01 UTC (rev 26195)
+++ branches/render25/release/scripts/ui/space_node.py	2010-01-22 16:17:24 UTC (rev 26196)
@@ -56,8 +56,6 @@
             id_from = snode.id_from
             if id_from:
                 layout.template_ID(id_from, "active_texture", new="texture.new")
-            if snode_id:
-                layout.prop(snode_id, "use_nodes")
 
         elif snode.tree_type == 'COMPOSITING':
             snode_id = snode.id

Modified: branches/render25/source/blender/blenkernel/BKE_material.h
===================================================================
--- branches/render25/source/blender/blenkernel/BKE_material.h	2010-01-22 14:59:01 UTC (rev 26195)
+++ branches/render25/source/blender/blenkernel/BKE_material.h	2010-01-22 16:17:24 UTC (rev 26196)
@@ -68,8 +68,8 @@
 
 /* rendering */
 
-void init_render_material(struct Material *, int, float *);
-void init_render_materials(int, float *);
+void init_render_material(struct Material *, int);
+void init_render_materials(int);
 void end_render_material(struct Material *);
 void end_render_materials(void);
 

Modified: branches/render25/source/blender/blenkernel/BKE_node.h
===================================================================
--- branches/render25/source/blender/blenkernel/BKE_node.h	2010-01-22 14:59:01 UTC (rev 26195)
+++ branches/render25/source/blender/blenkernel/BKE_node.h	2010-01-22 16:17:24 UTC (rev 26196)
@@ -46,6 +46,7 @@
 struct rctf;
 struct ListBase;
 struct RenderData;
+struct Render;
 struct Scene;
 struct Main;
 struct Tex;
@@ -91,7 +92,7 @@
 	void (*copystoragefunc)(struct bNode *, struct bNode *);
 	
 	/* for use with dynamic typedefs */
-	ID *id;
+	struct ID *id;
 	void *pynode; /* holds pointer to python script */
 	void *pydict; /* holds pointer to python script dictionary (scope)*/
 
@@ -263,15 +264,15 @@
 
 /* API */
 
-void			ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
-void			ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode);
-void			nodeShaderSynchronizeID(struct bNode *node, int copyto);
+void ntreeShaderExecTree(struct bNodeTree *ntree, struct Render *re, struct ShadeInput *shi, struct ShadeResult *shr);
+void ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode);
+void nodeShaderSynchronizeID(struct bNode *node, int copyto);
 
 				/* switch material render loop */
-extern void (*node_shader_lamp_loop)(struct ShadeInput *, struct ShadeResult *);
-void			set_node_shader_lamp_loop(void (*lamp_loop_func)(struct ShadeInput *, struct ShadeResult *));
+extern void (*node_shader_lamp_loop)(struct Render *re, struct ShadeInput *, struct ShadeResult *);
+void set_node_shader_lamp_loop(void (*lamp_loop_func)(struct Render *re, struct ShadeInput *, struct ShadeResult *));
 
-void			ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat);
+void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat);
 
 
 /* ************** COMPOSITE NODES *************** */

Modified: branches/render25/source/blender/blenkernel/intern/displist.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/displist.c	2010-01-22 14:59:01 UTC (rev 26195)
+++ branches/render25/source/blender/blenkernel/intern/displist.c	2010-01-22 16:17:24 UTC (rev 26196)
@@ -307,10 +307,12 @@
 static void init_fastshade_shadeinput(Render *re)
 {
 	memset(&shi, 0, sizeof(ShadeInput));
-	shi.lay= RE_GetScene(re)->lay;
-	shi.view[2]= -1.0f;
-	shi.passflag= SCE_PASS_COMBINED;
-	shi.combinedflag= -1;
+
+	shi.geometry.view[2]= -1.0f;
+
+	shi.shading.lay= RE_GetScene(re)->lay;
+	shi.shading.passflag= SCE_PASS_COMBINED;
+	shi.shading.combinedflag= -1;
 }
 
 static Render *fastshade_get_render(Scene *scene)
@@ -359,84 +361,89 @@
 	MTFace *mtface;
 	int index, n, needuv= ma->texco & TEXCO_UV;
 	char *vertcol;
+	ShadeTexco *tex= &shi.texture;
+	ShadeMaterial *mat= &shi.material;
 
-	shi.totuv= 0;
-	shi.totcol= 0;
+	tex->totuv= 0;
+	tex->totcol= 0;
 
 	for(index=0; index<fdata->totlayer; index++) {
 		layer= &fdata->layers[index];
 		
-		if(needuv && layer->type == CD_MTFACE && shi.totuv < MAX_MTFACE) {
-			n= fastshade_customdata_layer_num(shi.totuv, layer->active_rnd);
+		if(needuv && layer->type == CD_MTFACE && tex->totuv < MAX_MTFACE) {
+			n= fastshade_customdata_layer_num(tex->totuv, layer->active_rnd);
 			mtface= &((MTFace*)layer->data)[a];
 
-			shi.uv[shi.totuv].uv[0]= 2.0f*mtface->uv[j][0]-1.0f;
-			shi.uv[shi.totuv].uv[1]= 2.0f*mtface->uv[j][1]-1.0f;
-			shi.uv[shi.totuv].uv[2]= 1.0f;
+			tex->uv[tex->totuv].uv[0]= 2.0f*mtface->uv[j][0]-1.0f;
+			tex->uv[tex->totuv].uv[1]= 2.0f*mtface->uv[j][1]-1.0f;
+			tex->uv[tex->totuv].uv[2]= 1.0f;
 
-			shi.uv[shi.totuv].name= layer->name;
-			shi.totuv++;
+			tex->uv[tex->totuv].name= layer->name;
+			tex->totuv++;
 		}
-		else if(layer->type == CD_MCOL && shi.totcol < MAX_MCOL) {
-			n= fastshade_customdata_layer_num(shi.totcol, layer->active_rnd);
+		else if(layer->type == CD_MCOL && tex->totcol < MAX_MCOL) {
+			n= fastshade_customdata_layer_num(tex->totcol, layer->active_rnd);
 			vertcol= (char*)&((MCol*)layer->data)[a*4 + j];
 
-			shi.col[shi.totcol].col[0]= ((float)vertcol[3])/255.0f;
-			shi.col[shi.totcol].col[1]= ((float)vertcol[2])/255.0f;
-			shi.col[shi.totcol].col[2]= ((float)vertcol[1])/255.0f;
+			tex->col[tex->totcol].col[0]= ((float)vertcol[3])/255.0f;
+			tex->col[tex->totcol].col[1]= ((float)vertcol[2])/255.0f;
+			tex->col[tex->totcol].col[2]= ((float)vertcol[1])/255.0f;
 
-			shi.col[shi.totcol].name= layer->name;
-			shi.totcol++;
+			tex->col[tex->totcol].name= layer->name;
+			tex->totcol++;
 		}
 	}
 
-	if(needuv && shi.totuv == 0)
-		VECCOPY(shi.uv[0].uv, shi.lo);
+	if(needuv && tex->totuv == 0)
+		VECCOPY(tex->uv[0].uv, tex->lo);
 
-	if(shi.totcol)
-		VECCOPY(shi.vcol, shi.col[0].col);
+	if(tex->totcol)
+		VECCOPY(mat->vcol, tex->col[0].col);
 }
 
 static void fastshade(float *co, float *nor, float *orco, Material *ma, char *col1, char *col2)
 {
 	ShadeResult shr;
+	ShadeTexco *tex= &shi.texture;
+	ShadeGeometry *geom= &shi.geometry;
 	int a;
 	
-	VECCOPY(shi.co, co);
-	shi.vn[0]= -nor[0];
-	shi.vn[1]= -nor[1];
-	shi.vn[2]= -nor[2];
-	VECCOPY(shi.vno, shi.vn);
-	VECCOPY(shi.facenor, shi.vn);
+	VECCOPY(geom->co, co);
+	geom->vn[0]= -nor[0];
+	geom->vn[1]= -nor[1];

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list