2009-06-16 12:54:34 +00:00
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
def active_node_mat(mat):
|
|
|
|
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
|
|
|
|
# which settings from node-materials are used
|
|
|
|
if mat:
|
|
|
|
mat_node = mat.active_node_material
|
|
|
|
if mat_node:
|
|
|
|
return mat_node
|
2009-10-06 20:00:23 +00:00
|
|
|
else:
|
|
|
|
return mat
|
2009-10-06 15:31:25 +00:00
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
class MaterialButtonsPanel(bpy.types.Panel):
|
2009-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
2009-05-10 12:12:05 +00:00
|
|
|
__context__ = "material"
|
2009-07-30 08:10:10 +00:00
|
|
|
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
2009-05-20 13:34:04 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2009-09-01 00:33:39 +00:00
|
|
|
mat = context.material
|
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (engine in self.COMPAT_ENGINES)
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
class MATERIAL_PT_preview(MaterialButtonsPanel):
|
|
|
|
__label__ = "Preview"
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
|
2009-05-28 23:45:50 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2009-09-01 00:33:39 +00:00
|
|
|
self.layout.template_preview(context.material)
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
2009-07-26 03:54:17 +00:00
|
|
|
__show_header__ = False
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
|
2009-05-20 13:34:04 +00:00
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
def poll(self, context):
|
2009-07-30 08:10:10 +00:00
|
|
|
# An exception, dont call the parent poll func because
|
|
|
|
# this manages materials for all engine types
|
|
|
|
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
2009-09-16 18:47:42 +00:00
|
|
|
return (context.material or context.object) and (engine in self.COMPAT_ENGINES)
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
def draw(self, context):
|
2009-05-12 19:28:49 +00:00
|
|
|
layout = self.layout
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-06-03 00:17:35 +00:00
|
|
|
mat = context.material
|
2009-06-07 13:36:12 +00:00
|
|
|
ob = context.object
|
|
|
|
slot = context.material_slot
|
|
|
|
space = context.space_data
|
2009-05-20 13:34:04 +00:00
|
|
|
|
2009-07-09 19:45:27 +00:00
|
|
|
if ob:
|
|
|
|
row = layout.row()
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-07-21 00:55:20 +00:00
|
|
|
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-07-09 19:45:27 +00:00
|
|
|
col = row.column(align=True)
|
2009-08-22 08:48:01 +00:00
|
|
|
col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
|
|
|
|
col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
|
2009-10-15 13:47:18 +00:00
|
|
|
col.itemO("object.material_slot_copy", icon='ICON_COPY_ID', text="")
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-08-21 02:51:56 +00:00
|
|
|
if ob.mode == 'EDIT':
|
2009-07-21 00:55:20 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.itemO("object.material_slot_assign", text="Assign")
|
|
|
|
row.itemO("object.material_slot_select", text="Select")
|
|
|
|
row.itemO("object.material_slot_deselect", text="Deselect")
|
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
|
2009-07-28 18:54:02 +00:00
|
|
|
if ob:
|
|
|
|
split.template_ID(ob, "active_material", new="material.new")
|
2009-07-13 00:40:20 +00:00
|
|
|
row = split.row()
|
2009-07-28 18:54:02 +00:00
|
|
|
if slot:
|
2009-08-15 19:35:03 +00:00
|
|
|
row.itemR(slot, "link", text="")
|
2009-07-28 18:54:02 +00:00
|
|
|
else:
|
|
|
|
row.itemL()
|
2009-06-07 13:36:12 +00:00
|
|
|
elif mat:
|
2009-06-23 00:19:10 +00:00
|
|
|
split.template_ID(space, "pin_id")
|
2009-06-07 13:36:12 +00:00
|
|
|
split.itemS()
|
2009-09-17 00:14:47 +00:00
|
|
|
|
|
|
|
if mat:
|
|
|
|
layout.itemR(mat, "type", expand=True)
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_shading(MaterialButtonsPanel):
|
2009-07-17 12:35:57 +00:00
|
|
|
__label__ = "Shading"
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-08-20 13:45:04 +00:00
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
|
2009-08-20 13:45:04 +00:00
|
|
|
|
2009-07-09 09:07:25 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-07-09 09:07:25 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
if mat.type in ('SURFACE', 'WIRE'):
|
|
|
|
split = layout.split()
|
2009-07-17 12:35:57 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
col = split.column()
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = not mat.shadeless
|
|
|
|
sub.itemR(mat, "emit")
|
|
|
|
sub.itemR(mat, "ambient")
|
|
|
|
sub = col.column()
|
|
|
|
sub.itemR(mat, "translucency")
|
2009-07-17 12:35:57 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "shadeless")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = not mat.shadeless
|
|
|
|
sub.itemR(mat, "tangent_shading")
|
|
|
|
sub.itemR(mat, "cubic")
|
2009-07-25 12:22:22 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
elif mat.type == 'HALO':
|
|
|
|
layout.itemR(mat, "alpha")
|
2009-06-14 18:16:38 +00:00
|
|
|
|
2009-06-16 12:54:34 +00:00
|
|
|
class MATERIAL_PT_strand(MaterialButtonsPanel):
|
|
|
|
__label__ = "Strand"
|
2009-06-16 01:25:49 +00:00
|
|
|
__default_closed__ = True
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
2009-08-15 19:35:03 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
mat = context.material
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
|
2009-08-13 05:21:25 +00:00
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = context.material # dont use node material
|
2009-07-30 10:11:19 +00:00
|
|
|
tan = mat.strand
|
2009-06-13 21:22:21 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-08-21 17:53:27 +00:00
|
|
|
col = split.column(align=True)
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemL(text="Size:")
|
2009-08-27 08:46:39 +00:00
|
|
|
col.itemR(tan, "root_size", text="Root")
|
|
|
|
col.itemR(tan, "tip_size", text="Tip")
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(tan, "min_size", text="Minimum")
|
|
|
|
col.itemR(tan, "blender_units")
|
|
|
|
sub = col.column()
|
2009-08-06 13:15:23 +00:00
|
|
|
sub.active = (not mat.shadeless)
|
2009-07-30 10:11:19 +00:00
|
|
|
sub.itemR(tan, "tangent_shading")
|
2009-08-21 17:53:27 +00:00
|
|
|
col.itemR(tan, "shape")
|
2009-07-30 10:11:19 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-08-21 17:53:27 +00:00
|
|
|
col.itemL(text="Shading:")
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(tan, "width_fade")
|
|
|
|
col.itemR(tan, "uv_layer")
|
2009-08-21 17:53:27 +00:00
|
|
|
col.itemS()
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
2009-08-06 13:15:23 +00:00
|
|
|
sub.active = (not mat.shadeless)
|
2009-07-30 10:11:19 +00:00
|
|
|
sub.itemR(tan, "surface_diffuse")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = tan.surface_diffuse
|
|
|
|
sub.itemR(tan, "blend_distance", text="Distance")
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-08-07 19:14:49 +00:00
|
|
|
class MATERIAL_PT_physics(MaterialButtonsPanel):
|
|
|
|
__label__ = "Physics"
|
|
|
|
COMPAT_ENGINES = set(['BLENDER_GAME'])
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
phys = context.material.physics # dont use node material
|
2009-08-07 19:14:49 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(phys, "distance")
|
|
|
|
col.itemR(phys, "friction")
|
|
|
|
col.itemR(phys, "align_to_normal")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(phys, "force", slider=True)
|
|
|
|
col.itemR(phys, "elasticity", slider=True)
|
|
|
|
col.itemR(phys, "damp", slider=True)
|
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
class MATERIAL_PT_options(MaterialButtonsPanel):
|
|
|
|
__label__ = "Options"
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-08-13 05:21:25 +00:00
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
|
2009-08-13 05:21:25 +00:00
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-06-13 21:22:21 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "traceable")
|
|
|
|
col.itemR(mat, "full_oversampling")
|
|
|
|
col.itemR(mat, "sky")
|
|
|
|
col.itemR(mat, "exclude_mist")
|
|
|
|
col.itemR(mat, "invert_z")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemL(text="Light Group:")
|
|
|
|
sub.itemR(mat, "light_group", text="")
|
|
|
|
row = sub.row()
|
2009-07-25 21:31:17 +00:00
|
|
|
row.active = mat.light_group
|
|
|
|
row.itemR(mat, "light_group_exclusive", text="Exclusive")
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "face_texture")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = mat.face_texture
|
|
|
|
sub.itemR(mat, "face_texture_alpha")
|
2009-08-03 10:54:02 +00:00
|
|
|
col.itemS()
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(mat, "vertex_color_paint")
|
|
|
|
col.itemR(mat, "vertex_color_light")
|
|
|
|
col.itemR(mat, "object_color")
|
2009-07-17 12:35:57 +00:00
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_shadow(MaterialButtonsPanel):
|
|
|
|
__label__ = "Shadow"
|
|
|
|
__default_closed__ = True
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
|
2009-08-13 05:21:25 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
2009-07-17 12:35:57 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-07-17 12:35:57 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "shadows", text="Receive")
|
2009-08-27 08:46:39 +00:00
|
|
|
col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(mat, "only_shadow", text="Shadows Only")
|
|
|
|
col.itemR(mat, "cast_shadows_only", text="Cast Only")
|
2009-08-15 19:35:03 +00:00
|
|
|
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
|
2009-07-30 10:11:19 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-08-12 22:16:47 +00:00
|
|
|
col.itemR(mat, "cast_buffer_shadows")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
2009-08-12 22:16:47 +00:00
|
|
|
sub.active = mat.cast_buffer_shadows
|
2009-07-14 04:13:04 +00:00
|
|
|
sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
|
2009-08-12 22:16:47 +00:00
|
|
|
col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = (not mat.ray_shadow_bias)
|
|
|
|
sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-06-14 18:16:38 +00:00
|
|
|
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
|
|
|
|
__label__ = "Diffuse"
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
|
2009-06-13 21:22:21 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
2009-06-13 21:22:21 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-06-13 21:22:21 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "diffuse_color", text="")
|
|
|
|
sub = col.column()
|
2009-08-06 13:15:23 +00:00
|
|
|
sub.active = (not mat.shadeless)
|
2009-08-27 08:46:39 +00:00
|
|
|
sub.itemR(mat, "diffuse_intensity", text="Intensity")
|
2009-06-16 12:54:34 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
2009-08-06 13:15:23 +00:00
|
|
|
col.active = (not mat.shadeless)
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(mat, "diffuse_shader", text="")
|
|
|
|
col.itemR(mat, "use_diffuse_ramp", text="Ramp")
|
|
|
|
|
|
|
|
col = layout.column()
|
2009-08-06 13:15:23 +00:00
|
|
|
col.active = (not mat.shadeless)
|
2009-06-14 18:16:38 +00:00
|
|
|
if mat.diffuse_shader == 'OREN_NAYAR':
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(mat, "roughness")
|
|
|
|
elif mat.diffuse_shader == 'MINNAERT':
|
|
|
|
col.itemR(mat, "darkness")
|
|
|
|
elif mat.diffuse_shader == 'TOON':
|
|
|
|
row = col.row()
|
|
|
|
row.itemR(mat, "diffuse_toon_size", text="Size")
|
2009-08-15 19:35:03 +00:00
|
|
|
row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
|
2009-07-30 10:11:19 +00:00
|
|
|
elif mat.diffuse_shader == 'FRESNEL':
|
|
|
|
row = col.row()
|
|
|
|
row.itemR(mat, "diffuse_fresnel", text="Fresnel")
|
|
|
|
row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
|
|
|
|
|
2009-08-02 01:00:15 +00:00
|
|
|
if mat.use_diffuse_ramp:
|
|
|
|
layout.itemS()
|
2009-09-16 18:47:42 +00:00
|
|
|
layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
|
2009-08-02 01:00:15 +00:00
|
|
|
layout.itemS()
|
|
|
|
row = layout.row()
|
|
|
|
split = row.split(percentage=0.3)
|
|
|
|
split.itemL(text="Input:")
|
|
|
|
split.itemR(mat, "diffuse_ramp_input", text="")
|
|
|
|
split = row.split(percentage=0.3)
|
|
|
|
split.itemL(text="Blend:")
|
|
|
|
split.itemR(mat, "diffuse_ramp_blend", text="")
|
2009-10-09 14:35:54 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(mat, "diffuse_ramp_factor", text="Factor")
|
2009-08-25 14:26:27 +00:00
|
|
|
|
2009-06-14 18:16:38 +00:00
|
|
|
class MATERIAL_PT_specular(MaterialButtonsPanel):
|
|
|
|
__label__ = "Specular"
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
|
2009-06-14 18:16:38 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
2009-06-14 18:16:38 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-06-14 18:16:38 +00:00
|
|
|
|
2009-08-06 13:15:23 +00:00
|
|
|
layout.active = (not mat.shadeless)
|
2009-06-16 12:54:34 +00:00
|
|
|
|
2009-06-14 18:16:38 +00:00
|
|
|
split = layout.split()
|
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "specular_color", text="")
|
2009-08-27 08:46:39 +00:00
|
|
|
col.itemR(mat, "specular_intensity", text="Intensity")
|
2009-07-25 21:31:17 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "specular_shader", text="")
|
|
|
|
col.itemR(mat, "use_specular_ramp", text="Ramp")
|
|
|
|
|
|
|
|
col = layout.column()
|
2009-07-25 21:31:17 +00:00
|
|
|
if mat.specular_shader in ('COOKTORR', 'PHONG'):
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(mat, "specular_hardness", text="Hardness")
|
|
|
|
elif mat.specular_shader == 'BLINN':
|
|
|
|
row = col.row()
|
|
|
|
row.itemR(mat, "specular_hardness", text="Hardness")
|
|
|
|
row.itemR(mat, "specular_ior", text="IOR")
|
|
|
|
elif mat.specular_shader == 'WARDISO':
|
|
|
|
col.itemR(mat, "specular_slope", text="Slope")
|
|
|
|
elif mat.specular_shader == 'TOON':
|
|
|
|
row = col.row()
|
|
|
|
row.itemR(mat, "specular_toon_size", text="Size")
|
2009-08-15 19:35:03 +00:00
|
|
|
row.itemR(mat, "specular_toon_smooth", text="Smooth")
|
2009-06-14 18:16:38 +00:00
|
|
|
|
2009-07-25 21:31:17 +00:00
|
|
|
if mat.use_specular_ramp:
|
2009-08-02 01:00:15 +00:00
|
|
|
layout.itemS()
|
2009-09-16 18:47:42 +00:00
|
|
|
layout.template_color_ramp(mat, "specular_ramp", expand=True)
|
2009-08-02 01:00:15 +00:00
|
|
|
layout.itemS()
|
|
|
|
row = layout.row()
|
|
|
|
split = row.split(percentage=0.3)
|
|
|
|
split.itemL(text="Input:")
|
|
|
|
split.itemR(mat, "specular_ramp_input", text="")
|
|
|
|
split = row.split(percentage=0.3)
|
|
|
|
split.itemL(text="Blend:")
|
|
|
|
split.itemR(mat, "specular_ramp_blend", text="")
|
2009-10-09 14:35:54 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(mat, "specular_ramp_factor", text="Factor")
|
2009-07-25 12:22:22 +00:00
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
class MATERIAL_PT_sss(MaterialButtonsPanel):
|
|
|
|
__label__ = "Subsurface Scattering"
|
2009-06-16 01:25:49 +00:00
|
|
|
__default_closed__ = True
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
2009-06-16 12:54:34 +00:00
|
|
|
|
2009-05-20 13:34:04 +00:00
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
2009-05-20 14:46:49 +00:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-09-27 11:00:35 +00:00
|
|
|
sss = mat.subsurface_scattering
|
2009-08-21 17:53:27 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
self.layout.active = (not mat.shadeless)
|
|
|
|
self.layout.itemR(sss, "enabled", text="")
|
2009-05-10 12:12:05 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2009-05-12 19:28:49 +00:00
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-09-27 11:00:35 +00:00
|
|
|
sss = mat.subsurface_scattering
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-05-29 09:53:46 +00:00
|
|
|
layout.active = sss.enabled
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2009-06-14 18:16:38 +00:00
|
|
|
split = layout.split()
|
2009-08-06 13:15:23 +00:00
|
|
|
split.active = (not mat.shadeless)
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2009-08-21 17:53:27 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(sss, "ior")
|
|
|
|
col.itemR(sss, "scale")
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(sss, "color", text="")
|
2009-08-21 17:53:27 +00:00
|
|
|
col.itemR(sss, "radius", text="RGB Radius")
|
2009-07-30 10:11:19 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-08-02 11:36:12 +00:00
|
|
|
sub = col.column(align=True)
|
2009-08-21 17:53:27 +00:00
|
|
|
sub.itemL(text="Blend:")
|
|
|
|
sub.itemR(sss, "color_factor", text="Color")
|
|
|
|
sub.itemR(sss, "texture_factor", text="Texture")
|
|
|
|
sub.itemL(text="Scattering Weight:")
|
|
|
|
sub.itemR(sss, "front")
|
|
|
|
sub.itemR(sss, "back")
|
|
|
|
col.itemS()
|
|
|
|
col.itemR(sss, "error_tolerance", text="Error")
|
2009-06-14 18:16:38 +00:00
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
|
|
|
__label__ = "Mirror"
|
2009-06-16 01:25:49 +00:00
|
|
|
__default_closed__ = True
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2009-05-19 17:13:33 +00:00
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
2009-05-19 17:13:33 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
def draw_header(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
raym = active_node_mat(context.material).raytrace_mirror
|
2009-05-19 17:13:33 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
self.layout.itemR(raym, "enabled", text="")
|
2009-05-19 17:13:33 +00:00
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
def draw(self, context):
|
2009-05-12 19:28:49 +00:00
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-09-27 11:00:35 +00:00
|
|
|
raym = mat.raytrace_mirror
|
2009-06-13 21:22:21 +00:00
|
|
|
|
|
|
|
layout.active = raym.enabled
|
|
|
|
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
split = layout.split()
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
2009-08-28 14:25:17 +00:00
|
|
|
col.itemR(raym, "reflect_factor")
|
2009-07-30 10:11:19 +00:00
|
|
|
col.itemR(mat, "mirror_color", text="")
|
2009-08-25 14:26:27 +00:00
|
|
|
|
2009-08-21 17:53:27 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(raym, "fresnel")
|
2009-08-02 11:36:12 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = raym.fresnel > 0
|
2009-08-15 19:35:03 +00:00
|
|
|
sub.itemR(raym, "fresnel_factor", text="Blend")
|
2009-08-21 17:53:27 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-08-03 10:54:02 +00:00
|
|
|
col.itemS()
|
2009-08-21 17:53:27 +00:00
|
|
|
col.itemR(raym, "distance", text="Max Dist")
|
|
|
|
col.itemR(raym, "depth")
|
2009-08-03 10:54:02 +00:00
|
|
|
col.itemS()
|
|
|
|
sub = col.split(percentage=0.4)
|
|
|
|
sub.itemL(text="Fade To:")
|
|
|
|
sub.itemR(raym, "fade_to", text="")
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
2009-08-03 10:54:02 +00:00
|
|
|
col.itemL(text="Gloss:")
|
2009-08-28 14:25:17 +00:00
|
|
|
col.itemR(raym, "gloss_factor", text="Amount")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub = col.column()
|
2009-08-28 14:25:17 +00:00
|
|
|
sub.active = raym.gloss_factor < 1.0
|
2009-08-15 19:35:03 +00:00
|
|
|
sub.itemR(raym, "gloss_threshold", text="Threshold")
|
2009-07-30 10:11:19 +00:00
|
|
|
sub.itemR(raym, "gloss_samples", text="Samples")
|
2009-08-15 19:35:03 +00:00
|
|
|
sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
|
2009-08-25 14:26:27 +00:00
|
|
|
|
2009-08-15 19:35:03 +00:00
|
|
|
class MATERIAL_PT_transp(MaterialButtonsPanel):
|
|
|
|
__label__= "Transparency"
|
2009-06-16 01:25:49 +00:00
|
|
|
__default_closed__ = True
|
2009-07-30 08:10:10 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
2009-06-16 12:54:34 +00:00
|
|
|
|
2009-05-20 13:34:04 +00:00
|
|
|
def poll(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-08-25 14:26:27 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
def draw_header(self, context):
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-09-27 11:00:35 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
self.layout.itemR(mat, "transparency", text="")
|
2009-05-20 14:46:49 +00:00
|
|
|
|
2009-05-10 12:12:05 +00:00
|
|
|
def draw(self, context):
|
2009-05-12 19:28:49 +00:00
|
|
|
layout = self.layout
|
2009-07-30 10:11:19 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = active_node_mat(context.material)
|
2009-09-27 11:00:35 +00:00
|
|
|
rayt = mat.raytrace_transparency
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
row = layout.row()
|
2009-08-15 19:35:03 +00:00
|
|
|
row.active = mat.transparency and (not mat.shadeless)
|
2009-09-01 00:33:39 +00:00
|
|
|
row.itemR(mat, "transparency_method", expand=True)
|
2009-05-10 12:12:05 +00:00
|
|
|
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
split = layout.split()
|
2009-05-10 12:12:05 +00:00
|
|
|
|
2009-07-30 10:11:19 +00:00
|
|
|
col = split.column()
|
2009-09-01 00:33:39 +00:00
|
|
|
col.itemR(mat, "alpha")
|
2009-08-15 19:35:03 +00:00
|
|
|
row = col.row()
|
|
|
|
row.active = mat.transparency and (not mat.shadeless)
|
2009-08-21 17:53:27 +00:00
|
|
|
row.itemR(mat, "specular_alpha", text="Specular")
|
2009-08-25 14:26:27 +00:00
|
|
|
|
2009-08-03 10:54:02 +00:00
|
|
|
col = split.column()
|
2009-08-21 17:53:27 +00:00
|
|
|
col.active = (not mat.shadeless)
|
|
|
|
col.itemR(rayt, "fresnel")
|
2009-08-02 11:36:12 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = rayt.fresnel > 0
|
2009-08-15 19:35:03 +00:00
|
|
|
sub.itemR(rayt, "fresnel_factor", text="Blend")
|
|
|
|
|
|
|
|
if mat.transparency_method == 'RAYTRACE':
|
2009-08-21 17:53:27 +00:00
|
|
|
layout.itemS()
|
2009-08-15 19:35:03 +00:00
|
|
|
split = layout.split()
|
2009-08-21 17:53:27 +00:00
|
|
|
split.active = mat.transparency
|
2009-08-15 19:35:03 +00:00
|
|
|
|
|
|
|
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:")
|
2009-08-28 14:25:17 +00:00
|
|
|
col.itemR(rayt, "gloss_factor", text="Amount")
|
2009-08-15 19:35:03 +00:00
|
|
|
sub = col.column()
|
2009-08-28 14:25:17 +00:00
|
|
|
sub.active = rayt.gloss_factor < 1.0
|
2009-08-15 19:35:03 +00:00
|
|
|
sub.itemR(rayt, "gloss_threshold", text="Threshold")
|
|
|
|
sub.itemR(rayt, "gloss_samples", text="Samples")
|
2009-08-13 05:21:25 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_halo(MaterialButtonsPanel):
|
|
|
|
__label__= "Halo"
|
2009-08-13 05:21:25 +00:00
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-08-25 14:26:27 +00:00
|
|
|
mat = context.material
|
|
|
|
engine = context.scene.render_data.engine
|
2009-09-01 00:33:39 +00:00
|
|
|
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
|
2009-08-13 05:21:25 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = context.material # dont use node material
|
2009-09-01 00:33:39 +00:00
|
|
|
halo = mat.halo
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(mat, "diffuse_color", text="")
|
|
|
|
col.itemR(halo, "size")
|
|
|
|
col.itemR(halo, "hardness")
|
|
|
|
col.itemR(halo, "add")
|
|
|
|
col.itemL(text="Options:")
|
|
|
|
col.itemR(halo, "texture")
|
|
|
|
col.itemR(halo, "vertex_normal")
|
|
|
|
col.itemR(halo, "xalpha")
|
|
|
|
col.itemR(halo, "shaded")
|
|
|
|
col.itemR(halo, "soft")
|
2009-08-19 11:18:52 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(halo, "ring")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = halo.ring
|
|
|
|
sub.itemR(halo, "rings")
|
|
|
|
sub.itemR(mat, "mirror_color", text="")
|
|
|
|
col.itemS()
|
|
|
|
col.itemR(halo, "lines")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = halo.lines
|
|
|
|
sub.itemR(halo, "line_number", text="Lines")
|
|
|
|
sub.itemR(mat, "specular_color", text="")
|
|
|
|
col.itemS()
|
|
|
|
col.itemR(halo, "star")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = halo.star
|
|
|
|
sub.itemR(halo, "star_tips")
|
|
|
|
|
|
|
|
class MATERIAL_PT_flare(MaterialButtonsPanel):
|
|
|
|
__label__= "Flare"
|
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-08-13 05:21:25 +00:00
|
|
|
mat = context.material
|
2009-09-01 00:33:39 +00:00
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2009-09-27 11:00:35 +00:00
|
|
|
halo = context.material.halo
|
|
|
|
|
|
|
|
self.layout.itemR(halo, "flare_mode", text="")
|
2009-09-01 00:33:39 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = context.material # dont use node material
|
2009-09-01 00:33:39 +00:00
|
|
|
halo = mat.halo
|
|
|
|
|
|
|
|
layout.active = halo.flare_mode
|
2009-08-13 05:21:25 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(halo, "flare_size", text="Size")
|
|
|
|
col.itemR(halo, "flare_boost", text="Boost")
|
|
|
|
col.itemR(halo, "flare_seed", text="Seed")
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(halo, "flares_sub", text="Subflares")
|
|
|
|
col.itemR(halo, "flare_subsize", text="Subsize")
|
|
|
|
|
|
|
|
bpy.types.register(MATERIAL_PT_context_material)
|
|
|
|
bpy.types.register(MATERIAL_PT_preview)
|
|
|
|
bpy.types.register(MATERIAL_PT_diffuse)
|
|
|
|
bpy.types.register(MATERIAL_PT_specular)
|
|
|
|
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_halo)
|
|
|
|
bpy.types.register(MATERIAL_PT_flare)
|
|
|
|
bpy.types.register(MATERIAL_PT_physics)
|
|
|
|
bpy.types.register(MATERIAL_PT_strand)
|
|
|
|
bpy.types.register(MATERIAL_PT_options)
|
|
|
|
bpy.types.register(MATERIAL_PT_shadow)
|
|
|
|
|
|
|
|
# Volumetrics
|
|
|
|
class VolumeButtonsPanel(bpy.types.Panel):
|
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
|
|
|
__context__ = "material"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
mat = context.material
|
|
|
|
engine = context.scene.render_data.engine
|
|
|
|
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
|
|
|
class MATERIAL_PT_volume_density(VolumeButtonsPanel):
|
|
|
|
__label__ = "Density"
|
|
|
|
__default_closed__ = False
|
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
vol = context.material.volume # dont use node material
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
row = split.row()
|
|
|
|
row.itemR(vol, "density")
|
|
|
|
row.itemR(vol, "density_scale")
|
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
|
|
|
|
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
|
|
|
|
__label__ = "Shading"
|
|
|
|
__default_closed__ = False
|
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
vol = context.material.volume # dont use node material
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-08-16 06:10:31 +00:00
|
|
|
split = layout.split()
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-08-13 05:21:25 +00:00
|
|
|
col = split.column()
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
col.itemR(vol, "scattering")
|
|
|
|
col.itemR(vol, "asymmetry")
|
|
|
|
col.itemR(vol, "transmission_color")
|
|
|
|
|
2009-08-16 06:10:31 +00:00
|
|
|
col = split.column()
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(vol, "emission")
|
|
|
|
sub.itemR(vol, "emission_color", text="")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(vol, "reflection")
|
|
|
|
sub.itemR(vol, "reflection_color", text="")
|
2009-08-16 06:10:31 +00:00
|
|
|
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
|
|
|
|
__label__ = "Lighting"
|
2009-08-16 06:10:31 +00:00
|
|
|
__default_closed__ = False
|
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-08-16 06:10:31 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
vol = context.material.volume # dont use node material
|
2009-08-16 06:10:31 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
* changes/additions to volume lighting
Volumes can now receive shadows from external objects, either raytraced shadows or shadow maps.
To use external shadows, enable 'external shadows' in volume material 'lighting' panel. This an extra toggle since it causes a performance hit, but this can probably be revisited/optimised when the new raytrace accelerator is integrated. For shadow maps at least, it's still very quick.
Renamed 'scattering mode' to 'lighting mode' (a bit simpler to understand), and the options inside. Now there's:
- Shadeless
takes light contribution, but without shadowing or self-shading (fast)
good for fog-like volumes, such as mist, or underwater effects
- Shadowed (new)
takes light contribution with shadows, but no self-shading. (medium)
good for mist etc. with directional light sources
eg. http://vimeo.com/6901636
- Shaded
takes light contribution with internal/external shadows, and self shading (slower)
good for thicker/textured volumes like smoke
- Multiple scattering etc (still doesn't work properly, on the todo).
2009-10-05 02:59:47 +00:00
|
|
|
col.itemR(vol, "lighting_mode", text="")
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
* changes/additions to volume lighting
Volumes can now receive shadows from external objects, either raytraced shadows or shadow maps.
To use external shadows, enable 'external shadows' in volume material 'lighting' panel. This an extra toggle since it causes a performance hit, but this can probably be revisited/optimised when the new raytrace accelerator is integrated. For shadow maps at least, it's still very quick.
Renamed 'scattering mode' to 'lighting mode' (a bit simpler to understand), and the options inside. Now there's:
- Shadeless
takes light contribution, but without shadowing or self-shading (fast)
good for fog-like volumes, such as mist, or underwater effects
- Shadowed (new)
takes light contribution with shadows, but no self-shading. (medium)
good for mist etc. with directional light sources
eg. http://vimeo.com/6901636
- Shaded
takes light contribution with internal/external shadows, and self shading (slower)
good for thicker/textured volumes like smoke
- Multiple scattering etc (still doesn't work properly, on the todo).
2009-10-05 02:59:47 +00:00
|
|
|
if vol.lighting_mode == 'SHADED':
|
|
|
|
col.itemR(vol, "external_shadows")
|
2009-08-13 05:21:25 +00:00
|
|
|
col.itemR(vol, "light_cache")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = vol.light_cache
|
2009-08-16 06:10:31 +00:00
|
|
|
sub.itemR(vol, "cache_resolution")
|
* changes/additions to volume lighting
Volumes can now receive shadows from external objects, either raytraced shadows or shadow maps.
To use external shadows, enable 'external shadows' in volume material 'lighting' panel. This an extra toggle since it causes a performance hit, but this can probably be revisited/optimised when the new raytrace accelerator is integrated. For shadow maps at least, it's still very quick.
Renamed 'scattering mode' to 'lighting mode' (a bit simpler to understand), and the options inside. Now there's:
- Shadeless
takes light contribution, but without shadowing or self-shading (fast)
good for fog-like volumes, such as mist, or underwater effects
- Shadowed (new)
takes light contribution with shadows, but no self-shading. (medium)
good for mist etc. with directional light sources
eg. http://vimeo.com/6901636
- Shaded
takes light contribution with internal/external shadows, and self shading (slower)
good for thicker/textured volumes like smoke
- Multiple scattering etc (still doesn't work properly, on the todo).
2009-10-05 02:59:47 +00:00
|
|
|
elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.enabled = True
|
|
|
|
sub.active = False
|
|
|
|
sub.itemR(vol, "light_cache")
|
2009-08-13 05:21:25 +00:00
|
|
|
col.itemR(vol, "cache_resolution")
|
2009-08-16 06:10:31 +00:00
|
|
|
|
2009-09-27 11:00:35 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(vol, "ms_diffusion")
|
|
|
|
sub.itemR(vol, "ms_spread")
|
|
|
|
sub.itemR(vol, "ms_intensity")
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
|
2009-08-23 02:54:30 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
|
2009-08-23 02:54:30 +00:00
|
|
|
__label__= "Transparency"
|
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
mat = context.material # dont use node material
|
2009-08-23 02:54:30 +00:00
|
|
|
|
2009-09-27 11:00:35 +00:00
|
|
|
layout.itemR(mat, "transparency_method", expand=True)
|
2009-08-13 05:21:25 +00:00
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
|
2009-08-16 06:10:31 +00:00
|
|
|
__label__ = "Integration"
|
|
|
|
__default_closed__ = False
|
|
|
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-08-16 06:10:31 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-09-27 11:00:35 +00:00
|
|
|
|
2009-10-06 15:31:25 +00:00
|
|
|
vol = context.material.volume # dont use node material
|
2009-08-16 06:10:31 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Step Calculation:")
|
|
|
|
col.itemR(vol, "step_calculation", text="")
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
col = col.column(align=True)
|
|
|
|
col.itemR(vol, "step_size")
|
2009-08-16 06:10:31 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL()
|
|
|
|
col.itemR(vol, "depth_cutoff")
|
2009-07-09 09:07:25 +00:00
|
|
|
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
bpy.types.register(MATERIAL_PT_volume_density)
|
2009-08-16 06:10:31 +00:00
|
|
|
bpy.types.register(MATERIAL_PT_volume_shading)
|
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.
Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.
There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering
Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)
More revisions to come later...
2009-09-29 22:01:32 +00:00
|
|
|
bpy.types.register(MATERIAL_PT_volume_lighting)
|
2009-08-23 02:54:30 +00:00
|
|
|
bpy.types.register(MATERIAL_PT_volume_transp)
|
2009-08-16 06:10:31 +00:00
|
|
|
bpy.types.register(MATERIAL_PT_volume_integration)
|