svn merge ^/trunk/blender -r47805:47873
authorCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jun 2012 09:39:54 +0000 (09:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jun 2012 09:39:54 +0000 (09:39 +0000)
373 files changed:
doc/python_api/rst/bge.types.rst
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_camera.cpp
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_light.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_types.h
intern/cycles/render/integrator.cpp
intern/cycles/render/integrator.h
intern/cycles/render/light.cpp
intern/cycles/render/light.h
intern/cycles/render/object.cpp
intern/cycles/render/scene.cpp
intern/raskter/raskter.c
intern/raskter/raskter.h
release/scripts/presets/interface_theme/back_to_black.xml
release/scripts/presets/interface_theme/blender_24x.xml
release/scripts/presets/interface_theme/elsyiun.xml
release/scripts/presets/interface_theme/hexagon.xml
release/scripts/presets/interface_theme/ubuntu_ambiance.xml
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/BKE_mask.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_shrinkwrap.h
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/mask.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/BLI_math_color.h
source/blender/blenlib/intern/math_color.c
source/blender/blenlib/intern/math_color_inline.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationImporter.cpp
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/CameraExporter.cpp
source/blender/collada/DocumentExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/EffectExporter.cpp
source/blender/collada/ErrorHandler.cpp
source/blender/collada/ExtraHandler.cpp
source/blender/collada/ExtraTags.cpp
source/blender/collada/GeometryExporter.cpp
source/blender/collada/ImageExporter.cpp
source/blender/collada/InstanceWriter.cpp
source/blender/collada/LightExporter.cpp
source/blender/collada/MaterialExporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/collada/SceneExporter.cpp
source/blender/collada/SkinInfo.cpp
source/blender/collada/TransformReader.cpp
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada.cpp
source/blender/collada/collada_internal.cpp
source/blender/collada/collada_utils.cpp
source/blender/compositor/CMakeLists.txt
source/blender/compositor/COM_compositor.h
source/blender/compositor/COM_defines.h
source/blender/compositor/intern/COM_CPUDevice.h
source/blender/compositor/intern/COM_ChannelInfo.h
source/blender/compositor/intern/COM_ChunkOrder.h
source/blender/compositor/intern/COM_CompositorContext.h
source/blender/compositor/intern/COM_Converter.h
source/blender/compositor/intern/COM_Device.h
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/intern/COM_ExecutionGroup.h
source/blender/compositor/intern/COM_ExecutionSystem.cpp
source/blender/compositor/intern/COM_ExecutionSystem.h
source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
source/blender/compositor/intern/COM_ExecutionSystemHelper.h
source/blender/compositor/intern/COM_InputSocket.h
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/compositor/intern/COM_MemoryBuffer.h
source/blender/compositor/intern/COM_MemoryProxy.h
source/blender/compositor/intern/COM_Node.h
source/blender/compositor/intern/COM_NodeBase.h
source/blender/compositor/intern/COM_NodeOperation.cpp
source/blender/compositor/intern/COM_NodeOperation.h
source/blender/compositor/intern/COM_OpenCLDevice.h
source/blender/compositor/intern/COM_OutputSocket.h
source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp [new file with mode: 0644]
source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h [new file with mode: 0644]
source/blender/compositor/intern/COM_Socket.h
source/blender/compositor/intern/COM_SocketConnection.h
source/blender/compositor/intern/COM_SocketReader.h
source/blender/compositor/intern/COM_WorkPackage.h
source/blender/compositor/intern/COM_WorkScheduler.h
source/blender/compositor/intern/COM_compositor.cpp
source/blender/compositor/nodes/COM_AlphaOverNode.h
source/blender/compositor/nodes/COM_BilateralBlurNode.h
source/blender/compositor/nodes/COM_BlurNode.h
source/blender/compositor/nodes/COM_BokehBlurNode.h
source/blender/compositor/nodes/COM_BokehImageNode.h
source/blender/compositor/nodes/COM_BoxMaskNode.h
source/blender/compositor/nodes/COM_BrightnessNode.h
source/blender/compositor/nodes/COM_ChannelMatteNode.h
source/blender/compositor/nodes/COM_ChromaMatteNode.h
source/blender/compositor/nodes/COM_ColorBalanceNode.h
source/blender/compositor/nodes/COM_ColorCorrectionNode.h
source/blender/compositor/nodes/COM_ColorCurveNode.h
source/blender/compositor/nodes/COM_ColorMatteNode.h
source/blender/compositor/nodes/COM_ColorNode.h
source/blender/compositor/nodes/COM_ColorRampNode.h
source/blender/compositor/nodes/COM_ColorSpillNode.h
source/blender/compositor/nodes/COM_ColorToBWNode.h
source/blender/compositor/nodes/COM_CombineHSVANode.h
source/blender/compositor/nodes/COM_CombineRGBANode.h
source/blender/compositor/nodes/COM_CombineYCCANode.h
source/blender/compositor/nodes/COM_CombineYUVANode.h
source/blender/compositor/nodes/COM_CompositorNode.h
source/blender/compositor/nodes/COM_ConvertAlphaNode.h
source/blender/compositor/nodes/COM_CropNode.h
source/blender/compositor/nodes/COM_DefocusNode.h
source/blender/compositor/nodes/COM_DifferenceMatteNode.h
source/blender/compositor/nodes/COM_DilateErodeNode.cpp
source/blender/compositor/nodes/COM_DilateErodeNode.h
source/blender/compositor/nodes/COM_DirectionalBlurNode.h
source/blender/compositor/nodes/COM_DisplaceNode.h
source/blender/compositor/nodes/COM_DistanceMatteNode.h
source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h
source/blender/compositor/nodes/COM_EllipseMaskNode.h
source/blender/compositor/nodes/COM_FilterNode.h
source/blender/compositor/nodes/COM_FlipNode.h
source/blender/compositor/nodes/COM_GammaNode.h
source/blender/compositor/nodes/COM_GlareNode.cpp
source/blender/compositor/nodes/COM_GlareNode.h
source/blender/compositor/nodes/COM_GroupNode.h
source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h
source/blender/compositor/nodes/COM_HueSaturationValueNode.h
source/blender/compositor/nodes/COM_IDMaskNode.h
source/blender/compositor/nodes/COM_ImageNode.h
source/blender/compositor/nodes/COM_InvertNode.h
source/blender/compositor/nodes/COM_LensDistortionNode.h
source/blender/compositor/nodes/COM_LuminanceMatteNode.h
source/blender/compositor/nodes/COM_MapUVNode.h
source/blender/compositor/nodes/COM_MapValueNode.h
source/blender/compositor/nodes/COM_MaskNode.cpp
source/blender/compositor/nodes/COM_MaskNode.h
source/blender/compositor/nodes/COM_MathNode.h
source/blender/compositor/nodes/COM_MixNode.h
source/blender/compositor/nodes/COM_MovieClipNode.h
source/blender/compositor/nodes/COM_MovieDistortionNode.h
source/blender/compositor/nodes/COM_MuteNode.cpp
source/blender/compositor/nodes/COM_MuteNode.h
source/blender/compositor/nodes/COM_NormalNode.h
source/blender/compositor/nodes/COM_NormalizeNode.h
source/blender/compositor/nodes/COM_OutputFileNode.h
source/blender/compositor/nodes/COM_RenderLayersNode.h
source/blender/compositor/nodes/COM_RotateNode.h
source/blender/compositor/nodes/COM_ScaleNode.cpp
source/blender/compositor/nodes/COM_ScaleNode.h
source/blender/compositor/nodes/COM_SeparateHSVANode.h
source/blender/compositor/nodes/COM_SeparateRGBANode.h
source/blender/compositor/nodes/COM_SeparateYCCANode.h
source/blender/compositor/nodes/COM_SeparateYUVANode.h
source/blender/compositor/nodes/COM_SetAlphaNode.h
source/blender/compositor/nodes/COM_SocketProxyNode.h
source/blender/compositor/nodes/COM_SplitViewerNode.h
source/blender/compositor/nodes/COM_Stabilize2dNode.h
source/blender/compositor/nodes/COM_SwitchNode.h
source/blender/compositor/nodes/COM_TextureNode.h
source/blender/compositor/nodes/COM_TimeNode.h
source/blender/compositor/nodes/COM_TonemapNode.h
source/blender/compositor/nodes/COM_TransformNode.h
source/blender/compositor/nodes/COM_TranslateNode.h
source/blender/compositor/nodes/COM_ValueNode.h
source/blender/compositor/nodes/COM_VectorBlurNode.cpp
source/blender/compositor/nodes/COM_VectorBlurNode.h
source/blender/compositor/nodes/COM_VectorCurveNode.h
source/blender/compositor/nodes/COM_ViewLevelsNode.h
source/blender/compositor/nodes/COM_ViewerNode.h
source/blender/compositor/nodes/COM_ZCombineNode.h
source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
source/blender/compositor/operations/COM_AntiAliasOperation.cpp
source/blender/compositor/operations/COM_AntiAliasOperation.h
source/blender/compositor/operations/COM_BilateralBlurOperation.h
source/blender/compositor/operations/COM_BlurBaseOperation.h
source/blender/compositor/operations/COM_BokehBlurOperation.h
source/blender/compositor/operations/COM_BokehImageOperation.h
source/blender/compositor/operations/COM_BoxMaskOperation.h
source/blender/compositor/operations/COM_BrightnessOperation.h
source/blender/compositor/operations/COM_CalculateMeanOperation.cpp
source/blender/compositor/operations/COM_CalculateMeanOperation.h
source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp
source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
source/blender/compositor/operations/COM_ChangeHSVOperation.h
source/blender/compositor/operations/COM_ChannelMatteOperation.h
source/blender/compositor/operations/COM_ChromaMatteOperation.h
source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
source/blender/compositor/operations/COM_ColorCorrectionOperation.h
source/blender/compositor/operations/COM_ColorCurveOperation.h
source/blender/compositor/operations/COM_ColorMatteOperation.h
source/blender/compositor/operations/COM_ColorRampOperation.h
source/blender/compositor/operations/COM_ColorSpillOperation.h
source/blender/compositor/operations/COM_CombineChannelsOperation.h
source/blender/compositor/operations/COM_CompositorOperation.cpp
source/blender/compositor/operations/COM_CompositorOperation.h
source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
source/blender/compositor/operations/COM_ConvertColorToBWOperation.h
source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h
source/blender/compositor/operations/COM_ConvertColourToValueProg.h
source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h
source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h
source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h
source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h
source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h
source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h
source/blender/compositor/operations/COM_ConvertValueToColourProg.h
source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h
source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h
source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h
source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h
source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h
source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h
source/blender/compositor/operations/COM_ConvolutionFilterOperation.h
source/blender/compositor/operations/COM_CropOperation.h
source/blender/compositor/operations/COM_CurveBaseOperation.h
source/blender/compositor/operations/COM_DifferenceMatteOperation.h
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/compositor/operations/COM_DilateErodeOperation.h
source/blender/compositor/operations/COM_DirectionalBlurOperation.h
source/blender/compositor/operations/COM_DisplaceOperation.h
source/blender/compositor/operations/COM_DisplaceSimpleOperation.h
source/blender/compositor/operations/COM_DistanceMatteOperation.h
source/blender/compositor/operations/COM_DotproductOperation.h
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h
source/blender/compositor/operations/COM_EllipseMaskOperation.h
source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
source/blender/compositor/operations/COM_FastGaussianBlurOperation.h
source/blender/compositor/operations/COM_FlipOperation.h
source/blender/compositor/operations/COM_FogGlowImageOperation.cpp [deleted file]
source/blender/compositor/operations/COM_GammaCorrectOperation.h
source/blender/compositor/operations/COM_GammaOperation.h
source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h
source/blender/compositor/operations/COM_GaussianXBlurOperation.h
source/blender/compositor/operations/COM_GaussianYBlurOperation.h
source/blender/compositor/operations/COM_GlareBaseOperation.cpp
source/blender/compositor/operations/COM_GlareBaseOperation.h
source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp [new file with mode: 0644]
source/blender/compositor/operations/COM_GlareFogGlowOperation.h [new file with mode: 0644]
source/blender/compositor/operations/COM_GlareGhostOperation.cpp
source/blender/compositor/operations/COM_GlareGhostOperation.h
source/blender/compositor/operations/COM_GlareSimpleStarOperation.cpp
source/blender/compositor/operations/COM_GlareSimpleStarOperation.h
source/blender/compositor/operations/COM_GlareStreaksOperation.cpp
source/blender/compositor/operations/COM_GlareStreaksOperation.h
source/blender/compositor/operations/COM_GlareThresholdOperation.cpp
source/blender/compositor/operations/COM_GlareThresholdOperation.h
source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h
source/blender/compositor/operations/COM_IDMaskOperation.h
source/blender/compositor/operations/COM_ImageOperation.h
source/blender/compositor/operations/COM_InvertOperation.h
source/blender/compositor/operations/COM_LuminanceMatteOperation.h
source/blender/compositor/operations/COM_MapUVOperation.h
source/blender/compositor/operations/COM_MapValueOperation.h
source/blender/compositor/operations/COM_MaskOperation.cpp
source/blender/compositor/operations/COM_MaskOperation.h
source/blender/compositor/operations/COM_MathBaseOperation.h
source/blender/compositor/operations/COM_MixAddOperation.h
source/blender/compositor/operations/COM_MixBaseOperation.h
source/blender/compositor/operations/COM_MixBlendOperation.h
source/blender/compositor/operations/COM_MixBurnOperation.h
source/blender/compositor/operations/COM_MixColorOperation.h
source/blender/compositor/operations/COM_MixDarkenOperation.h
source/blender/compositor/operations/COM_MixDifferenceOperation.h
source/blender/compositor/operations/COM_MixDivideOperation.h
source/blender/compositor/operations/COM_MixDodgeOperation.h
source/blender/compositor/operations/COM_MixGlareOperation.cpp [new file with mode: 0644]
source/blender/compositor/operations/COM_MixGlareOperation.h [moved from source/blender/compositor/operations/COM_FogGlowImageOperation.h with 66% similarity]
source/blender/compositor/operations/COM_MixHueOperation.h
source/blender/compositor/operations/COM_MixLightenOperation.h
source/blender/compositor/operations/COM_MixLinearLightOperation.h
source/blender/compositor/operations/COM_MixMultiplyOperation.h
source/blender/compositor/operations/COM_MixOverlayOperation.h
source/blender/compositor/operations/COM_MixSaturationOperation.h
source/blender/compositor/operations/COM_MixScreenOperation.h
source/blender/compositor/operations/COM_MixSoftLightOperation.h
source/blender/compositor/operations/COM_MixSubtractOperation.h
source/blender/compositor/operations/COM_MixValueOperation.h
source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
source/blender/compositor/operations/COM_MovieClipOperation.h
source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
source/blender/compositor/operations/COM_MovieDistortionOperation.h
source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
source/blender/compositor/operations/COM_MultilayerImageOperation.h
source/blender/compositor/operations/COM_NormalizeOperation.cpp
source/blender/compositor/operations/COM_NormalizeOperation.h
source/blender/compositor/operations/COM_OpenCLKernels.cl
source/blender/compositor/operations/COM_OpenCLKernels.cl.h
source/blender/compositor/operations/COM_OutputFileOperation.cpp
source/blender/compositor/operations/COM_OutputFileOperation.h
source/blender/compositor/operations/COM_PreviewOperation.h
source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h
source/blender/compositor/operations/COM_QualityStepHelper.h
source/blender/compositor/operations/COM_ReadBufferOperation.h
source/blender/compositor/operations/COM_RenderLayersAlphaProg.h
source/blender/compositor/operations/COM_RenderLayersBaseProg.h
source/blender/compositor/operations/COM_RotateOperation.h
source/blender/compositor/operations/COM_ScaleOperation.cpp
source/blender/compositor/operations/COM_ScaleOperation.h
source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
source/blender/compositor/operations/COM_SeparateChannelOperation.h
source/blender/compositor/operations/COM_SetAlphaOperation.h
source/blender/compositor/operations/COM_SetColorOperation.h
source/blender/compositor/operations/COM_SetSamplerOperation.h
source/blender/compositor/operations/COM_SetValueOperation.h
source/blender/compositor/operations/COM_SetVectorOperation.h
source/blender/compositor/operations/COM_SocketProxyOperation.h
source/blender/compositor/operations/COM_SplitViewerOperation.h
source/blender/compositor/operations/COM_TextureOperation.h
source/blender/compositor/operations/COM_TonemapOperation.cpp
source/blender/compositor/operations/COM_TonemapOperation.h
source/blender/compositor/operations/COM_TranslateOperation.h
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
source/blender/compositor/operations/COM_VectorBlurOperation.cpp
source/blender/compositor/operations/COM_VectorBlurOperation.h
source/blender/compositor/operations/COM_VectorCurveOperation.h
source/blender/compositor/operations/COM_ViewerBaseOperation.h
source/blender/compositor/operations/COM_ViewerOperation.cpp
source/blender/compositor/operations/COM_ViewerOperation.h
source/blender/compositor/operations/COM_WriteBufferOperation.cpp
source/blender/compositor/operations/COM_WriteBufferOperation.h
source/blender/compositor/operations/COM_ZCombineOperation.h
source/blender/editors/mask/mask_draw.c
source/blender/editors/mask/mask_edit.c
source/blender/editors/mask/mask_intern.h
source/blender/editors/mask/mask_ops.c
source/blender/editors/mesh/editmesh_bvh.c
source/blender/editors/mesh/editmesh_bvh.h
source/blender/editors/mesh/meshtools.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/rna_mask.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_space.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/nodes/composite/nodes/node_composite_glare.c
source/blender/nodes/composite/nodes/node_composite_mask.c
source/blender/nodes/composite/nodes/node_composite_tonemap.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/volumetric.c
source/blender/windowmanager/intern/wm_operators.c
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_RadarSensor.h

index bcef816dc9d2a577b188ad7cefc4290f701f8f1e..ff85df1f68b4d2143e5b952017e9279f3140f93a 100644 (file)
@@ -2692,7 +2692,7 @@ Game Types (bge.types)
 
       The angle of the cone (in degrees) with which to test.
 
-      :type: float from 0 to 360
+      :type: float
 
    .. attribute:: axis
 
@@ -2703,11 +2703,6 @@ Game Types (bge.types)
       KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, 
       KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
 
-   .. method:: getConeHeight()
-
-      :return: The height of the cone with which to test.
-      :rtype: float
-
 .. class:: KX_RaySensor(SCA_ISensor)
 
    A ray sensor detects the first object in a given direction.
index 3ade04c4658c61e7d197431fffae7a6d699b0b9f..b4673ec620643c147d7e430fca5f1964fcb2d087 100644 (file)
@@ -57,6 +57,12 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
                 default='GPU_COMPATIBLE',
                 )
 
+        cls.progressive = BoolProperty(
+                name="Progressive",
+                description="Use progressive sampling of lighting",
+                default=True,
+                )
+
         cls.samples = IntProperty(
                 name="Samples",
                 description="Number of samples to render for each pixel",
@@ -80,6 +86,49 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
                 default=False,
                 )
 
