svn merge -r 22450:22627 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
authorMatt Ebb <matt@mke3.net>
Wed, 19 Aug 2009 11:18:52 +0000 (11:18 +0000)
committerMatt Ebb <matt@mke3.net>
Wed, 19 Aug 2009 11:18:52 +0000 (11:18 +0000)
18 files changed:
1  2 
release/ui/buttons_material.py
release/ui/buttons_texture.py
source/blender/blenkernel/intern/material.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/preview/previewrender.c
source/blender/makesdna/DNA_material_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_texture.c
source/blender/render/CMakeLists.txt
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/texture.c

@@@ -81,9 -82,8 +82,8 @@@ class MATERIAL_PT_shading(MaterialButto
                space = context.space_data
  
                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()
@@@ -105,10 -106,11 +106,14 @@@ class MATERIAL_PT_strand(MaterialButton
        __label__ = "Strand"
        __default_closed__ = True
        COMPAT_ENGINES = set(['BLENDER_RENDER'])
+       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)
        
 +      def poll(self, context):
 +              return context.material.type in ('SURFACE', 'WIRE', 'HALO')
 +      
        def draw(self, context):
                layout = self.layout
                
@@@ -197,12 -196,10 +202,13 @@@ class MATERIAL_PT_options(MaterialButto
                col.itemR(mat, "vertex_color_light")
                col.itemR(mat, "object_color")
  
- class MATERIAL_PT_shadows(MaterialButtonsPanel):
-       __label__ = "Shadows"
+ class MATERIAL_PT_shadow(MaterialButtonsPanel):
+       __label__ = "Shadow"
+       __default_closed__ = True
        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
@@@ -471,113 -467,26 +476,124 @@@ class MATERIAL_PT_transp(MaterialButton
                col.itemR(rayt, "fresnel", text="Amount")
                sub = col.column()
                sub.active = rayt.fresnel > 0
-               sub.itemR(rayt, "fresnel_fac", text="Blend", slider=True)
-               
-               col = split.column()
-               col.itemL(text="Gloss:")
-               col.itemR(rayt, "gloss", text="Amount", slider=True)
-               sub = col.column()
-               sub.active = rayt.gloss < 1
-               sub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold")
-               sub.itemR(rayt, "gloss_samples", text="Samples")
+               sub.itemR(rayt, "fresnel_factor", text="Blend")
+               if mat.transparency_method == 'RAYTRACE':
+                       split = layout.split()
+                       split.active = mat.transparency and (not mat.shadeless)
+                       col = split.column()
+                       col.itemR(rayt, "ior")
+                       col.itemR(rayt, "filter")
+                       col.itemR(rayt, "falloff")
+                       col.itemR(rayt, "limit")
+                       col.itemR(rayt, "depth")
+                       
+                       col = split.column()
+                       col.itemL(text="Gloss:")
+                       col.itemR(rayt, "gloss", text="Amount")
+                       sub = col.column()
+                       sub.active = rayt.gloss < 1
+                       sub.itemR(rayt, "gloss_threshold", text="Threshold")
+                       sub.itemR(rayt, "gloss_samples", text="Samples")
 +
 +class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
 +      __label__ = "Shading"
 +      __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()
 +              
 +              row = split.row()
 +              row.itemR(vol, "density")
 +              row.itemR(vol, "scattering")
 +              
 +              split = layout.split()
 +              col = split.column()
 +              col.itemR(vol, "absorption")
 +              col.itemR(vol, "absorption_color", text="")
 +              
 +                              
 +              col = split.column()
 +              col.itemR(vol, "emission")
 +              col.itemR(vol, "emission_color", text="")
 +              
 +              
 +
 +class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
 +      __label__ = "Scattering"
 +      __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, "scattering_mode", text="")
 +              if vol.scattering_mode == 'SINGLE_SCATTERING':
 +                      col.itemR(vol, "light_cache")
 +                      sub = col.column()
 +                      sub.active = vol.light_cache
 +                      sub.itemR(vol, "cache_resolution")
 +              elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
 +                      col.itemR(vol, "cache_resolution")
 +                      
 +                      col = col.column(align=True)
 +                      col.itemR(vol, "ms_diffusion")
 +                      col.itemR(vol, "ms_spread")
 +                      col.itemR(vol, "ms_intensity")
 +              
 +              col = split.column()
 +              # col.itemL(text="Anisotropic Scattering:")
 +              col.itemR(vol, "phase_function", text="")
 +              if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
 +                      col.itemR(vol, "asymmetry")
 +              
 +class MATERIAL_PT_volume_integration(MaterialButtonsPanel):
 +      __label__ = "Integration"
 +      __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.itemL(text="Step Calculation:")
 +              col.itemR(vol, "step_calculation", text="")
 +              col = col.column(align=True)
 +              col.itemR(vol, "step_size")
 +              col.itemR(vol, "shading_step_size")
 +              
 +              col = split.column()
 +              col.itemL()
 +              col.itemR(vol, "depth_cutoff")
 +              col.itemR(vol, "density_scale")
 +              
                
  class MATERIAL_PT_halo(MaterialButtonsPanel):
        __label__= "Halo"
  
  bpy.types.register(MATERIAL_PT_context_material)
  bpy.types.register(MATERIAL_PT_preview)
- bpy.types.register(MATERIAL_PT_material)
  bpy.types.register(MATERIAL_PT_diffuse)
  bpy.types.register(MATERIAL_PT_specular)
- bpy.types.register(MATERIAL_PT_raymir)
- bpy.types.register(MATERIAL_PT_raytransp)
+ bpy.types.register(MATERIAL_PT_shading)
+ bpy.types.register(MATERIAL_PT_transp)
+ bpy.types.register(MATERIAL_PT_mirror)
  bpy.types.register(MATERIAL_PT_sss)
 +bpy.types.register(MATERIAL_PT_volume_shading)
 +bpy.types.register(MATERIAL_PT_volume_scattering)
 +bpy.types.register(MATERIAL_PT_volume_integration)
  bpy.types.register(MATERIAL_PT_halo)
  bpy.types.register(MATERIAL_PT_physics)
  bpy.types.register(MATERIAL_PT_strand)
Simple merge
@@@ -170,22 -170,7 +170,22 @@@ void init_material(Material *ma
        ma->sss_front= 1.0f;
        ma->sss_back= 1.0f;
  
-       ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR;
 +      ma->vol.density = 1.0f;
 +      ma->vol.emission = 0.0f;
 +      ma->vol.absorption = 1.0f;
 +      ma->vol.scattering = 1.0f;
 +      ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f;
 +      ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f;
 +      ma->vol.density_scale = 1.0f;
 +      ma->vol.depth_cutoff = 0.01f;
 +      ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED;
 +      ma->vol.stepsize = 0.2f;
 +      ma->vol.shade_stepsize = 0.2f;
 +      ma->vol.shade_type = MA_VOL_SHADE_SINGLE;
 +      ma->vol.shadeflag |= MA_VOL_PRECACHESHADING;
 +      ma->vol.precache_resolution = 50;
 +      
+       ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR;
  
        ma->preview = NULL;
  }
@@@ -1531,9 -1530,9 +1531,9 @@@ float BLI_bvhtree_bb_raycast(float *bv
  {
        BVHRayCastData data;
        float dist = 0.0;
-       
        data.hit.dist = FLT_MAX;
 -
 +      
        // get light direction
        data.ray.direction[0] = light_end[0] - light_start[0];
        data.ray.direction[1] = light_end[1] - light_start[1];
@@@ -304,10 -305,10 +305,12 @@@ static Scene *preview_prepare_scene(Sce
                                end_render_material(mat);
                                
                                /* turn on raytracing if needed */
-                               if(mat->mode_l & (MA_RAYTRANSP|MA_RAYMIRROR))
+                               if(mat->mode_l & MA_RAYMIRROR)
                                        sce->r.mode |= R_RAYTRACE;
 +                              if(mat->material_type == MA_TYPE_VOLUME)
 +                                      sce->r.mode |= R_RAYTRACE;
+                               if((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
+                                       sce->r.mode |= R_RAYTRACE;
                                if(mat->sss_flag & MA_DIFF_SSS)
                                        sce->r.mode |= R_SSS;
                                
@@@ -486,10 -496,8 +498,10 @@@ extern StructRNA RNA_UserSolidLight
  extern StructRNA RNA_VectorFont;
  extern StructRNA RNA_VertexGroup;
  extern StructRNA RNA_VertexGroupElement;
+ extern StructRNA RNA_VertexPaint;
  extern StructRNA RNA_VoronoiTexture;
 +extern StructRNA RNA_VoxelData;
 +extern StructRNA RNA_VoxelDataTexture;
  extern StructRNA RNA_WaveModifier;
  extern StructRNA RNA_Window;
  extern StructRNA RNA_WindowManager;
@@@ -864,172 -807,8 +876,166 @@@ static void rna_def_material_raytra(Ble
        RNA_def_property_range(prop, 0.1f, 10.0f);
        RNA_def_property_ui_text(prop, "Falloff", "Falloff power for transmissivity filter effect (1.0 is linear).");
        RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-       
-       prop= RNA_def_property(srna, "specular_opacity", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "spectra");
-       RNA_def_property_range(prop, 0.0f, 1.0f);
-       RNA_def_property_ui_text(prop, "Specular Opacity", "Makes specular areas opaque on transparent materials.");
-       RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
  }
  
 +static void rna_def_material_volume(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      static EnumPropertyItem prop_scattering_items[] = {
 +              {MA_VOL_SHADE_NONE, "NONE", 0, "None", ""},
 +              {MA_VOL_SHADE_SINGLE, "SINGLE_SCATTERING", 0, "Single Scattering", ""},
 +              {MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""},
 +              {MA_VOL_SHADE_SINGLEPLUSMULTIPLE, "SINGLE_PLUS_MULTIPLE_SCATTERING", 0, "Single + Multiple Scattering", ""},
 +              {0, NULL, 0, NULL, NULL}};
 +
 +      static EnumPropertyItem prop_stepsize_items[] = {
 +              {MA_VOL_STEP_RANDOMIZED, "RANDOMIZED", 0, "Randomized", ""},
 +              {MA_VOL_STEP_CONSTANT, "CONSTANT", 0, "Constant", ""},
 +              //{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""},
 +              {0, NULL, 0, NULL, NULL}};
 +              
 +      static EnumPropertyItem prop_phasefunction_items[] = {
 +              {MA_VOL_PH_ISOTROPIC, "ISOTROPIC", 0, "Isotropic", ""},
 +              {MA_VOL_PH_MIEHAZY, "MIE_HAZY", 0, "Mie Hazy", ""},
 +              {MA_VOL_PH_MIEMURKY, "MIE_MURKY", 0, "Mie Murky", ""},
 +              {MA_VOL_PH_RAYLEIGH, "RAYLEIGH", 0, "Rayleigh", ""},
 +              {MA_VOL_PH_HG, "HENYEY-GREENSTEIN", 0, "Henyey-Greenstein", ""},
 +              {MA_VOL_PH_SCHLICK, "SCHLICK", 0, "Schlick", ""},
 +              {0, NULL, 0, NULL, NULL}};
 +
 +      srna= RNA_def_struct(brna, "MaterialVolume", NULL);
 +      RNA_def_struct_sdna(srna, "VolumeSettings");
 +      RNA_def_struct_nested(brna, srna, "Material");
 +      RNA_def_struct_ui_text(srna, "Material Volume", "Volume rendering settings for a Material datablock.");
 +      
 +      prop= RNA_def_property(srna, "step_calculation", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "stepsize_type");
 +      RNA_def_property_enum_items(prop, prop_stepsize_items);
 +      RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "stepsize");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
 +      RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples.");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "shading_step_size", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "shade_stepsize");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
 +      RNA_def_property_ui_text(prop, "Shading Step Size", "Distance between subsequent volume shading samples.");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "scattering_mode", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "shade_type");
 +      RNA_def_property_enum_items(prop, prop_scattering_items);
 +      RNA_def_property_ui_text(prop, "Scattering Mode", "Method of shading, attenuating, and scattering light through the volume");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "light_cache", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */
 +      RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "precache_resolution");
 +      RNA_def_property_range(prop, 0, 1024);
 +      RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory.");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "ms_diff");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "ms_spread", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "ms_steps");
 +      RNA_def_property_range(prop, 0, 1024);
 +      RNA_def_property_ui_text(prop, "Spread", "Simulation steps, the effective distance over which the light is diffused");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "ms_intensity");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "depth_cutoff", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "depth_cutoff");
 +      RNA_def_property_range(prop, 0.0f, 1.0f);
 +      RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy.");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_PERCENTAGE);
 +      RNA_def_property_float_sdna(prop, NULL, "density");
 +      RNA_def_property_range(prop, 0.0f, 1.0f);
 +      RNA_def_property_ui_text(prop, "Density", "The base density of the volume");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +
 +      prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "density_scale");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
 +      RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "absorption");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
 +      RNA_def_property_ui_text(prop, "Absorption", "Amount of light that gets absorbed by the volume - higher values mean light travels less distance");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "absorption_color", PROP_FLOAT, PROP_COLOR);
 +      RNA_def_property_float_sdna(prop, NULL, "absorption_col");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Absorption Color", "");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
 +      
 +      prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "scattering");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
 +      RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered by the volume - values > 1.0 are non-physical");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "emission");
 +      RNA_def_property_range(prop, 0.0f, FLT_MAX);
 +      RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
 +      RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
 +      RNA_def_property_float_sdna(prop, NULL, "emission_col");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Emission Color", "");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
 +      
 +      prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_USEALPHA); /* use bitflags */
 +      RNA_def_property_ui_text(prop, "Use Alpha", "Temp method for getting a usable alpha channel");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "phase_function", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "phasefunc_type");
 +      RNA_def_property_enum_items(prop, prop_phasefunction_items);
 +      RNA_def_property_ui_text(prop, "Phase Function", "Isotropic/Anisotropic scattering");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +      
 +      prop= RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "phasefunc_g");
 +      RNA_def_property_range(prop, -1.0f, 1.0f);
 +      RNA_def_property_ui_text(prop, "Asymmetry", "Continuum between forward scattering and back scattering");
 +      RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 +}
 +
 +
  static void rna_def_material_halo(BlenderRNA *brna)
  {
        StructRNA *srna;
@@@ -1403,9 -1182,13 +1409,13 @@@ void RNA_def_material(BlenderRNA *brna
        static EnumPropertyItem prop_type_items[] = {
                {MA_TYPE_SURFACE, "SURFACE", 0, "Surface", "Render object as a surface."},
                {MA_TYPE_WIRE, "WIRE", 0, "Wire", "Render the edges of faces as wires (not supported in ray tracing)."},
 -              // {MA_TYPE_VOLUME, "VOLUME", 0, "Volume", "Render object as a volume."},
 +              {MA_TYPE_VOLUME, "VOLUME", 0, "Volume", "Render object as a volume."},
                {MA_TYPE_HALO, "HALO", 0, "Halo", "Render object as halo particles."},
                {0, NULL, 0, NULL, NULL}};
+       static EnumPropertyItem transparency_items[] = {
+               {MA_ZTRANSP, "Z_TRANSPARENCY", 0, "Z Transparency", "Use alpha buffer for transparent faces."},
+               {MA_RAYTRANSP, "RAYTRACE", 0, "Raytrace", "Use raytracing for transparent refraction rendering."},
+               {0, NULL, 0, NULL, NULL}};
  
        srna= RNA_def_struct(brna, "Material", "ID");
        RNA_def_struct_ui_text(srna, "Material", "Material datablock to defined the appearance of geometric objects for rendering.");
@@@ -28,9 -28,8 +28,9 @@@ FILE(GLOB SRC intern/source/*.c
  
  SET(INC 
    intern/include ../../../intern/guardedalloc ../blenlib ../makesdna
-   extern/include ../blenkernel ../radiosity/extern/include ../imbuf
-   ../quicktime ../include ../../kernel/gen_messaging ../blenloader
+   extern/include ../blenkernel ../imbuf
+   ../include ../../kernel/gen_messaging ../blenloader
 +  ../../../intern/smoke/extern
    ../makesrna
  )
  
@@@ -3075,14 -3025,6 +3075,9 @@@ static void init_render_mesh(Render *re
                                }
                                need_nmap_tangent= 1;
                        }
-                       /* radio faces need autosmooth, to separate shared vertices in corners */
-                       if(re->r.mode & R_RADIO)
-                               if(ma->mode & MA_RADIO) 
-                                       do_autosmooth= 1;
 +                      
 +                      if (ma->material_type == MA_TYPE_VOLUME)
 +                              add_volume(re, obr, ma);
                }
        }