[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22423] branches/volume25: * First commit merging 2.4-based sim_physics in to volume25 branch.

Matt Ebb matt at mke3.net
Thu Aug 13 07:21:26 CEST 2009


Revision: 22423
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22423
Author:   broken
Date:     2009-08-13 07:21:25 +0200 (Thu, 13 Aug 2009)

Log Message:
-----------
* First commit merging 2.4-based sim_physics in to volume25 branch.

Integration is still very rough around the edges and WIP, but it works, and can render smoke (using new Smoke format in Voxel Data texture) --> http://vimeo.com/6030983

More to come, but this makes things much easier to work on for me :)

Modified Paths:
--------------
    branches/volume25/CMakeLists.txt
    branches/volume25/release/ui/buttons_material.py
    branches/volume25/release/ui/buttons_texture.py
    branches/volume25/source/blender/blenkernel/BKE_texture.h
    branches/volume25/source/blender/blenkernel/intern/material.c
    branches/volume25/source/blender/blenkernel/intern/texture.c
    branches/volume25/source/blender/blenlib/BLI_arithb.h
    branches/volume25/source/blender/blenlib/BLI_kdopbvh.h
    branches/volume25/source/blender/blenlib/intern/BLI_kdopbvh.c
    branches/volume25/source/blender/blenlib/intern/arithb.c
    branches/volume25/source/blender/blenloader/intern/readfile.c
    branches/volume25/source/blender/blenloader/intern/writefile.c
    branches/volume25/source/blender/editors/preview/previewrender.c
    branches/volume25/source/blender/makesdna/DNA_material_types.h
    branches/volume25/source/blender/makesdna/DNA_texture_types.h
    branches/volume25/source/blender/makesrna/RNA_access.h
    branches/volume25/source/blender/makesrna/intern/rna_material.c
    branches/volume25/source/blender/makesrna/intern/rna_texture.c
    branches/volume25/source/blender/render/CMakeLists.txt
    branches/volume25/source/blender/render/extern/include/RE_shader_ext.h
    branches/volume25/source/blender/render/intern/include/render_types.h
    branches/volume25/source/blender/render/intern/include/shading.h
    branches/volume25/source/blender/render/intern/source/convertblender.c
    branches/volume25/source/blender/render/intern/source/occlusion.c
    branches/volume25/source/blender/render/intern/source/rayshade.c
    branches/volume25/source/blender/render/intern/source/raytrace.c
    branches/volume25/source/blender/render/intern/source/shadeinput.c
    branches/volume25/source/blender/render/intern/source/shadeoutput.c
    branches/volume25/source/blender/render/intern/source/texture.c

Added Paths:
-----------
    branches/volume25/source/blender/blenlib/BLI_voxel.h
    branches/volume25/source/blender/blenlib/intern/voxel.c
    branches/volume25/source/blender/render/intern/include/pointdensity.h
    branches/volume25/source/blender/render/intern/include/volume_precache.h
    branches/volume25/source/blender/render/intern/include/volumetric.h
    branches/volume25/source/blender/render/intern/include/voxeldata.h
    branches/volume25/source/blender/render/intern/source/pointdensity.c
    branches/volume25/source/blender/render/intern/source/volume_precache.c
    branches/volume25/source/blender/render/intern/source/volumetric.c
    branches/volume25/source/blender/render/intern/source/voxeldata.c

Modified: branches/volume25/CMakeLists.txt
===================================================================
--- branches/volume25/CMakeLists.txt	2009-08-13 02:36:20 UTC (rev 22422)
+++ branches/volume25/CMakeLists.txt	2009-08-13 05:21:25 UTC (rev 22423)
@@ -234,7 +234,7 @@
 
   SET(ZLIB ${LIBDIR}/zlib)
   SET(ZLIB_INC ${ZLIB}/include)
-  SET(ZLIB_LIBRARIES zlib)
+  SET(ZLIB_LIBRARIES libz)
   SET(ZLIB_LIBPATH ${ZLIB}/lib)
   
   SET(PTHREADS ${LIBDIR}/pthreads)
@@ -257,7 +257,7 @@
   SET(GETTEXT ${LIBDIR}/gettext)
   SET(GETTEXT_INC ${GETTEXT}/include)
   IF(CMAKE_CL_64)
-  	SET(GETTEXT_LIB gettextlib)
+  	SET(GETTEXT_LIB gettext)
   ELSE(CMAKE_CL_64)
   	SET(GETTEXT_LIB gnu_gettext)
   ENDIF(CMAKE_CL_64)

Modified: branches/volume25/release/ui/buttons_material.py
===================================================================
--- branches/volume25/release/ui/buttons_material.py	2009-08-13 02:36:20 UTC (rev 22422)
+++ branches/volume25/release/ui/buttons_material.py	2009-08-13 05:21:25 UTC (rev 22423)
@@ -83,7 +83,7 @@
 		if mat:
 			layout.itemR(mat, "type", expand=True)
 
