[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26353] trunk/blender: Ambient Occlusion split up into:
Brecht Van Lommel
brecht at blender.org
Wed Jan 27 22:40:08 CET 2010
Revision: 26353
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26353
Author: blendix
Date: 2010-01-27 22:40:08 +0100 (Wed, 27 Jan 2010)
Log Message:
-----------
Ambient Occlusion split up into:
Ambient occlusion: multiplied with direct lighting by default, add
is also still available and more blending methods might be added if
they are useful. This is fundamentally a non physical effect.
Environment lighting: always added as you would expect (though you can
subtract by specifying negative energy). This can be just white or take
colors or textures from the world.
Indirect lighting: only supported for AAO at the moment (and is still
too approximate), and also is always added. A factor is available to
specify how much is added, though value 1.0 is correct.
Also:
* Material ambient value now defaults to 1.0.
* Added Environment, Indirect and Emit pass.
* "Both" blending method is no longer available.
* Attenuation, sampling parameters are still shared, some could be split
up, though if they are different this would affect performance.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_render.py
trunk/blender/release/scripts/ui/properties_world.py
trunk/blender/source/blender/blenkernel/BKE_blender.h
trunk/blender/source/blender/blenkernel/intern/material.c
trunk/blender/source/blender/blenkernel/intern/world.c
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/makesdna/DNA_scene_types.h
trunk/blender/source/blender/makesdna/DNA_world_types.h
trunk/blender/source/blender/makesrna/intern/rna_render.c
trunk/blender/source/blender/makesrna/intern/rna_scene.c
trunk/blender/source/blender/makesrna/intern/rna_world.c
trunk/blender/source/blender/render/extern/include/RE_shader_ext.h
trunk/blender/source/blender/render/intern/include/render_types.h
trunk/blender/source/blender/render/intern/include/rendercore.h
trunk/blender/source/blender/render/intern/source/convertblender.c
trunk/blender/source/blender/render/intern/source/occlusion.c
trunk/blender/source/blender/render/intern/source/pipeline.c
trunk/blender/source/blender/render/intern/source/rayshade.c
trunk/blender/source/blender/render/intern/source/rendercore.c
trunk/blender/source/blender/render/intern/source/shadeinput.c
trunk/blender/source/blender/render/intern/source/shadeoutput.c
trunk/blender/source/blender/render/intern/source/strand.c
trunk/blender/source/blender/render/intern/source/zbuf.c
Modified: trunk/blender/release/scripts/ui/properties_render.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_render.py 2010-01-27 21:33:39 UTC (rev 26352)
+++ trunk/blender/release/scripts/ui/properties_render.py 2010-01-27 21:40:08 UTC (rev 26353)
@@ -137,11 +137,11 @@
col.prop(rl, "pass_uv")
col.prop(rl, "pass_mist")
col.prop(rl, "pass_object_index")
+ col.prop(rl, "pass_color")
if wide_ui:
col = split.column()
col.label()
- col.prop(rl, "pass_color")
col.prop(rl, "pass_diffuse")
row = col.row()
row.prop(rl, "pass_specular")
@@ -150,16 +150,24 @@
row.prop(rl, "pass_shadow")
row.prop(rl, "pass_shadow_exclude", text="", icon='X')
row = col.row()
+ row.prop(rl, "pass_emit")
+ row.prop(rl, "pass_emit_exclude", text="", icon='X')
+ row = col.row()
row.prop(rl, "pass_ao")
row.prop(rl, "pass_ao_exclude", text="", icon='X')
row = col.row()
+ row.prop(rl, "pass_environment")
+ row.prop(rl, "pass_environment_exclude", text="", icon='X')
+ row = col.row()
+ row.prop(rl, "pass_indirect")
+ row.prop(rl, "pass_indirect_exclude", text="", icon='X')
+ row = col.row()
row.prop(rl, "pass_reflection")
row.prop(rl, "pass_reflection_exclude", text="", icon='X')
row = col.row()
row.prop(rl, "pass_refraction")
row.prop(rl, "pass_refraction_exclude", text="", icon='X')
-
class RENDER_PT_shading(RenderButtonsPanel):
bl_label = "Shading"
COMPAT_ENGINES = {'BLENDER_RENDER'}
Modified: trunk/blender/release/scripts/ui/properties_world.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_world.py 2010-01-27 21:33:39 UTC (rev 26352)
+++ trunk/blender/release/scripts/ui/properties_world.py 2010-01-27 21:40:08 UTC (rev 26353)
@@ -105,6 +105,7 @@
class WORLD_PT_mist(WorldButtonsPanel):
bl_label = "Mist"
+ bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw_header(self, context):
@@ -135,6 +136,7 @@
class WORLD_PT_stars(WorldButtonsPanel):
bl_label = "Stars"
+ bl_default_closed = True
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw_header(self, context):
@@ -166,77 +168,110 @@
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw_header(self, context):
- world = context.world
+ light = context.world.lighting
+ self.layout.prop(light, "use_ambient_occlusion", text="")
- self.layout.prop(world.ambient_occlusion, "enabled", text="")
+ def draw(self, context):
+ layout = self.layout
+ light = context.world.lighting
+ layout.active = light.use_ambient_occlusion
+
+ split = layout.split()
+ split.prop(light, "ao_factor", text="Factor")
+ split.prop(light, "ao_blend_mode", text="")
+
+class WORLD_PT_environment_lighting(WorldButtonsPanel):
+ bl_label = "Environment Lighting"
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+ def draw_header(self, context):
+ light = context.world.lighting
+ self.layout.prop(light, "use_environment_lighting", text="")
+
def draw(self, context):
layout = self.layout
- wide_ui = context.region.width > narrowui
- ao = context.world.ambient_occlusion
+ light = context.world.lighting
- layout.active = ao.enabled
+ layout.active = light.use_environment_lighting
- layout.prop(ao, "gather_method", expand=True)
-
split = layout.split()
+ split.prop(light, "environment_energy", text="Energy")
+ split.prop(light, "environment_color", text="")
- col = split.column()
- col.label(text="Attenuation:")
- if ao.gather_method == 'RAYTRACE':
- col.prop(ao, "distance")
- col.prop(ao, "falloff")
- sub = col.row()
- sub.active = ao.falloff
- sub.prop(ao, "falloff_strength", text="Strength")
+class WORLD_PT_indirect_lighting(WorldButtonsPanel):
+ bl_label = "Indirect Lighting"
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
- if ao.gather_method == 'RAYTRACE':
- if wide_ui:
- col = split.column()
+ def draw_header(self, context):
+ light = context.world.lighting
+ self.layout.prop(light, "use_indirect_lighting", text="")
- col.label(text="Sampling:")
- col.prop(ao, "sample_method", text="")
+ def draw(self, context):
+ layout = self.layout
+ light = context.world.lighting
- sub = col.column()
- sub.prop(ao, "samples")
+ layout.active = light.use_indirect_lighting
- if ao.sample_method == 'ADAPTIVE_QMC':
- sub.prop(ao, "threshold")
- sub.prop(ao, "adapt_to_speed", slider=True)
- elif ao.sample_method == 'CONSTANT_JITTERED':
- sub.prop(ao, "bias")
+ split = layout.split()
+ split.prop(light, "indirect_factor", text="Factor")
+ split.prop(light, "indirect_bounces", text="Bounces")
- if ao.gather_method == 'APPROXIMATE':
- if wide_ui:
- col = split.column()
+class WORLD_PT_gather(WorldButtonsPanel):
+ bl_label = "Gather"
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
- col.label(text="Sampling:")
- col.prop(ao, "passes")
- col.prop(ao, "error_tolerance", text="Error")
- col.prop(ao, "pixel_cache")
- col.prop(ao, "correction")
+ def draw(self, context):
+ layout = self.layout
+ light = context.world.lighting
- col = layout.column()
- col.label(text="Influence:")
+ layout.active = light.use_ambient_occlusion or light.use_environment_lighting or light.use_indirect_lighting
- col.row().prop(ao, "blend_mode", expand=True)
+ layout.prop(light, "gather_method", expand=True)
split = layout.split()
col = split.column()
- col.prop(ao, "energy")
- col.prop(ao, "indirect_energy")
+ col.label(text="Attenuation:")
+ if light.gather_method == 'RAYTRACE':
+ col.prop(light, "distance")
+ col.prop(light, "falloff")
+ sub = col.row()
+ sub.active = light.falloff
+ sub.prop(light, "falloff_strength", text="Strength")
- if wide_ui:
+ if light.gather_method == 'RAYTRACE':
col = split.column()
- col.prop(ao, "color")
- col.prop(ao, "indirect_bounces")
+ col.label(text="Sampling:")
+ col.prop(light, "sample_method", text="")
+
+ sub = col.column()
+ sub.prop(light, "samples")
+
+ if light.sample_method == 'ADAPTIVE_QMC':
+ sub.prop(light, "threshold")
+ sub.prop(light, "adapt_to_speed", slider=True)
+ elif light.sample_method == 'CONSTANT_JITTERED':
+ sub.prop(light, "bias")
+
+ if light.gather_method == 'APPROXIMATE':
+ col = split.column()
+
+ col.label(text="Sampling:")
+ col.prop(light, "passes")
+ col.prop(light, "error_tolerance", text="Error")
+ col.prop(light, "pixel_cache")
+ col.prop(light, "correction")
+
bpy.types.register(WORLD_PT_context_world)
bpy.types.register(WORLD_PT_preview)
bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion)
+bpy.types.register(WORLD_PT_environment_lighting)
+bpy.types.register(WORLD_PT_indirect_lighting)
+bpy.types.register(WORLD_PT_gather)
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)
-bpy.types.register(WORLD_PT_custom_props)
\ No newline at end of file
+bpy.types.register(WORLD_PT_custom_props)
Modified: trunk/blender/source/blender/blenkernel/BKE_blender.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_blender.h 2010-01-27 21:33:39 UTC (rev 26352)
+++ trunk/blender/source/blender/blenkernel/BKE_blender.h 2010-01-27 21:40:08 UTC (rev 26353)
@@ -43,7 +43,7 @@
struct ReportList;
#define BLENDER_VERSION 250
-#define BLENDER_SUBVERSION 14
+#define BLENDER_SUBVERSION 15
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
Modified: trunk/blender/source/blender/blenkernel/intern/material.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/material.c 2010-01-27 21:33:39 UTC (rev 26352)
+++ trunk/blender/source/blender/blenkernel/intern/material.c 2010-01-27 21:40:08 UTC (rev 26353)
@@ -112,7 +112,7 @@
ma->specr= ma->specg= ma->specb= 1.0;
ma->mirr= ma->mirg= ma->mirb= 1.0;
ma->spectra= 1.0;
- ma->amb= 0.5;
+ ma->amb= 1.0;
ma->alpha= 1.0;
ma->spec= ma->hasize= 0.5;
ma->har= 50;
Modified: trunk/blender/source/blender/blenkernel/intern/world.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/world.c 2010-01-27 21:33:39 UTC (rev 26352)
+++ trunk/blender/source/blender/blenkernel/intern/world.c 2010-01-27 21:40:08 UTC (rev 26353)
@@ -102,6 +102,9 @@
wrld->aodist= 10.0f;
wrld->aosamp= 5;
wrld->aoenergy= 1.0f;
+ wrld->ao_env_energy= 1.0f;
+ wrld->ao_indirect_energy= 1.0f;
+ wrld->ao_indirect_bounces= 1;
wrld->aobias= 0.05f;
wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY;
wrld->ao_approx_error= 0.25f;
Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c 2010-01-27 21:33:39 UTC (rev 26352)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c 2010-01-27 21:40:08 UTC (rev 26353)
@@ -10604,6 +10604,36 @@
}
}
+ if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 15)) {
+ World *wo;
+ Material *ma;
+
+ /* ambient default from 0.5f to 1.0f */
+ for(ma= main->mat.first; ma; ma=ma->id.next)
+ ma->amb *= 2.0f;
+
+ for(wo= main->world.first; wo; wo=wo->id.next) {
+ /* ao splitting into ao/env/indirect */
+ wo->ao_env_energy= wo->aoenergy;
+ wo->aoenergy= 1.0f;
+
+ if(wo->ao_indirect_bounces == 0)
+ wo->ao_indirect_bounces= 1;
+ else
+ wo->mode |= WO_INDIRECT_LIGHT;
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list