+        cls.aa_samples = IntProperty(
+                name="AA Samples",
+                description="Number of antialiasing samples to render for each pixel",
+                min=1, max=10000,
+                default=4,
+                )
+        cls.preview_aa_samples = IntProperty(
+                name="AA Samples",
+                description="Number of antialiasing samples to render in the viewport, unlimited if 0",
+                min=0, max=10000,
+                default=4,
+                )
+        cls.diffuse_samples = IntProperty(
+                name="Diffuse Samples",
+                description="Number of diffuse bounce samples to render for each AA sample",
+                min=1, max=10000,
+                default=1,
+                )
+        cls.glossy_samples = IntProperty(
+                name="Glossy Samples",
+                description="Number of glossy bounce samples to render for each AA sample",
+                min=1, max=10000,
+                default=1,
+                )
+        cls.transmission_samples = IntProperty(
+                name="Transmission Samples",
+                description="Number of transmission bounce samples to render for each AA sample",
+                min=1, max=10000,
+                default=1,
+                )
+        cls.ao_samples = IntProperty(
+                name="Ambient Occlusion Samples",
+                description="Number of ambient occlusion samples to render for each AA sample",
+                min=1, max=10000,
+                default=1,
+                )
+        cls.mesh_light_samples = IntProperty(
+                name="Mesh Light Samples",
+                description="Number of mesh emission light samples to render for each AA sample",
+                min=1, max=10000,
+                default=1,
+                )
+
         cls.no_caustics = BoolProperty(
                 name="No Caustics",
                 description="Leave out caustics, resulting in a darker image with less noise",
@@ -340,6 +389,12 @@ class CyclesLampSettings(bpy.types.PropertyGroup):
                 description="Lamp casts shadows",
                 default=True,
                 )
+        cls.samples = IntProperty(
+                name="Samples",
+                description="Number of light samples to render for each AA sample",
+                min=1, max=10000,
+                default=1,
+                )
 
     @classmethod
     def unregister(cls):
@@ -365,6 +420,12 @@ class CyclesWorldSettings(bpy.types.PropertyGroup):
                 min=4, max=8096,
                 default=256,
                 )
+        cls.samples = IntProperty(
+                name="Samples",
+                description="Number of light samples to render for each AA sample",
+                min=1, max=10000,
+                default=4,
+                )
 
     @classmethod
     def unregister(cls):
index 3b906bb4bdf0327c53225ccab8cae2c676171535..bda8249c17e943b51ed75b4886f50888be4077bb 100644 (file)
@@ -44,8 +44,49 @@ class CyclesButtonsPanel():
         return rd.engine == 'CYCLES'
 
 
-class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel):
-    bl_label = "Integrator"
+class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
+    bl_label = "Sampling"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        scene = context.scene
+        cscene = scene.cycles
+
+        split = layout.split()
+
+        col = split.column()
+        sub = col.column()
+        sub.active = cscene.device == 'CPU'
+        sub.prop(cscene, "progressive")
+
+        sub = col.column(align=True)
+        sub.prop(cscene, "seed")
+        sub.prop(cscene, "sample_clamp")
+
+        if cscene.progressive or cscene.device != 'CPU':
+            col = split.column()
+            col.label(text="Samples:")
+            sub = col.column(align=True)
+            sub.prop(cscene, "samples", text="Render")
+            sub.prop(cscene, "preview_samples", text="Preview")
+        else:
+            sub.label(text="AA Samples:")
+            sub.prop(cscene, "aa_samples", text="Render")
+            sub.prop(cscene, "preview_aa_samples", text="Preview")
+
+            col = split.column()
+            col.label(text="Samples:")
+            sub = col.column(align=True)
+            sub.prop(cscene, "diffuse_samples", text="Diffuse")
+            sub.prop(cscene, "glossy_samples", text="Glossy")
+            sub.prop(cscene, "transmission_samples", text="Transmission")
+            sub.prop(cscene, "ao_samples", text="AO")
+            sub.prop(cscene, "mesh_light_samples", text="Mesh Light")
+
+class CyclesRender_PT_light_paths(CyclesButtonsPanel, Panel):
+    bl_label = "Light Paths"
     bl_options = {'DEFAULT_CLOSED'}
 
     def draw(self, context):
@@ -62,12 +103,6 @@ class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel):
         split = layout.split()
 
         col = split.column()
-        sub = col.column(align=True)
-        sub.label(text="Samples:")
-        sub.prop(cscene, "samples", text="Render")
-        sub.prop(cscene, "preview_samples", text="Preview")
-        sub.prop(cscene, "seed")
-        sub.prop(cscene, "sample_clamp")
 
         sub = col.column(align=True)
         sub.label("Transparency:")
@@ -75,6 +110,11 @@ class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel):
         sub.prop(cscene, "transparent_min_bounces", text="Min")
         sub.prop(cscene, "use_transparent_shadows", text="Shadows")
 
+        col.separator()
+
+        col.prop(cscene, "no_caustics")
+        col.prop(cscene, "blur_glossy")
+
         col = split.column()
 
         sub = col.column(align=True)
@@ -83,16 +123,10 @@ class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel):
         sub.prop(cscene, "min_bounces", text="Min")
 
         sub = col.column(align=True)
-        sub.label(text="Light Paths:")
         sub.prop(cscene, "diffuse_bounces", text="Diffuse")
         sub.prop(cscene, "glossy_bounces", text="Glossy")
         sub.prop(cscene, "transmission_bounces", text="Transmission")
 
-        col.separator()
-
-        col.prop(cscene, "no_caustics")
-        col.prop(cscene, "blur_glossy")
-
 
 class CyclesRender_PT_motion_blur(CyclesButtonsPanel, Panel):
     bl_label = "Motion Blur"
@@ -467,6 +501,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
 
         lamp = context.lamp
         clamp = lamp.cycles
+        cscene = context.scene.cycles
 
         layout.prop(lamp, "type", expand=True)
 
@@ -485,6 +520,9 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
                 sub.prop(lamp, "size", text="Size X")
                 sub.prop(lamp, "size_y", text="Size Y")
 
+        if not cscene.progressive and cscene.device == 'CPU':
+            col.prop(clamp, "samples")
+
         col = split.column()
         col.prop(clamp, "cast_shadow")
 
@@ -604,13 +642,16 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
 
         world = context.world
         cworld = world.cycles
+        cscene = context.scene.cycles
 
         col = layout.column()
 
         col.prop(cworld, "sample_as_light")
-        row = col.row()
-        row.active = cworld.sample_as_light
-        row.prop(cworld, "sample_map_resolution")
+        sub = col.row(align=True)
+        sub.active = cworld.sample_as_light
+        sub.prop(cworld, "sample_map_resolution")
+        if not cscene.progressive and cscene.device == 'CPU':
+            sub.prop(cworld, "samples")
 
 
 class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
index 122d0bd7c17c08e2d4ac8af9f40e636eaa8bf2b6..46d5fefd4dcad7140cad2e6ae6dd21ea4c12b55b 100644 (file)
@@ -485,10 +485,10 @@ static void blender_camera_border(BlenderCamera *bcam, BL::Scene b_scene, BL::Sp
        bcam->border_top = tmp_bottom + bcam->border_top*(tmp_top - tmp_bottom);
 
        /* clamp */
-       bcam->border_left = max(bcam->border_left, 0.0f);
-       bcam->border_right = min(bcam->border_right, 1.0f);
-       bcam->border_bottom = max(bcam->border_bottom, 0.0f);
-       bcam->border_top = min(bcam->border_top, 1.0f);
+       bcam->border_left = clamp(bcam->border_left, 0.0f, 1.0f);
+       bcam->border_right = clamp(bcam->border_right, 0.0f, 1.0f);
+       bcam->border_bottom = clamp(bcam->border_bottom, 0.0f, 1.0f);
+       bcam->border_top = clamp(bcam->border_top, 0.0f, 1.0f);
 }
 
 void BlenderSync::sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height)
@@ -514,6 +514,10 @@ BufferParams BlenderSync::get_buffer_params(BL::Scene b_scene, Camera *cam, int
                params.full_y = cam->border_bottom*height;
                params.width = (int)(cam->border_right*width) - params.full_x;
                params.height = (int)(cam->border_top*height) - params.full_y;
+
+               /* survive in case border goes out of view or becomes too small */
+               params.width = max(params.width, 1);
+               params.height = max(params.height, 1);
        }
        else {
                params.width = width;
index c4b58d6fa761c5ffa6642a01397d70b45366d2a8..d5b884cfccd46ca822c8f607fcb0bc1368e2e2b2 100644 (file)
@@ -154,6 +154,7 @@ void BlenderSync::sync_light(BL::Object b_parent, int b_index, BL::Object b_ob,
        /* shadow */
        PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles");
        light->cast_shadow = get_boolean(clamp, "cast_shadow");
+       light->samples = get_int(clamp, "samples");
 
        /* tag */
        light->tag_update(scene);
@@ -178,6 +179,7 @@ void BlenderSync::sync_background_light()
                        {
                                light->type = LIGHT_BACKGROUND;
                                light->map_resolution  = get_int(cworld, "sample_map_resolution");
+                               light->samples  = get_int(cworld, "samples");
                                light->shader = scene->default_background;
 
                                light->tag_update(scene);
@@ -317,14 +319,18 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
                                        object_create_duplilist(*b_ob, b_scene);
 
                                        BL::Object::dupli_list_iterator b_dup;
+                                       int b_index = 0;
+
                                        for(b_ob->dupli_list.begin(b_dup); b_dup != b_ob->dupli_list.end(); ++b_dup) {
                                                Transform tfm = get_transform(b_dup->matrix());
                                                BL::Object b_dup_ob = b_dup->object();
                                                bool dup_hide = (b_v3d)? b_dup_ob.hide(): b_dup_ob.hide_render();
 
                                                if(!(b_dup->hide() || dup_hide)) {
-                                                       sync_object(*b_ob, b_dup->index(), b_dup_ob, tfm, ob_layer, motion, b_dup->particle_index() + particle_offset);
+                                                       sync_object(*b_ob, b_index, b_dup_ob, tfm, ob_layer, motion, b_dup->particle_index() + particle_offset);
                                                }
+                                               
+                                               ++b_index;
                                        }
 
                                        object_free_duplilist(*b_ob);
index 13040e551bdcd9e46dacdec1fdf7777cf511dcce..5640a411fd71243f600086eb4931bab2bdfa42e4 100644 (file)
@@ -168,6 +168,13 @@ void BlenderSync::sync_integrator()
        integrator->motion_blur = (!preview && r.use_motion_blur());
 #endif
 
+       integrator->diffuse_samples = get_int(cscene, "diffuse_samples");
+       integrator->glossy_samples = get_int(cscene, "glossy_samples");
+       integrator->transmission_samples = get_int(cscene, "transmission_samples");
+       integrator->ao_samples = get_int(cscene, "ao_samples");
+       integrator->mesh_light_samples = get_int(cscene, "mesh_light_samples");
+       integrator->progressive = get_boolean(cscene, "progressive");
+
        if(integrator->modified(previntegrator))
                integrator->tag_update(scene);
 }
@@ -308,15 +315,27 @@ SessionParams BlenderSync::get_session_params(BL::UserPreferences b_userpref, BL
 
        /* Background */
        params.background = background;
-                       
+
        /* samples */
-       if(background) {
-               params.samples = get_int(cscene, "samples");
+       if(get_boolean(cscene, "progressive")) {
+               if(background) {
+                       params.samples = get_int(cscene, "samples");
+               }
+               else {
+                       params.samples = get_int(cscene, "preview_samples");
+                       if(params.samples == 0)
+                               params.samples = INT_MAX;
+               }
        }
        else {
-               params.samples = get_int(cscene, "preview_samples");
-               if(params.samples == 0)
-                       params.samples = INT_MAX;
+               if(background) {
+                       params.samples = get_int(cscene, "aa_samples");
+               }
+               else {
+                       params.samples = get_int(cscene, "preview_aa_samples");
+                       if(params.samples == 0)
+                               params.samples = INT_MAX;
+               }
        }
 
        /* other parameters */
index f582ace69f0a2b1424cbaaf02b7e5fb7e948de35..53d53b4bedd498b71aed4e21aaa56dec566fca45 100644 (file)
@@ -67,7 +67,7 @@ __device bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex,
 
        float pdf = -1.0f;
 
-#ifdef __MULTI_LIGHT__
+#ifdef __NON_PROGRESSIVE__
        if(lindex != -1) {
                /* sample position on a specified light */
                light_select(kg, lindex, randu, randv, sd->P, &ls, &pdf);
index edc302cd6e38f3a42f2eeaee3a8597463ac973b5..1084415d0cf73e30a11e62126fa4e7f33e245e6d 100644 (file)
@@ -388,6 +388,12 @@ __device float light_sample_pdf(KernelGlobals *kg, LightSample *ls, float3 I, fl
        return pdf;
 }
 
+__device int light_select_num_samples(KernelGlobals *kg, int index)
+{
+       float4 data3 = kernel_tex_fetch(__light_data, index*LIGHT_SIZE + 3);
+       return __float_as_int(data3.x);
+}
+
 __device void light_select(KernelGlobals *kg, int index, float randu, float randv, float3 P, LightSample *ls, float *pdf)
 {
        regular_light_sample(kg, index, randu, randv, P, ls, pdf);
index 8dbf66c108c08ced5d1d0fca3b71b80d6203f6ed..2da6a7e4d8ffd57677820e618cfaf2896c714762 100644 (file)
@@ -218,7 +218,7 @@ __device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ra
        return result;
 }
 
-__device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer)
+__device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer)
 {
        /* initialize */
        PathRadiance L;
@@ -366,26 +366,189 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
                                light_ray.time = sd.time;
 #endif
 
-#ifdef __MULTI_LIGHT__
-                               /* index -1 means randomly sample from distribution */
-                               int i = (kernel_data.integrator.num_all_lights)? 0: -1;
+                               if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
+                                       /* trace shadow ray */
+                                       float3 shadow;
 
-                               for(; i < kernel_data.integrator.num_all_lights; i++) {
-#else
-                               const int i = -1;
+                                       if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
+                                               /* accumulate */
+                                               path_radiance_accum_light(&L, throughput, &L_light, shadow, state.bounce, is_lamp);
+                                       }
+                               }
+                       }
+               }
 #endif
-                                       if(direct_emission(kg, &sd, i, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
-                                               /* trace shadow ray */
-                                               float3 shadow;
 
-                                               if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
-                                                       /* accumulate */
-                                                       path_radiance_accum_light(&L, throughput, &L_light, shadow, state.bounce, is_lamp);
-                                               }
-                                       }
-#ifdef __MULTI_LIGHT__
+               /* no BSDF? we can stop here */
+               if(!(sd.flag & SD_BSDF))
+                       break;
+
+               /* sample BSDF */
+               float bsdf_pdf;
+               BsdfEval bsdf_eval;
+               float3 bsdf_omega_in;
+               differential3 bsdf_domega_in;
+               float bsdf_u = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF_U);
+               float bsdf_v = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF_V);
+               int label;
+
+               label = shader_bsdf_sample(kg, &sd, bsdf_u, bsdf_v, &bsdf_eval,
+                       &bsdf_omega_in, &bsdf_domega_in, &bsdf_pdf);
+
+               shader_release(kg, &sd);
+
+               if(bsdf_pdf == 0.0f || bsdf_eval_is_zero(&bsdf_eval))
+                       break;
+
+               /* modify throughput */
+               path_radiance_bsdf_bounce(&L, &throughput, &bsdf_eval, bsdf_pdf, state.bounce, label);
+
+               /* set labels */
+               if(!(label & LABEL_TRANSPARENT)) {
+                       ray_pdf = bsdf_pdf;
+                       min_ray_pdf = fminf(bsdf_pdf, min_ray_pdf);
+               }
+
+               /* update path state */
+               path_state_next(kg, &state, label);
+
+               /* setup ray */
+               ray.P = ray_offset(sd.P, (label & LABEL_TRANSMIT)? -sd.Ng: sd.Ng);
+               ray.D = bsdf_omega_in;
+               ray.t = FLT_MAX;
+#ifdef __RAY_DIFFERENTIALS__
+               ray.dP = sd.dP;
+               ray.dD = bsdf_domega_in;
+#endif
+       }
+
+       float3 L_sum = path_radiance_sum(kg, &L);
+
+#ifdef __CLAMP_SAMPLE__
+       path_radiance_clamp(&L, &L_sum, kernel_data.integrator.sample_clamp);
+#endif
+
+       kernel_write_light_passes(kg, buffer, &L, sample);
+
+       return make_float4(L_sum.x, L_sum.y, L_sum.z, 1.0f - L_transparent);
+}
+
+#ifdef __NON_PROGRESSIVE__
+
+__device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer,
+       float3 throughput, float min_ray_pdf, float ray_pdf, PathState state, int rng_offset, PathRadiance *L)
+{
+       /* path iteration */
+       for(;; rng_offset += PRNG_BOUNCE_NUM) {
+               /* intersect scene */
+               Intersection isect;
+               uint visibility = path_state_ray_visibility(kg, &state);
+
+               if(!scene_intersect(kg, &ray, visibility, &isect)) {
+#ifdef __BACKGROUND__
+                       /* sample background shader */
+                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
+                       path_radiance_accum_background(L, throughput, L_background, state.bounce);
+#endif
+
+                       break;
+               }
+
+               /* setup shading */
+               ShaderData sd;
+               shader_setup_from_ray(kg, &sd, &isect, &ray);
+               float rbsdf = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF);
+               shader_eval_surface(kg, &sd, rbsdf, state.flag);
+               shader_merge_closures(kg, &sd);
+
+               /* blurring of bsdf after bounces, for rays that have a small likelihood
+                * of following this particular path (diffuse, rough glossy) */
+               if(kernel_data.integrator.filter_glossy != FLT_MAX) {
+                       float blur_pdf = kernel_data.integrator.filter_glossy*min_ray_pdf;
+
+                       if(blur_pdf < 1.0f) {
+                               float blur_roughness = sqrtf(1.0f - blur_pdf)*0.5f;
+                               shader_bsdf_blur(kg, &sd, blur_roughness);
+                       }
+               }
+
+#ifdef __EMISSION__
+               /* emission */
+               if(sd.flag & SD_EMISSION) {
+                       float3 emission = indirect_emission(kg, &sd, isect.t, state.flag, ray_pdf);
+                       path_radiance_accum_emission(L, throughput, emission, state.bounce);
+               }
+#endif
+
+               /* path termination. this is a strange place to put the termination, it's
+                * mainly due to the mixed in MIS that we use. gives too many unneeded
+                * shader evaluations, only need emission if we are going to terminate */
+               float probability = path_state_terminate_probability(kg, &state, throughput);
+               float terminate = path_rng(kg, rng, sample, rng_offset + PRNG_TERMINATE);
+
+               if(terminate >= probability)
+                       break;
+
+               throughput /= probability;
+
+#ifdef __AO__
+               /* ambient occlusion */
+               if(kernel_data.integrator.use_ambient_occlusion) {
+                       /* todo: solve correlation */
+                       float bsdf_u = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF_U);
+                       float bsdf_v = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF_V);
+
+                       float3 ao_D;
+                       float ao_pdf;
+
+                       sample_cos_hemisphere(sd.N, bsdf_u, bsdf_v, &ao_D, &ao_pdf);
+
+                       if(dot(sd.Ng, ao_D) > 0.0f && ao_pdf != 0.0f) {
+                               Ray light_ray;
+                               float3 ao_shadow;
+
+                               light_ray.P = ray_offset(sd.P, sd.Ng);
+                               light_ray.D = ao_D;
+                               light_ray.t = kernel_data.background.ao_distance;
+#ifdef __MOTION__
+                               light_ray.time = sd.time;
+#endif
+
+                               if(!shadow_blocked(kg, &state, &light_ray, &ao_shadow)) {
+                                       float3 ao_bsdf = shader_bsdf_diffuse(kg, &sd)*kernel_data.background.ao_factor;
+                                       path_radiance_accum_ao(L, throughput, ao_bsdf, ao_shadow, state.bounce);
                                }
+                       }
+               }
 #endif