-			if mat.type in ('SURFACE', 'WIRE', 'VOLUME'):
+			if mat.type in ['SURFACE', 'WIRE']:
 				split = layout.split()
 	
 				col = split.column()
@@ -106,6 +106,9 @@
 	__default_closed__ = True
 	COMPAT_ENGINES = set(['BLENDER_RENDER'])
 	
+	def poll(self, context):
+		return context.material.type in ['SURFACE', 'WIRE', 'HALO']
+	
 	def draw(self, context):
 		layout = self.layout
 		
@@ -161,6 +164,9 @@
 	__label__ = "Options"
 	COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
+	def poll(self, context):
+		return (context.material.type in ['SURFACE', 'WIRE', 'HALO'])
+
 	def draw(self, context):
 		layout = self.layout
 		
@@ -194,6 +200,9 @@
 class MATERIAL_PT_shadows(MaterialButtonsPanel):
 	__label__ = "Shadows"
 	COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+	
+	def poll(self, context):
+		return context.material.type in ['SURFACE', 'WIRE']
 
 	def draw(self, context):
 		layout = self.layout
@@ -226,7 +235,7 @@
 
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type != 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw(self, context):
 		layout = self.layout
@@ -280,7 +289,7 @@
 
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type != 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw(self, context):
 		layout = self.layout
@@ -332,7 +341,7 @@
 	
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw_header(self, context):
 		layout = self.layout
@@ -374,7 +383,7 @@
 	
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in 'SURFACE', 'WIRE') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 	
 	def draw_header(self, context):
 		layout = self.layout
@@ -426,7 +435,7 @@
 		
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in 'SURFACE', 'WIRE') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw_header(self, context):
 		layout = self.layout
@@ -471,7 +480,58 @@
 		sub.active = rayt.gloss < 1
 		sub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold")
 		sub.itemR(rayt, "gloss_samples", text="Samples")
+
+class MATERIAL_PT_volume(MaterialButtonsPanel):
+	__label__ = "Volume"
+	__default_closed__ = False
+	COMPAT_ENGINES = set(['BLENDER_RENDER'])
+	
+	def poll(self, context):
+		return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+	
+	def draw(self, context):
+		layout = self.layout
 		
+		mat = context.material
+		vol = context.material.volume
+		
+		split = layout.split()
+		
+		col = split.column()
+		col.itemR(vol, "step_calculation")
+		col.itemR(vol, "step_size")
+		col.itemR(vol, "shading_step_size")
+		
+		col.itemR(mat, "alpha", text="Density", slider=True)
+		
+		col.itemR(vol, "scattering_mode")
+		if vol.scattering_mode == 'SINGLE':
+			col.itemR(vol, "light_cache")
+			sub = col.column()
+			sub.active = vol.light_cache
+			col.itemR(vol, "cache_resolution")
+		elif vol.scattering_mode in ['MULTIPLE', 'SINGLE_PLUS_MULTIPLE']:
+			col.itemR(vol, "cache_resolution")
+			col.itemR(vol, "ms_diffusion")
+			col.itemR(vol, "ms_spread")
+			col.itemR(vol, "ms_intensity")
+			
+		col.itemR(vol, "density_scale")
+		col.itemR(vol, "depth_cutoff")
+		
+		col = split.column()
+		col.itemR(vol, "absorption")
+		col.itemR(vol, "absorption_color")
+		col.itemR(vol, "scattering")
+		
+		col.itemR(mat, "emit")
+		col.itemR(mat, "diffuse_color")
+		
+		col.itemR(vol, "phase_function")
+		col.itemR(vol, "asymmetry")
+		
+
+
 class MATERIAL_PT_halo(MaterialButtonsPanel):
 	__label__= "Halo"
 	COMPAT_ENGINES = set(['BLENDER_RENDER'])
@@ -532,6 +592,7 @@
 bpy.types.register(MATERIAL_PT_raymir)
 bpy.types.register(MATERIAL_PT_raytransp)
 bpy.types.register(MATERIAL_PT_sss)
+bpy.types.register(MATERIAL_PT_volume)
 bpy.types.register(MATERIAL_PT_halo)
 bpy.types.register(MATERIAL_PT_physics)
 bpy.types.register(MATERIAL_PT_strand)

Modified: branches/volume25/release/ui/buttons_texture.py
===================================================================
--- branches/volume25/release/ui/buttons_texture.py	2009-08-13 02:36:20 UTC (rev 22422)
+++ branches/volume25/release/ui/buttons_texture.py	2009-08-13 05:21:25 UTC (rev 22423)
@@ -1,4 +1,4 @@
-
+	
 import bpy
 
 class TextureButtonsPanel(bpy.types.Panel):
@@ -610,7 +610,53 @@
 		flow.itemR(tex, "distortion_amount", text="Distortion")
 		flow.itemR(tex, "noise_size", text="Size")
 		flow.itemR(tex, "nabla")	
+		
+class TEXTURE_PT_voxeldata(TextureButtonsPanel):
+	__idname__= "TEXTURE_PT_voxeldata"
+	__label__ = "Voxel Data"
+	
+	def poll(self, context):
+		tex = context.texture
+		return (tex and tex.type == 'VOXEL_DATA')
 