+
+#ifdef __EMISSION__
+               if(kernel_data.integrator.use_direct_light) {
+                       /* sample illumination from lights to find path contribution */
+                       if(sd.flag & SD_BSDF_HAS_EVAL) {
+                               float light_t = path_rng(kg, rng, sample, rng_offset + PRNG_LIGHT);
+                               float light_o = path_rng(kg, rng, sample, rng_offset + PRNG_LIGHT_F);
+                               float light_u = path_rng(kg, rng, sample, rng_offset + PRNG_LIGHT_U);
+                               float light_v = path_rng(kg, rng, sample, rng_offset + PRNG_LIGHT_V);
+
+                               Ray light_ray;
+                               BsdfEval L_light;
+                               bool is_lamp;
+
+#ifdef __MOTION__
+                               light_ray.time = sd.time;
+#endif
+
+                               /* sample random light */
+                               if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
+                                       /* trace shadow ray */
+                                       float3 shadow;
+
+                                       if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
+                                               /* accumulate */
+                                               path_radiance_accum_light(L, throughput, &L_light, shadow, state.bounce, is_lamp);
+                                       }
+                               }
                        }
                }
 #endif
@@ -412,7 +575,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
                        break;
 
                /* modify throughput */
-               path_radiance_bsdf_bounce(&L, &throughput, &bsdf_eval, bsdf_pdf, state.bounce, label);
+               path_radiance_bsdf_bounce(L, &throughput, &bsdf_eval, bsdf_pdf, state.bounce, label);
 
                /* set labels */
                if(!(label & LABEL_TRANSPARENT)) {
@@ -432,6 +595,275 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
                ray.dD = bsdf_domega_in;
 #endif
        }
+}
+
+__device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer)
+{
+       /* initialize */
+       PathRadiance L;
+       float3 throughput = make_float3(1.0f, 1.0f, 1.0f);
+       float L_transparent = 0.0f;
+
+       path_radiance_init(&L, kernel_data.film.use_light_pass);
+
+       float ray_pdf = 0.0f;
+       PathState state;
+       int rng_offset = PRNG_BASE_NUM;
+
+       path_state_init(&state);
+
+       for(;; rng_offset += PRNG_BOUNCE_NUM) {
+               /* intersect scene */
+               Intersection isect;
+               uint visibility = path_state_ray_visibility(kg, &state);
+
+               if(!scene_intersect(kg, &ray, visibility, &isect)) {
+                       /* eval background shader if nothing hit */
+                       if(kernel_data.background.transparent) {
+                               L_transparent += average(throughput);
+
+#ifdef __PASSES__
+                               if(!(kernel_data.film.pass_flag & PASS_BACKGROUND))
+#endif
+                                       break;
+                       }
+
+#ifdef __BACKGROUND__
+                       /* sample background shader */
+                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
+                       path_radiance_accum_background(&L, throughput, L_background, state.bounce);
+#endif
+
+                       break;
+               }
+
+               /* setup shading */
+               ShaderData sd;
+               shader_setup_from_ray(kg, &sd, &isect, &ray);
+               float rbsdf = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF);
+               shader_eval_surface(kg, &sd, rbsdf, state.flag);
+               shader_merge_closures(kg, &sd);
+
+               kernel_write_data_passes(kg, buffer, &L, &sd, sample, state.flag, throughput);
+
+               /* holdout */
+#ifdef __HOLDOUT__
+               if((sd.flag & (SD_HOLDOUT|SD_HOLDOUT_MASK))) {
+                       if(kernel_data.background.transparent) {
+                               float3 holdout_weight;
+                               
+                               if(sd.flag & SD_HOLDOUT_MASK)
+                                       holdout_weight = make_float3(1.0f, 1.0f, 1.0f);
+                               else
+                                       shader_holdout_eval(kg, &sd);
+
+                               /* any throughput is ok, should all be identical here */
+                               L_transparent += average(holdout_weight*throughput);
+                       }
+
+                       if(sd.flag & SD_HOLDOUT_MASK)
+                               break;
+               }
+#endif
+
+#ifdef __EMISSION__
+               /* emission */
+               if(sd.flag & SD_EMISSION) {
+                       float3 emission = indirect_emission(kg, &sd, isect.t, state.flag, ray_pdf);
+                       path_radiance_accum_emission(&L, throughput, emission, state.bounce);
+               }
+#endif
+
+               /* transparency termination */
+               if(state.flag & PATH_RAY_TRANSPARENT) {
+                       /* path termination. this is a strange place to put the termination, it's
+                        * mainly due to the mixed in MIS that we use. gives too many unneeded
+                        * shader evaluations, only need emission if we are going to terminate */
+                       float probability = path_state_terminate_probability(kg, &state, throughput);
+                       float terminate = path_rng(kg, rng, sample, rng_offset + PRNG_TERMINATE);
+
+                       if(terminate >= probability)
+                               break;
+
+                       throughput /= probability;
+               }
+
+#ifdef __AO__
+               /* ambient occlusion */
+               if(kernel_data.integrator.use_ambient_occlusion) {
+                       int num_samples = kernel_data.integrator.ao_samples;
+                       float ao_factor = kernel_data.background.ao_factor/num_samples;
+
+                       for(int j = 0; j < num_samples; j++) {
+                               /* todo: solve correlation */
+                               float bsdf_u = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_BSDF_U);
+                               float bsdf_v = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_BSDF_V);
+
+                               float3 ao_D;
+                               float ao_pdf;
+
+                               sample_cos_hemisphere(sd.N, bsdf_u, bsdf_v, &ao_D, &ao_pdf);
+
+                               if(dot(sd.Ng, ao_D) > 0.0f && ao_pdf != 0.0f) {
+                                       Ray light_ray;
+                                       float3 ao_shadow;
+
+                                       light_ray.P = ray_offset(sd.P, sd.Ng);
+                                       light_ray.D = ao_D;
+                                       light_ray.t = kernel_data.background.ao_distance;
+#ifdef __MOTION__
+                                       light_ray.time = sd.time;
+#endif
+
+                                       if(!shadow_blocked(kg, &state, &light_ray, &ao_shadow)) {
+                                               float3 ao_bsdf = shader_bsdf_diffuse(kg, &sd)*ao_factor;
+                                               path_radiance_accum_ao(&L, throughput, ao_bsdf, ao_shadow, state.bounce);
+                                       }
+                               }
+                       }
+               }
+#endif
+
+#ifdef __EMISSION__
+               /* sample illumination from lights to find path contribution */
+               if(sd.flag & SD_BSDF_HAS_EVAL) {
+                       Ray light_ray;
+                       BsdfEval L_light;
+                       bool is_lamp;
+
+#ifdef __MOTION__
+                       light_ray.time = sd.time;
+#endif
+
+                       /* lamp sampling */
+                       for(int i = 0; i < kernel_data.integrator.num_all_lights; i++) {
+                               int num_samples = light_select_num_samples(kg, i);
+                               float num_samples_inv = 1.0f/(num_samples*kernel_data.integrator.num_all_lights);
+
+                               if(kernel_data.integrator.pdf_triangles != 0.0f)
+                                       num_samples_inv *= 0.5f;
+
+                               for(int j = 0; j < num_samples; j++) {
+                                       float light_u = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_LIGHT_U);
+                                       float light_v = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_LIGHT_V);
+
+                                       if(direct_emission(kg, &sd, i, 0.0f, 0.0f, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
+                                               /* trace shadow ray */
+                                               float3 shadow;
+
+                                               if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
+                                                       /* accumulate */
+                                                       path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, state.bounce, is_lamp);
+                                               }
+                                       }
+                               }
+                       }
+
+                       /* mesh light sampling */
+                       if(kernel_data.integrator.pdf_triangles != 0.0f) {
+                               int num_samples = kernel_data.integrator.mesh_light_samples;
+                               float num_samples_inv = 1.0f/num_samples;
+
+                               if(kernel_data.integrator.num_all_lights)
+                                       num_samples_inv *= 0.5f;
+
+                               for(int j = 0; j < num_samples; j++) {
+                                       float light_t = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_LIGHT);
+                                       float light_u = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_LIGHT_U);
+                                       float light_v = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_LIGHT_V);
+
+                                       /* only sample triangle lights */
+                                       if(kernel_data.integrator.num_all_lights)
+                                               light_t = 0.5f*light_t;
+
+                                       if(direct_emission(kg, &sd, -1, light_t, 0.0f, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
+                                               /* trace shadow ray */
+                                               float3 shadow;
+
+                                               if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
+                                                       /* accumulate */
+                                                       path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, state.bounce, is_lamp);
+                                               }
+                                       }
+                               }
+                       }
+               }
+#endif
+
+               for(int i = 0; i< sd.num_closure; i++) {
+                       const ShaderClosure *sc = &sd.closure[i];
+
+                       if(!CLOSURE_IS_BSDF(sc->type))
+                               continue;
+                       /* transparency is not handled here, but in outer loop */
+                       if(sc->type == CLOSURE_BSDF_TRANSPARENT_ID)
+                               continue;
+
+                       int num_samples;
+
+                       if(CLOSURE_IS_BSDF_DIFFUSE(sc->type))
+                               num_samples = kernel_data.integrator.diffuse_samples;
+                       else if(CLOSURE_IS_BSDF_GLOSSY(sc->type))
+                               num_samples = kernel_data.integrator.glossy_samples;
+                       else
+                               num_samples = kernel_data.integrator.transmission_samples;
+
+                       float num_samples_inv = 1.0f/num_samples;
+
+                       for(int j = 0; j < num_samples; j++) {
+                               /* sample BSDF */
+                               float bsdf_pdf;
+                               BsdfEval bsdf_eval;
+                               float3 bsdf_omega_in;
+                               differential3 bsdf_domega_in;
+                               float bsdf_u = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_BSDF_U);
+                               float bsdf_v = path_rng(kg, rng, sample*num_samples + j, rng_offset + PRNG_BSDF_V);
+                               int label;
+
+                               label = shader_bsdf_sample_closure(kg, &sd, sc, bsdf_u, bsdf_v, &bsdf_eval,
+                                       &bsdf_omega_in, &bsdf_domega_in, &bsdf_pdf);
+
+                               if(bsdf_pdf == 0.0f || bsdf_eval_is_zero(&bsdf_eval))
+                                       continue;
+
+                               /* modify throughput */
+                               float3 tp = throughput;
+                               path_radiance_bsdf_bounce(&L, &tp, &bsdf_eval, bsdf_pdf, state.bounce, label);
+
+                               /* set labels */
+                               float min_ray_pdf = FLT_MAX;
+
+                               if(!(label & LABEL_TRANSPARENT))
+                                       min_ray_pdf = fminf(bsdf_pdf, min_ray_pdf);
+
+                               /* modify path state */
+                               PathState ps = state;
+                               path_state_next(kg, &ps, label);
+
+                               /* setup ray */
+                               ray.P = ray_offset(sd.P, (label & LABEL_TRANSMIT)? -sd.Ng: sd.Ng);
+                               ray.D = bsdf_omega_in;
+                               ray.t = FLT_MAX;
+#ifdef __RAY_DIFFERENTIALS__
+                               ray.dP = sd.dP;
+                               ray.dD = bsdf_domega_in;
+#endif
+
+                               kernel_path_indirect(kg, rng, sample*num_samples, ray, buffer,
+                                       tp*num_samples_inv, min_ray_pdf, bsdf_pdf, ps, rng_offset+PRNG_BOUNCE_NUM, &L);
+                       }
+               }
+
+               /* continue in case of transparency */
+               throughput *= shader_bsdf_transparency(kg, &sd);
+               shader_release(kg, &sd);
+
+               if(is_zero(throughput))
+                       break;
+
+               path_state_next(kg, &state, LABEL_TRANSPARENT);
+               ray.P = ray_offset(sd.P, -sd.Ng);
+       }
 
        float3 L_sum = path_radiance_sum(kg, &L);
 
@@ -444,6 +876,8 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
        return make_float4(L_sum.x, L_sum.y, L_sum.z, 1.0f - L_transparent);
 }
 
+#endif
+
 __device void kernel_path_trace(KernelGlobals *kg,
        __global float *buffer, __global uint *rng_state,
        int sample, int x, int y, int offset, int stride)
@@ -480,8 +914,16 @@ __device void kernel_path_trace(KernelGlobals *kg,
        /* integrate */
        float4 L;
 
-       if (ray.t != 0.f)
-               L = kernel_path_integrate(kg, &rng, sample, ray, buffer);
+       if (ray.t != 0.0f) {
+#ifdef __NON_PROGRESSIVE__
+               if(kernel_data.integrator.progressive)
+#endif
+                       L = kernel_path_progressive(kg, &rng, sample, ray, buffer);
+#ifdef __NON_PROGRESSIVE__
+               else
+                       L = kernel_path_non_progressive(kg, &rng, sample, ray, buffer);
+#endif
+       }
        else
                L = make_float4(0.f, 0.f, 0.f, 0.f);
 
index 53a41d58e200b8e327d764f743e840c1c4142486..bc873f4e112306d4ab6a7f54290c538790a730b3 100644 (file)
@@ -407,6 +407,25 @@ __device int shader_bsdf_sample(KernelGlobals *kg, const ShaderData *sd,
 #endif
 }
 
+__device int shader_bsdf_sample_closure(KernelGlobals *kg, const ShaderData *sd,
+       const ShaderClosure *sc, float randu, float randv, BsdfEval *bsdf_eval,
+       float3 *omega_in, differential3 *domega_in, float *pdf)
+{
+       int label;
+       float3 eval;
+
+       *pdf = 0.0f;
+#ifdef __OSL__
+       label = OSLShader::bsdf_sample(sd, sc, randu, randv, eval, *omega_in, *domega_in, *pdf);
+#else
+       label = svm_bsdf_sample(sd, sc, randu, randv, &eval, omega_in, domega_in, pdf);
+#endif
+       if(*pdf != 0.0f)
+               bsdf_eval_init(bsdf_eval, sc->type, eval*sc->weight, kernel_data.film.use_light_pass);
+
+       return label;
+}
+
 __device void shader_bsdf_blur(KernelGlobals *kg, ShaderData *sd, float roughness)
 {
 #ifndef __OSL__
@@ -679,6 +698,35 @@ __device bool shader_transparent_shadow(KernelGlobals *kg, Intersection *isect)
 }
 #endif
 
+/* Merging */
+
+#ifdef __NON_PROGRESSIVE__
+__device void shader_merge_closures(KernelGlobals *kg, ShaderData *sd)
+{
+#ifndef __OSL__
+       /* merge identical closures, better when we sample a single closure at a time */
+       for(int i = 0; i < sd->num_closure; i++) {
+               ShaderClosure *sci = &sd->closure[i];
+
+               for(int j = i + 1; j < sd->num_closure; j++) {
+                       ShaderClosure *scj = &sd->closure[j];
+
+                       if(sci->type == scj->type && sci->data0 == scj->data0 && sci->data1 == scj->data1) {
+                               sci->weight += scj->weight;
+                               sci->sample_weight += scj->sample_weight;
+
+                               int size = sd->num_closure - (j+1);
+                               if(size > 0)
+                                       memmove(scj, scj+1, size*sizeof(ShaderClosure));
+
+                               sd->num_closure--;
+                       }
+               }
+       }
+#endif
+}
+#endif
+
 /* Free ShaderData */
 
 __device void shader_release(KernelGlobals *kg, ShaderData *sd)
index 77a800b0e674731775ec9d1729f2a2137f48a716..d204b114b8e5a5e51370f9a4804956e5ebc32f48 100644 (file)
@@ -43,6 +43,7 @@ CCL_NAMESPACE_BEGIN
 #ifdef WITH_OSL
 #define __OSL__
 #endif
+#define __NON_PROGRESSIVE__
 #endif
 
 #ifdef __KERNEL_CUDA__
@@ -110,7 +111,6 @@ CCL_NAMESPACE_BEGIN
 //#define __MOTION__
 #endif
 
-//#define __MULTI_LIGHT__
 //#define __SOBOL_FULL_SCREEN__
 //#define __QBVH__
 
@@ -627,6 +627,15 @@ typedef struct KernelIntegrator {
 
        /* clamp */
        float sample_clamp;
+
+       /* non-progressive */
+       int progressive;
+       int diffuse_samples;
+       int glossy_samples;
+       int transmission_samples;
+       int ao_samples;
+       int mesh_light_samples;
+       int pad1, pad2;
 } KernelIntegrator;
 
 typedef struct KernelBVH {
index b26ebfd91e178733c82773d724a1f4b8f152bded..da563c9c4ec7469857c9236ccef9417947882654 100644 (file)
 
 #include "device.h"
 #include "integrator.h"
+#include "light.h"
 #include "scene.h"
 #include "sobol.h"
 
+#include "util_foreach.h"
 #include "util_hash.h"
 
 CCL_NAMESPACE_BEGIN
@@ -47,6 +49,13 @@ Integrator::Integrator()
        sample_clamp = 0.0f;
        motion_blur = false;
 
+       diffuse_samples = 1;
+       glossy_samples = 1;
+       transmission_samples = 1;
+       ao_samples = 1;
+       mesh_light_samples = 1;
+       progressive = true;
+
        need_update = true;
 }
 
@@ -54,7 +63,7 @@ Integrator::~Integrator()
 {
 }
 
-void Integrator::device_update(Device *device, DeviceScene *dscene)
+void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene)
 {
        if(!need_update)
                return;
@@ -93,8 +102,27 @@ void Integrator::device_update(Device *device, DeviceScene *dscene)
        
        kintegrator->sample_clamp = (sample_clamp == 0.0f)? FLT_MAX: sample_clamp*3.0f;
 
+       kintegrator->progressive = progressive;
+       kintegrator->diffuse_samples = diffuse_samples;
+       kintegrator->glossy_samples = glossy_samples;
+       kintegrator->transmission_samples = transmission_samples;
+       kintegrator->ao_samples = ao_samples;
+       kintegrator->mesh_light_samples = mesh_light_samples;
+
        /* sobol directions table */
-       int dimensions = PRNG_BASE_NUM + (max_bounce + transparent_max_bounce + 2)*PRNG_BOUNCE_NUM;
+       int max_samples = 1;
+
+       if(!progressive) {
+               foreach(Light *light, scene->lights)
+                       max_samples = max(max_samples, light->samples);
+
+               max_samples = max(max_samples, max(diffuse_samples, max(glossy_samples, transmission_samples)));
+               max_samples = max(max_samples, max(ao_samples, mesh_light_samples));
+       }
+
+       max_samples *= (max_bounce + transparent_max_bounce + 2);
+
+       int dimensions = PRNG_BASE_NUM + max_samples*PRNG_BOUNCE_NUM;
        uint *directions = dscene->sobol_directions.resize(SOBOL_BITS*dimensions);
 
        sobol_generate_direction_vectors((uint(*)[SOBOL_BITS])directions, dimensions);
@@ -127,6 +155,12 @@ bool Integrator::modified(const Integrator& integrator)
                layer_flag == integrator.layer_flag &&
                seed == integrator.seed &&
                sample_clamp == integrator.sample_clamp &&
+               progressive == integrator.progressive &&
+               diffuse_samples == integrator.diffuse_samples &&
+               glossy_samples == integrator.glossy_samples &&
+               transmission_samples == integrator.transmission_samples &&
+               ao_samples == integrator.ao_samples &&
+               mesh_light_samples == integrator.mesh_light_samples &&
                motion_blur == integrator.motion_blur);
 }
 
index afda41a857ddc022412ed8fcad9e6ad851e93b8c..8fb341182b74ccd882c1801b7a1f114c11b197f9 100644 (file)
@@ -49,12 +49,20 @@ public:
        float sample_clamp;
        bool motion_blur;
 
+       int diffuse_samples;
+       int glossy_samples;
+       int transmission_samples;
+       int ao_samples;
+       int mesh_light_samples;
+
+       bool progressive;
+
        bool need_update;
 
        Integrator();
        ~Integrator();
 
-       void device_update(Device *device, DeviceScene *dscene);
+       void device_update(Device *device, DeviceScene *dscene, Scene *scene);
        void device_free(Device *device, DeviceScene *dscene);
 
        bool modified(const Integrator& integrator);
index e918de990c212ea17a5c1d0620dc19e785c58075..6c03d0859a75caafd93f00f23e0e017979d8fd44 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include "device.h"
+#include "integrator.h"
 #include "light.h"
 #include "mesh.h"
 #include "object.h"
@@ -114,6 +115,7 @@ Light::Light()
 
        cast_shadow = true;
        shader = 0;
+       samples = 1;
 }
 
 void Light::tag_update(Scene *scene)
@@ -136,9 +138,6 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 {
        progress.set_status("Updating Lights", "Computing distribution");
 
-       /* option to always sample all point lights */
-       bool multi_light = false;
-
        /* count */
        size_t num_lights = scene->lights.size();
        size_t num_triangles = 0;
@@ -169,9 +168,7 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
        }
 
        size_t num_distribution = num_triangles;
-
-       if(!multi_light)
-               num_distribution += num_lights;
+       num_distribution += num_lights;
 
        /* emission area */
        float4 *distribution = dscene->light_distribution.resize(num_distribution + 1);
@@ -231,16 +228,14 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
        float trianglearea = totarea;
 
        /* point lights */
-       if(!multi_light) {
-               float lightarea = (totarea > 0.0f)? totarea/scene->lights.size(): 1.0f;
-
-               for(int i = 0; i < scene->lights.size(); i++, offset++) {
-                       distribution[offset].x = totarea;
-                       distribution[offset].y = __int_as_float(~(int)i);
-                       distribution[offset].z = 1.0f;
-                       distribution[offset].w = scene->lights[i]->size;
-                       totarea += lightarea;
-               }
+       float lightarea = (totarea > 0.0f)? totarea/scene->lights.size(): 1.0f;
+
+       for(int i = 0; i < scene->lights.size(); i++, offset++) {
+               distribution[offset].x = totarea;
+               distribution[offset].y = __int_as_float(~(int)i);
+               distribution[offset].z = 1.0f;
+               distribution[offset].w = scene->lights[i]->size;
+               totarea += lightarea;
        }
 
        /* normalize cumulative distribution functions */
@@ -259,7 +254,7 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
 
        /* update device */
        KernelIntegrator *kintegrator = &dscene->data.integrator;
-       kintegrator->use_direct_light = (totarea > 0.0f) || (multi_light && num_lights);
+       kintegrator->use_direct_light = (totarea > 0.0f);
 
        if(kintegrator->use_direct_light) {
                /* number of emissives */
@@ -269,30 +264,19 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
                kintegrator->pdf_triangles = 0.0f;
                kintegrator->pdf_lights = 0.0f;
 
-               if(multi_light) {
-                       /* sample one of all triangles and all lights */
-                       kintegrator->num_all_lights = num_lights;
+               /* sample one, with 0.5 probability of light or triangle */
+               kintegrator->num_all_lights = num_lights;
 
-                       if(trianglearea > 0.0f)
-                               kintegrator->pdf_triangles = 1.0f/trianglearea;
+               if(trianglearea > 0.0f) {
+                       kintegrator->pdf_triangles = 1.0f/trianglearea;
                        if(num_lights)
-                               kintegrator->pdf_lights = 1.0f;
+                               kintegrator->pdf_triangles *= 0.5f;
                }
-               else {
-                       /* sample one, with 0.5 probability of light or triangle */
-                       kintegrator->num_all_lights = 0;
-
-                       if(trianglearea > 0.0f) {
-                               kintegrator->pdf_triangles = 1.0f/trianglearea;
-                               if(num_lights)
-                                       kintegrator->pdf_triangles *= 0.5f;
-                       }
 
-                       if(num_lights) {
-                               kintegrator->pdf_lights = 1.0f/num_lights;
-                               if(trianglearea > 0.0f)
-                                       kintegrator->pdf_lights *= 0.5f;
-                       }
+               if(num_lights) {
+                       kintegrator->pdf_lights = 1.0f/num_lights;
+                       if(trianglearea > 0.0f)
+                               kintegrator->pdf_lights *= 0.5f;
                }
 
                /* CDF */
@@ -417,6 +401,7 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
                float3 co = light->co;
                float3 dir = normalize(light->dir);
                int shader_id = scene->shader_manager->get_shader_id(scene->lights[i]->shader);
+               float samples = __int_as_float(light->samples);
 
                if(!light->cast_shadow)
                        shader_id &= ~SHADER_CAST_SHADOW;
@@ -427,7 +412,7 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
                        light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z);
                        light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), light->size, 0.0f, 0.0f);
                        light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
-                       light_data[i*LIGHT_SIZE + 3] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+                       light_data[i*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f);
                }
                else if(light->type == LIGHT_DISTANT) {
                        shader_id &= ~SHADER_AREA_LIGHT;
@@ -435,7 +420,7 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
                        light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), dir.x, dir.y, dir.z);
                        light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), light->size, 0.0f, 0.0f);
                        light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
-                       light_data[i*LIGHT_SIZE + 3] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+                       light_data[i*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f);
                }
                else if(light->type == LIGHT_BACKGROUND) {
                        shader_id &= ~SHADER_AREA_LIGHT;
@@ -443,7 +428,7 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
                        light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), 0.0f, 0.0f, 0.0f);
                        light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), 0.0f, 0.0f, 0.0f);
                        light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
-                       light_data[i*LIGHT_SIZE + 3] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+                       light_data[i*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f);
                }
                else if(light->type == LIGHT_AREA) {
                        float3 axisu = light->axisu*(light->sizeu*light->size);
@@ -452,7 +437,7 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
                        light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z);
                        light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), axisu.x, axisu.y, axisu.z);
                        light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, axisv.x, axisv.y, axisv.z);
-                       light_data[i*LIGHT_SIZE + 3] = make_float4(0.0f, dir.x, dir.y, dir.z);
+                       light_data[i*LIGHT_SIZE + 3] = make_float4(samples, dir.x, dir.y, dir.z);
                }
                else if(light->type == LIGHT_SPOT) {
                        shader_id &= ~SHADER_AREA_LIGHT;
@@ -463,7 +448,7 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
                        light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z);
                        light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), light->size, dir.x, dir.y);
                        light_data[i*LIGHT_SIZE + 2] = make_float4(dir.z, spot_angle, spot_smooth, 0.0f);
-                       light_data[i*LIGHT_SIZE + 3] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+                       light_data[i*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f);
                }
        }
        
index fb8684fa59b57cf029d3187abbc869723379b059..3cedde2596e270cd7ce6856dfce4bc6c43195c85 100644 (file)
@@ -54,6 +54,7 @@ public:
        bool cast_shadow;
 
        int shader;
+       int samples;
 
        void tag_update(Scene *scene);
 };
index 376a7911fc909a0fdbf361738f389d23f12af5a7..6de7eaea343bab71eb32acfcbd53072b91e37601 100644 (file)
@@ -147,7 +147,7 @@ ObjectManager::~ObjectManager()
 void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)
 {
        float4 *objects = dscene->objects.resize(OBJECT_SIZE*scene->objects.size());
-       uint *object_flag = dscene->object_flag.resize(OBJECT_SIZE*scene->objects.size());
+       uint *object_flag = dscene->object_flag.resize(scene->objects.size());
        int i = 0;
        map<Mesh*, float> surface_area_map;
        Scene::MotionType need_motion = scene->need_motion();
index a5f90bfe34b4ed1d261b95745e8dbdb431b2e6a4..45c8a05c27df501b32fc48e8ad5c7027086b3c02 100644 (file)
@@ -160,7 +160,7 @@ void Scene::device_update(Device *device_, Progress& progress)
        if(progress.get_cancel()) return;
 
        progress.set_status("Updating Integrator");
-       integrator->device_update(device, &dscene);
+       integrator->device_update(device, &dscene, this);
 
        if(progress.get_cancel()) return;
 
index 081a7c6bdbd825bf57cd269d25cb466d2e6009ea..0574d985d0c0af3bddf25754f990d11a3e186aa6 100644 (file)
@@ -34,7 +34,7 @@
 /* from BLI_utildefines.h */
 #define MIN2(x, y)               ( (x) < (y) ? (x) : (y) )
 #define MAX2(x, y)               ( (x) > (y) ? (x) : (y) )
-
+#define ABS(a)          ( (a) < 0 ? (-(a)) : (a) )
 
 struct e_status {
        int x;
@@ -67,8 +67,7 @@ struct r_fill_context {
  * just the poly. Since the DEM code could end up being coupled with this, we'll keep it separate
  * for now.
  */
-static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, struct e_status *open_edge)
-{
+static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, struct e_status *open_edge) {
        int i;
        int xbeg;
        int ybeg;
@@ -94,8 +93,7 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
                        /* we're not at the last vert, so end of the edge is the previous vertex */
                        xend = v[i - 1].x;
                        yend = v[i - 1].y;
-               }
-               else {
+               } else {
                        /* we're at the first vertex, so the "end" of this edge is the last vertex */
                        xend = v[num_verts - 1].x;
                        yend = v[num_verts - 1].y;
@@ -124,8 +122,7 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
                        if (dx > 0) {
                                e_new->xdir = 1;
                                xdist = dx;
-                       }
-                       else {
+                       } else {
                                e_new->xdir = -1;
                                xdist = -dx;
                        }
@@ -138,15 +135,13 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
                        /* calculate deltas for incremental drawing */
                        if (dx >= 0) {
                                e_new->drift = 0;
-                       }
-                       else {
+                       } else {
                                e_new->drift = -dy + 1;
                        }
                        if (dy >= xdist) {
                                e_new->drift_inc = xdist;
                                e_new->xshift = 0;
-                       }
-                       else {
+                       } else {
                                e_new->drift_inc = xdist % dy;
                                e_new->xshift = (xdist / dy) * e_new->xdir;
                        }
@@ -170,8 +165,7 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
  * for speed, but waiting on final design choices for curve-data before eliminating data the DEM code will need
  * if it ends up being coupled with this function.
  */
-static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts)
-{
+static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, float intensity) {
        int x_curr;                 /* current pixel position in X */
        int y_curr;                 /* current scan line being drawn */
        int yp;                     /* y-pixel's position in frame buffer */
@@ -260,8 +254,7 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
                                        edgec = &ctx->all_edges->e_next;     /* Set our list to the next edge's location in memory. */
                                        ctx->all_edges = e_temp;             /* Skip the NULL or bad X edge, set pointer to next edge. */
                                        break;                               /* Stop looping edges (since we ran out or hit empty X span. */
-                               }
-                               else {
+                               } else {
                                        edgec = &e_curr->e_next;             /* Set the pointer to the edge list the "next" edge. */
                                }
                        }
@@ -307,7 +300,7 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
 
                        if ((y_curr >= 0) && (y_curr < ctx->rb.sizey)) {
                                /* draw the pixels. */
-                               for (; cpxl <= mpxl; *cpxl++ = 1.0f);
+                               for(; cpxl <= mpxl; *cpxl++ += intensity);
                        }
                }
 
@@ -323,8 +316,7 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
                for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
                        if (!(--(e_curr->num))) {
                                *edgec = e_curr->e_next;
-                       }
-                       else {
+                       } else {
                                e_curr->x += e_curr->xshift;
                                if ((e_curr->drift += e_curr->drift_inc) > 0) {
                                        e_curr->x += e_curr->xdir;
@@ -383,12 +375,17 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
 }
 
 int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
-                   float *buf, int buf_x, int buf_y)
-{
+                                  float *buf, int buf_x, int buf_y, int do_mask_AA) {
+       int subdiv_AA = (do_mask_AA != 0)? 8:0;
        int i;                                   /* i: Loop counter. */
+       int sAx;
+       int sAy;
        struct poly_vert *ply;                   /* ply: Pointer to a list of integer buffer-space vertex coordinates. */
        struct r_fill_context ctx = {0};
-
+       const float buf_x_f = (float)(buf_x);
+       const float buf_y_f = (float)(buf_y);
+       float div_offset=(1.0f / (float)(subdiv_AA));
+       float div_offset_static = 0.5f * (float)(subdiv_AA) * div_offset;
        /*
         * Allocate enough memory for our poly_vert list. It'll be the size of the poly_vert
         * data structure multiplied by the number of base_verts.
@@ -400,6 +397,9 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
                return(0);
        }
 
+       ctx.rb.buf = buf;                            /* Set the output buffer pointer. */
+       ctx.rb.sizex = buf_x;                        /* Set the output buffer size in X. (width) */
+       ctx.rb.sizey = buf_y;                        /* Set the output buffer size in Y. (height) */
        /*
         * Loop over all verts passed in to be rasterized. Each vertex's X and Y coordinates are
         * then converted from normalized screen space (0.0 <= POS <= 1.0) to integer coordinates
@@ -408,16 +408,25 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
         * It's worth noting that this function ONLY outputs fully white pixels in a mask. Every pixel
         * drawn will be 1.0f in value, there is no anti-aliasing.
         */
+
+       if(!subdiv_AA) {
        for (i = 0; i < num_base_verts; i++) {                          /* Loop over all base_verts. */
-               ply[i].x = (base_verts[i][0] * buf_x) + 0.5f;       /* Range expand normalized X to integer buffer-space X. */
-               ply[i].y = (base_verts[i][1] * buf_y) + 0.5f; /* Range expand normalized Y to integer buffer-space Y. */
+                       ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f);       /* Range expand normalized X to integer buffer-space X. */
+                       ply[i].y = (int)((base_verts[i][1] * buf_y_f) + 0.5f); /* Range expand normalized Y to integer buffer-space Y. */
        }
 
-       ctx.rb.buf = buf;                            /* Set the output buffer pointer. */
-       ctx.rb.sizex = buf_x;                        /* Set the output buffer size in X. (width) */
-       ctx.rb.sizey = buf_y;                        /* Set the output buffer size in Y. (height) */
-
-       i = rast_scan_fill(&ctx, ply, num_base_verts);  /* Call our rasterizer, passing in the integer coords for each vert. */
+               i = rast_scan_fill(&ctx, ply, num_base_verts,1.0f);  /* Call our rasterizer, passing in the integer coords for each vert. */
+       } else {
+               for(sAx=0; sAx < subdiv_AA; sAx++) {
+                       for(sAy=0; sAy < subdiv_AA; sAy++) {
+                               for(i=0; i < num_base_verts; i++) {
+                                       ply[i].x = (int)((base_verts[i][0]*buf_x_f)+0.5f - div_offset_static + (div_offset*(float)(sAx)));
+                                       ply[i].y = (int)((base_verts[i][1]*buf_y_f)+0.5f - div_offset_static + (div_offset*(float)(sAy)));
+                               }
+                               i = rast_scan_fill(&ctx, ply, num_base_verts,(1.0f / (float)(subdiv_AA*subdiv_AA)));
+                       }
+               }
+       }
        free(ply);                                      /* Free the memory allocated for the integer coordinate table. */
        return(i);                                      /* Return the value returned by the rasterizer. */
 }
@@ -429,8 +438,7 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
  */
 static int rast_scan_feather(struct r_fill_context *ctx,
                              float (*base_verts_f)[2], int num_base_verts,
-                             struct poly_vert *feather_verts, float (*feather_verts_f)[2], int num_feather_verts)
-{
+                                                        struct poly_vert *feather_verts, float(*feather_verts_f)[2], int num_feather_verts) {
        int x_curr;                 /* current pixel position in X */
        int y_curr;                 /* current scan line being drawn */
        int yp;                     /* y-pixel's position in frame buffer */
@@ -536,8 +544,7 @@ static int rast_scan_feather(struct r_fill_context *ctx,
                                        edgec = &ctx->all_edges->e_next;     /* Set our list to the next edge's location in memory. */
                                        ctx->all_edges = e_temp;             /* Skip the NULL or bad X edge, set pointer to next edge. */
                                        break;                               /* Stop looping edges (since we ran out or hit empty X span. */
-                               }
-                               else {
+                               } else {
                                        edgec = &e_curr->e_next;             /* Set the pointer to the edge list the "next" edge. */
                                }
                        }