+	def draw(self, context):
+		layout = self.layout
+		tex = context.texture
+		vd = tex.voxeldata
+
+		layout.itemR(vd, "file_format")
+		if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']:
+			layout.itemR(vd, "source_path")
+		if vd.file_format == 'RAW_8BIT':
+			layout.itemR(vd, "resolution")
+		if vd.file_format == 'SMOKE':
+			layout.itemR(vd, "object")
+		
+		layout.itemR(vd, "still")
+		if vd.still:
+			layout.itemR(vd, "still_frame_number")
+		
+		layout.itemR(vd, "interpolation")
+		layout.itemR(vd, "intensity")
+		
+class TEXTURE_PT_pointdensity(TextureButtonsPanel):
+	__idname__= "TEXTURE_PT_pointdensity"
+	__label__ = "Point Density"
+	
+	def poll(self, context):
+		tex = context.texture
+		return (tex and tex.type == 'POINT_DENSITY')
+
+	def draw(self, context):
+		layout = self.layout
+		tex = context.texture
+		pd = tex.pointdensity
+
+		layout.itemR(pd, "point_source")
+
+		layout.itemR(pd, "falloff")
+		
+
 bpy.types.register(TEXTURE_PT_context_texture)
 bpy.types.register(TEXTURE_PT_preview)
 bpy.types.register(TEXTURE_PT_clouds)
@@ -627,6 +673,8 @@
 bpy.types.register(TEXTURE_PT_musgrave)
 bpy.types.register(TEXTURE_PT_voronoi)
 bpy.types.register(TEXTURE_PT_distortednoise)
+bpy.types.register(TEXTURE_PT_voxeldata)
+bpy.types.register(TEXTURE_PT_pointdensity)
 bpy.types.register(TEXTURE_PT_colors)
 bpy.types.register(TEXTURE_PT_mapping)
 bpy.types.register(TEXTURE_PT_influence)

Modified: branches/volume25/source/blender/blenkernel/BKE_texture.h
===================================================================
--- branches/volume25/source/blender/blenkernel/BKE_texture.h	2009-08-13 02:36:20 UTC (rev 22422)
+++ branches/volume25/source/blender/blenkernel/BKE_texture.h	2009-08-13 05:21:25 UTC (rev 22423)
@@ -40,6 +40,8 @@
 struct HaloRen;
 struct TexMapping;
 struct EnvMap;
+struct PointDensity;
+struct VoxelData;
 
 /*  in ColorBand struct */
 #define MAXCOLORBAND 32
@@ -75,6 +77,16 @@
 struct EnvMap *BKE_add_envmap(void);
 struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
 
+void    BKE_free_pointdensitydata(struct PointDensity *pd);
+void    BKE_free_pointdensity(struct PointDensity *pd);
+struct PointDensity *BKE_add_pointdensity(void);
+struct PointDensity *BKE_copy_pointdensity(struct PointDensity *pd);
+
+void BKE_free_voxeldatadata(struct VoxelData *vd);
+void BKE_free_voxeldata(struct VoxelData *vd);
+struct VoxelData *BKE_add_voxeldata(void);
+struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd);
+
 int     BKE_texture_dependsOnTime(const struct Tex *texture);
 
 #endif

Modified: branches/volume25/source/blender/blenkernel/intern/material.c
===================================================================
--- branches/volume25/source/blender/blenkernel/intern/material.c	2009-08-13 02:36:20 UTC (rev 22422)
+++ branches/volume25/source/blender/blenkernel/intern/material.c	2009-08-13 05:21:25 UTC (rev 22423)
@@ -170,6 +170,14 @@
 	ma->sss_front= 1.0f;
 	ma->sss_back= 1.0f;
 
+	ma->vol.density_scale = 1.0f;
+	ma->vol.stepsize = 0.2f;
+	ma->vol.shade_stepsize = 0.2f;
+	ma->vol.absorption = 1.0f;
+	ma->vol.scattering = 1.0f;
+	ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f;
+	ma->vol.precache_resolution = 50;
+	
 	ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR;
 
 	ma->preview = NULL;

Modified: branches/volume25/source/blender/blenkernel/intern/texture.c
===================================================================
--- branches/volume25/source/blender/blenkernel/intern/texture.c	2009-08-13 02:36:20 UTC (rev 22422)
+++ branches/volume25/source/blender/blenkernel/intern/texture.c	2009-08-13 05:21:25 UTC (rev 22423)
@@ -43,6 +43,7 @@
 #include "BLI_blenlib.h"
 #include "BLI_arithb.h"
 #include "BLI_rand.h"
+#include "BLI_kdopbvh.h"
 
 #include "DNA_texture_types.h"
 #include "DNA_key_types.h"
@@ -417,6 +418,8 @@
 	free_plugin_tex(tex->plugin);
 	if(tex->coba) MEM_freeN(tex->coba);
 	if(tex->env) BKE_free_envmap(tex->env);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list