@@ -647,8 +654,7 @@ static int rast_scan_feather(struct r_fill_context *ctx,
                for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
                        if (!(--(e_curr->num))) {
                                *edgec = e_curr->e_next;
-                       }
-                       else {
+                       } else {
                                e_curr->x += e_curr->xshift;
                                if ((e_curr->drift += e_curr->drift_inc) > 0) {
                                        e_curr->x += e_curr->xdir;
@@ -708,8 +714,7 @@ static int rast_scan_feather(struct r_fill_context *ctx,
 }
 
 int PLX_raskterize_feather(float (*base_verts)[2], int num_base_verts, float (*feather_verts)[2], int num_feather_verts,
-                           float *buf, int buf_x, int buf_y)
-{
+                                                  float *buf, int buf_x, int buf_y) {
        int i;                            /* i: Loop counter. */
        struct poly_vert *fe;             /* fe: Pointer to a list of integer buffer-space feather vertex coords. */
        struct r_fill_context ctx = {0};
@@ -751,3 +756,572 @@ int PLX_raskterize_feather(float (*base_verts)[2], int num_base_verts, float (*f
        free(fe);
        return i;                                   /* Return the value returned by the rasterizer. */
 }
+
+int get_range_expanded_pixel_coord(float normalized_value, int max_value) {
+       return (int)((normalized_value * (float)(max_value)) + 0.5f);
+}
+
+float get_pixel_intensity(float *buf, int buf_x, int buf_y, int pos_x, int pos_y) {
+       if(pos_x < 0 || pos_x >= buf_x || pos_y < 0 || pos_y >= buf_y) {
+               return 0.0f;
+       }
+       return buf[(pos_y * buf_y) + buf_x];
+}
+
+float get_pixel_intensity_bilinear(float *buf, int buf_x, int buf_y, float u, float v) {
+       int a;
+       int b;
+       int a_plus_1;
+       int b_plus_1;
+       float prop_u;
+       float prop_v;
+       float inv_prop_u;
+       float inv_prop_v;
+       if(u<0.0f || u>1.0f || v<0.0f || v>1.0f) {
+               return 0.0f;
+       }
+       u = u * (float)(buf_x) - 0.5f;
+       v = v * (float)(buf_y) - 0.5f;
+       a = (int)(u);
+       b = (int)(v);
+       prop_u = u - (float)(a);
+       prop_v = v - (float)(b);
+       inv_prop_u = 1.0f - prop_u;
+       inv_prop_v = 1.0f - prop_v;
+       a_plus_1 = MIN2((buf_x-1),a+1);
+       b_plus_1 = MIN2((buf_y-1),b+1);
+       return (buf[(b * buf_y) + a] * inv_prop_u + buf[(b*buf_y)+(a_plus_1)] * prop_u)*inv_prop_v+(buf[((b_plus_1) * buf_y)+a] * inv_prop_u + buf[((b_plus_1)*buf_y)+(a_plus_1)] * prop_u) * prop_v;
+
+}
+
+void set_pixel_intensity(float *buf, int buf_x, int buf_y, int pos_x, int pos_y, float intensity) {
+       if(pos_x < 0 || pos_x >= buf_x || pos_y < 0 || pos_y >= buf_y) {
+               return;
+       }
+       buf[(pos_y * buf_y) + buf_x] = intensity;
+}
+#define __PLX__FAKE_AA__
+int PLX_antialias_buffer(float *buf, int buf_x, int buf_y) {
+#ifdef __PLX__FAKE_AA__
+#ifdef __PLX_GREY_AA__
+       int i=0;
+       int sz = buf_x * buf_y;
+       for(i=0; i<sz; i++) {
+               buf[i] *= 0.5f;
+       }
+#endif
+       buf_x = buf_x;
+       buf_y = buf_y;
+       buf[0] = buf[0];
+       return 1;
+#else
+       /*XXX - TODO: THIS IS NOT FINAL CODE - IT DOES NOT WORK - DO NOT ENABLE IT */
+       const float p0 = 1.0f;
+       const float p1 = 1.0f;
+       const float p2 = 1.0f;
+       const float p3 = 1.0f;
+       const float p4 = 1.0f;
+       const float p5 = 1.5f;
+       const float p6 = 2.0f;
+       const float p7 = 2.0f;
+       const float p8 = 2.0f;
+       const float p9 = 2.0f;
+       const float p10 = 4.0f;
+       const float p11 = 8.0f;
+
+       const float edge_threshold = 0.063f;
+       const float edge_threshold_min = 0.0312f;
+       const float quality_subpix = 1.0f;
+//     int px_x;
+//     int px_y;
+
+       float posM_x,posM_y;
+       float posB_x,posB_y;
+       float posN_x,posN_y;
+       float posP_x,posP_y;
+       float offNP_x,offNP_y;
+       float lumaM;
+       float lumaS;
+       float lumaE;
+       float lumaN;
+       float lumaW;
+       float lumaNW;
+       float lumaSE;
+       float lumaNE;
+       float lumaSW;
+       float lumaNS;
+       float lumaWE;
+       float lumaNESE;
+       float lumaNWNE;
+       float lumaNWSW;
+       float lumaSWSE;
+       float lumaNN;
+       float lumaSS;
+       float lumaEndN;
+       float lumaEndP;
+       float lumaMM;
+       float lumaMLTZero;
+       float subpixNWSWNESE;
+       float subpixRcpRange;
+       float subpixNSWE;
+       float maxSM;
+       float minSM;
+       float maxESM;
+       float minESM;
+       float maxWN;
+       float minWN;
+       float rangeMax;
+       float rangeMin;
+       float rangeMaxScaled;
+       float range;
+       float rangeMaxClamped;
+       float edgeHorz;
+       float edgeVert;
+       float edgeHorz1;
+       float edgeVert1;
+       float edgeHorz2;
+       float edgeVert2;
+       float edgeHorz3;
+       float edgeVert3;
+       float edgeHorz4;
+       float edgeVert4;
+       float lengthSign;
+       float subpixA;
+       float subpixB;
+       float subpixC;
+       float subpixD;
+       float subpixE;
+       float subpixF;
+       float subpixG;
+       float subpixH;
+       float gradientN;
+       float gradientS;
+       float gradient;
+       float gradientScaled;
+       float dstN;
+       float dstP;
+       float dst;
+       float spanLength;
+       float spanLengthRcp;
+       float pixelOffset;
+       float pixelOffsetGood;
+       float pixelOffsetSubpix;
+       int directionN;
+       int goodSpan;
+       int goodSpanN;
+       int goodSpanP;
+       int horzSpan;
+       int earlyExit;
+       int pairN;
+       int doneN;
+       int doneP;
+       int doneNP;
+       int curr_x=0;
+       int curr_y=0;
+       for(curr_y=0; curr_y < buf_y; curr_y++) {
+               for(curr_x=0; curr_x < buf_x; curr_x++) {
+                       posM_x = ((float)(curr_x) + 0.5f) * (1.0f/(float)(buf_x));
+                       posM_y = ((float)(curr_y) + 0.5f) * (1.0f/(float)(buf_y));
+
+                       lumaM = get_pixel_intensity(buf, buf_x, buf_y, curr_x, curr_y);
+                       lumaS = get_pixel_intensity(buf, buf_x, buf_y, curr_x, curr_y - 1);
+                       lumaE = get_pixel_intensity(buf, buf_x, buf_y, curr_x + 1, curr_y);
+                       lumaN = get_pixel_intensity(buf, buf_x, buf_y, curr_x, curr_y + 1);
+                       lumaW = get_pixel_intensity(buf, buf_x, buf_y, curr_x - 1, curr_y);
+
+                       maxSM = MAX2(lumaS, lumaM);
+                       minSM = MIN2(lumaS, lumaM);
+                       maxESM = MAX2(lumaE, maxSM);
+                       minESM = MIN2(lumaE, minSM);
+                       maxWN = MAX2(lumaN, lumaW);
+                       minWN = MIN2(lumaN, lumaW);
+                       rangeMax = MAX2(maxWN, maxESM);
+                       rangeMin = MIN2(minWN, minESM);
+                       rangeMaxScaled = rangeMax * edge_threshold;
+                       range = rangeMax - rangeMin;
+                       rangeMaxClamped = MAX2(edge_threshold_min, rangeMaxScaled);
+
+                       earlyExit = range < rangeMaxClamped ? 1:0;
+                       if(earlyExit) {
+                               set_pixel_intensity(buf, buf_x, buf_y, curr_x, curr_y, lumaM);
+                       }
+
+                       lumaNW = get_pixel_intensity(buf, buf_x, buf_y, curr_x + 1, curr_y - 1);
+                       lumaSE = get_pixel_intensity(buf, buf_x, buf_y, curr_x - 1, curr_y + 1);
+                       lumaNE = get_pixel_intensity(buf, buf_x, buf_y, curr_x + 1, curr_y + 1);
+                       lumaSW = get_pixel_intensity(buf, buf_x, buf_y, curr_x - 1, curr_y - 1);
+
+                       lumaNS = lumaN + lumaS;
+                       lumaWE = lumaW + lumaE;
+                       subpixRcpRange = 1.0f/range;
+                       subpixNSWE = lumaNS + lumaWE;
+                       edgeHorz1 = (-2.0f * lumaM) + lumaNS;
+                       edgeVert1 = (-2.0f * lumaM) + lumaWE;
+
+                       lumaNESE = lumaNE + lumaSE;
+                       lumaNWNE = lumaNW + lumaNE;
+                       edgeHorz2 = (-2.0f * lumaE) + lumaNESE;
+                       edgeVert2 = (-2.0f * lumaN) + lumaNWNE;
+
+                       lumaNWSW = lumaNW + lumaSW;
+                       lumaSWSE = lumaSW + lumaSE;
+                       edgeHorz4 = (ABS(edgeHorz1) * 2.0f) + ABS(edgeHorz2);
+                       edgeVert4 = (ABS(edgeVert1) * 2.0f) + ABS(edgeVert2);
+                       edgeHorz3 = (-2.0f * lumaW) + lumaNWSW;
+                       edgeVert3 = (-2.0f * lumaS) + lumaSWSE;
+                       edgeHorz = ABS(edgeHorz3) + edgeHorz4;
+                       edgeVert = ABS(edgeVert3) + edgeVert4;
+
+                       subpixNWSWNESE = lumaNWSW + lumaNESE;
+                       lengthSign = 1.0f / (float)(buf_x);
+                       horzSpan = edgeHorz >= edgeVert ? 1:0;
+                       subpixA = subpixNSWE * 2.0f + subpixNWSWNESE;
+
+                       if(!horzSpan) {
+                               lumaN = lumaW;
+                               lumaS = lumaE;
+                       } else {
+                               lengthSign = 1.0f / (float)(buf_y);
+                       }
+                       subpixB = (subpixA * (1.0f/12.0f)) - lumaM;
+
+                       gradientN = lumaN - lumaM;
+                       gradientS = lumaS - lumaM;
+                       lumaNN = lumaN + lumaM;
+                       lumaSS = lumaS + lumaM;
+                       pairN = (ABS(gradientN)) >= (ABS(gradientS)) ? 1:0;
+                       gradient = MAX2(ABS(gradientN), ABS(gradientS));
+                       if(pairN) {
+                               lengthSign = -lengthSign;
+                       }
+                       subpixC = MAX2(MIN2(ABS(subpixB) * subpixRcpRange,1.0f),0.0f);
+
+                       posB_x = posM_x;
+                       posB_y = posM_y;
+                       offNP_x = (!horzSpan) ? 0.0f:(1.0f / (float)(buf_x));
+                       offNP_y = (horzSpan) ? 0.0f:(1.0f / (float)(buf_y));
+                       if(!horzSpan) {
+                               posB_x += lengthSign * 0.5f;
+                       } else {
+                               posB_y += lengthSign * 0.5f;
+                       }
+
+                       posN_x = posB_x - offNP_x * p0;
+                       posN_y = posB_y - offNP_y * p0;
+                       posP_x = posB_x + offNP_x * p0;
+                       posP_y = posB_y + offNP_y * p0;
+                       subpixD = ((-2.0f)*subpixC) + 3.0f;
+                       //may need bilinear filtered get_pixel_intensity() here...done
+                       lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                       subpixE = subpixC * subpixC;
+                       //may need bilinear filtered get_pixel_intensity() here...done
+                       lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+
+                       if(!pairN) {
+                               lumaNN = lumaSS;
+                       }
+                       gradientScaled = gradient * 1.0f/4.0f;
+                       lumaMM =lumaM - lumaNN * 0.5f;
+                       subpixF = subpixD * subpixE;
+                       lumaMLTZero = lumaMM < 0.0f ? 1:0;
+
+                       lumaEndN -= lumaNN * 0.5f;
+                       lumaEndP -= lumaNN * 0.5f;
+                       doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                       doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                       if(!doneN) {
+                               posN_x -= offNP_x * p1;
+                               posN_y -= offNP_y * p1;
+                       }
+                       doneNP = (!doneN) || (!doneP) ? 1:0;
+                       if(!doneP) {
+                               posP_x += offNP_x * p1;
+                               posP_y += offNP_y * p1;
+                       }
+
+                       if(doneNP) {
+                               if(!doneN) {
+                                       lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posN_x,posN_y);
+                               }
+                               if(!doneP) {
+                                       lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x, posP_y);
+                               }
+                               if(!doneN) {
+                                       lumaEndN = lumaEndN - lumaNN * 0.5;
+                               }
+                               if(!doneP) {
+                                       lumaEndP = lumaEndP - lumaNN * 0.5;
+                               }
+                               doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                               doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                               if(!doneN) {
+                                       posN_x -= offNP_x * p2;
+                                       posN_y -= offNP_y * p2;
+                               }
+                               doneNP = (!doneN) || (!doneP) ? 1:0;
+                               if(!doneP) {
+                                       posP_x += offNP_x * p2;
+                                       posP_y += offNP_y * p2;
+                               }
+                               if(doneNP) {
+                                       if(!doneN) {
+                                               lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                       }
+                                       if(!doneP) {
+                                               lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                       }
+                                       if(!doneN) {
+                                               lumaEndN = lumaEndN - lumaNN * 0.5;
+                                       }
+                                       if(!doneP) {
+                                               lumaEndP = lumaEndP - lumaNN * 0.5;
+                                       }
+                                       doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                       doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                       if(!doneN) {
+                                               posN_x -= offNP_x * p3;
+                                               posN_y -= offNP_y * p3;
+                                       }
+                                       doneNP = (!doneN) || (!doneP) ? 1:0;
+                                       if(!doneP) {
+                                               posP_x += offNP_x * p3;
+                                               posP_y += offNP_y * p3;
+                                       }
+                                       if(doneNP) {
+                                               if(!doneN) {
+                                                       lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                               }
+                                               if(!doneP) {
+                                                       lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                               }
+                                               if(!doneN) {
+                                                       lumaEndN = lumaEndN - lumaNN * 0.5;
+                                               }
+                                               if(!doneP) {
+                                                       lumaEndP = lumaEndP - lumaNN * 0.5;
+                                               }
+                                               doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                               doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                               if(!doneN) {
+                                                       posN_x -= offNP_x * p4;
+                                                       posN_y -= offNP_y * p4;
+                                               }
+                                               doneNP = (!doneN) || (!doneP) ? 1:0;
+                                               if(!doneP) {
+                                                       posP_x += offNP_x * p4;
+                                                       posP_y += offNP_y * p4;
+                                               }
+                                               if(doneNP) {
+                                                       if(!doneN) {
+                                                               lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                                       }
+                                                       if(!doneP) {
+                                                               lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                                       }
+                                                       if(!doneN) {
+                                                               lumaEndN = lumaEndN - lumaNN * 0.5;
+                                                       }
+                                                       if(!doneP) {
+                                                               lumaEndP = lumaEndP - lumaNN * 0.5;
+                                                       }
+                                                       doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                                       doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                                       if(!doneN) {
+                                                               posN_x -= offNP_x * p5;
+                                                               posN_y -= offNP_y * p5;
+                                                       }
+                                                       doneNP = (!doneN) || (!doneP) ? 1:0;
+                                                       if(!doneP) {
+                                                               posP_x += offNP_x * p5;
+                                                               posP_y += offNP_y * p5;
+                                                       }
+                                                       if(doneNP) {
+                                                               if(!doneN) {
+                                                                       lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                                               }
+                                                               if(!doneP) {
+                                                                       lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                                               }
+                                                               if(!doneN) {
+                                                                       lumaEndN = lumaEndN - lumaNN * 0.5;
+                                                               }
+                                                               if(!doneP) {
+                                                                       lumaEndP = lumaEndP - lumaNN * 0.5;
+                                                               }
+                                                               doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                                               doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                                               if(!doneN) {
+                                                                       posN_x -= offNP_x * p6;
+                                                                       posN_y -= offNP_y * p6;
+                                                               }
+                                                               doneNP = (!doneN) || (!doneP) ? 1:0;
+                                                               if(!doneP) {
+                                                                       posP_x += offNP_x * p6;
+                                                                       posP_y += offNP_y * p6;
+                                                               }
+                                                               if(doneNP) {
+                                                                       if(!doneN) {
+                                                                               lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                                                       }
+                                                                       if(!doneP) {
+                                                                               lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                                                       }
+                                                                       if(!doneN) {
+                                                                               lumaEndN = lumaEndN - lumaNN * 0.5;
+                                                                       }
+                                                                       if(!doneP) {
+                                                                               lumaEndP = lumaEndP - lumaNN * 0.5;
+                                                                       }
+                                                                       doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                                                       doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                                                       if(!doneN) {
+                                                                               posN_x -= offNP_x * p7;
+                                                                               posN_y -= offNP_y * p7;
+                                                                       }
+                                                                       doneNP = (!doneN) || (!doneP) ? 1:0;
+                                                                       if(!doneP) {
+                                                                               posP_x += offNP_x * p7;
+                                                                               posP_y += offNP_y * p7;
+                                                                       }
+                                                                       if(doneNP) {
+                                                                               if(!doneN) {
+                                                                                       lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                                                               }
+                                                                               if(!doneP) {
+                                                                                       lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                                                               }
+                                                                               if(!doneN) {
+                                                                                       lumaEndN = lumaEndN - lumaNN * 0.5;
+                                                                               }
+                                                                               if(!doneP) {
+                                                                                       lumaEndP = lumaEndP - lumaNN * 0.5;
+                                                                               }
+                                                                               doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                                                               doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                                                               if(!doneN) {
+                                                                                       posN_x -= offNP_x * p8;
+                                                                                       posN_y -= offNP_y * p8;
+                                                                               }
+                                                                               doneNP = (!doneN) || (!doneP) ? 1:0;
+                                                                               if(!doneP) {
+                                                                                       posP_x += offNP_x * p8;
+                                                                                       posP_y += offNP_y * p8;
+                                                                               }
+                                                                               if(doneNP) {
+                                                                                       if(!doneN) {
+                                                                                               lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                                                                       }
+                                                                                       if(!doneP) {
+                                                                                               lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                                                                       }
+                                                                                       if(!doneN) {
+                                                                                               lumaEndN = lumaEndN - lumaNN * 0.5;
+                                                                                       }
+                                                                                       if(!doneP) {
+                                                                                               lumaEndP = lumaEndP - lumaNN * 0.5;
+                                                                                       }
+                                                                                       doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                                                                       doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                                                                       if(!doneN) {
+                                                                                               posN_x -= offNP_x * p9;
+                                                                                               posN_y -= offNP_y * p9;
+                                                                                       }
+                                                                                       doneNP = (!doneN) || (!doneP) ? 1:0;
+                                                                                       if(!doneP) {
+                                                                                               posP_x += offNP_x * p9;
+                                                                                               posP_y += offNP_y * p9;
+                                                                                       }
+                                                                                       if(doneNP) {
+                                                                                               if(!doneN) {
+                                                                                                       lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                                                                               }
+                                                                                               if(!doneP) {
+                                                                                                       lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                                                                               }
+                                                                                               if(!doneN) {
+                                                                                                       lumaEndN = lumaEndN - lumaNN * 0.5;
+                                                                                               }
+                                                                                               if(!doneP) {
+                                                                                                       lumaEndP = lumaEndP - lumaNN * 0.5;
+                                                                                               }
+                                                                                               doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                                                                               doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                                                                               if(!doneN) {
+                                                                                                       posN_x -= offNP_x * p10;
+                                                                                                       posN_y -= offNP_y * p10;
+                                                                                               }
+                                                                                               doneNP = (!doneN) || (!doneP) ? 1:0;
+                                                                                               if(!doneP) {
+                                                                                                       posP_x += offNP_x * p10;
+                                                                                                       posP_y += offNP_y * p10;
+                                                                                               }
+                                                                                               if(doneNP) {
+                                                                                                       if(!doneN) {
+                                                                                                               lumaEndN = get_pixel_intensity_bilinear(buf, buf_x, buf_y,posN_x,posN_y);
+                                                                                                       }
+                                                                                                       if(!doneP) {
+                                                                                                               lumaEndP = get_pixel_intensity_bilinear(buf, buf_x, buf_y, posP_x,posP_y);
+                                                                                                       }
+                                                                                                       if(!doneN) {
+                                                                                                               lumaEndN = lumaEndN - lumaNN * 0.5;
+                                                                                                       }
+                                                                                                       if(!doneP) {
+                                                                                                               lumaEndP = lumaEndP - lumaNN * 0.5;
+                                                                                                       }
+                                                                                                       doneN = (ABS(lumaEndN)) >= gradientScaled ? 1:0;
+                                                                                                       doneP = (ABS(lumaEndP)) >= gradientScaled ? 1:0;
+                                                                                                       if(!doneN) {
+                                                                                                               posN_x -= offNP_x * p11;
+                                                                                                               posN_y -= offNP_y * p11;
+                                                                                                       }
+                                                                                                       doneNP = (!doneN) || (!doneP) ? 1:0;
+                                                                                                       if(!doneP) {
+                                                                                                               posP_x += offNP_x * p11;
+                                                                                                               posP_y += offNP_y * p11;
+                                                                                                       }
+                                                                                               }
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+                       dstN = posM_x - posN_x;
+                       dstP = posP_x - posM_x;
+                       if(!horzSpan) {
+                               dstN = posM_y - posN_y;
+                               dstP = posP_y - posM_y;
+                       }
+
+                       goodSpanN = ((lumaEndN < 0.0f) ? 1:0) != lumaMLTZero ? 1:0;
+                       spanLength = (dstP + dstN);
+                       goodSpanP = ((lumaEndP < 0.0f) ? 1:0) != lumaMLTZero ? 1:0;
+                       spanLengthRcp = 1.0f/spanLength;
+
+                       directionN = dstN < dstP ? 1:0;
+                       dst = MIN2(dstN, dstP);
+                       goodSpan = (directionN==1) ? goodSpanN:goodSpanP;
+                       subpixG = subpixF * subpixF;
+                       pixelOffset = (dst * (-spanLengthRcp)) + 0.5f;
+                       subpixH = subpixG * quality_subpix;
+
+                       pixelOffsetGood = (goodSpan==1) ? pixelOffset : 0.0f;
+                       pixelOffsetSubpix = MAX2(pixelOffsetGood, subpixH);
+                       if(!horzSpan) {
+                               posM_x += pixelOffsetSubpix * lengthSign;
+                       } else {
+                               posM_y += pixelOffsetSubpix * lengthSign;
+                       }
+                       //may need bilinear filtered get_pixel_intensity() here...
+                       set_pixel_intensity(buf,buf_x,buf_y,curr_x,curr_y,get_pixel_intensity_bilinear(buf, buf_x, buf_y, posM_x,posM_y)* lumaM);
+
+               }
+       }
+       return 1;
+
+#endif
+}
+
index e80ca1d41c4c0233b8914e854a602b4a01a41e73..e078b0d26be2a9126749bfb0a3b286b48056f4bb 100644 (file)
@@ -49,11 +49,11 @@ extern "C" {
 #endif
 
 int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
-                   float *buf, int buf_x, int buf_y);
+                   float *buf, int buf_x, int buf_y, int do_mask_AA);
 int PLX_raskterize_feather(float (*base_verts)[2], int num_base_verts,
                            float (*feather_verts)[2], int num_feather_verts,
                            float *buf, int buf_x, int buf_y);
-
+int PLX_antialias_buffer(float *buf, int buf_x, int buf_y);
 #ifdef __cplusplus
 }
 #endif
index 66a2ae54ade678cb763d0a7fd3358ec2062706cd..866c4ab412d2f00fd3f4ec5170b65785290ef5ac 100644 (file)
@@ -42,6 +42,7 @@
                    object_selected="#f15800"
                    outline_width="1"
                    panel="#a5a5a57f"
+                   skin_root="#000000"
                    speaker="#535353"
                    transform="#ffffff"
                    handle_vect="#409030"
@@ -80,7 +81,9 @@
                        marker_outline="#0094af"
                        path_after="#0000ff"
                        path_before="#ff0000"
-                       selected_marker="#ffff00">
+                       selected_marker="#ffff00"
+                       strips="#0c0a0a"
+                       strips_selected="#ff8c00">
         <space>
           <ThemeSpaceGeneric header="#000000"
                              header_text="#979797"
                              back="#0d0d0d">
           </ThemeSpaceGeneric>
         </space>
+        <space_list>
+          <ThemeSpaceListGeneric list="#666666"
+                                 list_text="#000000"
+                                 list_text_hi="#ffffff"
+                                 list_title="#000000">
+          </ThemeSpaceListGeneric>
+        </space_list>
       </ThemeClipEditor>
     </clip_editor>
     <console>
                       grid="#212121"
                       long_key="#0c0a0a"
                       long_key_selected="#ff8c00"
+                      summary="#00000000"
                       value_sliders="#000000"
                       view_sliders="#969696">
         <space>
       </ThemeLogicEditor>
     </logic_editor>
     <nla_editor>
-      <ThemeNLAEditor bars="#707070"
-                      bars_selected="#60c040"
+      <ThemeNLAEditor active_action="#00000000"
                       frame_current="#2f6421"
                       grid="#5e5e5e"
+                      meta_strips="#000000"
+                      meta_strips_selected="#000000"
+                      active_action_unset="#00000000"
+                      sound_strips="#000000"
+                      sound_strips_selected="#000000"
                       strips="#aa8d8d"
                       strips_selected="#ff8c00"
+                      transition_strips="#000000"
+                      transition_strips_selected="#000000"
+                      tweak="#000000"
+                      tweak_duplicate="#000000"
                       view_sliders="#969696">
         <space>
           <ThemeSpaceGeneric header="#000000"
       </ThemeNLAEditor>
     </nla_editor>
     <node_editor>
-      <ThemeNodeEditor converter_node="#113941"
+      <ThemeNodeEditor node_active="#ffffff"
+                       converter_node="#113941"
+                       frame_node="#9a9b9ba0"
                        group_node="#091a07"
                        in_out_node="#273053"
                        node_backdrop="#202030bc"
+                       node_selected="#ffffff"
                        noodle_curving="5"
                        operator_node="#0e3157"
                        selected_text="#7f7070"
                            keyframe="#ff8500"
                            meta_strip="#6d9183"
                            movie_strip="#516987"
-                           plugin_strip="#7e7e50"
                            preview_back="#000000"
                            scene_strip="#4e983e"
                            transition_strip="#a25f6f"
index d36e54262bad7c852883f51107c62ef34377d77a..79d1ed4ecf470607e8bde27a7d713e79da39053e 100644 (file)
@@ -42,6 +42,7 @@
                    object_selected="#ff88ff"
                    outline_width="1"
                    panel="#a5a5a5ff"
+                   skin_root="#000000"
                    speaker="#000000"
                    transform="#ffffff"
                    handle_vect="#409030"
@@ -80,7 +81,9 @@
                        marker_outline="#000000"
                        path_after="#0000ff"
                        path_before="#ff0000"
-                       selected_marker="#ffff00">
+                       selected_marker="#ffff00"
+                       strips="#0c0a0a"
+                       strips_selected="#ff8c00">
         <space>
           <ThemeSpaceGeneric header="#b4b4b4"
                              header_text="#000000"
                              back="#757575">
           </ThemeSpaceGeneric>
         </space>
+        <space_list>
+          <ThemeSpaceListGeneric list="#666666"
+                                 list_text="#000000"
+                                 list_text_hi="#ffffff"
+                                 list_title="#000000">
+          </ThemeSpaceListGeneric>
+        </space_list>
       </ThemeClipEditor>
     </clip_editor>
     <console>
                       grid="#858585"
                       long_key="#0c0a0a"
                       long_key_selected="#ff8c00"
+                      summary="#00000000"
                       value_sliders="#000000"
                       view_sliders="#969696">
         <space>
       </ThemeLogicEditor>
     </logic_editor>
     <nla_editor>
-      <ThemeNLAEditor bars="#707070"
-                      bars_selected="#60c040"
+      <ThemeNLAEditor active_action="#00000000"
                       frame_current="#60c040"
                       grid="#5e5e5e"
+                      meta_strips="#000000"
+                      meta_strips_selected="#000000"
+                      active_action_unset="#00000000"
+                      sound_strips="#000000"
+                      sound_strips_selected="#000000"
                       strips="#0c0a0a"
                       strips_selected="#ff8c00"
+                      transition_strips="#000000"
+                      transition_strips_selected="#000000"
+                      tweak="#000000"
+                      tweak_duplicate="#000000"
                       view_sliders="#969696">
         <space>
           <ThemeSpaceGeneric header="#b4b4b4"
       </ThemeNLAEditor>
     </nla_editor>
     <node_editor>
-      <ThemeNodeEditor converter_node="#686a75"
+      <ThemeNodeEditor node_active="#ffffff"
+                       converter_node="#686a75"
+                       frame_node="#9a9b9ba0"
                        group_node="#69756e"
                        in_out_node="#646464"
                        node_backdrop="#9b9b9ba0"
+                       node_selected="#ffffff"
                        noodle_curving="5"
                        operator_node="#6c696f"
                        selected_text="#7f7070"
                            keyframe="#ff8500"
                            meta_strip="#6d9183"
                            movie_strip="#516987"
-                           plugin_strip="#7e7e50"
                            preview_back="#000000"
                            scene_strip="#4e983e"
                            transition_strip="#a25f6f"
index 9e4c17a1715a621dbe45a9877a836a563338bcf8..bfeb3a0175e244e48c8c409c140205c926a7303c 100644 (file)
@@ -42,6 +42,7 @@
                    object_selected="#ff8500"
                    outline_width="1"
                    panel="#a5a5a57f"
+                   skin_root="#000000"
                    speaker="#000000"
                    transform="#ffffff"
                    handle_vect="#409030"
@@ -80,7 +81,9 @@
                        marker_outline="#000000"
                        path_after="#0000ff"
                        path_before="#ff0000"
-                       selected_marker="#ffff00">
+                       selected_marker="#ffff00"
+                       strips="#0c0a0a"
+                       strips_selected="#ff8c00">
         <space>
           <ThemeSpaceGeneric header="#313131"
                              header_text="#000000"
                              back="#393939">
           </ThemeSpaceGeneric>
         </space>
+        <space_list>
+          <ThemeSpaceListGeneric list="#666666"
+                                 list_text="#000000"
+                                 list_text_hi="#ffffff"
+                                 list_title="#000000">
+          </ThemeSpaceListGeneric>
+        </space_list>
       </ThemeClipEditor>
     </clip_editor>
     <console>
                       grid="#585858"
                       long_key="#0c0a0a"
                       long_key_selected="#ff8c00"
+                      summary="#00000000"
                       value_sliders="#000000"
                       view_sliders="#969696">
         <space>
       </ThemeLogicEditor>
     </logic_editor>
     <nla_editor>
-      <ThemeNLAEditor bars="#707070"
-                      bars_selected="#60c040"
+      <ThemeNLAEditor active_action="#00000000"
                       frame_current="#60c040"
                       grid="#585858"
+                      meta_strips="#000000"
+                      meta_strips_selected="#000000"
+                      active_action_unset="#00000000"
+                      sound_strips="#000000"
+                      sound_strips_selected="#000000"
                       strips="#0c0a0a"
                       strips_selected="#ff8c00"
+                      transition_strips="#000000"
+                      transition_strips_selected="#000000"
+                      tweak="#000000"
+                      tweak_duplicate="#000000"
                       view_sliders="#969696">
         <space>
           <ThemeSpaceGeneric header="#3b3b3b"
       </ThemeNLAEditor>
     </nla_editor>
     <node_editor>
-      <ThemeNodeEditor converter_node="#575675"
+      <ThemeNodeEditor node_active="#ffffff"
+                       converter_node="#575675"
+                       frame_node="#9a9b9ba0"
                        group_node="#1e7524"
                        in_out_node="#e08706"
                        node_backdrop="#9b9b9ba0"
+                       node_selected="#ffffff"
                        noodle_curving="5"
                        operator_node="#2c6f6f"
                        selected_text="#7f7070"
                            keyframe="#ff8500"
                            meta_strip="#6d9183"
                            movie_strip="#516987"
-                           plugin_strip="#7e7e50"
                            preview_back="#000000"
                            scene_strip="#4e983e"
                            transition_strip="#a25f6f"
index 4f6dbb376e2724fdb8f0548c4b7144aed063483d..7727d860a90c29aece0b4ecc3a8bb1af72f30e04 100644 (file)
@@ -42,6 +42,7 @@
                    object_selected="#52c6ff"
                    outline_width="1"
                    panel="#a5a5a5ff"
+                   skin_root="#000000"
                    speaker="#000000"
                    transform="#ffffff"
                    handle_vect="#409030"
@@ -80,7 +81,9 @@
                        marker_outline="#000000"
                        path_after="#0000ff"
                        path_before="#ff0000"
-                       selected_marker="#ffff00">
+                       selected_marker="#ffff00"
+                       strips="#0c0a0a"
+                       strips_selected="#ff8c00">
         <space>
           <ThemeSpaceGeneric header="#5c606c"
                              header_text="#000000"
                              back="#7c7e88">
           </ThemeSpaceGeneric>
         </space>
+        <space_list>
+          <ThemeSpaceListGeneric list="#666666"
+                                 list_text="#000000"
+                                 list_text_hi="#ffffff"
+                                 list_title="#000000">
+          </ThemeSpaceListGeneric>
+        </space_list>
       </ThemeClipEditor>
     </clip_editor>
     <console>
                       grid="#58587c"
                       long_key="#0c0a0a"
                       long_key_selected="#ff8c00"
+                      summary="#00000000"
                       value_sliders="#000000"
                       view_sliders="#969696">
         <space>
       </ThemeLogicEditor>
     </logic_editor>
     <nla_editor>
-      <ThemeNLAEditor bars="#707070"
-                      bars_selected="#60c040"
+      <ThemeNLAEditor active_action="#00000000"
                       frame_current="#60c040"
                       grid="#5e5e5e"
+                      meta_strips="#000000"
+                      meta_strips_selected="#000000"
+                      active_action_unset="#00000000"
+                      sound_strips="#000000"
+                      sound_strips_selected="#000000"
                       strips="#0c0a0a"
                       strips_selected="#ff8c00"
+                      transition_strips="#000000"
+                      transition_strips_selected="#000000"
+                      tweak="#000000"
+                      tweak_duplicate="#000000"
                       view_sliders="#969696">
         <space>
           <ThemeSpaceGeneric header="#5c606c"
       </ThemeNLAEditor>
     </nla_editor>
     <node_editor>
-      <ThemeNodeEditor converter_node="#686a84"
+      <ThemeNodeEditor node_active="#ffffff"
+                       converter_node="#686a84"
+                       frame_node="#9a9b9ba0"
                        group_node="#69756e"
                        in_out_node="#64647b"
                        node_backdrop="#9b9baca0"
+                       node_selected="#ffffff"
                        noodle_curving="5"
                        operator_node="#6c697e"
                        selected_text="#7f7070"
                            keyframe="#ff8500"
                            meta_strip="#6d9183"
                            movie_strip="#516987"
-                           plugin_strip="#7e7e50"
                            preview_back="#000000"
                            scene_strip="#4e983e"
                            transition_strip="#a25f6f"
index 3897c41f8081c7c163a6fbd3d655153b4672084b..72852e2760411bdd1e202b141959f12acb5f832c 100644 (file)
@@ -42,6 +42,7 @@
                    object_selected="#f15800"
                    outline_width="1"
                    panel="#a5a5a57f"
+                   skin_root="#000000"
                    speaker="#000000"
                    transform="#ffffff"
                    handle_vect="#409030"
@@ -80,7 +81,9 @@
                        marker_outline="#000000"
                        path_after="#19b6ee"
                        path_before="#ff5100"
-                       selected_marker="#d5ff00">
+                       selected_marker="#d5ff00"
+                       strips="#0c0a0a"
+                       strips_selected="#ff8c00">
         <space>
           <ThemeSpaceGeneric header="#3c3b37"
                              header_text="#000000"
                              back="#131311">
           </ThemeSpaceGeneric>
         </space>
+        <space_list>
+          <ThemeSpaceListGeneric list="#666666"
+                                 list_text="#000000"
+                                 list_text_hi="#ffffff"
+                                 list_title="#000000">
+          </ThemeSpaceListGeneric>
+        </space_list>
       </ThemeClipEditor>
     </clip_editor>
     <console>
                       grid="#525252"
                       long_key="#0c0a0a"
                       long_key_selected="#f47421"
+                      summary="#00000000"
                       value_sliders="#000000"
                       view_sliders="#969696">
         <space>
       </ThemeLogicEditor>
     </logic_editor>
     <nla_editor>
-      <ThemeNLAEditor bars="#3c3b37"
-                      bars_selected="#60c040"
+      <ThemeNLAEditor active_action="#00000000"
                       frame_current="#f58032"
                       grid="#5c5c52"
+                      meta_strips="#000000"
+                      meta_strips_selected="#000000"
+                      active_action_unset="#00000000"
+                      sound_strips="#000000"
+                      sound_strips_selected="#000000"
                       strips="#0c0a0a"
                       strips_selected="#6b395a"
+                      transition_strips="#000000"
+                      transition_strips_selected="#000000"
+                      tweak="#000000"
+                      tweak_duplicate="#000000"
                       view_sliders="#969696">
         <space>
           <ThemeSpaceGeneric header="#464541"
       </ThemeNLAEditor>
     </nla_editor>
     <node_editor>
-      <ThemeNodeEditor converter_node="#93be00"
+      <ThemeNodeEditor node_active="#ffffff"
+                       converter_node="#93be00"
+                       frame_node="#9a9b9ba0"
                        group_node="#19b6ee"
                        in_out_node="#f40051"
                        node_backdrop="#52524ed1"
+                       node_selected="#ffffff"
                        noodle_curving="5"
                        operator_node="#000000"
                        selected_text="#7f7070"
                            keyframe="#f47421"
                            meta_strip="#6d9183"
                            movie_strip="#516987"
-                           plugin_strip="#7e7e50"
                            preview_back="#000000"
                            scene_strip="#4e983e"
                            transition_strip="#a25f6f"
index 55922da3892d122149ea45a1f75ac106336cd113..a77302ff4ae620fdb6b1929a4d71e3ed7ca12eb5 100644 (file)
@@ -1269,6 +1269,7 @@ class CLIP_MT_mask(Menu):
         layout.separator()
         layout.operator("mask.cyclic_toggle")
         layout.operator("mask.switch_direction")
+        layout.operator("mask.normals_make_consistent")
         layout.operator("mask.feather_weight_clear")  # TODO, better place?
 
         layout.separator()
index 397bdc0d74efd4de0e639b446995b4b14658fb94..d7fe7ebbbf72c9c4cff5437098fd02f6e9bc08bd 100644 (file)
@@ -2575,13 +2575,21 @@ class VIEW3D_PT_background_image(Panel):
 
                 if has_bg:
                     col = box.column()
-                    col.prop(bg, "show_on_foreground")
                     col.prop(bg, "opacity", slider=True)
+
+                    rowsub = col.row()
+                    rowsub.prop(bg, "draw_depth", expand=True)
+
+                    if bg.view_axis in {'CAMERA', 'ALL'}:
+                        rowsub = col.row()
+                        rowsub.prop(bg, "frame_method", expand=True)
+
                     if bg.view_axis != 'CAMERA':
                         col.prop(bg, "size")
-                        row = col.row(align=True)
-                        row.prop(bg, "offset_x", text="X")
-                        row.prop(bg, "offset_y", text="Y")
+
+                    row = col.row(align=True)
+                    row.prop(bg, "offset_x", text="X")
+                    row.prop(bg, "offset_y", text="Y")
 
 
 class VIEW3D_PT_transform_orientations(Panel):
index d67e1a9118ea850bcc0873430a80f8adbe22caaf..f58af8f39a0c221ea718c43632b9ee7116ce26eb 100644 (file)
@@ -35,6 +35,7 @@ struct CurveMapping;
 struct CurveMap;
 struct CurveMapPoint;
 struct Scopes;
+struct Histogram;
 struct ImBuf;
 struct rctf;
 
@@ -74,7 +75,7 @@ void                curvemapping_premultiply(struct CurveMapping *cumap, int res
 int                 curvemapping_RGBA_does_something(struct CurveMapping *cumap);
 void                curvemapping_initialize(struct CurveMapping *cumap);
 void                curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
-
+void                BKE_histogram_update_sample_line(struct Histogram *hist, struct ImBuf *ibuf, const short use_color_management);
 void                scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
 void                scopes_free(struct Scopes *scopes);
 void                scopes_new(struct Scopes *scopes);
index 345a2190e896fc8c57cd3693d04886ecc69ec33e..0e93869a8b0d9e7d6bf6f63e742f0363ed7d222b 100644 (file)
@@ -48,6 +48,7 @@ struct MaskLayer *BKE_mask_layer_active(struct Mask *mask);
 void BKE_mask_layer_active_set(struct Mask *mask, struct MaskLayer *masklay);
 void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay);
 
+void BKE_mask_layer_free_shapes(struct MaskLayer *masklay);
 void BKE_mask_layer_free(struct MaskLayer *masklay);
 void BKE_mask_spline_free(struct MaskSpline *spline);
 struct MaskSpline *BKE_mask_spline_copy(struct MaskSpline *spline);
@@ -169,7 +170,7 @@ void BKE_mask_layer_shape_changed_remove(struct MaskLayer *masklay, int index, i
 /* rasterization */
 int BKE_mask_get_duration(struct Mask *mask);
 void BKE_mask_rasterize(struct Mask *mask, int width, int height, float *buffer,
-                        const short do_aspect_correct);
+                        const short do_aspect_correct, int do_mask_aa);
 
 #define MASKPOINT_ISSEL_ANY(p)          ( ((p)->bezt.f1 | (p)->bezt.f2 | (p)->bezt.f2) & SELECT)
 #define MASKPOINT_ISSEL_KNOT(p)         ( (p)->bezt.f2 & SELECT)
index dd61a7e4c0fecefdec1da7068b9b2fbb92aa6b64..f97996bfc29e6ee68d9f72cab89713fd1be2f46c 100644 (file)
@@ -339,7 +339,7 @@ struct bNodeSocket *nodeInsertSocket(struct bNodeTree *ntree, struct bNode *node
 void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock);
 void nodeRemoveAllSockets(struct bNodeTree *ntree, struct bNode *node);
 
-void                   nodeAddToPreview(struct bNode *, float *, int, int, int);
+void                   nodeAddToPreview(struct bNode *node, float col[4], int x, int y, int do_manage);
 
 struct bNode   *nodeAddNode(struct bNodeTree *ntree, struct bNodeTemplate *ntemp);
 void                   nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
index 29979f62d604f96c55f41399e5a3e415535a60ba..b8ba30959056b0ee9c5318951114113eb6a241f1 100644 (file)
@@ -161,13 +161,13 @@ struct MovieClip *BKE_object_movieclip_get(struct Scene *scene, struct Object *o
 /* this function returns a superset of the scenes selection based on relationships */
 
 typedef enum eObRelationTypes {
-       OB_REL_NONE               = 0,      /* just the selection as is */
-       OB_REL_PARENT             = (1<<0), /* immediate parent */
-       OB_REL_PARENT_RECURSIVE   = (1<<1), /* parents up to root of selection tree*/
-       OB_REL_CHILDREN           = (1<<2), /* immediate children */
-       OB_REL_CHILDREN_RECURSIVE = (1<<3), /* All children */
-       OB_REL_MOD_ARMATURE       = (1<<4), /* Armatures related to the selected objects */
-       OB_REL_SCENE_CAMERA       = (1<<5), /* you might want the scene camera too even if unselected? */
+       OB_REL_NONE               = 0,        /* just the selection as is */
+       OB_REL_PARENT             = (1 << 0), /* immediate parent */
+       OB_REL_PARENT_RECURSIVE   = (1 << 1), /* parents up to root of selection tree*/
+       OB_REL_CHILDREN           = (1 << 2), /* immediate children */
+       OB_REL_CHILDREN_RECURSIVE = (1 << 3), /* All children */
+       OB_REL_MOD_ARMATURE       = (1 << 4), /* Armatures related to the selected objects */
+       OB_REL_SCENE_CAMERA       = (1 << 5), /* you might want the scene camera too even if unselected? */
 } eObRelationTypes;
 
 typedef enum eObjectSet {
index 5b09f8fdf3d2aa331e65324eb824af4d59a7e037..a7b03cef9334b1a22b90e784e3da627c79ae5130 100644 (file)
@@ -72,8 +72,8 @@ typedef struct SpaceTransform {
 } SpaceTransform;
 
 void space_transform_from_matrixs(struct SpaceTransform *data, float local[4][4], float target[4][4]);
-void space_transform_apply(const struct SpaceTransform *data, float *co);
-void space_transform_invert(const struct SpaceTransform *data, float *co);
+void space_transform_apply(const struct SpaceTransform *data, float co[3]);
+void space_transform_invert(const struct SpaceTransform *data, float co[3]);
 
 #define space_transform_setup(data, local, target) space_transform_from_matrixs(data, (local)->obmat, (target)->obmat)
 
index 12dee600532a535735b81602920e20c21be7844a..6879ec506f050d2dbecd006e394378931a0fda34 100644 (file)
@@ -946,6 +946,62 @@ static void save_sample_line(Scopes *scopes, const int idx, const float fx, cons
        }
 }
 
+void BKE_histogram_update_sample_line(Histogram *hist, ImBuf *ibuf, const short use_color_management)
+{
+       int i, x, y;
+       float *fp;
+       float rgb[3];
+       unsigned char *cp;
+
+       int x1 = 0.5f + hist->co[0][0] * ibuf->x;
+       int x2 = 0.5f + hist->co[1][0] * ibuf->x;
+       int y1 = 0.5f + hist->co[0][1] * ibuf->y;
+       int y2 = 0.5f + hist->co[1][1] * ibuf->y;
+
+       hist->channels = 3;
+       hist->x_resolution = 256;
+       hist->xmax = 1.0f;
+       hist->ymax = 1.0f;
+
+       if (ibuf->rect == NULL && ibuf->rect_float == NULL) return;
+
+       /* persistent draw */
+       hist->flag |= HISTO_FLAG_SAMPLELINE; /* keep drawing the flag after */
+
+       for (i = 0; i < 256; i++) {
+               x = (int)(0.5f + x1 + (float)i * (x2 - x1) / 255.0f);
+               y = (int)(0.5f + y1 + (float)i * (y2 - y1) / 255.0f);
+
+               if (x < 0 || y < 0 || x >= ibuf->x || y >= ibuf->y) {
+                       hist->data_luma[i] = hist->data_r[i] = hist->data_g[i] = hist->data_b[i] = hist->data_a[i] = 0.0f;
+               }
+               else {
+                       if (ibuf->rect_float) {
+                               fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
+
+                               if (use_color_management)
+                                       linearrgb_to_srgb_v3_v3(rgb, fp);
+                               else
+                                       copy_v3_v3(rgb, fp);
+
+                               hist->data_luma[i]  = rgb_to_luma(rgb);
+                               hist->data_r[i]     = rgb[0];
+                               hist->data_g[i]     = rgb[1];
+                               hist->data_b[i]     = rgb[2];
+                               hist->data_a[i]     = fp[3];
+                       }
+                       else if (ibuf->rect) {
+                               cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x);
+                               hist->data_luma[i]  = (float)rgb_to_luma_byte(cp) / 255.0f;
+                               hist->data_r[i]     = (float)cp[0] / 255.0f;
+                               hist->data_g[i]     = (float)cp[1] / 255.0f;
+                               hist->data_b[i]     = (float)cp[2] / 255.0f;
+                               hist->data_a[i]     = (float)cp[3] / 255.0f;
+                       }
+               }
+       }
+}
+
 void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
 {
        int x, y, c;
index a28ff3a175d9f3789a2e63a8e3acfd03e98d03b5..7e9f189ae0121d773c99ec2da75b6b73c7159eb4 100644 (file)
@@ -1029,10 +1029,27 @@ void BKE_mask_layer_shape_free(MaskLayerShape *masklay_shape)
        MEM_freeN(masklay_shape);
 }
 
+/** \brief Free all animation keys for a mask layer
+ */
+void BKE_mask_layer_free_shapes(MaskLayer *masklay)
+{
+       MaskLayerShape *masklay_shape;
+
+       /* free animation data */
+       masklay_shape = masklay->splines_shapes.first;
+       while (masklay_shape) {
+               MaskLayerShape *next_masklay_shape = masklay_shape->next;
+
+               BLI_remlink(&masklay->splines_shapes, masklay_shape);
+               BKE_mask_layer_shape_free(masklay_shape);
+
+               masklay_shape = next_masklay_shape;
+       }
+}
+
 void BKE_mask_layer_free(MaskLayer *masklay)
 {
        MaskSpline *spline;
-       MaskLayerShape *masklay_shape;
 
        /* free splines */
        spline = masklay->splines.first;
@@ -1046,15 +1063,7 @@ void BKE_mask_layer_free(MaskLayer *masklay)
        }
 
        /* free animation data */
-       masklay_shape = masklay->splines_shapes.first;
-       while (masklay_shape) {
-               MaskLayerShape *next_masklay_shape = masklay_shape->next;
-
-               BLI_remlink(&masklay->splines_shapes, masklay_shape);
-               BKE_mask_layer_shape_free(masklay_shape);
-
-               masklay_shape = next_masklay_shape;
-       }
+       BKE_mask_layer_free_shapes(masklay);
 
        MEM_freeN(masklay);
 }
@@ -2080,7 +2089,7 @@ int BKE_mask_get_duration(Mask *mask)
 
 /* rasterization */
 void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer,
-                        const short do_aspect_correct)
+                        const short do_aspect_correct, int do_mask_aa)
 {
        MaskLayer *masklay;
 
@@ -2145,7 +2154,7 @@ void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer,
 
                                if (tot_diff_point) {
                                        PLX_raskterize(diff_points, tot_diff_point,
-                                                      buffer_tmp, width, height);
+                                                      buffer_tmp, width, height, do_mask_aa);
 
                                        if (tot_diff_feather_points) {
                                                PLX_raskterize_feather(diff_points, tot_diff_point,
index 7fe4016f68000ff4818e208d43b245e073967781..bd3690e21743919ec699df57e79e25c91c380e7d 100644 (file)
@@ -802,7 +802,7 @@ void ntreeClearPreview(bNodeTree *ntree)
 /* hack warning! this function is only used for shader previews, and 
  * since it gets called multiple times per pixel for Ztransp we only
  * add the color once. Preview gets cleared before it starts render though */
-void nodeAddToPreview(bNode *node, float *col, int x, int y, int do_manage)
+void nodeAddToPreview(bNode *node, float col[4], int x, int y, int do_manage)
 {
        bNodePreview *preview= node->preview;
        if (preview) {
index 91fd5811911e9d35afcb2ad4515b67bacecf3c54..1f5ba8ae30517dd5aeb1ff977867d5b9a178f221 100644 (file)
@@ -3090,13 +3090,11 @@ static Object *obrel_armature_find(Object *ob)
                ob_arm = ob->parent;
        }
        else {
-               ModifierData *mod = (ModifierData*)ob->modifiers.first;
-               while (mod) {
+               ModifierData *mod;
+               for (mod = (ModifierData *)ob->modifiers.first; mod; mod = mod->next) {
                        if (mod->type == eModifierType_Armature) {
-                               ob_arm = ((ArmatureModifierData*)mod)->object;
+                               ob_arm = ((ArmatureModifierData *)mod)->object;
                        }
-
-                       mod = mod->next;
                }
        }
 
@@ -3104,11 +3102,11 @@ static Object *obrel_armature_find(Object *ob)
 }
 
 static int obrel_is_recursive_child(Object *ob, Object *child) {
-       Object *ancestor = child->parent;
-       while (ancestor)
-       {
-               if(ancestor == ob) return TRUE;
-               ancestor = ancestor->parent;
+       Object *par;
+       for (par = child->parent; par; par = par->parent) {
+               if (par == ob) {
+                       return TRUE;
+               }
        }
        return FALSE;
 }
@@ -3151,16 +3149,16 @@ struct LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet
                        obrel_list_add(&links, ob);
                }
                else {
-                       if ( (objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE(((View3D *)NULL), scene, base))
-                       ||   (objectSet == OB_SET_VISIBLE  && BASE_EDITABLE_BGMODE(((View3D *)NULL), scene, base))
-                               ) {
+                       if ((objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE(((View3D *)NULL), scene, base)) ||
+                           (objectSet == OB_SET_VISIBLE  && BASE_EDITABLE_BGMODE(((View3D *)NULL), scene, base)))
+                       {
                                Object *ob = base->object;
 
                                if (obrel_list_test(ob))
                                        obrel_list_add(&links, ob);
 
                                /* parent relationship */
-                               if (includeFilter & ( OB_REL_PARENT | OB_REL_PARENT_RECURSIVE )) {
+                               if (includeFilter & (OB_REL_PARENT | OB_REL_PARENT_RECURSIVE)) {
                                        Object *parent = ob->parent;
                                        if (obrel_list_test(parent)) {
 
@@ -3169,7 +3167,7 @@ struct LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet
                                                /* recursive parent relationship */
                                                if (includeFilter & OB_REL_PARENT_RECURSIVE) {
                                                        parent = parent->parent;
-                                                       while (obrel_list_test(parent)){
+                                                       while (obrel_list_test(parent)) {
 
                                                                obrel_list_add(&links, parent);
                                                                parent = parent->parent;
@@ -3179,15 +3177,16 @@ struct LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet
                                }
 
                                /* child relationship */
-                               if (includeFilter & ( OB_REL_CHILDREN | OB_REL_CHILDREN_RECURSIVE )) {
+                               if (includeFilter & (OB_REL_CHILDREN | OB_REL_CHILDREN_RECURSIVE)) {
                                        Base *local_base;
                                        for (local_base = scene->base.first; local_base; local_base = local_base->next) {
                                                if (BASE_EDITABLE_BGMODE(((View3D *)NULL), scene, local_base)) {
 
                                                        Object *child = local_base->object;
                                                        if (obrel_list_test(child)) {
-                                                               if ((includeFilter & OB_REL_CHILDREN_RECURSIVE && obrel_is_recursive_child(ob,child))
-                                                               ||  (includeFilter & OB_REL_CHILDREN && child->parent && child->parent == ob )) {
+                                                               if ((includeFilter & OB_REL_CHILDREN_RECURSIVE && obrel_is_recursive_child(ob, child)) ||
+                                                                   (includeFilter & OB_REL_CHILDREN && child->parent && child->parent == ob))
+                                                               {
                                                                        obrel_list_add(&links, child);
                                                                }
                                                        }
@@ -3206,7 +3205,7 @@ struct LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet
 
                        }
                }
-       } // end for
+       }
 
        return links;
 }
index 889eee25d6bec1fe9c13f624a83102eed6c500db..ddf30ecfa81c38e861e6a3aa5ebd603cf3659cfe 100644 (file)
@@ -2081,7 +2081,8 @@ static ImBuf *seq_render_mask_strip(
                BKE_mask_rasterize(seq->mask,
                                   context.rectx, context.recty,
                                   maskbuf,
-                                  TRUE);
+                                  TRUE,
+                                  FALSE /*XXX- TODO: make on/off for anti-aliasing*/);
 
                fp_src = maskbuf;
                fp_dst = ibuf->rect_float;
@@ -2104,7 +2105,8 @@ static ImBuf *seq_render_mask_strip(
                BKE_mask_rasterize(seq->mask,
                                   context.rectx, context.recty,
                                   maskbuf,
-                                  TRUE);
+                                  TRUE,
+                                  FALSE /*XXX- TODO: mask on/off for anti-aliasing*/);
 
                fp_src = maskbuf;
                ub_dst = (unsigned char *)ibuf->rect;
index b61a39a2cd209bb4cf49d6e64159a2bf6dcae397..0aa0d36c537f07dd3be1d9713485fefb3428b6d8 100644 (file)
@@ -1428,7 +1428,7 @@ static void track_mask_gpencil_layer_rasterize(int frame_width, int frame_height
                                        fp[1] = (stroke_points[i].y - marker->search_min[1]) * frame_height / mask_height;
                                }
 
-                               PLX_raskterize((float (*)[2])mask_points, stroke->totpoints, mask, mask_width, mask_height);
+                               PLX_raskterize((float (*)[2])mask_points, stroke->totpoints, mask, mask_width, mask_height, FALSE /* XXX- TODO: make on/off for AA*/);
 
                                MEM_freeN(mask_points);
                        }
index 44f54c4112909cf072e6586df56837c4a4d92db3..7520f09fe954e9b68493e092a8d9d1d0eea8adba 100644 (file)
@@ -74,10 +74,7 @@ void rgb_to_xyz(float r, float g, float b, float *x, float *y, float *z);
 unsigned int rgb_to_cpack(float r, float g, float b);
 unsigned int hsv_to_cpack(float h, float s, float v);
 
-float rgb_to_grayscale(const float rgb[3]);
-unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3]);
-float rgb_to_luma(const float rgb[3]);
-unsigned char rgb_to_luma_byte(const unsigned char rgb[3]);
+/* rgb_to_grayscale & rgb_to_luma functions moved to math_color_inline.c */
 
 /**************** Profile Transformations *****************/
 
index 5b034bd287257871d88ad31fc6af36623b4ebf4d..b93597bf107c929f31d2d3114057852a99e303cc 100644 (file)
@@ -381,15 +381,9 @@ unsigned int rgb_to_cpack(float r, float g, float b)
 
 void cpack_to_rgb(unsigned int col, float *r, float *g, float *b)
 {
-
-       *r = (float)((col) & 0xFF);
-       *r /= 255.0f;
-
-       *g = (float)(((col) >> 8) & 0xFF);
-       *g /= 255.0f;
-
-       *b = (float)(((col) >> 16) & 0xFF);
-       *b /= 255.0f;
+       *r = ((float)(((col)      ) & 0xFF)) * (1.0f / 255.0f);
+       *g = ((float)(((col) >>  8) & 0xFF)) * (1.0f / 255.0f);
+       *b = ((float)(((col) >> 16) & 0xFF)) * (1.0f / 255.0f);
 }
 
 void rgb_uchar_to_float(float col_r[3], const unsigned char col_ub[3])
@@ -496,26 +490,6 @@ int constrain_rgb(float *r, float *g, float *b)
        return 0; /* Color within RGB gamut */
 }
 
-float rgb_to_grayscale(const float rgb[3])
-{
-       return 0.3f * rgb[0] + 0.58f * rgb[1] + 0.12f * rgb[2];
-}
-
-unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3])
-{
-       return (76 * (unsigned short) rgb[0] + 148 * (unsigned short) rgb[1] + 31 * (unsigned short) rgb[2]) / 255;
-}
-
-float rgb_to_luma(const float rgb[3])
-{
-       return 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2];
-}
-
-unsigned char rgb_to_luma_byte(const unsigned char rgb[3])
-{
-       return (76 * (unsigned short) rgb[0] + 150 * (unsigned short) rgb[1] + 29 * (unsigned short) rgb[2]) / 255;
-}
-
 /* ********************************* lift/gamma/gain / ASC-CDL conversion ********************************* */
 
 void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power)
@@ -648,9 +622,9 @@ void rgb_to_xyz(float r, float g, float b, float *x, float *y, float *z)
        g = inverse_srgb_companding(g) * 100.0f;
        b = inverse_srgb_companding(b) * 100.0f;
 
-       *x = r * 0.4124 + g * 0.3576 + b * 0.1805;
-       *y = r * 0.2126 + g * 0.7152 + b * 0.0722;
-       *z = r * 0.0193 + g * 0.1192 + b * 0.9505;
+       *x = r * 0.412453f + g * 0.357580f + b * 0.180423f;
+       *y = r * 0.212671f + g * 0.715160f + b * 0.072169f;
+       *z = r * 0.019334f + g * 0.119193f + b * 0.950227f;
 }
 
 static float xyz_to_lab_component(float v)
index b2a87a914330fdf105addb2cb036efa6a5827301..417c557af8a5bc7d4511db4332f9c619995c59ad 100644 (file)
@@ -222,4 +222,37 @@ MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack)
        r_col[2] = ((pack) >> 16) & 0xFF;
 }
 
+
+MINLINE float rgb_to_grayscale(const float rgb[3])
+{
+       return 0.3f * rgb[0] + 0.58f * rgb[1] + 0.12f * rgb[2];
+}
+
+MINLINE unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3])
+{
+       return (76 * (unsigned short) rgb[0] + 148 * (unsigned short) rgb[1] + 31 * (unsigned short) rgb[2]) / 255;
+}
+
+MINLINE float rgb_to_luma(const float rgb[3])
+{
+       return 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2];
+}
+
+MINLINE unsigned char rgb_to_luma_byte(const unsigned char rgb[3])
+{
+       return (76 * (unsigned short) rgb[0] + 150 * (unsigned short) rgb[1] + 29 * (unsigned short) rgb[2]) / 255;
+}
+
+/* gamma-corrected RGB --> CIE XYZ
+ * for this function we only get the Y component
+ * see: http://software.intel.com/sites/products/documentation/hpc/ipp/ippi/ippi_ch6/ch6_color_models.html
+ *
+ * also known as:
+ * luminance rec. 709 */
+MINLINE float rgb_to_luma_y(const float rgb[3])
+{
+       return 0.212671f * rgb[0] + 0.71516f * rgb[1] + 0.072169f * rgb[2];
+}
+
+
 #endif /* __MATH_COLOR_INLINE_C__ */
index ae001b2baf62c8b32c17023478ce2f7515724ed2..6e6037239b9f3252939961b958805f26bc795b20 100644 (file)
@@ -504,7 +504,9 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
                        BMO_op_finish(bm, &extop);
                }
 
-               if (usedvec)
+               if (usedvec) {
+                       mul_m3_v3(rmat, dvec);
                        BMO_op_callf(bm, "translate vec=%v verts=%s", dvec, op, "lastout");
+               }
        }
 }
index beb098ba0fc0bf071e5112fe3b4236ba232b7cdf..9582da4fe5c96a584ce48b909981149d85522265 100644 (file)
@@ -28,7 +28,7 @@ template<class Functor>
 void forEachObjectInExportSet(Scene *sce, Functor &f, LinkNode *export_set)
 {
        LinkNode *node;
-       for(node=export_set; node; node=node->next) {
+       for (node = export_set; node; node = node->next) {
                Object *ob = (Object *)node->link;
                f(ob);
        }
@@ -48,7 +48,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
 }
 
 // called for each exported object
-void AnimationExporter::operator() (Object *ob) 
+void AnimationExporter::operator()(Object *ob)
 {
        FCurve *fcu;
        char *transformName;
@@ -56,24 +56,24 @@ void AnimationExporter::operator() (Object *ob)
 
        //Export transform animations
        if (ob->adt && ob->adt->action) {
-               fcu = (FCurve*)ob->adt->action->curves.first;
+               fcu = (FCurve *)ob->adt->action->curves.first;
 
                //transform matrix export for bones are temporarily disabled here.
-               if ( ob->type == OB_ARMATURE ) {
-                       bArmature *arm = (bArmature*)ob->data;
-                       for (Bone *bone = (Bone*)arm->bonebase.first; bone; bone = bone->next)
+               if (ob->type == OB_ARMATURE) {
+                       bArmature *arm = (bArmature *)ob->data;
+                       for (Bone *bone = (Bone *)arm->bonebase.first; bone; bone = bone->next)
                                write_bone_animation_matrix(ob, bone);
                }
 
                while (fcu) {
                        //for armature animations as objects
-                       if ( ob->type == OB_ARMATURE )
+                       if (ob->type == OB_ARMATURE)
                                transformName =  fcu->rna_path;
                        else 
-                               transformName = extract_transform_name( fcu->rna_path );
+                               transformName = extract_transform_name(fcu->rna_path);
 
                        if ((!strcmp(transformName, "location") || !strcmp(transformName, "scale")) ||
-                           (!strcmp(transformName, "rotation_euler") && ob->rotmode == ROT_MODE_EUL)||
+                           (!strcmp(transformName, "rotation_euler") && ob->rotmode == ROT_MODE_EUL) ||
                            (!strcmp(transformName, "rotation_quaternion")))
                        {
                                dae_animation(ob, fcu, transformName, false);
@@ -84,12 +84,12 @@ void AnimationExporter::operator() (Object *ob)
        }
 
        //Export Lamp parameter animations
-       if ( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action ) {
-               fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
+       if ( (ob->type == OB_LAMP) && ((Lamp *)ob->data)->adt && ((Lamp *)ob->data)->adt->action) {
+               fcu = (FCurve *)(((Lamp *)ob->data)->adt->action->curves.first);
                while (fcu) {
-                       transformName = extract_transform_name( fcu->rna_path );
+                       transformName = extract_transform_name(fcu->rna_path);
 
-                       if ((!strcmp(transformName, "color")) || (!strcmp(transformName, "spot_size"))||
+                       if ((!strcmp(transformName, "color")) || (!strcmp(transformName, "spot_size")) ||
                            (!strcmp(transformName, "spot_blend")) || (!strcmp(transformName, "distance")))
                        {
                                dae_animation(ob, fcu, transformName, true);
@@ -99,14 +99,14 @@ void AnimationExporter::operator() (Object *ob)
        }
 
        //Export Camera parameter animations
-       if ( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action ) {
-               fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
+       if ( (ob->type == OB_CAMERA) && ((Camera *)ob->data)->adt && ((Camera *)ob->data)->adt->action) {
+               fcu = (FCurve *)(((Camera *)ob->data)->adt->action->curves.first);
                while (fcu) {
-                       transformName = extract_transform_name( fcu->rna_path );
+                       transformName = extract_transform_name(fcu->rna_path);
 
-                       if ((!strcmp(transformName, "lens"))||
-                           (!strcmp(transformName, "ortho_scale"))||
-                           (!strcmp(transformName, "clip_end"))||(!strcmp(transformName, "clip_start")))
+                       if ((!strcmp(transformName, "lens")) ||
+                           (!strcmp(transformName, "ortho_scale")) ||
+                           (!strcmp(transformName, "clip_end")) || (!strcmp(transformName, "clip_start")))
                        {
                                dae_animation(ob, fcu, transformName, true);
                        }
@@ -116,19 +116,19 @@ void AnimationExporter::operator() (Object *ob)
 
        //Export Material parameter animations.
        for (int a = 0; a < ob->totcol; a++) {
-               Material *ma = give_current_material(ob, a+1);
+               Material *ma = give_current_material(ob, a + 1);
                if (!ma) continue;
                if (ma->adt && ma->adt->action) {
                        /* isMatAnim = true; */
-                       fcu = (FCurve*)ma->adt->action->curves.first;
+                       fcu = (FCurve *)ma->adt->action->curves.first;
                        while (fcu) {
-                               transformName = extract_transform_name( fcu->rna_path );
+                               transformName = extract_transform_name(fcu->rna_path);
 
-                               if ((!strcmp(transformName, "specular_hardness"))||(!strcmp(transformName, "specular_color")) ||
-                                   (!strcmp(transformName, "diffuse_color"))||(!strcmp(transformName, "alpha")) ||
-                                       (!strcmp(transformName, "ior")))
+                               if ((!strcmp(transformName, "specular_hardness")) || (!strcmp(transformName, "specular_color")) ||
+                                   (!strcmp(transformName, "diffuse_color")) || (!strcmp(transformName, "alpha")) ||
+                                   (!strcmp(transformName, "ior")))
                                {
-                                       dae_animation(ob, fcu, transformName, true, ma );
+                                       dae_animation(ob, fcu, transformName, true, ma);
                                }
                                fcu = fcu->next;
                        }
@@ -138,33 +138,33 @@ void AnimationExporter::operator() (Object *ob)
 }
 
 //euler sources from quternion sources
-float * AnimationExporter::get_eul_source_for_quat(Object *ob )
+float *AnimationExporter::get_eul_source_for_quat(Object *ob)
 {
-       FCurve *fcu = (FCurve*)ob->adt->action->curves.first;
+       FCurve *fcu = (FCurve *)ob->adt->action->curves.first;
        const int keys = fcu->totvert;  
-       float *quat = (float*)MEM_callocN(sizeof(float) * fcu->totvert * 4, "quat output source values");  
-       float *eul = (float*)MEM_callocN(sizeof(float) * fcu->totvert * 3, "quat output source values");
+       float *quat = (float *)MEM_callocN(sizeof(float) * fcu->totvert * 4, "quat output source values");
+       float *eul = (float *)MEM_callocN(sizeof(float) * fcu->totvert * 3, "quat output source values");
        float temp_quat[4];
        float temp_eul[3];
        while (fcu) {
-               char * transformName = extract_transform_name( fcu->rna_path );
+               char *transformName = extract_transform_name(fcu->rna_path);
 
-               if ( !strcmp(transformName, "rotation_quaternion") )    { 
-                       for ( int i = 0 ; i < fcu->totvert ; i++) {
-                               *(quat + ( i * 4 ) + fcu->array_index) = fcu->bezt[i].vec[1][1];
+               if (!strcmp(transformName, "rotation_quaternion") ) {
+                       for (int i = 0; i < fcu->totvert; i++) {
+                               *(quat + (i * 4) + fcu->array_index) = fcu->bezt[i].vec[1][1];
                        }
                }
                fcu = fcu->next;
        }
 
-       for ( int i = 0 ; i < keys ; i++) {
-               for ( int j = 0;j<4;j++)
-                       temp_quat[j] = quat[(i*4)+j];
+       for (int i = 0; i < keys; i++) {
+               for (int j = 0; j < 4; j++)
+                       temp_quat[j] = quat[(i * 4) + j];
 
                quat_to_eul(temp_eul, temp_quat);
 
-               for (int k = 0;k<3;k++)
-                       eul[i*3 + k] = temp_eul[k];
+               for (int k = 0; k < 3; k++)
+                       eul[i * 3 + k] = temp_eul[k];
 
        }
        MEM_freeN(quat);
@@ -173,22 +173,22 @@ float * AnimationExporter::get_eul_source_for_quat(Object *ob )
 }
 
 //Get proper name for bones
-std::string AnimationExporter::getObjectBoneName( Object* ob, const FCurve* fcu ) 
+std::string AnimationExporter::getObjectBoneName(Object *ob, const FCurve *fcu)
 {
        //hard-way to derive the bone name from rna_path. Must find more compact method
        std::string rna_path = std::string(fcu->rna_path);
 
-       charboneName = strtok((char *)rna_path.c_str(), "\"");
+       char *boneName = strtok((char *)rna_path.c_str(), "\"");
        boneName = strtok(NULL, "\"");
 
-       if ( boneName != NULL )
+       if (boneName != NULL)
                return /*id_name(ob) + "_" +*/ std::string(boneName);
        else            
                return id_name(ob);
 }
 
 //convert f-curves to animation curves and write
-void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformName, bool is_param, Material * ma )
+void AnimationExporter::dae_animation(Object *ob, FCurve *fcu, char *transformName, bool is_param, Material *ma)
 {
        const char *axis_name = NULL;
        char anim_id[200];
@@ -196,15 +196,15 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
        bool has_tangents = false;
        bool quatRotation = false;
 
-       if ( !strcmp(transformName, "rotation_quaternion") ) {
+       if (!strcmp(transformName, "rotation_quaternion") ) {
                fprintf(stderr, "quaternion rotation curves are not supported. rotation curve will not be exported\n");
                quatRotation = true;
                return;
        }
 
        //axis names for colors
-       else if ( !strcmp(transformName, "color")||!strcmp(transformName, "specular_color")||!strcmp(transformName, "diffuse_color")||
-               (!strcmp(transformName, "alpha")))
+       else if (!strcmp(transformName, "color") || !strcmp(transformName, "specular_color") || !strcmp(transformName, "diffuse_color") ||
+                (!strcmp(transformName, "alpha")))
        {
                const char *axis_names[] = {"R", "G", "B"};
                if (fcu->array_index < 3)
@@ -213,7 +213,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
 
        //axis names for transforms
        else if ((!strcmp(transformName, "location") || !strcmp(transformName, "scale")) ||
-               (!strcmp(transformName, "rotation_euler"))||(!strcmp(transformName, "rotation_quaternion")))
+                (!strcmp(transformName, "rotation_euler")) || (!strcmp(transformName, "rotation_quaternion")))
        {
                const char *axis_names[] = {"X", "Y", "Z"};
                if (fcu->array_index < 3)
@@ -229,16 +229,16 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
        //Create anim Id
        if (ob->type == OB_ARMATURE) {
                ob_name =  getObjectBoneName(ob, fcu);
-               BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s.%s", (char*)translate_id(ob_name).c_str(),
-                       transformName, axis_name);
+               BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s.%s", (char *)translate_id(ob_name).c_str(),
+                            transformName, axis_name);
        }
        else {
                if (ma)
                        ob_name = id_name(ob) + "_material";
                else
                        ob_name = id_name(ob);
-               BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char*)translate_id(ob_name).c_str(),
-                       fcu->rna_path, axis_name);
+               BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char *)translate_id(ob_name).c_str(),
+                            fcu->rna_path, axis_name);
        }
 
        openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING);
@@ -252,16 +252,16 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
        //quat rotations are skipped for now, because of complications with determining axis.
        if (quatRotation) {
                float *eul  = get_eul_source_for_quat(ob);
-               float *eul_axis = (float*)MEM_callocN(sizeof(float) * fcu->totvert, "quat output source values");
-               for (int i = 0 ; i< fcu->totvert ; i++) {
-                       eul_axis[i] = eul[i*3 + fcu->array_index];
+               float *eul_axis = (float *)MEM_callocN(sizeof(float) * fcu->totvert, "quat output source values");
+               for (int i = 0; i < fcu->totvert; i++) {
+                       eul_axis[i] = eul[i * 3 + fcu->array_index];
                }
-               output_id= create_source_from_array(COLLADASW::InputSemantic::OUTPUT, eul_axis, fcu->totvert, quatRotation, anim_id, axis_name);
+               output_id = create_source_from_array(COLLADASW::InputSemantic::OUTPUT, eul_axis, fcu->totvert, quatRotation, anim_id, axis_name);
                MEM_freeN(eul);
                MEM_freeN(eul_axis);
        }
        else {
-               output_id= create_source_from_fcurve(COLLADASW::InputSemantic::OUTPUT, fcu, anim_id, axis_name);
+               output_id = create_source_from_fcurve(COLLADASW::InputSemantic::OUTPUT, fcu, anim_id, axis_name);
        }
        // create interpolations source
        std::string interpolation_id = create_interpolation_source(fcu, anim_id, axis_name, &has_tangents);
@@ -296,21 +296,21 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
 
        std::string target;
 
-       if ( !is_param )
+       if (!is_param)
                target = translate_id(ob_name) +
                         "/" + get_transform_sid(fcu->rna_path, -1, axis_name, true);
        else {
-               if ( ob->type == OB_LAMP )
+               if (ob->type == OB_LAMP)
                        target = get_light_id(ob) +
                                 "/" + get_light_param_sid(fcu->rna_path, -1, axis_name, true);
 
-               if ( ob->type == OB_CAMERA )
+               if (ob->type == OB_CAMERA)
                        target = get_camera_id(ob) +
                                 "/" + get_camera_param_sid(fcu->rna_path, -1, axis_name, true);
 
-               if ( ma ) 
+               if (ma)
                        target = translate_id(id_name(ma)) + "-effect" +
-                       "/common/" /*profile common is only supported */ + get_transform_sid(fcu->rna_path, -1, axis_name, true);
+                                "/common/" /*profile common is only supported */ + get_transform_sid(fcu->rna_path, -1, axis_name, true);
        }
        addChannel(COLLADABU::URI(empty, sampler_id), target);
 
@@ -330,18 +330,18 @@ void AnimationExporter::write_bone_animation_matrix(Object *ob_arm, Bone *bone)
 
        sample_and_write_bone_animation_matrix(ob_arm, bone);
 
-       for (Bone *child = (Bone*)bone->childbase.first; child; child = child->next)
+       for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next)
                write_bone_animation_matrix(ob_arm, child);
 }
 
-bool AnimationExporter::is_bone_deform_group(Bone * bone)
+bool AnimationExporter::is_bone_deform_group(Bone *bone)
 {   
        bool is_def;
        //Check if current bone is deform
-       if ((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
+       if ((bone->flag & BONE_NO_DEFORM) == 0) return true;
        //Check child bones
        else {
-               for (Bone *child = (Bone*)bone->childbase.first; child; child = child->next) {
+               for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
                        //loop through all the children until deform bone is found, and then return
                        is_def = is_bone_deform_group(child);
                        if (is_def) return true;
@@ -353,16 +353,16 @@ bool AnimationExporter::is_bone_deform_group(Bone * bone)
 
 void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, Bone *bone)
 {
-       bArmature *arm = (bArmature*)ob_arm->data;
+       bArmature *arm = (bArmature *)ob_arm->data;
        int flag = arm->flag;
        std::vector<float> fra;
        //char prefix[256];
 
-       FCurve* fcu = (FCurve*)ob_arm->adt->action->curves.first;
+       FCurve *fcu = (FCurve *)ob_arm->adt->action->curves.first;
        while (fcu) {
                std::string bone_name = getObjectBoneName(ob_arm, fcu);
-               int val = BLI_strcasecmp((char*)bone_name.c_str(), bone->name);
-               if (val==0) break;
+               int val = BLI_strcasecmp((char *)bone_name.c_str(), bone->name);
+               if (val == 0) break;
                fcu = fcu->next;
        }
 
@@ -379,7 +379,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
        }
 
        if (fra.size()) {
-               dae_baked_animation(fra, ob_arm, bone );
+               dae_baked_animation(fra, ob_arm, bone);
        }
 
        if (flag & ARM_RESTPOS) 
@@ -396,8 +396,8 @@ void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_
        if (!fra.size())
                return;
 
-       BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char*)translate_id(ob_name).c_str(),
-               (char*)translate_id(bone_name).c_str(), "pose_matrix");
+       BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char *)translate_id(ob_name).c_str(),
+                    (char *)translate_id(bone_name).c_str(), "pose_matrix");
 
        openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING);
 
@@ -406,7 +406,7 @@ void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_
 
        // create output source
        std::string output_id;
-       output_id = create_4x4_source( fra, ob_arm, bone,  anim_id);
+       output_id = create_4x4_source(fra, ob_arm, bone,  anim_id);
 
        // create interpolations source
        std::string interpolation_id = fake_interpolation_source(fra.size(), anim_id, "");
@@ -444,15 +444,15 @@ void AnimationExporter::dae_bone_animation(std::vector<float> &fra, float *value
 
        char rna_path[200];
        BLI_snprintf(rna_path, sizeof(rna_path), "pose.bones[\"%s\"].%s", bone_name.c_str(),
-               tm_type == 0 ? "rotation_quaternion" : (tm_type == 1 ? "scale" : "location"));
+                    tm_type == 0 ? "rotation_quaternion" : (tm_type == 1 ? "scale" : "location"));
 
        if (axis > -1)
                axis_name = axis_names[axis];
 
        std::string transform_sid = get_transform_sid(NULL, tm_type, axis_name, false);
 
-       BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char*)translate_id(ob_name).c_str(),
-               (char*)translate_id(bone_name).c_str(), (char*)transform_sid.c_str());
+       BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char *)translate_id(ob_name).c_str(),
+                    (char *)translate_id(bone_name).c_str(), (char *)transform_sid.c_str());
 
        openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING);
 
@@ -518,7 +518,7 @@ std::string AnimationExporter::get_semantic_suffix(COLLADASW::InputSemantic::Sem
 }
 
 void AnimationExporter::add_source_parameters(COLLADASW::SourceBase::ParameterNameList& param,
-                                                                                         COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform)
+                                              COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform)
 {
        switch (semantic) {
                case COLLADASW::InputSemantic::INPUT:
@@ -533,14 +533,14 @@ void AnimationExporter::add_source_parameters(COLLADASW::SourceBase::ParameterNa
                                        param.push_back(axis);
                                }
                                else 
-                                       if ( transform ) {
-                                               param.push_back("TRANSFORM");  
-                            &nbs