Cycles / HSV Separator and Combine node:
authorThomas Dinges <blender@dingto.org>
Wed, 31 Jul 2013 21:27:48 +0000 (21:27 +0000)
committerThomas Dinges <blender@dingto.org>
Wed, 31 Jul 2013 21:27:48 +0000 (21:27 +0000)
* Added nodes to separate and combine hsv colors.

Part of my GSoC 2013 project, SVN merge of r57981.

694 files changed:
CMakeLists.txt
build_files/cmake/Modules/FindPythonLibsUnix.cmake
build_files/cmake/macros.cmake
doc/python_api/rst/bge.render.rst
extern/libmv/libmv-capi.cc
extern/libmv/libmv-capi.h
extern/libmv/libmv-capi_stub.cc
extern/libredcode/codec.c
extern/libredcode/codec.h
extern/libredcode/debayer.c
extern/libredcode/debayer.h
extern/libredcode/format.c
extern/libredcode/format.h
intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
intern/bsp/CMakeLists.txt
intern/cycles/CMakeLists.txt
intern/cycles/app/cycles_test.cpp
intern/cycles/blender/addon/__init__.py
intern/cycles/blender/addon/presets.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_mesh.cpp
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_shader.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/blender/blender_sync.h
intern/cycles/bvh/bvh.h
intern/cycles/device/device.h
intern/cycles/device/device_cpu.cpp
intern/cycles/device/device_cuda.cpp
intern/cycles/device/device_multi.cpp
intern/cycles/kernel/kernel_camera.h
intern/cycles/kernel/kernel_displace.h
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_light.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_random.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_textures.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/osl/osl_services.h
intern/cycles/kernel/shaders/node_blackbody.osl
intern/cycles/kernel/shaders/node_light_path.osl
intern/cycles/kernel/shaders/node_vector_transform.osl
intern/cycles/kernel/svm/svm_blackbody.h
intern/cycles/kernel/svm/svm_image.h
intern/cycles/kernel/svm/svm_light_path.h
intern/cycles/kernel/svm/svm_types.h
intern/cycles/kernel/svm/svm_vector_transform.h
intern/cycles/render/blackbody.cpp
intern/cycles/render/buffers.cpp
intern/cycles/render/film.cpp
intern/cycles/render/graph.cpp
intern/cycles/render/image.cpp
intern/cycles/render/image.h
intern/cycles/render/light.cpp
intern/cycles/render/mesh.cpp
intern/cycles/render/mesh.h
intern/cycles/render/nodes.cpp
intern/cycles/render/nodes.h
intern/cycles/render/scene.cpp
intern/cycles/render/scene.h
intern/cycles/render/session.cpp
intern/cycles/render/shader.cpp
intern/cycles/render/svm.cpp
intern/cycles/render/tables.cpp
intern/cycles/util/util_math.h
intern/cycles/util/util_task.cpp
intern/cycles/util/util_task.h
intern/cycles/util/util_view.cpp
intern/ghost/GHOST_C-api.h
intern/ghost/GHOST_IWindow.h
intern/ghost/intern/GHOST_C-api.cpp
intern/ghost/intern/GHOST_DropTargetWin32.h
intern/ghost/intern/GHOST_DropTargetX11.cpp
intern/ghost/intern/GHOST_DropTargetX11.h
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
intern/ghost/intern/GHOST_Window.h
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.h
intern/ghost/intern/GHOST_WindowX11.cpp
intern/ghost/intern/GHOST_WindowX11.h
intern/iksolver/CMakeLists.txt
intern/opencl/OCL_opencl.h
intern/opencl/intern/OCL_opencl.c
intern/opencl/intern/clew.c
intern/smoke/CMakeLists.txt
release/datafiles/LICENSE-droidsans.ttf.txt
release/datafiles/fonts/droidsans.ttf.gz
release/datafiles/splash.png
release/datafiles/startup.blend
release/scripts/freestyle/style_modules/ChainingIterators.py
release/scripts/freestyle/style_modules/parameter_editor.py
release/scripts/modules/bl_i18n_utils/utils_spell_check.py
release/scripts/modules/bpy_extras/anim_utils.py
release/scripts/modules/rna_keymap_ui.py [new file with mode: 0644]
release/scripts/presets/cycles/sampling/final.py [new file with mode: 0644]
release/scripts/presets/cycles/sampling/preview.py [new file with mode: 0644]
release/scripts/startup/bl_operators/anim.py
release/scripts/startup/bl_operators/node.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_data_mesh.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_mask_common.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_userpref_keymap.py [deleted file]
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/scripts/templates_py/custom_nodes.py
source/blender/avi/intern/avi.c
source/blender/avi/intern/avi_options.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_bmesh.h [deleted file]
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_deform.h
source/blender/blenkernel/BKE_dynamicpaint.h
source/blender/blenkernel/BKE_fcurve.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_key.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_pbvh.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/editmesh.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/linestyle.c
source/blender/blenkernel/intern/mask.c
source/blender/blenkernel/intern/mask_rasterize.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_validate.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/modifiers_bmesh.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/navmesh_conversion.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pbvh.c
source/blender/blenkernel/intern/pbvh_bmesh.c
source/blender/blenkernel/intern/pbvh_intern.h
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/property.c
source/blender/blenkernel/intern/rigidbody.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenkernel/intern/unit.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/BLI_alloca.h [moved from source/gameengine/GamePlayer/common/GPC_RawLogoArrays.h with 60% similarity]
source/blender/blenlib/BLI_array.h
source/blender/blenlib/BLI_bitmap.h
source/blender/blenlib/BLI_buffer.h
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/BLI_listbase.h
source/blender/blenlib/BLI_math_geom.h
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/BLI_string.h
source/blender/blenlib/BLI_string_utf8.h
source/blender/blenlib/BLI_threads.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/BLI_mempool.c
source/blender/blenlib/intern/DLRB_tree.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/listbase.c
source/blender/blenlib/intern/math_color.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/math_vector.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/noise.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/string.c
source/blender/blenlib/intern/string_utf8.c
source/blender/blenlib/intern/threads.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/CMakeLists.txt
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_construct.h
source/blender/bmesh/intern/bmesh_core.c
source/blender/bmesh/intern/bmesh_core.h
source/blender/bmesh/intern/bmesh_edgeloop.c
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/intern/bmesh_mods.c
source/blender/bmesh/intern/bmesh_opdefines.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/intern/bmesh_operators.h
source/blender/bmesh/intern/bmesh_operators_private.h
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/intern/bmesh_polygon.h
source/blender/bmesh/intern/bmesh_queries.c
source/blender/bmesh/intern/bmesh_queries.h
source/blender/bmesh/operators/bmo_beautify.c
source/blender/bmesh/operators/bmo_bridge.c
source/blender/bmesh/operators/bmo_connect.c
source/blender/bmesh/operators/bmo_connect_nonplanar.c [new file with mode: 0644]
source/blender/bmesh/operators/bmo_connect_pair.c
source/blender/bmesh/operators/bmo_create.c
source/blender/bmesh/operators/bmo_dissolve.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_extrude.c
source/blender/bmesh/operators/bmo_fill_edgeloop.c
source/blender/bmesh/operators/bmo_fill_holes.c [new file with mode: 0644]
source/blender/bmesh/operators/bmo_inset.c
source/blender/bmesh/operators/bmo_join_triangles.c
source/blender/bmesh/operators/bmo_normals.c [new file with mode: 0644]
source/blender/bmesh/operators/bmo_similar.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/operators/bmo_subdivide_edgering.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/bmesh/tools/BME_bevel.c [deleted file]
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/bmesh/tools/bmesh_decimate.h
source/blender/bmesh/tools/bmesh_decimate_dissolve.c
source/blender/bmesh/tools/bmesh_triangulate.c
source/blender/collada/AnimationImporter.cpp
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/ArmatureImporter.h
source/blender/collada/ControllerExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/collada/SkinInfo.cpp
source/blender/collada/TransformReader.cpp
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada_internal.cpp
source/blender/collada/collada_internal.h
source/blender/collada/collada_utils.cpp
source/blender/collada/collada_utils.h
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/intern/COM_SocketReader.h
source/blender/compositor/intern/COM_WorkScheduler.cpp
source/blender/compositor/nodes/COM_ChromaMatteNode.cpp
source/blender/compositor/nodes/COM_GroupNode.cpp
source/blender/compositor/nodes/COM_TextureNode.cpp
source/blender/compositor/nodes/COM_ZCombineNode.cpp
source/blender/compositor/operations/COM_BlurBaseOperation.cpp
source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp
source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp
source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
source/blender/compositor/operations/COM_KeyingScreenOperation.h
source/blender/compositor/operations/COM_MathBaseOperation.cpp
source/blender/compositor/operations/COM_MixAddOperation.cpp
source/blender/compositor/operations/COM_MixBurnOperation.cpp
source/blender/compositor/operations/COM_MixColorOperation.cpp
source/blender/compositor/operations/COM_MixDarkenOperation.cpp
source/blender/compositor/operations/COM_MixDifferenceOperation.cpp
source/blender/compositor/operations/COM_MixDivideOperation.cpp
source/blender/compositor/operations/COM_MixDodgeOperation.cpp
source/blender/compositor/operations/COM_MixHueOperation.cpp
source/blender/compositor/operations/COM_MixLightenOperation.cpp
source/blender/compositor/operations/COM_MixLinearLightOperation.cpp
source/blender/compositor/operations/COM_MixOverlayOperation.cpp
source/blender/compositor/operations/COM_MixSaturationOperation.cpp
source/blender/compositor/operations/COM_MixScreenOperation.cpp
source/blender/compositor/operations/COM_MixSoftLightOperation.cpp
source/blender/compositor/operations/COM_MixSubtractOperation.cpp
source/blender/compositor/operations/COM_MixValueOperation.cpp
source/blender/compositor/operations/COM_TextureOperation.cpp
source/blender/compositor/operations/COM_TextureOperation.h
source/blender/compositor/operations/COM_TrackPositionOperation.h
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_intern.h
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_general.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/armature_add.c
source/blender/editors/armature/armature_edit.c
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/armature_relations.c
source/blender/editors/armature/armature_select.c
source/blender/editors/armature/armature_skinning.c
source/blender/editors/armature/armature_utils.c
source/blender/editors/armature/pose_select.c
source/blender/editors/armature/pose_slide.c
source/blender/editors/armature/pose_utils.c
source/blender/editors/curve/curve_intern.h
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/include/BIF_glutil.h
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_render.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mask/mask_add.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/mask/mask_select.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_extrude.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/dynamicpaint_ops.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/render/render_intern.h
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/render/render_update.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_hide.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/paint_vertex_proj.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_buttons.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_add.c
source/blender/editors/space_node/node_buttons.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/node_relationships.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_node/node_toolbar.c
source/blender/editors/space_node/node_view.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_buttons.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_autocomplete.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_iterators.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_ruler.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/util/CMakeLists.txt
source/blender/editors/util/crazyspace.c
source/blender/editors/util/numinput.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
source/blender/freestyle/intern/stroke/Canvas.h
source/blender/freestyle/intern/stroke/ContextFunctions.cpp
source/blender/freestyle/intern/stroke/ContextFunctions.h
source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp
source/blender/freestyle/intern/view_map/BoxGrid.cpp
source/blender/freestyle/intern/view_map/GridDensityProvider.h
source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
source/blender/freestyle/intern/view_map/SphericalGrid.cpp
source/blender/freestyle/intern/view_map/ViewMap.cpp
source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/cineon/logImageCore.c
source/blender/imbuf/intern/cineon/logmemfile.c
source/blender/imbuf/intern/colormanagement.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/png.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_particle_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_dynamicpaint.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_meta.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture_api.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_cast.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_laplaciansmooth.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_ocean.c
source/blender/modifiers/intern/MOD_particlesystem.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/modifiers/intern/MOD_shapekey.c
source/blender/modifiers/intern/MOD_shrinkwrap.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/modifiers/intern/MOD_skin.c
source/blender/modifiers/intern/MOD_smooth.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_surface.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_util.h
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/modifiers/intern/MOD_weightvg_util.c
source/blender/nodes/NOD_static_types.h
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/nodes/intern/node_common.c
source/blender/nodes/intern/node_exec.c
source/blender/nodes/intern/node_socket.c
source/blender/nodes/shader/nodes/node_shader_light_path.c
source/blender/nodes/shader/nodes/node_shader_math.c
source/blender/nodes/shader/nodes/node_shader_particle_info.c
source/blender/nodes/texture/node_texture_tree.c
source/blender/nodes/texture/nodes/node_texture_math.c
source/blender/nodes/texture/nodes/node_texture_output.c
source/blender/python/bmesh/bmesh_py_ops_call.c
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/bmesh/bmesh_py_types_meshdata.c
source/blender/python/generic/idprop_py_api.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna_array.c
source/blender/python/mathutils/mathutils_Color.c
source/blender/python/mathutils/mathutils_Euler.c
source/blender/python/mathutils/mathutils_Matrix.c
source/blender/python/mathutils/mathutils_Quaternion.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/quicktime/apple/quicktime_export.c
source/blender/render/extern/include/RE_engine.h
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_texture.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_playanim.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_event_types.h
source/blender/windowmanager/wm_window.h
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/CMakeLists.txt
source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
source/gameengine/BlenderRoutines/KX_BlenderGL.h
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Converter/KX_ConvertProperties.cpp
source/gameengine/Expressions/CMakeLists.txt
source/gameengine/Expressions/FloatValue.cpp
source/gameengine/Expressions/IntValue.cpp
source/gameengine/Expressions/KX_HashedPtr.cpp
source/gameengine/GameLogic/CMakeLists.txt
source/gameengine/GameLogic/SCA_IScene.cpp
source/gameengine/GameLogic/SCA_IScene.h
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GamePlayer/CMakeLists.txt
source/gameengine/GamePlayer/common/CMakeLists.txt
source/gameengine/GamePlayer/common/GPC_Canvas.cpp
source/gameengine/GamePlayer/common/GPC_Canvas.h
source/gameengine/GamePlayer/common/GPC_Engine.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_Engine.h [deleted file]
source/gameengine/GamePlayer/common/GPC_RawImage.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_RawImage.h [deleted file]
source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.h [deleted file]
source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/GamePlayer/common/GPC_System.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_System.h [deleted file]
source/gameengine/GamePlayer/common/SConscript
source/gameengine/GamePlayer/common/bmfont.cpp [deleted file]
source/gameengine/GamePlayer/common/load.blend [deleted file]
source/gameengine/GamePlayer/common/logo_blender.raw [deleted file]
source/gameengine/GamePlayer/common/logo_blender3d.raw [deleted file]
source/gameengine/GamePlayer/common/logo_nan.raw [deleted file]
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
source/gameengine/GamePlayer/ghost/GPG_Canvas.h
source/gameengine/GamePlayer/ghost/GPG_System.h
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Ketsji/KX_FontObject.cpp
source/gameengine/Ketsji/KX_FontObject.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_IPO_SGController.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_PhysicsPropertiesobsolete.h [deleted file]
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_PythonSeq.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Network/CMakeLists.txt
source/gameengine/Physics/Bullet/CMakeLists.txt
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Dummy/CMakeLists.txt
source/gameengine/Rasterizer/CMakeLists.txt
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
source/gameengine/Rasterizer/RAS_ICanvas.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
source/gameengine/SceneGraph/CMakeLists.txt
source/gameengine/VideoTexture/CMakeLists.txt

index acd01f43fcdc0f5ba8ab99956ea8f086d6510324..e91ec18caee7fddd150d7603b6ae7655853c1603 100644 (file)
@@ -538,9 +538,6 @@ set(PLATFORM_LINKFLAGS "")
 set(PLATFORM_LINKFLAGS_DEBUG "")
 
 
-# disabled for now, not supported
-# option(WITH_WEBPLUGIN     "Enable Web Plugin (Unix only)" OFF)
-
 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
 # On Unix:
 #   cmake ../blender \
@@ -1874,16 +1871,6 @@ if(WITH_IMAGE_REDCODE)
        set(REDCODE_INC ${REDCODE})
 endif()
 
-#-----------------------------------------------------------------------------
-# Blender WebPlugin
-
-if(WITH_WEBPLUGIN)
-       set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
-       set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
-
-       set(WITH_PLAYER ON)
-endif()
-
 
 #-----------------------------------------------------------------------------
 # Configure OpenGL.
@@ -1977,6 +1964,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull)  # C only
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
 
        # gcc 4.2 gives annoying warnings on every file with this
        if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2003,6 +1991,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self)  # needs -Wuninitialized
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
 
        # gcc 4.2 gives annoying warnings on every file with this
        if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2053,6 +2042,20 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
        ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
        ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS    -Wno-unused-macros)
 
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
+
+       ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
+       ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
+       ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
+       ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
+       ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
+
 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
index 1dffd54fed120421eb8c3640017e07724f1521b4..82f74373b8bc37886aa8444cc42f078f0c5122ec 100644 (file)
@@ -2,9 +2,11 @@
 # Find the native Python includes and library
 #
 # Note:, This is not _yet_ intended to be a general python module for other
-#  projects to use since its hard coded to python 3.2 as blender only supports
-#  a single python version.
-#  This is for blender/unix python only.
+#  projects to use since its hard coded to fixed Python version
+#  as Blender only supports a single Python version at the moment.
+#
+# Note:
+#  this is for Blender/Unix Python only.
 #
 # This module defines
 #  PYTHON_VERSION
index 109d9244b3a08d3512f1920e8b6d8aee94e09981..854609f1665a06345fa52c163a3d2127bfd87569 100644 (file)
@@ -530,7 +530,9 @@ macro(remove_strict_flags_file
 
        foreach(_SOURCE ${ARGV})
 
-               if(CMAKE_COMPILER_IS_GNUCC)
+               if(CMAKE_COMPILER_IS_GNUCC OR
+                 (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+
                        set_source_files_properties(${_SOURCE}
                                PROPERTIES
                                        COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
index c3bcf19c01b2a9e4b5bf0aa5d4cefd7125d35145..5a80b7fa5c1c55c231916a98db75b5210660f7df 100644 (file)
@@ -62,6 +62,18 @@ Constants
 .. data:: KX_BLENDER_GLSL_MATERIAL
 
    Materials approximating blender materials with GLSL.
+   
+.. DATA:: VSYNC_OFF
+
+   Disables vsync
+
+.. DATA:: VSYNC_ON
+
+   Enables vsync
+
+.. DATA:: VSYNC_ADAPTIVE
+
+   Enables adaptive vsync if supported. Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. Otherwise, vsync is diabled if the framerate is too low.
 
 *********
 Functions
@@ -289,3 +301,15 @@ Functions
 
    Disable the motion blur effect.
 
+.. function:: setVsync(value)
+
+   Set the vsync value
+
+   :arg value: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE
+   :type value: integer
+
+.. function:: getVsync()
+
+   Get the current vsync value
+
+   :rtype: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE
index 563919e1d7b9cc677357c2ae44e2b7e1f57c07c1..990b40df90a47ded14054863afe810306eefedf8 100644 (file)
@@ -62,7 +62,7 @@
 #  define snprintf _snprintf
 #endif
 
-typedef struct libmv_Reconstruction {
+struct libmv_Reconstruction {
        libmv::EuclideanReconstruction reconstruction;
 
        /* used for per-track average error calculation after reconstruction */
@@ -70,12 +70,12 @@ typedef struct libmv_Reconstruction {
        libmv::CameraIntrinsics intrinsics;
 
        double error;
-} libmv_Reconstruction;
+};
 
-typedef struct libmv_Features {
+struct libmv_Features {
        int count, margin;
        libmv::Feature *features;
-} libmv_Features;
+};
 
 /* ************ Logging ************ */
 
@@ -197,30 +197,30 @@ static void saveImage(const char *prefix, libmv::FloatImage image, int x0, int y
        int x, y;
        png_bytep *row_pointers;
 
-       row_pointers= (png_bytep*)malloc(sizeof(png_bytep)*image.Height());
+       row_pointers = (png_bytep *) malloc(sizeof(png_bytep) * image.Height());
 
        for (y = 0; y < image.Height(); y++) {
-               row_pointers[y]= (png_bytep)malloc(sizeof(png_byte)*4*image.Width());
+               row_pointers[y] = (png_bytep) malloc(sizeof(png_byte) * 4 * image.Width());
 
                for (x = 0; x < image.Width(); x++) {
                        if (x0 == x && image.Height() - y0 - 1 == y) {
-                               row_pointers[y][x*4+0]= 255;
-                               row_pointers[y][x*4+1]= 0;
-                               row_pointers[y][x*4+2]= 0;
-                               row_pointers[y][x*4+3]= 255;
+                               row_pointers[y][x * 4 + 0] = 255;
+                               row_pointers[y][x * 4 + 1] = 0;
+                               row_pointers[y][x * 4 + 2] = 0;
+                               row_pointers[y][x * 4 + 3] = 255;
                        }
                        else {
                                float pixel = image(image.Height() - y - 1, x, 0);
-                               row_pointers[y][x*4+0]= pixel*255;
-                               row_pointers[y][x*4+1]= pixel*255;
-                               row_pointers[y][x*4+2]= pixel*255;
-                               row_pointers[y][x*4+3]= 255;
+                               row_pointers[y][x * 4 + 0] = pixel * 255;
+                               row_pointers[y][x * 4 + 1] = pixel * 255;
+                               row_pointers[y][x * 4 + 2] = pixel * 255;
+                               row_pointers[y][x * 4 + 3] = 255;
                        }
                }
        }
 
        {
-               static int a= 0;
+               static int a = 0;
                char buf[128];
                snprintf(buf, sizeof(buf), "%s_%02d.png", prefix, ++a);
                savePNGImage(row_pointers, image.Width(), image.Height(), 8, PNG_COLOR_TYPE_RGBA, buf);
@@ -237,17 +237,17 @@ static void saveBytesImage(const char *prefix, unsigned char *data, int width, i
        int x, y;
        png_bytep *row_pointers;
 
-       row_pointers= (png_bytep*)malloc(sizeof(png_bytep)*height);
+       row_pointers = (png_bytep *) malloc(sizeof(png_bytep) * height);
 
        for (y = 0; y < height; y++) {
-               row_pointers[y]= (png_bytep)malloc(sizeof(png_byte)*4*width);
+               row_pointers[y] = (png_bytep) malloc(sizeof(png_byte) * 4 * width);
 
                for (x = 0; x < width; x++) {
-                       char pixel = data[width*y+x];
-                       row_pointers[y][x*4+0]= pixel;
-                       row_pointers[y][x*4+1]= pixel;
-                       row_pointers[y][x*4+2]= pixel;
-                       row_pointers[y][x*4+3]= 255;
+                       char pixel = data[width * y + x];
+                       row_pointers[y][x * 4 + 0] = pixel;
+                       row_pointers[y][x * 4 + 1] = pixel;
+                       row_pointers[y][x * 4 + 2] = pixel;
+                       row_pointers[y][x * 4 + 3] = 255;
                }
        }
 
@@ -267,12 +267,12 @@ static void saveBytesImage(const char *prefix, unsigned char *data, int width, i
 
 /* ************ Planar tracker ************ */
 
-/* TrackRegion (new planar tracker) */
-int libmv_trackRegion(const struct libmv_trackRegionOptions *options,
+/* TrackRegion */
+int libmv_trackRegion(const libmv_TrackRegionOptions *options,
                       const float *image1, int image1_width, int image1_height,
                       const float *image2, int image2_width, int image2_height,
                       const double *x1, const double *y1,
-                      struct libmv_trackRegionResult *result,
+                      libmv_TrackRegionResult *result,
                       double *x2, double *y2)
 {
        double xx1[5], yy1[5];
@@ -292,7 +292,7 @@ int libmv_trackRegion(const struct libmv_trackRegionOptions *options,
 
        switch (options->motion_model) {
 #define LIBMV_CONVERT(the_model) \
-    case libmv::TrackRegionOptions::the_model: \
+       case libmv::TrackRegionOptions::the_model: \
                track_region_options.mode = libmv::TrackRegionOptions::the_model; \
                break;
                LIBMV_CONVERT(TRANSLATION)
@@ -384,29 +384,28 @@ void libmv_samplePlanarPatch(const float *image, int width, int height,
 
 /* ************ Tracks ************ */
 
-libmv_Tracks *libmv_tracksNew(void)
+struct libmv_Tracks *libmv_tracksNew(void)
 {
        libmv::Tracks *libmv_tracks = new libmv::Tracks();
 
-       return (libmv_Tracks *)libmv_tracks;
+       return (struct libmv_Tracks *)libmv_tracks;
 }
 
-void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y)
+void libmv_tracksDestroy(struct libmv_Tracks *libmv_tracks)
 {
-       ((libmv::Tracks*)libmv_tracks)->Insert(image, track, x, y);
+       delete (libmv::Tracks*) libmv_tracks;
 }
 
-void libmv_tracksDestroy(libmv_Tracks *libmv_tracks)
+void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y)
 {
-       delete (libmv::Tracks*)libmv_tracks;
+       ((libmv::Tracks*) libmv_tracks)->Insert(image, track, x, y);
 }
 
-/* ************ Reconstruction solver ************ */
+/* ************ Reconstruction ************ */
 
 class ReconstructUpdateCallback : public libmv::ProgressUpdateCallback {
 public:
-       ReconstructUpdateCallback(reconstruct_progress_update_cb progress_update_callback,
-                       void *callback_customdata)
+       ReconstructUpdateCallback(reconstruct_progress_update_cb progress_update_callback, void *callback_customdata)
        {
                progress_update_callback_ = progress_update_callback;
                callback_customdata_ = callback_customdata;
@@ -414,7 +413,7 @@ public:
 
        void invoke(double progress, const char *message)
        {
-               if(progress_update_callback_) {
+               if (progress_update_callback_) {
                        progress_update_callback_(callback_customdata_, progress, message);
                }
        }
@@ -456,7 +455,7 @@ static void libmv_solveRefineIntrinsics(const libmv::Tracks &tracks,
                                               intrinsics);
 }
 
-static void cameraIntrinsicsFromOptions(const libmv_cameraIntrinsicsOptions *camera_intrinsics_options,
+static void cameraIntrinsicsFromOptions(const libmv_CameraIntrinsicsOptions *camera_intrinsics_options,
                                         libmv::CameraIntrinsics *camera_intrinsics)
 {
        camera_intrinsics->SetFocalLength(camera_intrinsics_options->focal_length,
@@ -486,7 +485,7 @@ static libmv::Tracks getNormalizedTracks(const libmv::Tracks &tracks, const libm
 }
 
 static void finishReconstruction(const libmv::Tracks &tracks, const libmv::CameraIntrinsics &camera_intrinsics,
-                                 libmv_Reconstruction *libmv_reconstruction,
+                                 struct libmv_Reconstruction *libmv_reconstruction,
                                  reconstruct_progress_update_cb progress_update_callback,
                                  void *callback_customdata)
 {
@@ -571,13 +570,13 @@ static bool selectTwoKeyframesBasedOnGRICAndVariance(
        return true;
 }
 
-libmv_Reconstruction *libmv_solveReconstruction(const libmv_Tracks *libmv_tracks,
-                       const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
-                       libmv_reconstructionOptions *libmv_reconstruction_options,
-                       reconstruct_progress_update_cb progress_update_callback,
-                       void *callback_customdata)
+struct libmv_Reconstruction *libmv_solveReconstruction(const struct libmv_Tracks *libmv_tracks,
+               const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+               libmv_ReconstructionOptions *libmv_reconstruction_options,
+               reconstruct_progress_update_cb progress_update_callback,
+               void *callback_customdata)
 {
-       libmv_Reconstruction *libmv_reconstruction = new libmv_Reconstruction();
+       struct libmv_Reconstruction *libmv_reconstruction = new libmv_Reconstruction();
 
        libmv::Tracks &tracks = *((libmv::Tracks *) libmv_tracks);
        libmv::EuclideanReconstruction &reconstruction = libmv_reconstruction->reconstruction;
@@ -650,16 +649,16 @@ libmv_Reconstruction *libmv_solveReconstruction(const libmv_Tracks *libmv_tracks
        finishReconstruction(tracks, camera_intrinsics, libmv_reconstruction,
                             progress_update_callback, callback_customdata);
 
-       return (libmv_Reconstruction *)libmv_reconstruction;
+       return (struct libmv_Reconstruction *)libmv_reconstruction;
 }
 
-struct libmv_Reconstruction *libmv_solveModal(const libmv_Tracks *libmv_tracks,
-                       const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
-                       const libmv_reconstructionOptions *libmv_reconstruction_options,
-                       reconstruct_progress_update_cb progress_update_callback,
-                       void *callback_customdata)
+struct libmv_Reconstruction *libmv_solveModal(const struct libmv_Tracks *libmv_tracks,
+               const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+               const libmv_ReconstructionOptions *libmv_reconstruction_options,
+               reconstruct_progress_update_cb progress_update_callback,
+               void *callback_customdata)
 {
-       libmv_Reconstruction *libmv_reconstruction = new libmv_Reconstruction();
+       struct libmv_Reconstruction *libmv_reconstruction = new libmv_Reconstruction();
 
        libmv::Tracks &tracks = *((libmv::Tracks *) libmv_tracks);
        libmv::EuclideanReconstruction &reconstruction = libmv_reconstruction->reconstruction;
@@ -697,15 +696,20 @@ struct libmv_Reconstruction *libmv_solveModal(const libmv_Tracks *libmv_tracks,
        finishReconstruction(tracks, camera_intrinsics, libmv_reconstruction,
                             progress_update_callback, callback_customdata);
 
-       return (libmv_Reconstruction *)libmv_reconstruction;
+       return (struct libmv_Reconstruction *)libmv_reconstruction;
+}
+
+void libmv_reconstructionDestroy(struct libmv_Reconstruction *libmv_reconstruction)
+{
+       delete libmv_reconstruction;
 }
 
-int libmv_reporojectionPointForTrack(const libmv_Reconstruction *libmv_reconstruction, int track, double pos[3])
+int libmv_reprojectionPointForTrack(const struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3])
 {
        const libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction;
        const libmv::EuclideanPoint *point = reconstruction->PointForTrack(track);
 
-       if(point) {
+       if (point) {
                pos[0] = point->X[0];
                pos[1] = point->X[2];
                pos[2] = point->X[1];
@@ -732,7 +736,7 @@ static libmv::Marker ProjectMarker(const libmv::EuclideanPoint &point,
        return reprojected_marker;
 }
 
-double libmv_reporojectionErrorForTrack(const libmv_Reconstruction *libmv_reconstruction, int track)
+double libmv_reprojectionErrorForTrack(const struct libmv_Reconstruction *libmv_reconstruction, int track)
 {
        const libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction;
        const libmv::CameraIntrinsics *intrinsics = &libmv_reconstruction->intrinsics;
@@ -755,13 +759,13 @@ double libmv_reporojectionErrorForTrack(const libmv_Reconstruction *libmv_recons
                double ex = reprojected_marker.x - markers[i].x;
                double ey = reprojected_marker.y - markers[i].y;
 
-               total_error += sqrt(ex*ex + ey*ey);
+               total_error += sqrt(ex * ex + ey * ey);
        }
 
        return total_error / num_reprojected;
 }
 
-double libmv_reporojectionErrorForImage(const libmv_Reconstruction *libmv_reconstruction, int image)
+double libmv_reprojectionErrorForImage(const struct libmv_Reconstruction *libmv_reconstruction, int image)
 {
        const libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction;
        const libmv::CameraIntrinsics *intrinsics = &libmv_reconstruction->intrinsics;
@@ -786,19 +790,19 @@ double libmv_reporojectionErrorForImage(const libmv_Reconstruction *libmv_recons
                double ex = reprojected_marker.x - markers[i].x;
                double ey = reprojected_marker.y - markers[i].y;
 
-               total_error += sqrt(ex*ex + ey*ey);
+               total_error += sqrt(ex * ex + ey * ey);
        }
 
        return total_error / num_reprojected;
 }
 
-int libmv_reporojectionCameraForImage(const libmv_Reconstruction *libmv_reconstruction,
+int libmv_reprojectionCameraForImage(const struct libmv_Reconstruction *libmv_reconstruction,
                                       int image, double mat[4][4])
 {
        const libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction;
        const libmv::EuclideanCamera *camera = reconstruction->CameraForImage(image);
 
-       if(camera) {
+       if (camera) {
                for (int j = 0; j < 3; ++j) {
                        for (int k = 0; k < 3; ++k) {
                                int l = k;
@@ -809,7 +813,7 @@ int libmv_reporojectionCameraForImage(const libmv_Reconstruction *libmv_reconstr
                                if (j == 2) mat[j][l] = -camera->R(j,k);
                                else mat[j][l] = camera->R(j,k);
                        }
-                       mat[j][3]= 0.0;
+                       mat[j][3] = 0.0;
                }
 
                libmv::Vec3 optical_center = -camera->R.transpose() * camera->t;
@@ -818,7 +822,7 @@ int libmv_reporojectionCameraForImage(const libmv_Reconstruction *libmv_reconstr
                mat[3][1] = optical_center(2);
                mat[3][2] = optical_center(1);
 
-               mat[3][3]= 1.0;
+               mat[3][3] = 1.0;
 
                return 1;
        }
@@ -826,17 +830,17 @@ int libmv_reporojectionCameraForImage(const libmv_Reconstruction *libmv_reconstr
        return 0;
 }
 
-double libmv_reprojectionError(const libmv_Reconstruction *libmv_reconstruction)
+double libmv_reprojectionError(const struct libmv_Reconstruction *libmv_reconstruction)
 {
        return libmv_reconstruction->error;
 }
 
-void libmv_destroyReconstruction(libmv_Reconstruction *libmv_reconstruction)
+struct libmv_CameraIntrinsics *libmv_reconstructionExtractIntrinsics(struct libmv_Reconstruction *libmv_reconstruction)
 {
-       delete libmv_reconstruction;
+       return (struct libmv_CameraIntrinsics *)&libmv_reconstruction->intrinsics;
 }
 
-/* ************ feature detector ************ */
+/* ************ Feature detector ************ */
 
 struct libmv_Features *libmv_detectFeaturesFAST(const unsigned char *data,
                                                 int width, int height, int stride,
@@ -844,24 +848,24 @@ struct libmv_Features *libmv_detectFeaturesFAST(const unsigned char *data,
 {
        libmv::Feature *features = NULL;
        std::vector<libmv::Feature> v;
-       libmv_Features *libmv_features = new libmv_Features();
-       int i= 0, count;
+       struct libmv_Features *libmv_features = new libmv_Features();
+       int i = 0, count;
 
-       if(margin) {
-               data += margin*stride+margin;
-               width -= 2*margin;
-               height -= 2*margin;
+       if (margin) {
+               data += margin * stride+margin;
+               width -= 2 * margin;
+               height -= 2 * margin;
        }
 
        v = libmv::DetectFAST(data, width, height, stride, min_trackness, min_distance);
 
        count = v.size();
 
-       if(count) {
-               features= new libmv::Feature[count];
+       if (count) {
+               features = new libmv::Feature[count];
 
                for(std::vector<libmv::Feature>::iterator it = v.begin(); it != v.end(); it++) {
-                       features[i++]= *it;
+                       features[i++] = *it;
                }
        }
 
@@ -869,7 +873,7 @@ struct libmv_Features *libmv_detectFeaturesFAST(const unsigned char *data,
        libmv_features->count = count;
        libmv_features->margin = margin;
 
-       return (libmv_Features *)libmv_features;
+       return (struct libmv_Features *)libmv_features;
 }
 
 struct libmv_Features *libmv_detectFeaturesMORAVEC(const unsigned char *data,
@@ -877,13 +881,13 @@ struct libmv_Features *libmv_detectFeaturesMORAVEC(const unsigned char *data,
                                                    int margin, int count, int min_distance)
 {
        libmv::Feature *features = NULL;
-       libmv_Features *libmv_features = new libmv_Features;
+       struct libmv_Features *libmv_features = new libmv_Features;
 
-       if(count) {
-               if(margin) {
-                       data += margin*stride+margin;
-                       width -= 2*margin;
-                       height -= 2*margin;
+       if (count) {
+               if (margin) {
+                       data += margin * stride+margin;
+                       width -= 2 * margin;
+                       height -= 2 * margin;
                }
 
                features = new libmv::Feature[count];
@@ -897,14 +901,22 @@ struct libmv_Features *libmv_detectFeaturesMORAVEC(const unsigned char *data,
        return libmv_features;
 }
 
-int libmv_countFeatures(const libmv_Features *libmv_features)
+void libmv_featuresDestroy(struct libmv_Features *libmv_features)
+{
+       if (libmv_features->features)
+               delete [] libmv_features->features;
+
+       delete libmv_features;
+}
+
+int libmv_countFeatures(const struct libmv_Features *libmv_features)
 {
        return libmv_features->count;
 }
 
-void libmv_getFeature(const libmv_Features *libmv_features, int number, double *x, double *y, double *score, double *size)
+void libmv_getFeature(const struct libmv_Features *libmv_features, int number, double *x, double *y, double *score, double *size)
 {
-       libmv::Feature feature= libmv_features->features[number];
+       libmv::Feature feature = libmv_features->features[number];
 
        *x = feature.x + libmv_features->margin;
        *y = feature.y + libmv_features->margin;
@@ -912,29 +924,16 @@ void libmv_getFeature(const libmv_Features *libmv_features, int number, double *
        *size = feature.size;
 }
 
-void libmv_destroyFeatures(libmv_Features *libmv_features)
-{
-       if(libmv_features->features)
-               delete [] libmv_features->features;
+/* ************ Camera intrinsics ************ */
 
-       delete libmv_features;
-}
-
-/* ************ camera intrinsics ************ */
-
-struct libmv_CameraIntrinsics *libmv_ReconstructionExtractIntrinsics(libmv_Reconstruction *libmv_Reconstruction)
-{
-       return (struct libmv_CameraIntrinsics *)&libmv_Reconstruction->intrinsics;
-}
-
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNewEmpty(void)
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNewEmpty(void)
 {
        libmv::CameraIntrinsics *camera_intrinsics = new libmv::CameraIntrinsics();
 
        return (struct libmv_CameraIntrinsics *) camera_intrinsics;
 }
 
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options)
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNew(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options)
 {
        libmv::CameraIntrinsics *camera_intrinsics = new libmv::CameraIntrinsics();
 
@@ -943,23 +942,23 @@ struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(const libmv_cameraIntri
        return (struct libmv_CameraIntrinsics *) camera_intrinsics;
 }
 
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(const libmv_CameraIntrinsics *libmvIntrinsics)
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsCopy(const libmv_CameraIntrinsics *libmvIntrinsics)
 {
        libmv::CameraIntrinsics *orig_intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics;
-       libmv::CameraIntrinsics *new_intrinsics= new libmv::CameraIntrinsics(*orig_intrinsics);
+       libmv::CameraIntrinsics *new_intrinsics = new libmv::CameraIntrinsics(*orig_intrinsics);
 
        return (struct libmv_CameraIntrinsics *) new_intrinsics;
 }
 
-void libmv_CameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmvIntrinsics)
+void libmv_cameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmvIntrinsics)
 {
        libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics;
 
        delete intrinsics;
 }
 
-void libmv_CameraIntrinsicsUpdate(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
-                                  libmv_CameraIntrinsics *libmv_intrinsics)
+void libmv_cameraIntrinsicsUpdate(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+                                  struct libmv_CameraIntrinsics *libmv_intrinsics)
 {
        libmv::CameraIntrinsics *camera_intrinsics = (libmv::CameraIntrinsics *) libmv_intrinsics;
 
@@ -997,15 +996,16 @@ void libmv_CameraIntrinsicsUpdate(const libmv_cameraIntrinsicsOptions *libmv_cam
        }
 }
 
-void libmv_CameraIntrinsicsSetThreads(libmv_CameraIntrinsics *libmv_intrinsics, int threads)
+void libmv_cameraIntrinsicsSetThreads(struct libmv_CameraIntrinsics *libmv_intrinsics, int threads)
 {
        libmv::CameraIntrinsics *camera_intrinsics = (libmv::CameraIntrinsics *) libmv_intrinsics;
 
        camera_intrinsics->SetThreads(threads);
 }
 
-void libmv_CameraIntrinsicsExtract(const libmv_CameraIntrinsics *libmv_intrinsics, double *focal_length,
-                       double *principal_x, double *principal_y, double *k1, double *k2, double *k3, int *width, int *height)
+void libmv_cameraIntrinsicsExtract(const struct libmv_CameraIntrinsics *libmv_intrinsics, double *focal_length,
+                                   double *principal_x, double *principal_y, double *k1, double *k2, double *k3,
+                                   int *width, int *height)
 {
        libmv::CameraIntrinsics *camera_intrinsics = (libmv::CameraIntrinsics *) libmv_intrinsics;
 
@@ -1016,40 +1016,42 @@ void libmv_CameraIntrinsicsExtract(const libmv_CameraIntrinsics *libmv_intrinsic
        *k2 = camera_intrinsics->k2();
 }
 
-void libmv_CameraIntrinsicsUndistortByte(const libmv_CameraIntrinsics *libmv_intrinsics,
-                       unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsUndistortByte(const struct libmv_CameraIntrinsics *libmv_intrinsics,
+                                         unsigned char *src, unsigned char *dst, int width, int height,
+                                         float overscan, int channels)
 {
        libmv::CameraIntrinsics *camera_intrinsics = (libmv::CameraIntrinsics *) libmv_intrinsics;
 
        camera_intrinsics->Undistort(src, dst, width, height, overscan, channels);
 }
 
-void libmv_CameraIntrinsicsUndistortFloat(const libmv_CameraIntrinsics *libmvIntrinsics,
-                       float *src, float *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsUndistortFloat(const struct libmv_CameraIntrinsics *libmvIntrinsics,
+                                          float *src, float *dst, int width, int height,
+                                          float overscan, int channels)
 {
        libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics;
 
        intrinsics->Undistort(src, dst, width, height, overscan, channels);
 }
 
-void libmv_CameraIntrinsicsDistortByte(const libmv_CameraIntrinsics *libmvIntrinsics,
-                       unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsDistortByte(const struct libmv_CameraIntrinsics *libmvIntrinsics,
+                                       unsigned char *src, unsigned char *dst, int width, int height,
+                                       float overscan, int channels)
 {
        libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics;
        intrinsics->Distort(src, dst, width, height, overscan, channels);
 }
 
-void libmv_CameraIntrinsicsDistortFloat(const libmv_CameraIntrinsics *libmvIntrinsics,
-                       float *src, float *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsDistortFloat(const struct libmv_CameraIntrinsics *libmvIntrinsics,
+                                        float *src, float *dst, int width, int height,
+                                        float overscan, int channels)
 {
        libmv::CameraIntrinsics *intrinsics = (libmv::CameraIntrinsics *) libmvIntrinsics;
 
        intrinsics->Distort(src, dst, width, height, overscan, channels);
 }
 
-/* ************ utils ************ */
-
-void libmv_ApplyCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+void libmv_cameraIntrinsicsApply(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
                                  double x, double y, double *x1, double *y1)
 {
        libmv::CameraIntrinsics camera_intrinsics;
@@ -1063,7 +1065,7 @@ void libmv_ApplyCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_came
        }
 }
 
-void libmv_InvertCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+void libmv_cameraIntrinsicsInvert(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
                                   double x, double y, double *x1, double *y1)
 {
        libmv::CameraIntrinsics camera_intrinsics;
index beac3e85468206c8863b19c971ee190bd5ad3254..7c91881fe71638c0fc539ca12d7ddaedc9f4ace7 100644 (file)
@@ -41,8 +41,8 @@ void libmv_initLogging(const char *argv0);
 void libmv_startDebugLogging(void);
 void libmv_setLoggingVerbosity(int verbosity);
 
-/* TrackRegion (new planar tracker) */
-struct libmv_trackRegionOptions {
+/* Planar tracker */
+typedef struct libmv_TrackRegionOptions {
        int motion_model;
        int num_iterations;
        int use_brute;
@@ -50,21 +50,20 @@ struct libmv_trackRegionOptions {
        double minimum_correlation;
        double sigma;
        float *image1_mask;
-};
+} libmv_TrackRegionOptions;
 
-struct libmv_trackRegionResult {
+typedef struct libmv_TrackRegionResult {
        int termination;
        const char *termination_reason;
        double correlation;
-};
+} libmv_TrackRegionResult;
 
-int libmv_trackRegion(const struct libmv_trackRegionOptions *options,
+int libmv_trackRegion(const libmv_TrackRegionOptions *options,
                       const float *image1, int image1_width, int image1_height,
                       const float *image2, int image2_width, int image2_height,
                       const double *x1, const double *y1,
-                      struct libmv_trackRegionResult *result,
+                      libmv_TrackRegionResult *result,
                       double *x2, double *y2);
-
 void libmv_samplePlanarPatch(const float *image, int width, int height,
                              int channels, const double *xs, const double *ys,
                              int num_samples_x, int num_samples_y,
@@ -73,25 +72,24 @@ void libmv_samplePlanarPatch(const float *image, int width, int height,
 
 /* Tracks */
 struct libmv_Tracks *libmv_tracksNew(void);
-void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y);
 void libmv_tracksDestroy(struct libmv_Tracks *libmv_tracks);
+void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y);
 
-/* Reconstruction solver */
-
+/* Reconstruction */
 #define LIBMV_REFINE_FOCAL_LENGTH          (1 << 0)
 #define LIBMV_REFINE_PRINCIPAL_POINT       (1 << 1)
 #define LIBMV_REFINE_RADIAL_DISTORTION_K1  (1 << 2)
 #define LIBMV_REFINE_RADIAL_DISTORTION_K2  (1 << 4)
 
-typedef struct libmv_cameraIntrinsicsOptions {
+typedef struct libmv_CameraIntrinsicsOptions {
        double focal_length;
        double principal_point_x, principal_point_y;
        double k1, k2, k3;
        double p1, p2;
        int image_width, image_height;
-} libmv_cameraIntrinsicsOptions;
+} libmv_CameraIntrinsicsOptions;
 
-typedef struct libmv_reconstructionOptions {
+typedef struct libmv_ReconstructionOptions {
        int select_keyframes;
        int keyframe1, keyframe2;
 
@@ -99,72 +97,67 @@ typedef struct libmv_reconstructionOptions {
 
        double success_threshold;
        int use_fallback_reconstruction;
-} libmv_reconstructionOptions;
+} libmv_ReconstructionOptions;
 
 typedef void (*reconstruct_progress_update_cb) (void *customdata, double progress, const char *message);
 
 struct libmv_Reconstruction *libmv_solveReconstruction(const struct libmv_Tracks *libmv_tracks,
-                       const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
-                       libmv_reconstructionOptions *libmv_reconstruction_options,
-                       reconstruct_progress_update_cb progress_update_callback,
-                       void *callback_customdata);
+               const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+               libmv_ReconstructionOptions *libmv_reconstruction_options,
+               reconstruct_progress_update_cb progress_update_callback,
+               void *callback_customdata);
 struct libmv_Reconstruction *libmv_solveModal(const struct libmv_Tracks *libmv_tracks,
-                       const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
-                       const libmv_reconstructionOptions *libmv_reconstruction_options,
-                       reconstruct_progress_update_cb progress_update_callback,
-                       void *callback_customdata);
-int libmv_reporojectionPointForTrack(const struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]);
-double libmv_reporojectionErrorForTrack(const struct libmv_Reconstruction *libmv_reconstruction, int track);
-double libmv_reporojectionErrorForImage(const struct libmv_Reconstruction *libmv_reconstruction, int image);
-int libmv_reporojectionCameraForImage(const struct libmv_Reconstruction *libmv_reconstruction, int image, double mat[4][4]);
+               const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+               const libmv_ReconstructionOptions *libmv_reconstruction_options,
+               reconstruct_progress_update_cb progress_update_callback,
+               void *callback_customdata);
+void libmv_reconstructionDestroy(struct libmv_Reconstruction *libmv_reconstruction);
+int libmv_reprojectionPointForTrack(const struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]);
+double libmv_reprojectionErrorForTrack(const struct libmv_Reconstruction *libmv_reconstruction, int track);
+double libmv_reprojectionErrorForImage(const struct libmv_Reconstruction *libmv_reconstruction, int image);
+int libmv_reprojectionCameraForImage(const struct libmv_Reconstruction *libmv_reconstruction,
+                                     int image, double mat[4][4]);
 double libmv_reprojectionError(const struct libmv_Reconstruction *libmv_reconstruction);
-void libmv_destroyReconstruction(struct libmv_Reconstruction *libmv_reconstruction);
+struct libmv_CameraIntrinsics *libmv_reconstructionExtractIntrinsics(struct libmv_Reconstruction *libmv_Reconstruction);
 
-/* feature detector */
+/* Feature detector */
 struct libmv_Features *libmv_detectFeaturesFAST(const unsigned char *data, int width, int height, int stride,
-                       int margin, int min_trackness, int min_distance);
+                                                int margin, int min_trackness, int min_distance);
 struct libmv_Features *libmv_detectFeaturesMORAVEC(const unsigned char *data, int width, int height, int stride,
-                       int margin, int count, int min_distance);
+                                                   int margin, int count, int min_distance);
+void libmv_featuresDestroy(struct libmv_Features *libmv_features);
 int libmv_countFeatures(const struct libmv_Features *libmv_features);
-void libmv_getFeature(const struct libmv_Features *libmv_features, int number, double *x, double *y, double *score, double *size);
-void libmv_destroyFeatures(struct libmv_Features *libmv_features);
-
-/* camera intrinsics */
-struct libmv_CameraIntrinsics *libmv_ReconstructionExtractIntrinsics(struct libmv_Reconstruction *libmv_Reconstruction);
-
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNewEmpty(void);
-
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options);
-
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(const struct libmv_CameraIntrinsics *libmv_intrinsics);
-
-void libmv_CameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmv_intrinsics);
-
-void libmv_CameraIntrinsicsUpdate(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+void libmv_getFeature(const struct libmv_Features *libmv_features, int number, double *x, double *y, double *score,
+                      double *size);
+
+/* Camera intrinsics */
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNewEmpty(void);
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNew(
+               const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options);
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsCopy(const struct libmv_CameraIntrinsics *libmv_intrinsics);
+void libmv_cameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmv_intrinsics);
+void libmv_cameraIntrinsicsUpdate(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
                                   struct libmv_CameraIntrinsics *libmv_intrinsics);
-
-void libmv_CameraIntrinsicsSetThreads(struct libmv_CameraIntrinsics *libmv_intrinsics, int threads);
-
-void libmv_CameraIntrinsicsExtract(const struct libmv_CameraIntrinsics *libmv_intrinsics, double *focal_length,
-                       double *principal_x, double *principal_y, double *k1, double *k2, double *k3, int *width, int *height);
-
-void libmv_CameraIntrinsicsUndistortByte(const struct libmv_CameraIntrinsics *libmv_intrinsics,
-                       unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels);
-
-void libmv_CameraIntrinsicsUndistortFloat(const struct libmv_CameraIntrinsics *libmv_intrinsics,
-                       float *src, float *dst, int width, int height, float overscan, int channels);
-
-void libmv_CameraIntrinsicsDistortByte(const struct libmv_CameraIntrinsics *libmv_intrinsics,
-                       unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels);
-
-void libmv_CameraIntrinsicsDistortFloat(const struct libmv_CameraIntrinsics *libmv_intrinsics,
-                       float *src, float *dst, int width, int height, float overscan, int channels);
-
-/* utils */
-void libmv_ApplyCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
-                       double x, double y, double *x1, double *y1);
-void libmv_InvertCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
-                       double x, double y, double *x1, double *y1);
+void libmv_cameraIntrinsicsSetThreads(struct libmv_CameraIntrinsics *libmv_intrinsics, int threads);
+void libmv_cameraIntrinsicsExtract(const struct libmv_CameraIntrinsics *libmv_intrinsics, double *focal_length,
+                                   double *principal_x, double *principal_y, double *k1, double *k2, double *k3,
+                                   int *width, int *height);
+void libmv_cameraIntrinsicsUndistortByte(const struct libmv_CameraIntrinsics *libmv_intrinsics,
+                                         unsigned char *src, unsigned char *dst, int width, int height,
+                                         float overscan, int channels);
+void libmv_cameraIntrinsicsUndistortFloat(const struct libmv_CameraIntrinsics *libmv_intrinsics,
+                                          float *src, float *dst, int width, int height,
+                                          float overscan, int channels);
+void libmv_cameraIntrinsicsDistortByte(const struct libmv_CameraIntrinsics *libmv_intrinsics,
+                                       unsigned char *src, unsigned char *dst, int width, int height,
+                                       float overscan, int channels);
+void libmv_cameraIntrinsicsDistortFloat(const struct libmv_CameraIntrinsics *libmv_intrinsics,
+                                        float *src, float *dst, int width, int height,
+                                        float overscan, int channels);
+void libmv_cameraIntrinsicsApply(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+                                 double x, double y, double *x1, double *y1);
+void libmv_cameraIntrinsicsInvert(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+                                  double x, double y, double *x1, double *y1);
 
 #ifdef __cplusplus
 }
index 4bc2b18081a1fe400483d0b95be20cfe60bf6972..36977eb58bab11f64b21260448ce41bc9b1da60c 100644 (file)
@@ -48,11 +48,11 @@ void libmv_setLoggingVerbosity(int /*verbosity*/)
 /* ************ Planar tracker ************ */
 
 /* TrackRegion (new planar tracker) */
-int libmv_trackRegion(const struct libmv_trackRegionOptions * /*options*/,
+int libmv_trackRegion(const libmv_TrackRegionOptions * /*options*/,
                       const float * /*image1*/, int /*image1_width*/, int /*image1_height*/,
                       const float * /*image2*/, int /*image2_width*/, int /*image2_height*/,
                       const double *x1, const double *y1,
-                      struct libmv_trackRegionResult *result,
+                      libmv_TrackRegionResult *result,
                       double *x2, double *y2)
 {
        /* Convert to doubles for the libmv api. The four corners and the center. */
@@ -79,7 +79,8 @@ void libmv_samplePlanarPatch(const float *image, int width, int height,
 
 /* ************ Tracks ************ */
 
-libmv_Tracks *libmv_tracksNew(void) {
+struct libmv_Tracks *libmv_tracksNew(void)
+{
        return NULL;
 }
 
@@ -88,73 +89,72 @@ void libmv_tracksInsert(struct libmv_Tracks * /*libmv_tracks*/, int /*image*/,
 {
 }
 
-void libmv_tracksDestroy(libmv_Tracks * /*libmv_tracks*/)
+void libmv_tracksDestroy(struct libmv_Tracks * /*libmv_tracks*/)
 {
 }
 
 /* ************ Reconstruction solver ************ */
 
-libmv_Reconstruction *libmv_solveReconstruction(const libmv_Tracks * /*libmv_tracks*/,
-                       const libmv_cameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/,
-                       libmv_reconstructionOptions * /*libmv_reconstruction_options*/,
-                       reconstruct_progress_update_cb /*progress_update_callback*/,
-                       void * /*callback_customdata*/)
+struct libmv_Reconstruction *libmv_solveReconstruction(const struct libmv_Tracks * /*libmv_tracks*/,
+               const libmv_CameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/,
+               libmv_ReconstructionOptions * /*libmv_reconstruction_options*/,
+               reconstruct_progress_update_cb /*progress_update_callback*/,
+               void * /*callback_customdata*/)
 {
        return NULL;
 }
 
 struct libmv_Reconstruction *libmv_solveModal(const struct libmv_Tracks * /*libmv_tracks*/,
-                       const libmv_cameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/,
-                       const libmv_reconstructionOptions * /*libmv_reconstruction_options*/,
-                       reconstruct_progress_update_cb /*progress_update_callback*/,
-                       void * /*callback_customdata*/)
+               const libmv_CameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/,
+               const libmv_ReconstructionOptions * /*libmv_reconstruction_options*/,
+               reconstruct_progress_update_cb /*progress_update_callback*/,
+               void * /*callback_customdata*/)
 {
        return NULL;
 }
 
-int libmv_reporojectionPointForTrack(const libmv_Reconstruction * /*libmv_reconstruction*/,
+int libmv_reprojectionPointForTrack(const struct libmv_Reconstruction * /*libmv_reconstruction*/,
                                      int /*track*/, double /*pos*/[3])
 {
        return 0;
 }
 
-double libmv_reporojectionErrorForTrack(const libmv_Reconstruction * /*libmv_reconstruction*/, int /*track*/)
+double libmv_reprojectionErrorForTrack(const struct libmv_Reconstruction * /*libmv_reconstruction*/, int /*track*/)
 {
        return 0.0;
 }
 
-double libmv_reporojectionErrorForImage(const libmv_Reconstruction * /*libmv_reconstruction*/, int /*image*/)
+double libmv_reprojectionErrorForImage(const struct libmv_Reconstruction * /*libmv_reconstruction*/, int /*image*/)
 {
        return 0.0;
 }
 
-int libmv_reporojectionCameraForImage(const libmv_Reconstruction * /*libmv_reconstruction*/, int /*image*/,
+int libmv_reprojectionCameraForImage(const struct libmv_Reconstruction * /*libmv_reconstruction*/, int /*image*/,
                                       double /*mat*/[4][4])
 {
        return 0;
 }
 
-double libmv_reprojectionError(const libmv_Reconstruction * /*libmv_reconstruction*/)
+double libmv_reprojectionError(const struct libmv_Reconstruction * /*libmv_reconstruction*/)
 {
        return 0.0;
 }
 
-void libmv_destroyReconstruction(libmv_Reconstruction * /*libmv_reconstruction*/)
+void libmv_reconstructionDestroy(struct libmv_Reconstruction * /*libmv_reconstruction*/)
 {
 }
 
 /* ************ feature detector ************ */
 
-struct libmv_Features *libmv_detectFeaturesFAST(const unsigned char * /*data*/,
-                       int /*width*/, int /*height*/, int /*stride*/,
-                       int /*margin*/, int /*min_trackness*/, int /*min_distance*/)
+struct libmv_Features *libmv_detectFeaturesFAST(const unsigned char * /*data*/, int /*width*/, int /*height*/,
+                                                int /*stride*/, int /*margin*/, int /*min_trackness*/,
+                                                int /*min_distance*/)
 {
        return NULL;
 }
 
-struct libmv_Features *libmv_detectFeaturesMORAVEC(const unsigned char * /*data*/,
-                       int /*width*/, int /*height*/, int /*stride*/,
-                       int /*margin*/, int /*count*/, int /*min_distance*/)
+struct libmv_Features *libmv_detectFeaturesMORAVEC(const unsigned char * /*data*/, int /*width*/, int /*height*/,
+                                                   int /*stride*/, int /*margin*/, int /*count*/, int /*min_distance*/)
 {
        return NULL;
 }
@@ -173,49 +173,50 @@ void libmv_getFeature(const struct libmv_Features * /*libmv_features*/, int /*nu
        *size = 0.0;
 }
 
-void libmv_destroyFeatures(struct libmv_Features * /*libmv_features*/)
+void libmv_featuresDestroy(struct libmv_Features * /*libmv_features*/)
 {
 }
 
 /* ************ camera intrinsics ************ */
 
-struct libmv_CameraIntrinsics *libmv_ReconstructionExtractIntrinsics(
-                       struct libmv_Reconstruction * /*libmv_Reconstruction*/)
+struct libmv_CameraIntrinsics *libmv_reconstructionExtractIntrinsics(
+               struct libmv_Reconstruction * /*libmv_reconstruction*/)
 {
        return NULL;
 }
 
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNewEmpty(void)
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNewEmpty(void)
 {
        return NULL;
 }
 
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(const libmv_cameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/)
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNew(
+               const libmv_CameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/)
 {
        return NULL;
 }
 
-struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(const struct libmv_CameraIntrinsics * /*libmvIntrinsics*/)
+struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsCopy(const libmv_CameraIntrinsics * /*libmvIntrinsics*/)
 {
        return NULL;
 }
 
-void libmv_CameraIntrinsicsDestroy(struct libmv_CameraIntrinsics * /*libmvIntrinsics*/)
+void libmv_cameraIntrinsicsDestroy(struct libmv_CameraIntrinsics * /*libmvIntrinsics*/)
 {
 }
 
-void libmv_CameraIntrinsicsUpdate(const libmv_cameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/,
-                                  libmv_CameraIntrinsics * /*libmv_intrinsics*/)
+void libmv_cameraIntrinsicsUpdate(const libmv_CameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/,
+                                  struct libmv_CameraIntrinsics * /*libmv_intrinsics*/)
 {
 }
 
-void libmv_CameraIntrinsicsSetThreads(struct libmv_CameraIntrinsics * /*libmv_intrinsics*/, int /*threads*/)
+void libmv_cameraIntrinsicsSetThreads(struct libmv_CameraIntrinsics * /*libmv_intrinsics*/, int /*threads*/)
 {
 }
 
-void libmv_CameraIntrinsicsExtract(const struct libmv_CameraIntrinsics * /*libmv_intrinsics*/, double * focal_length,
-                       double * principal_x, double *principal_y, double *k1, double *k2, double *k3,
-                       int *width, int *height)
+void libmv_cameraIntrinsicsExtract(const struct libmv_CameraIntrinsics * /*libmv_intrinsics*/, double * focal_length,
+                                   double * principal_x, double *principal_y, double *k1, double *k2, double *k3,
+                                   int *width, int *height)
 {
        *focal_length = 1.0;
        *principal_x = 0.0;
@@ -226,33 +227,35 @@ void libmv_CameraIntrinsicsExtract(const struct libmv_CameraIntrinsics * /*libmv
        *height = 0.0;
 }
 
-void libmv_CameraIntrinsicsUndistortByte(const struct libmv_CameraIntrinsics * /*libmv_intrinsics*/,
-                       unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsUndistortByte(const struct libmv_CameraIntrinsics * /*libmv_intrinsics*/,
+                                         unsigned char *src, unsigned char *dst, int width, int height,
+                                         float overscan, int channels)
 {
        memcpy(dst, src, channels * width * height * sizeof(unsigned char));
 }
 
-void libmv_CameraIntrinsicsUndistortFloat(const struct libmv_CameraIntrinsics * /*libmvIntrinsics*/,
-                       float *src, float *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsUndistortFloat(const struct libmv_CameraIntrinsics * /*libmvIntrinsics*/,
+                                          float *src, float *dst, int width, int height, float overscan, int channels)
 {
        memcpy(dst, src, channels * width * height * sizeof(float));
 }
 
-void libmv_CameraIntrinsicsDistortByte(const struct libmv_CameraIntrinsics *libmvIntrinsics,
-                       unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsDistortByte(const struct libmv_CameraIntrinsics *libmvIntrinsics,
+                                       unsigned char *src, unsigned char *dst, int width, int height,
+                                       float overscan, int channels)
 {
        memcpy(dst, src, channels * width * height * sizeof(unsigned char));
 }
 
-void libmv_CameraIntrinsicsDistortFloat(const struct libmv_CameraIntrinsics *libmvIntrinsics,
-                       float *src, float *dst, int width, int height, float overscan, int channels)
+void libmv_cameraIntrinsicsDistortFloat(const struct libmv_CameraIntrinsics *libmvIntrinsics,
+                                        float *src, float *dst, int width, int height, float overscan, int channels)
 {
        memcpy(dst, src, channels * width * height * sizeof(float));
 }
 
 /* ************ utils ************ */
 
-void libmv_ApplyCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+void libmv_cameraIntrinsicsApply(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
                                  double x, double y, double *x1, double *y1)
 {
        double focal_length = libmv_camera_intrinsics_options->focal_length;
@@ -263,7 +266,7 @@ void libmv_ApplyCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_came
        *y1 = y * focal_length + principal_y;
 }
 
-void libmv_InvertCameraIntrinsics(const libmv_cameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+void libmv_cameraIntrinsicsInvert(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
                                   double x, double y, double *x1, double *y1)
 {
        double focal_length = libmv_camera_intrinsics_options->focal_length;
index 4a2dcdd6f5bf8d372d2137651b06782d365b5d8e..70c875ca991f4415241aeb3bd9d7adc799fe4ce3 100644 (file)
@@ -1,3 +1,25 @@
+/* ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2008 Peter Schlaile
+ *
+ * This file is part of libredcode.
+ *
+ * Libredcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Libredcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with libredcode; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****/
+
 #include "codec.h"
 #include "format.h"
 #include "debayer.h"
index dd239180c10c3fcb4f24d5b309aa29ca71db9caf..6f7092672eeff3c9632bab379a3e7b8b72559a28 100644 (file)
@@ -1,3 +1,25 @@
+/* ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2008 Peter Schlaile
+ *
+ * This file is part of libredcode.
+ *
+ * Libredcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Libredcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Libredcode; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****/
+
 #ifndef __CODEC_H__
 #define __CODEC_H__
 
index de7bec510cb9a61edd2bfdb3270b7b21e20718a2..a236fed174953026b093193fdde2c53a98225035 100644 (file)
@@ -1,3 +1,25 @@
+/* ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2008 Peter Schlaile
+ *
+ * This file is part of libredcode.
+ *
+ * Libredcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Libredcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Libredcode; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****/
+
 #include "debayer.h"
 
 /* pretty simple but astonishingly very effective "debayer" function 
index 43564240cc2a5c337e303a46612d03ceb9437bf3..31f3dd01fea5ddf1fc091c7d2c032a84e410e0bb 100644 (file)
@@ -1,3 +1,25 @@
+/* ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2008 Peter Schlaile
+ *
+ * This file is part of libredcode.
+ *
+ * Libredcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Libredcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Libredcode; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****/
+
 #ifndef __DEBAYER_H__
 #define __DEBAYER_H__
 
index cf8f9d5faa72c0bb8c1a6b2c496d7e6c0e0004f2..8c6cae5234e1422c5efa9c371109c9c92c0c19f1 100644 (file)
@@ -1,3 +1,25 @@
+/* ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2008 Peter Schlaile
+ *
+ * This file is part of libredcode.
+ *
+ * Libredcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Libredcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Libredcode; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****/
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 3cee804aa9d5fa2a635b2a982c68efa5c205a506..473a2b1a8d9f36e7391afa9811886984fb50f627 100644 (file)
@@ -1,3 +1,25 @@
+/* ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2008 Peter Schlaile
+ *
+ * This file is part of libredcode.
+ *
+ * Libredcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Libredcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Libredcode; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****/
+
 #ifndef __FORMAT_H__
 #define __FORMAT_H__
 
index 3d830df83e8e1fe3a97ef4f694370991cbaad1c5..ba961f0cb78c4be9162f3e63127bc90d9cb6148f 100644 (file)
@@ -347,10 +347,6 @@ void AUD_FFMPEGReader::seek(int position)
                uint64_t st_time = m_formatCtx->start_time;
                uint64_t seek_pos = ((uint64_t)position) * ((uint64_t)AV_TIME_BASE) / ((uint64_t)m_specs.rate);
 
-               if (seek_pos < 0) {
-                       seek_pos = 0;
-               }
-
                if (st_time != AV_NOPTS_VALUE) {
                        seek_pos += st_time;
                }
index e3907c5273dcf6881224ba7a0f3deb07e9d920c8..5a2e3538e0aee97c286a1d699d41aa4ddedd5afd 100644 (file)
@@ -28,10 +28,10 @@ set(INC
        ../container
        ../guardedalloc
        ../memutil
-       ../moto/include
 )
 
 set(INC_SYS
+       ../moto/include
        ../../extern/carve/include
 )
 
index cc132a2c3b2dce3f21c8ea6ff8fa9f7a96e40ab7..82029e3a7af8194db8a2b4b880e1662d0ab3027a 100644 (file)
@@ -25,6 +25,10 @@ elseif(CMAKE_COMPILER_IS_GNUCC)
        set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2 -mfpmath=sse")
        set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -mfpmath=sse")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+       set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2")
+       set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3")
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
 endif()
 
 # for OSL
index 625e8cc1706b6aba2efb18edfc569b002cb26089..6d7c5912cb5a592fe3a1aa58f0c9ad9e62fb7760 100644 (file)
@@ -181,7 +181,7 @@ static void resize(int width, int height)
                options.session->reset(session_buffer_params(), options.session_params.samples);
 }
 
-void keyboard(unsigned char key)
+static void keyboard(unsigned char key)
 {
        if(key == 'r')
                options.session->reset(session_buffer_params(), options.session_params.samples);
index b451b8ef3bf38ea687124020952a784d0a34174d..cefdf5042069db2fc098d33dce40ae419dc4dec7 100644 (file)
@@ -41,6 +41,7 @@ class CyclesRender(bpy.types.RenderEngine):
     bl_use_shading_nodes = True
     bl_use_preview = True
     bl_use_exclude_layers = True
+    bl_use_save_buffers = True
 
     def __init__(self):
         self.session = None
index e2836b2cc21d53d86280d35edff990283401cd09..d1f8e7c3a6defa190ff9979aeeb98812abbf7b5e 100644 (file)
@@ -46,6 +46,36 @@ class AddPresetIntegrator(AddPresetBase, Operator):
     preset_subdir = "cycles/integrator"
 
 
+class AddPresetSampling(AddPresetBase, Operator):
+    '''Add a Sampling Preset'''
+    bl_idname = "render.cycles_sampling_preset_add"
+    bl_label = "Add Sampling Preset"
+    preset_menu = "CYCLES_MT_sampling_presets"
+
+    preset_defines = [
+        "cycles = bpy.context.scene.cycles"
+    ]
+
+    preset_values = [
+        "cycles.samples",
+        "cycles.preview_samples",
+        "cycles.aa_samples",
+        "cycles.preview_aa_samples",
+        "cycles.diffuse_samples",
+        "cycles.glossy_samples",
+        "cycles.transmission_samples",
+        "cycles.ao_samples",
+        "cycles.mesh_light_samples",
+        "cycles.subsurface_samples",
+        "cycles.no_caustics",
+        "cycles.blur_glossy",
+        "cycles.squared_samples",
+        "cycles.progressive"
+    ]
+
+    preset_subdir = "cycles/sampling"
+
+
 def register():
     pass
 
index ca49ffccd2a59415d3f5cc4241aba5c49ca0efbf..eba94604a88c436b804f16f9e27ec5fd5c698e06 100644 (file)
@@ -150,6 +150,11 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
                 description="Use progressive sampling of lighting",
                 default=True,
                 )
+        cls.squared_samples = BoolProperty(
+                name="Squared Samples",
+                description="Square sampling values for easier artist control",
+                default=False,
+                )
 
         cls.samples = IntProperty(
                 name="Samples",
index b80ab6b1c5ecdb1f1fa354e01859e4e404859710..1a17675cb71d83084f8318f2c0e689b0ec9399e5 100644 (file)
@@ -23,6 +23,14 @@ import bpy
 from bpy.types import Panel, Menu, Operator
 
 
+class CYCLES_MT_sampling_presets(Menu):
+    bl_label = "Sampling Presets"
+    preset_subdir = "cycles/sampling"
+    preset_operator = "script.execute_preset"
+    COMPAT_ENGINES = {'CYCLES'}
+    draw = Menu.draw_preset
+
+
 class CYCLES_MT_integrator_presets(Menu):
     bl_label = "Integrator Presets"
     preset_subdir = "cycles/integrator"
@@ -52,20 +60,30 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
         scene = context.scene
         cscene = scene.cycles
         device_type = context.user_preferences.system.compute_device_type
+        
+        row = layout.row(align=True)
+        row.menu("CYCLES_MT_sampling_presets", text=bpy.types.CYCLES_MT_sampling_presets.bl_label)
+        row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMIN")
+        row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
 
+        row = layout.row()
+        sub = row.row()
+        sub.active = (device_type == 'NONE' or cscene.device == 'CPU')
+        sub.prop(cscene, "progressive")
+        row.prop(cscene, "squared_samples")
+        
         split = layout.split()
-
+        
         col = split.column()
-        col.prop(cscene, "progressive")
-
         sub = col.column(align=True)
+        sub.label("Settings:")
         sub.prop(cscene, "seed")
         sub.prop(cscene, "sample_clamp")
 
-        if cscene.progressive:
+        if cscene.progressive or (device_type != 'NONE' and cscene.device == 'GPU'):
             col = split.column()
-            col.label(text="Samples:")
             sub = col.column(align=True)
+            sub.label(text="Samples:")
             sub.prop(cscene, "samples", text="Render")
             sub.prop(cscene, "preview_samples", text="Preview")
         else:
@@ -74,8 +92,8 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
             sub.prop(cscene, "preview_aa_samples", text="Preview")
 
             col = split.column()
-            col.label(text="Samples:")
             sub = col.column(align=True)
+            sub.label(text="Samples:")
             sub.prop(cscene, "diffuse_samples", text="Diffuse")
             sub.prop(cscene, "glossy_samples", text="Glossy")
             sub.prop(cscene, "transmission_samples", text="Transmission")
@@ -211,21 +229,23 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
         subsub.enabled = not rd.use_border
         subsub.prop(rd, "use_save_buffers")
 
-        col = split.column()
+        col = split.column(align=True)
 
-        sub = col.column(align=True)
-        sub.label(text="Acceleration structure:")
-        sub.prop(cscene, "debug_bvh_type", text="")
-        sub.prop(cscene, "debug_use_spatial_splits")
-        sub.prop(cscene, "use_cache")
+        col.label(text="Viewport:")
+        col.prop(cscene, "debug_bvh_type", text="")
+        col.separator()
+        col.prop(cscene, "preview_start_resolution")
 
-        sub = col.column(align=True)
-        sub.label(text="Viewport:")
-        sub.prop(cscene, "preview_start_resolution")
+        col.separator()
 
-        sub = col.column(align=True)
-        sub.label(text="Final Render:")
-        sub.prop(rd, "use_persistent_data", text="Persistent Images")
+        col.label(text="Final Render:")
+        col.prop(cscene, "use_cache")
+        col.prop(rd, "use_persistent_data", text="Persistent Images")
+
+        col.separator()
+
+        col.label(text="Acceleration structure:")   
+        col.prop(cscene, "debug_use_spatial_splits")
 
 
 class CyclesRender_PT_opengl(CyclesButtonsPanel, Panel):
@@ -628,6 +648,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
         lamp = context.lamp
         clamp = lamp.cycles
         cscene = context.scene.cycles
+        device_type = context.user_preferences.system.compute_device_type
 
         layout.prop(lamp, "type", expand=True)
 
@@ -646,7 +667,7 @@ 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:
+        if not cscene.progressive and (device_type == 'NONE' or cscene.device == 'CPU'):
             col.prop(clamp, "samples")
 
         col = split.column()
@@ -835,6 +856,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
         world = context.world
         cworld = world.cycles
         cscene = context.scene.cycles
+        device_type = context.user_preferences.system.compute_device_type
 
         col = layout.column()
 
@@ -842,7 +864,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
         sub = col.row(align=True)
         sub.active = cworld.sample_as_light
         sub.prop(cworld, "sample_map_resolution")
-        if not cscene.progressive:
+        if not cscene.progressive and (device_type == 'NONE' or cscene.device == 'CPU'):
             sub.prop(cworld, "samples")
 
 
index d628fa04f92170fb8ec772f39e26187fff25a485..55282a1ec00b36705085d52eb7adced8d066a0dd 100644 (file)
@@ -212,13 +212,27 @@ static void mikk_compute_tangents(BL::Mesh b_mesh, BL::MeshTextureFaceLayer b_la
 
 static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<uint>& used_shaders)
 {
-       /* create vertices */
+       /* count vertices and faces */
+       int numverts = b_mesh.vertices.length();
+       int numfaces = b_mesh.tessfaces.length();
+       int numtris = 0;
+
        BL::Mesh::vertices_iterator v;
+       BL::Mesh::tessfaces_iterator f;
 
-       for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end(); ++v)
-               mesh->verts.push_back(get_float3(v->co()));
+       for(b_mesh.tessfaces.begin(f); f != b_mesh.tessfaces.end(); ++f) {
+               int4 vi = get_int4(f->vertices_raw());
+               numtris += (vi[3] == 0)? 1: 2;
+       }
+
+       /* reserve memory */
+       mesh->reserve(numverts, numtris, 0, 0);
+
+       /* create vertex coordinates and normals */
+       int i = 0;
+       for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end(); ++v, ++i)
+               mesh->verts[i] = get_float3(v->co());
 
-       /* create vertex normals */
        Attribute *attr_N = mesh->attributes.add(ATTR_STD_VERTEX_NORMAL);
        float3 *N = attr_N->data_float3();
 
@@ -226,10 +240,10 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
                *N = get_float3(v->normal());
 
        /* create faces */
-       BL::Mesh::tessfaces_iterator f;
-       vector<int> nverts;
+       vector<int> nverts(numfaces);
+       int fi = 0, ti = 0;
 
-       for(b_mesh.tessfaces.begin(f); f != b_mesh.tessfaces.end(); ++f) {
+       for(b_mesh.tessfaces.begin(f); f != b_mesh.tessfaces.end(); ++f, ++fi) {
                int4 vi = get_int4(f->vertices_raw());
                int n = (vi[3] == 0)? 3: 4;
                int mi = clamp(f->material_index(), 0, used_shaders.size()-1);
@@ -239,18 +253,18 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
                if(n == 4) {
                        if(len_squared(cross(mesh->verts[vi[1]] - mesh->verts[vi[0]], mesh->verts[vi[2]] - mesh->verts[vi[0]])) == 0.0f ||
                                len_squared(cross(mesh->verts[vi[2]] - mesh->verts[vi[0]], mesh->verts[vi[3]] - mesh->verts[vi[0]])) == 0.0f) {
-                               mesh->add_triangle(vi[0], vi[1], vi[3], shader, smooth);
-                               mesh->add_triangle(vi[2], vi[3], vi[1], shader, smooth);
+                               mesh->set_triangle(ti++, vi[0], vi[1], vi[3], shader, smooth);
+                               mesh->set_triangle(ti++, vi[2], vi[3], vi[1], shader, smooth);
                        }
                        else {
-                               mesh->add_triangle(vi[0], vi[1], vi[2], shader, smooth);
-                               mesh->add_triangle(vi[0], vi[2], vi[3], shader, smooth);
+                               mesh->set_triangle(ti++, vi[0], vi[1], vi[2], shader, smooth);
+                               mesh->set_triangle(ti++, vi[0], vi[2], vi[3], shader, smooth);
                        }
                }
                else
-                       mesh->add_triangle(vi[0], vi[1], vi[2], shader, smooth);
+                       mesh->set_triangle(ti++, vi[0], vi[1], vi[2], shader, smooth);
 
-               nverts.push_back(n);
+               nverts[fi] = n;
        }
 
        /* create vertex color attributes */
@@ -448,7 +462,6 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
        mesh_synced.insert(mesh);
 
        /* create derived mesh */
-       bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
        PointerRNA cmesh = RNA_pointer_get(&b_ob_data.ptr, "cycles");
 
        vector<Mesh::Triangle> oldtriangle = mesh->triangles;
@@ -462,6 +475,10 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
        mesh->name = ustring(b_ob_data.name().c_str());
 
        if(render_layer.use_surfaces || render_layer.use_hair) {
+               if(preview)
+                       b_ob.update_from_editmode();
+
+               bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
                BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview, need_undeformed);
 
                if(b_mesh) {
index 4a72341cd8c5193379a9df9e2191caf639880193..b2235c36af037b51fa2bbba4492003deb0e00693 100644 (file)
@@ -154,10 +154,16 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI
        light->shader = used_shaders[0];
 
        /* shadow */
+       PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
        PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles");
        light->cast_shadow = get_boolean(clamp, "cast_shadow");
        light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling");
-       light->samples = get_int(clamp, "samples");
+       
+       int samples = get_int(clamp, "samples");
+       if(get_boolean(cscene, "squared_samples"))
+               light->samples = samples * samples;
+       else
+               light->samples = samples;
 
        /* visibility */
        uint visibility = object_ray_visibility(b_ob);
@@ -174,6 +180,7 @@ void BlenderSync::sync_background_light()
        BL::World b_world = b_scene.world();
 
        if(b_world) {
+               PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
                PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
                bool sample_as_light = get_boolean(cworld, "sample_as_light");
 
@@ -188,8 +195,13 @@ 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;
+                               
+                               int samples = get_int(cworld, "samples");
+                               if(get_boolean(cscene, "squared_samples"))
+                                       light->samples = samples * samples;
+                               else
+                                       light->samples = samples;
 
                                light->tag_update(scene);
                                light_map.set_recalc(b_world);
@@ -304,7 +316,7 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
                }
 
                if (b_dupli_ob) {
-                       object->dupli_generated = get_float3(b_dupli_ob.orco());
+                       object->dupli_generated = 0.5f*get_float3(b_dupli_ob.orco()) - make_float3(0.5f, 0.5f, 0.5f);
                        object->dupli_uv = get_float2(b_dupli_ob.uv());
                }
                else {
index 86bdbc0749f572ca3667eb4772ec3945ac36ab2b..3a46897fcac673284c71289aac12a7fd602cf205 100644 (file)
@@ -279,6 +279,11 @@ void BlenderSession::do_write_update_render_tile(RenderTile& rtile, bool do_upda
 
        BL::RenderResult::layers_iterator b_single_rlay;
        b_rr.layers.begin(b_single_rlay);
+
+       /* layer will be missing if it was disabled in the UI */
+       if(b_single_rlay == b_rr.layers.end())
+               return;
+
        BL::RenderLayer b_rlay = *b_single_rlay;
 
        if (do_update_only) {
index d0b83d9e55379e50f40406b8adb1669b2c694d8d..469ba15d291fa7a7746f892495faf18935f08f95 100644 (file)
@@ -260,8 +260,8 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
                BL::ShaderNodeVectorTransform b_vector_transform_node(b_node);
                VectorTransformNode *vtransform = new VectorTransformNode();
                vtransform->type = VectorTransformNode::type_enum[b_vector_transform_node.type()];
-               vtransform->convert_from = VectorTransformNode::convert_from_enum[b_vector_transform_node.convert_from()];
-               vtransform->convert_to = VectorTransformNode::convert_to_enum[b_vector_transform_node.convert_to()];
+               vtransform->convert_from = VectorTransformNode::convert_space_enum[b_vector_transform_node.convert_from()];
+               vtransform->convert_to = VectorTransformNode::convert_space_enum[b_vector_transform_node.convert_to()];
                node = vtransform;
        }
        else if (b_node.is_a(&RNA_ShaderNodeNormal)) {
index be5f0692dbde6e1cbdee5587a4d71683bdef8416..11e2be5e0fb0cd483f8e7d6540d86297a4979fcc 100644 (file)
@@ -191,14 +191,33 @@ void BlenderSync::sync_integrator()
        }
 #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->subsurface_samples = get_int(cscene, "subsurface_samples");
        integrator->progressive = get_boolean(cscene, "progressive");
 
+       int diffuse_samples = get_int(cscene, "diffuse_samples");
+       int glossy_samples = get_int(cscene, "glossy_samples");
+       int transmission_samples = get_int(cscene, "transmission_samples");
+       int ao_samples = get_int(cscene, "ao_samples");
+       int mesh_light_samples = get_int(cscene, "mesh_light_samples");
+       int subsurface_samples = get_int(cscene, "subsurface_samples");
+
+       if(get_boolean(cscene, "squared_samples")) {
+               integrator->diffuse_samples = diffuse_samples * diffuse_samples;
+               integrator->glossy_samples = glossy_samples * glossy_samples;
+               integrator->transmission_samples = transmission_samples * transmission_samples;
+               integrator->ao_samples = ao_samples * ao_samples;
+               integrator->mesh_light_samples = mesh_light_samples * mesh_light_samples;
+               integrator->subsurface_samples = subsurface_samples * subsurface_samples;
+       } 
+       else {
+               integrator->diffuse_samples = diffuse_samples;
+               integrator->glossy_samples = glossy_samples;
+               integrator->transmission_samples = transmission_samples;
+               integrator->ao_samples = ao_samples;
+               integrator->mesh_light_samples = mesh_light_samples;
+               integrator->subsurface_samples = subsurface_samples;
+       }
+       
+
        if(experimental)
                integrator->sampling_pattern = (SamplingPattern)RNA_enum_get(&cscene, "sampling_pattern");
 
@@ -300,8 +319,13 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
                        render_layer.use_localview = false;
 
                        render_layer.bound_samples = (use_layer_samples == 1);
-                       if(use_layer_samples != 2)
-                               render_layer.samples = b_rlay->samples();
+                       if(use_layer_samples != 2) {
+                               int samples = b_rlay->samples();
+                               if(get_boolean(cscene, "squared_samples"))
+                                       render_layer.samples = samples * samples;
+                               else
+                                       render_layer.samples = samples;
+                       }
                }
 
                first_layer = false;
@@ -385,24 +409,36 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
        params.background = background;
 
        /* samples */
-       if(get_boolean(cscene, "progressive") == 0) {
+       int samples = get_int(cscene, "samples");
+       int aa_samples = get_int(cscene, "aa_samples");
+       int preview_samples = get_int(cscene, "preview_samples");
+       int preview_aa_samples = get_int(cscene, "preview_aa_samples");
+       
+       if(get_boolean(cscene, "squared_samples")) {
+               samples = samples * samples;
+               aa_samples = aa_samples * aa_samples;
+               preview_samples = preview_samples * preview_samples;
+               preview_aa_samples = preview_aa_samples * preview_aa_samples;
+       }
+
+       if(get_boolean(cscene, "progressive") == 0 && params.device.type == DEVICE_CPU) {
                if(background) {
-                       params.samples = get_int(cscene, "aa_samples");
+                       params.samples = aa_samples;
                }
                else {
-                       params.samples = get_int(cscene, "preview_aa_samples");
+                       params.samples = preview_aa_samples;
                        if(params.samples == 0)
-                               params.samples = INT_MAX;
+                               params.samples = USHRT_MAX;
                }
        }
        else {
                if(background) {
-                       params.samples = get_int(cscene, "samples");
+                       params.samples = samples;
                }
                else {
-                       params.samples = get_int(cscene, "preview_samples");
+                       params.samples = preview_samples;
                        if(params.samples == 0)
-                               params.samples = INT_MAX;
+                               params.samples = USHRT_MAX;
                }
        }
 
index ed1f2b9d70f0d29fc7658788fd4f7b7fce0663c9..da86bafa9365621a4cc6cf8a7915c5b9f83cdf64 100644 (file)
@@ -127,6 +127,7 @@ private:
                  use_surfaces(true),
                  use_hair(true),
                  use_viewport_visibility(false),
+                 use_localview(false),
                  samples(0), bound_samples(false)
                {}
 
index 00c146143b84b8acd64ee827520441a0031e9256..f2c96638b8454d817beb80b26a336080f304bef6 100644 (file)
@@ -46,7 +46,7 @@ class Progress;
 
 struct PackedBVH {
        /* BVH nodes storage, one node is 4x int4, and contains two bounding boxes,
-        * and child, triangle or object indexes dependening on the node type */
+        * and child, triangle or object indexes depending on the node type */
        array<int4> nodes; 
        /* object index to BVH node index mapping for instances */
        array<int> object_node; 
index e6d3922d3be53b21298ed7100fe3b4971b8d215b..7b31b9ba157e366af934de0c63a0a904d19d7c0f 100644 (file)
@@ -53,7 +53,6 @@ public:
        string description;
        string id;
        int num;
-       int extended_images;
        bool display_device;
        bool advanced_shading;
        bool pack_images;
@@ -64,7 +63,6 @@ public:
                type = DEVICE_CPU;
                id = "CPU";
                num = 0;
-               extended_images = false;
                display_device = false;
                advanced_shading = true;
                pack_images = false;
index e0e06683883e54a29bb58d75fd967b182eaa683a..7bc84878dab6511df007fd1b5c6bc5fd0d1d48ae 100644 (file)
@@ -307,8 +307,7 @@ public:
 
        void task_add(DeviceTask& task)
        {
-               /* split task into smaller ones, more than number of threads for uneven
-                * workloads where some parts of the image render slower than others */
+               /* split task into smaller ones */
                list<DeviceTask> tasks;
                task.split(tasks, TaskScheduler::num_threads());
 
@@ -340,7 +339,6 @@ void device_cpu_info(vector<DeviceInfo>& devices)
        info.description = system_cpu_brand_string();
        info.id = "CPU";
        info.num = 0;
-       info.extended_images = true;
        info.advanced_shading = true;
        info.pack_images = false;
 
index 65dd001f70f6885b6492c18ae76cbfb678084d25..4441ff1c69fe708b0adbb257cc0223f34685bdfa 100644 (file)
@@ -1021,7 +1021,6 @@ void device_cuda_info(vector<DeviceInfo>& devices)
                int major, minor;
                cuDeviceComputeCapability(&major, &minor, num);
                info.advanced_shading = (major >= 2);
-               info.extended_images = (major >= 3);
                info.pack_images = false;
 
                /* if device has a kernel timeout, assume it is used for display */
index 02db5b8483186453f39f60410a6123afbe0bc8d9..807bfe578f30b2fe6b3ec69554db8590433da491 100644 (file)
@@ -330,7 +330,6 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
 
        info.advanced_shading = with_advanced_shading;
        info.pack_images = false;
-       info.extended_images = true;
 
        foreach(DeviceInfo& subinfo, devices) {
                if(subinfo.type == type) {
@@ -354,7 +353,6 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
                        if(subinfo.display_device)
                                info.display_device = true;
                        info.pack_images = info.pack_images || subinfo.pack_images;
-                       info.extended_images = info.extended_images && subinfo.extended_images;
                        num_added++;
                }
        }
index 4b9ef8893f708698c699e4f569f1e717cd794238..c3cffc15ebe2e35c3372288c405e7eb1403da1d0 100644 (file)
@@ -166,6 +166,12 @@ __device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float ra
 
        ray->D = panorama_to_direction(kg, Pcamera.x, Pcamera.y);
 
+       /* indicates ray should not receive any light, outside of the lens */
+       if(is_zero(ray->D)) {   
+               ray->t = 0.0f;
+               return;
+       }
+
        /* modify ray for depth of field */
        float aperturesize = kernel_data.cam.aperturesize;
 
@@ -186,12 +192,6 @@ __device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float ra
                ray->D = normalize(Pfocus - ray->P);
        }
 
-       /* indicates ray should not receive any light, outside of the lens */
-       if(is_zero(ray->D)) {   
-               ray->t = 0.0f;
-               return;
-       }
-
        /* transform ray from camera to world */
        Transform cameratoworld = kernel_data.cam.cameratoworld;
 
index ae2e35e8d93be2d1e75dd3d06844576578455866..b4ece1610beee096528a887d8feb6f7fa4e95f29 100644 (file)
@@ -57,7 +57,7 @@ __device void kernel_shader_evaluate(KernelGlobals *kg, __global uint4 *input, _
 #endif
 
                /* setup shader data */
-               shader_setup_from_background(kg, &sd, &ray);
+               shader_setup_from_background(kg, &sd, &ray, 0);
 
                /* evaluate */
                int flag = 0; /* we can't know which type of BSDF this is for */
index 77dc59d2691fe4fed592e19141fe4007ad35f043..a6bd3ed2850dc53a4ab31965a95ab496c1a913ee 100644 (file)
@@ -21,7 +21,7 @@ CCL_NAMESPACE_BEGIN
 /* Direction Emission */
 
 __device_noinline float3 direct_emissive_eval(KernelGlobals *kg, float rando,
-       LightSample *ls, float u, float v, float3 I, differential3 dI, float t, float time)
+       LightSample *ls, float u, float v, float3 I, differential3 dI, float t, float time, int bounce)
 {
        /* setup shading at emitter */
        ShaderData sd;
@@ -41,7 +41,7 @@ __device_noinline float3 direct_emissive_eval(KernelGlobals *kg, float rando,
 #ifdef __CAMERA_MOTION__
                ray.time = time;
 #endif
-               shader_setup_from_background(kg, &sd, &ray);
+               shader_setup_from_background(kg, &sd, &ray, bounce+1);
                eval = shader_eval_background(kg, &sd, 0, SHADER_CONTEXT_EMISSION);
        }
        else
@@ -49,10 +49,10 @@ __device_noinline float3 direct_emissive_eval(KernelGlobals *kg, float rando,
        {
 #ifdef __HAIR__
                if(ls->type == LIGHT_STRAND)
-                       shader_setup_from_sample(kg, &sd, ls->P, ls->Ng, I, ls->shader, ls->object, ls->prim, u, v, t, time, ls->prim);
+                       shader_setup_from_sample(kg, &sd, ls->P, ls->Ng, I, ls->shader, ls->object, ls->prim, u, v, t, time, bounce+1, ls->prim);
                else
 #endif
-                       shader_setup_from_sample(kg, &sd, ls->P, ls->Ng, I, ls->shader, ls->object, ls->prim, u, v, t, time, ~0);
+                       shader_setup_from_sample(kg, &sd, ls->P, ls->Ng, I, ls->shader, ls->object, ls->prim, u, v, t, time, bounce+1, ~0);
 
                ls->Ng = sd.Ng;
 
@@ -74,7 +74,7 @@ __device_noinline float3 direct_emissive_eval(KernelGlobals *kg, float rando,
 
 __device_noinline bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex,
        float randt, float rando, float randu, float randv, Ray *ray, BsdfEval *eval,
-       bool *is_lamp)
+       bool *is_lamp, int bounce)
 {
        LightSample ls;
 
@@ -97,7 +97,7 @@ __device_noinline bool direct_emission(KernelGlobals *kg, ShaderData *sd, int li
        differential3 dD = differential3_zero();
 
        /* evaluate closure */
-       float3 light_eval = direct_emissive_eval(kg, rando, &ls, randu, randv, -ls.D, dD, ls.t, sd->time);
+       float3 light_eval = direct_emissive_eval(kg, rando, &ls, randu, randv, -ls.D, dD, ls.t, sd->time, bounce);
 
        if(is_zero(light_eval))
                return false;
@@ -185,7 +185,7 @@ __device_noinline float3 indirect_primitive_emission(KernelGlobals *kg, ShaderDa
 
 /* Indirect Lamp Emission */
 
-__device_noinline bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf, float randt, float3 *emission)
+__device_noinline bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf, float randt, float3 *emission, int bounce)
 {
        LightSample ls;
        int lamp = lamp_light_eval_sample(kg, randt);
@@ -209,7 +209,7 @@ __device_noinline bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int p
        /* todo: missing texture coordinates */
        float u = 0.0f;
        float v = 0.0f;
-       float3 L = direct_emissive_eval(kg, 0.0f, &ls, u, v, -ray->D, ray->dD, ls.t, ray->time);
+       float3 L = direct_emissive_eval(kg, 0.0f, &ls, u, v, -ray->D, ray->dD, ls.t, ray->time, bounce);
 
        if(!(path_flag & PATH_RAY_MIS_SKIP)) {
                /* multiple importance sampling, get regular light pdf,
@@ -224,7 +224,7 @@ __device_noinline bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int p
 
 /* Indirect Background */
 
-__device_noinline float3 indirect_background(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf)
+__device_noinline float3 indirect_background(KernelGlobals *kg, Ray *ray, int path_flag, float bsdf_pdf, int bounce)
 {
 #ifdef __BACKGROUND__
        int shader = kernel_data.background.shader;
@@ -240,7 +240,7 @@ __device_noinline float3 indirect_background(KernelGlobals *kg, Ray *ray, int pa
 
        /* evaluate background closure */
        ShaderData sd;
-       shader_setup_from_background(kg, &sd, ray);
+       shader_setup_from_background(kg, &sd, ray, bounce+1);
 
        float3 L = shader_eval_background(kg, &sd, path_flag, SHADER_CONTEXT_EMISSION);
 
index 4983122fb346b2f2a11dcd5042b6f98be99528c7..5091eac41db6f4a34ee93de0fa11129161a2f767 100644 (file)
@@ -271,7 +271,7 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
                        ls->pdf = invarea;
 
                        if(type == LIGHT_SPOT) {
-                               /* spot light attentuation */
+                               /* spot light attenuation */
                                float4 data2 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 2);
                                ls->eval_fac *= spot_light_attenuation(data1, data2, ls);
                        }
index 6e1843df50d6ccbf6ed9c39529331cbe4aa01565..40ecb1be91b99bf7feb3f9e9648da5265b6b33de 100644 (file)
@@ -215,7 +215,7 @@ __device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ra
                                        return true;
 
                                ShaderData sd;
-                               shader_setup_from_ray(kg, &sd, &isect, ray);
+                               shader_setup_from_ray(kg, &sd, &isect, ray, state->bounce+1);
                                shader_eval_surface(kg, &sd, 0.0f, PATH_RAY_SHADOW, SHADER_CONTEXT_SHADOW);
 
                                throughput *= shader_bsdf_transparency(kg, &sd);
@@ -300,7 +300,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
                        float light_t = path_rng_1D(kg, rng, sample, num_samples, rng_offset + PRNG_LIGHT);
                        float3 emission;
 
-                       if(indirect_lamp_emission(kg, &light_ray, state.flag, ray_pdf, light_t, &emission))
+                       if(indirect_lamp_emission(kg, &light_ray, state.flag, ray_pdf, light_t, &emission, state.bounce))
                                path_radiance_accum_emission(&L, throughput, emission, state.bounce);
                }
 #endif
@@ -318,7 +318,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
 
 #ifdef __BACKGROUND__
                        /* sample background shader */
-                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
+                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf, state.bounce);
                        path_radiance_accum_background(&L, throughput, L_background, state.bounce);
 #endif
 
@@ -327,7 +327,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
 
                /* setup shading */
                ShaderData sd;
-               shader_setup_from_ray(kg, &sd, &isect, &ray);
+               shader_setup_from_ray(kg, &sd, &isect, &ray, state.bounce);
                float rbsdf = path_rng_1D(kg, rng, sample, num_samples, rng_offset + PRNG_BSDF);
                shader_eval_surface(kg, &sd, rbsdf, state.flag, SHADER_CONTEXT_MAIN);
 
@@ -464,7 +464,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
                                light_ray.time = sd.time;
 #endif
 
-                               if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
+                               if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp, state.bounce)) {
                                        /* trace shadow ray */
                                        float3 shadow;
 
@@ -575,7 +575,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
                        float light_t = path_rng_1D(kg, rng, sample, num_total_samples, rng_offset + PRNG_LIGHT);
                        float3 emission;
 
-                       if(indirect_lamp_emission(kg, &light_ray, state.flag, ray_pdf, light_t, &emission))
+                       if(indirect_lamp_emission(kg, &light_ray, state.flag, ray_pdf, light_t, &emission, state.bounce))
                                path_radiance_accum_emission(L, throughput, emission, state.bounce);
                }
 #endif
@@ -583,7 +583,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
                if(!hit) {
 #ifdef __BACKGROUND__
                        /* sample background shader */
-                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
+                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf, state.bounce);
                        path_radiance_accum_background(L, throughput, L_background, state.bounce);
 #endif
 
@@ -592,7 +592,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
 
                /* setup shading */
                ShaderData sd;
-               shader_setup_from_ray(kg, &sd, &isect, &ray);
+               shader_setup_from_ray(kg, &sd, &isect, &ray, state.bounce);
                float rbsdf = path_rng_1D(kg, rng, sample, num_total_samples, rng_offset + PRNG_BSDF);
                shader_eval_surface(kg, &sd, rbsdf, state.flag, SHADER_CONTEXT_INDIRECT);
                shader_merge_closures(kg, &sd);
@@ -706,7 +706,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
 #endif
 
                                /* sample random light */
-                               if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
+                               if(direct_emission(kg, &sd, -1, light_t, light_o, light_u, light_v, &light_ray, &L_light, &is_lamp, state.bounce)) {
                                        /* trace shadow ray */
                                        float3 shadow;
 
@@ -838,7 +838,7 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R
                                float light_u, light_v;
                                path_rng_2D(kg, &lamp_rng, sample*num_samples + j, aa_samples*num_samples, rng_offset + PRNG_LIGHT_U, &light_u, &light_v);
 
-                               if(direct_emission(kg, sd, i, 0.0f, 0.0f, light_u, light_v, &light_ray, &L_light, &is_lamp)) {
+                               if(direct_emission(kg, sd, i, 0.0f, 0.0f, light_u, light_v, &light_ray, &L_light, &is_lamp, state.bounce)) {
                                        /* trace shadow ray */
                                        float3 shadow;
 
@@ -867,7 +867,7 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R
                                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)) {
+                               if(direct_emission(kg, sd, -1, light_t, 0.0f, light_u, light_v, &light_ray, &L_light, &is_lamp, state.bounce)) {
                                        /* trace shadow ray */
                                        float3 shadow;
 
@@ -925,10 +925,7 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R
                        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);
+                       float min_ray_pdf = fminf(bsdf_pdf, FLT_MAX);
 
                        /* modify path state */
                        PathState ps = state;
@@ -1016,7 +1013,7 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
 
 #ifdef __BACKGROUND__
                        /* sample background shader */
-                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
+                       float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf, state.bounce);
                        path_radiance_accum_background(&L, throughput, L_background, state.bounce);
 #endif
 
@@ -1025,7 +1022,7 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
 
                /* setup shading */
                ShaderData sd;
-               shader_setup_from_ray(kg, &sd, &isect, &ray);
+               shader_setup_from_ray(kg, &sd, &isect, &ray, state.bounce);
                shader_eval_surface(kg, &sd, 0.0f, state.flag, SHADER_CONTEXT_MAIN);
                shader_merge_closures(kg, &sd);
 
index 6292adff6a5f76f6e428734857bf8680970d5181..c86ac34a057015b577bc9504af6efbaa95c9cb19 100644 (file)
@@ -141,11 +141,13 @@ __device_inline void path_rng_2D(KernelGlobals *kg, RNG *rng, int sample, int nu
                int p = *rng + dimension;
                cmj_sample_2D(sample, num_samples, p, fx, fy);
        }
+       else
 #endif
-
-       /* sobol */
-       *fx = path_rng_1D(kg, rng, sample, num_samples, dimension);
-       *fy = path_rng_1D(kg, rng, sample, num_samples, dimension + 1);
+       {
+               /* sobol */
+               *fx = path_rng_1D(kg, rng, sample, num_samples, dimension);
+               *fy = path_rng_1D(kg, rng, sample, num_samples, dimension + 1);
+       }
 }
 
 __device_inline void path_rng_init(KernelGlobals *kg, __global uint *rng_state, int sample, int num_samples, RNG *rng, int x, int y, float *fx, float *fy)
index ca4d878daa05553286d734b673fb1fa86f411348..b902230a9b90585c20e2851deca5f6c5fb4080f3 100644 (file)
@@ -64,7 +64,7 @@ __device_noinline
 __device
 #endif
 void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
-       const Intersection *isect, const Ray *ray)
+       const Intersection *isect, const Ray *ray, int bounce)
 {
 #ifdef __INSTANCING__
        sd->object = (isect->object == ~0)? kernel_tex_fetch(__prim_object, isect->prim): isect->object;
@@ -80,6 +80,7 @@ void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
 
        sd->prim = kernel_tex_fetch(__prim_index, isect->prim);
        sd->ray_length = isect->t;
+       sd->ray_depth = bounce;
 
 #ifdef __HAIR__
        if(kernel_tex_fetch(__prim_segment, isect->prim) != ~0) {
@@ -277,7 +278,7 @@ __device
 #endif
 void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd,
        const float3 P, const float3 Ng, const float3 I,
-       int shader, int object, int prim, float u, float v, float t, float time, int segment)
+       int shader, int object, int prim, float u, float v, float t, float time, int bounce, int segment)
 {
        /* vectors */
        sd->P = P;
@@ -300,6 +301,7 @@ void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd,
        sd->v = v;
 #endif
        sd->ray_length = t;
+       sd->ray_depth = bounce;
 
        /* detect instancing, for non-instanced the object index is -object-1 */
 #ifdef __INSTANCING__
@@ -408,12 +410,12 @@ __device void shader_setup_from_displace(KernelGlobals *kg, ShaderData *sd,
 
        /* watch out: no instance transform currently */
 
-       shader_setup_from_sample(kg, sd, P, Ng, I, shader, object, prim, u, v, 0.0f, TIME_INVALID, ~0);
+       shader_setup_from_sample(kg, sd, P, Ng, I, shader, object, prim, u, v, 0.0f, TIME_INVALID, 0, ~0);
 }
 
 /* ShaderData setup from ray into background */
 
-__device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderData *sd, const Ray *ray)
+__device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderData *sd, const Ray *ray, int bounce)
 {
        /* vectors */
        sd->P = ray->D;
@@ -426,6 +428,7 @@ __device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderData
        sd->time = ray->time;
 #endif
        sd->ray_length = 0.0f;
+       sd->ray_depth = bounce;
 
 #ifdef __INSTANCING__
        sd->object = ~0;
@@ -931,15 +934,8 @@ __device void shader_merge_closures(KernelGlobals *kg, ShaderData *sd)
                                sci->sample_weight += scj->sample_weight;
 
                                int size = sd->num_closure - (j+1);
-                               if(size > 0) {
-#ifdef __KERNEL_GPU__
-                                       for(int k = 0; k < size; k++) {
-                                               scj[k] = scj[k+1];
-                                       }
-#else
+                               if(size > 0)
                                        memmove(scj, scj+1, size*sizeof(ShaderClosure));
-#endif
-                               }
 
                                sd->num_closure--;
                                j--;
index f09bb95046bc37177d4e3e856f2cc7ed535a4951..55c6e15ad04b20d0dc9631037c9b62c692c6522d 100644 (file)
@@ -176,61 +176,6 @@ KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_097)
 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_098)
 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_099)
 
-/* Kepler and above */
-#if defined(__KERNEL_CUDA__) && __CUDA_ARCH__ >= 300
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_100)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_101)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_102)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_103)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_104)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_105)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_106)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_107)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_108)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_109)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_110)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_111)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_112)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_113)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_114)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_115)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_116)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_117)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_118)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_119)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_120)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_121)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_122)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_123)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_124)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_125)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_126)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_127)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_128)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_129)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_130)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_131)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_132)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_133)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_134)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_135)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_136)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_137)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_138)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_139)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_140)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_141)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_142)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_143)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_144)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_145)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_146)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_147)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_148)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_149)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_150)
-#endif
-
 /* packed image (opencl) */
 KERNEL_TEX(uchar4, texture_uchar4, __tex_image_packed)
 KERNEL_TEX(uint4, texture_uint4, __tex_image_packed_info)
index 348e8b8a5f1f1866e44781f612b1b4810560779e..1010fdea627e8cb497ab76e8637eabe034d1a369 100644 (file)
@@ -44,11 +44,11 @@ CCL_NAMESPACE_BEGIN
 #define BSSRDF_MIN_RADIUS                      1e-8f
 #define BSSRDF_MAX_ATTEMPTS                    8
 
-#define BB_DRAPPER 800.0
-#define BB_MAX_TABLE_RANGE 12000.0
-#define BB_TABLE_XPOWER 1.5
-#define BB_TABLE_YPOWER 5.0
-#define BB_TABLE_SPACING 2.0
+#define BB_DRAPPER                             800.0
+#define BB_MAX_TABLE_RANGE             12000.0
+#define BB_TABLE_XPOWER                        1.5
+#define BB_TABLE_YPOWER                        5.0
+#define BB_TABLE_SPACING               2.0
 
 #define TEX_NUM_FLOAT_IMAGES   5
 
@@ -68,7 +68,6 @@ CCL_NAMESPACE_BEGIN
 #define __KERNEL_SHADING__
 #if __CUDA_ARCH__ >= 200
 #define __KERNEL_ADV_SHADING__
-#define __NON_PROGRESSIVE__
 #endif
 #endif
 
@@ -443,7 +442,7 @@ typedef enum AttributeStandard {
 
 /* Closure data */
 
-#define MAX_CLOSURE 16
+#define MAX_CLOSURE 64
 
 typedef struct ShaderClosure {
        ClosureType type;
@@ -547,6 +546,9 @@ typedef struct ShaderData {
        
        /* length of the ray being shaded */
        float ray_length;
+       
+       /* ray bounce depth */
+       int ray_depth;
 
 #ifdef __RAY_DIFFERENTIALS__
        /* differential of P. these are orthogonal to Ng, not N */
@@ -814,7 +816,7 @@ typedef struct KernelBSSRDF {
        int pad1, pad2;
 } KernelBSSRDF;
 
-typedef struct KernelBLACKBODY {
+typedef struct KernelBlackbody {
        int table_offset;
        int pad1, pad2, pad3;
 } KernelBLACKBODY;
@@ -829,7 +831,7 @@ typedef struct KernelData {
        KernelBVH bvh;
        KernelCurves curve_kernel_data;
        KernelBSSRDF bssrdf;
-       KernelBLACKBODY blackbody;
+       KernelBlackbody blackbody;
 } KernelData;
 
 CCL_NAMESPACE_END
index e1e43b117e71e623e7e28a30f85cfb9dbd04c6a0..f3b79da88944709407c2da458d769476fffc06d9 100644 (file)
@@ -84,6 +84,7 @@ ustring OSLRenderServices::u_curve_thickness("geom:curve_thickness");
 ustring OSLRenderServices::u_curve_tangent_normal("geom:curve_tangent_normal");
 #endif
 ustring OSLRenderServices::u_path_ray_length("path:ray_length");
+ustring OSLRenderServices::u_path_ray_depth("path:ray_depth");
 ustring OSLRenderServices::u_trace("trace");
 ustring OSLRenderServices::u_hit("hit");
 ustring OSLRenderServices::u_hitdist("hitdist");
@@ -660,6 +661,11 @@ bool OSLRenderServices::get_background_attribute(KernelGlobals *kg, ShaderData *
                float f = sd->ray_length;
                return set_attribute_float(f, type, derivatives, val);
        }
+       else if (name == u_path_ray_depth) {
+               /* Ray Depth */
+               int f = sd->ray_depth;
+               return set_attribute_int(f, type, derivatives, val);
+       }
        else if (name == u_ndc) {
                /* NDC coordinates with special exception for otho */
                OSLThreadData *tdata = kg->osl_tdata;
@@ -919,7 +925,10 @@ bool OSLRenderServices::getmessage(OSL::ShaderGlobals *sg, ustring source, ustri
 
                                if(!tracedata->setup) {
                                        /* lazy shader data setup */
-                                       shader_setup_from_ray(kg, sd, &tracedata->isect, &tracedata->ray);
+                                       ShaderData *original_sd = (ShaderData *)(sg->renderstate);
+                                       int bounce = original_sd->ray_depth + 1;
+
+                                       shader_setup_from_ray(kg, sd, &tracedata->isect, &tracedata->ray, bounce);
                                        tracedata->setup = true;
                                }
 
index ca18c85a1671c742876acb9b27410e328afed4e2..5ec4673ef3799850a53f972b484e111fa665b909 100644 (file)
@@ -135,6 +135,7 @@ public:
        static ustring u_curve_thickness;
        static ustring u_curve_tangent_normal;
        static ustring u_path_ray_length;
+       static ustring u_path_ray_depth;
        static ustring u_trace;
        static ustring u_hit;
        static ustring u_hitdist;
index 4a68eb973be601166f37fd7cd334dd70ebe745a7..3eb0ec4b5e393289e0292ff77d50f29bcf4ab317 100644 (file)
@@ -26,6 +26,8 @@ shader node_blackbody(
        
        /* Scale by luminance */
        float l = luminance(rgb);
-       Color = rgb /= l;
+       if (l != 0.0)
+               rgb /= l;
+       Color = rgb;
 }
 
index 9e3f6c7b4a985c6dd14d41e367c1260046c658f9..ed3c6969970a5bd918e370753f6f4f44f8d3447c 100644 (file)
@@ -26,7 +26,8 @@ shader node_light_path(
        output float IsSingularRay = 0.0,
        output float IsReflectionRay = 0.0,
        output float IsTransmissionRay = 0.0,
-       output float RayLength = 0.0)
+       output float RayLength = 0.0,
+       output float RayDepth = 0.0)
 {
        IsCameraRay = raytype("camera");
        IsShadowRay = raytype("shadow");
@@ -37,5 +38,9 @@ shader node_light_path(
        IsTransmissionRay = raytype("refraction");
 
        getattribute("path:ray_length", RayLength);
+
+       int ray_depth;
+       getattribute("path:ray_depth", ray_depth);
+       RayDepth = (float)ray_depth;
 }
 
index ae0cb1c7a4932e9e67128c4cd910bfae45f800e9..2a501b25ceac732da409b264a01056a46643cd41 100644 (file)
 
 shader node_vector_transform(
        string type = "Vector",
-       string convert_from = "World",
-       string convert_to = "Object",
+       string convert_from = "world",
+       string convert_to = "object",
        vector VectorIn = vector(0.0, 0.0, 0.0),
        output vector VectorOut = vector(0.0, 0.0, 0.0))
 {
-       /* OSL uses lower case variable names here */
-       string from = "world";
-       string to = "object";
-       
-       if (convert_from == "Object")
-               from = "object";
-       else if (convert_from == "Camera")
-               from = "camera";
-               
-       if (convert_to == "World")
-               to = "world";
-       else if (convert_to == "Camera")
-               to = "camera";
-       
-       if (type == "Vector") {
-               VectorOut = transform(from, to, VectorIn);
+       if (type == "Vector" || type == "Normal") {
+               VectorOut = transform(convert_from, convert_to, VectorIn);
+               if (type == "Normal")
+                       VectorOut = normalize(VectorOut);
        }
        else if (type == "Point") {
-               point Point = point(VectorIn[0], VectorIn[1], VectorIn[2]);
-               VectorOut = transform(from, to, Point);
+               point Point = (point)VectorIn;
+               VectorOut = transform(convert_from, convert_to, Point);
        }
 }
 
index 46b2f910f74771a21811ce5633c8d891059370ca..3c6e11ca683237362af09c2d808dfb00471c96d6 100644 (file)
@@ -47,35 +47,36 @@ __device void svm_node_blackbody(KernelGlobals *kg, ShaderData *sd, float *stack
                color_rgb = make_float3(1.0e-6f,0.0f,0.0f);
        }
        else if (temperature <= BB_MAX_TABLE_RANGE) {
-               /* This is the overall size of the table (317*3+3) */
-               const int lookuptablesize = 954;
-               const float lookuptablesizef = 954.0f;
+               /* This is the overall size of the table */
+               const int lookuptablesize = 956;
+               const float lookuptablenormalize = 1.0f/956.0f;
 
                /* reconstruct a proper index for the table lookup, compared to OSL we don't look up two colors
                just one (the OSL-lerp is also automatically done for us by "lookup_table_read") */
-               float t = powf ((temperature - BB_DRAPPER) / BB_TABLE_SPACING, 1.0f/BB_TABLE_XPOWER);
+               float t = powf((temperature - BB_DRAPPER) * (1.0f / BB_TABLE_SPACING), 1.0f/BB_TABLE_XPOWER);
 
                int blackbody_table_offset = kernel_data.blackbody.table_offset;
 
                /* Retrieve colors from the lookup table */
-               float lutval = t/lookuptablesizef;
+               float lutval = t*lookuptablenormalize;
                float R = lookup_table_read(kg, lutval, blackbody_table_offset, lookuptablesize);
-               lutval = (t + 317.0f*1.0f)/lookuptablesizef;
+               lutval = (t + 319.0f*1.0f)*lookuptablenormalize;
                float G = lookup_table_read(kg, lutval, blackbody_table_offset, lookuptablesize);
-               lutval = (t + 317.0f*2.0f)/lookuptablesizef;
+               lutval = (t + 319.0f*2.0f)*lookuptablenormalize;
                float B = lookup_table_read(kg, lutval, blackbody_table_offset, lookuptablesize);
 
                R = powf(R, BB_TABLE_YPOWER);
                G = powf(G, BB_TABLE_YPOWER);
                B = powf(B, BB_TABLE_YPOWER);
 
-               /* Luminance */
-               float l = linear_rgb_to_gray(make_float3(R, G, B));
-
                color_rgb = make_float3(R, G, B);
-               color_rgb /= l;
        }
 
+       /* Luminance */
+       float l = linear_rgb_to_gray(color_rgb);
+       if (l != 0.0f)
+               color_rgb /= l;
+
        if (stack_valid(col_offset))
                stack_store_float3(stack, col_offset, color_rgb);
 }
index 037bfa2d9b9014672ad1c86424b1143f818c7add..57adaa863f111a859ef16482c664b30b233ea3eb 100644 (file)
@@ -229,60 +229,6 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, u
                case 97: r = kernel_tex_image_interp(__tex_image_097, x, y); break;
                case 98: r = kernel_tex_image_interp(__tex_image_098, x, y); break;
                case 99: r = kernel_tex_image_interp(__tex_image_099, x, y); break;
-#if defined(__KERNEL_CUDA__) && __CUDA_ARCH__ >= 300
-               case 100: r = kernel_tex_image_interp(__tex_image_100, x, y); break;
-               case 101: r = kernel_tex_image_interp(__tex_image_101, x, y); break;
-               case 102: r = kernel_tex_image_interp(__tex_image_102, x, y); break;
-               case 103: r = kernel_tex_image_interp(__tex_image_103, x, y); break;
-               case 104: r = kernel_tex_image_interp(__tex_image_104, x, y); break;
-               case 105: r = kernel_tex_image_interp(__tex_image_105, x, y); break;
-               case 106: r = kernel_tex_image_interp(__tex_image_106, x, y); break;
-               case 107: r = kernel_tex_image_interp(__tex_image_107, x, y); break;
-               case 108: r = kernel_tex_image_interp(__tex_image_108, x, y); break;
-               case 109: r = kernel_tex_image_interp(__tex_image_109, x, y); break;
-               case 110: r = kernel_tex_image_interp(__tex_image_110, x, y); break;
-               case 111: r = kernel_tex_image_interp(__tex_image_111, x, y); break;
-               case 112: r = kernel_tex_image_interp(__tex_image_112, x, y); break;
-               case 113: r = kernel_tex_image_interp(__tex_image_113, x, y); break;
-               case 114: r = kernel_tex_image_interp(__tex_image_114, x, y); break;
-               case 115: r = kernel_tex_image_interp(__tex_image_115, x, y); break;
-               case 116: r = kernel_tex_image_interp(__tex_image_116, x, y); break;
-               case 117: r = kernel_tex_image_interp(__tex_image_117, x, y); break;
-               case 118: r = kernel_tex_image_interp(__tex_image_118, x, y); break;
-               case 119: r = kernel_tex_image_interp(__tex_image_119, x, y); break;
-               case 120: r = kernel_tex_image_interp(__tex_image_120, x, y); break;
-               case 121: r = kernel_tex_image_interp(__tex_image_121, x, y); break;
-               case 122: r = kernel_tex_image_interp(__tex_image_122, x, y); break;
-               case 123: r = kernel_tex_image_interp(__tex_image_123, x, y); break;
-               case 124: r = kernel_tex_image_interp(__tex_image_124, x, y); break;
-               case 125: r = kernel_tex_image_interp(__tex_image_125, x, y); break;
-               case 126: r = kernel_tex_image_interp(__tex_image_126, x, y); break;
-               case 127: r = kernel_tex_image_interp(__tex_image_127, x, y); break;
-               case 128: r = kernel_tex_image_interp(__tex_image_128, x, y); break;
-               case 129: r = kernel_tex_image_interp(__tex_image_129, x, y); break;
-               case 130: r = kernel_tex_image_interp(__tex_image_130, x, y); break;
-               case 131: r = kernel_tex_image_interp(__tex_image_131, x, y); break;
-               case 132: r = kernel_tex_image_interp(__tex_image_132, x, y); break;
-               case 133: r = kernel_tex_image_interp(__tex_image_133, x, y); break;
-               case 134: r = kernel_tex_image_interp(__tex_image_134, x, y); break;
-               case 135: r = kernel_tex_image_interp(__tex_image_135, x, y); break;
-               case 136: r = kernel_tex_image_interp(__tex_image_136, x, y); break;
-               case 137: r = kernel_tex_image_interp(__tex_image_137, x, y); break;
-               case 138: r = kernel_tex_image_interp(__tex_image_138, x, y); break;
-               case 139: r = kernel_tex_image_interp(__tex_image_139, x, y); break;
-               case 140: r = kernel_tex_image_interp(__tex_image_140, x, y); break;
-               case 141: r = kernel_tex_image_interp(__tex_image_141, x, y); break;
-               case 142: r = kernel_tex_image_interp(__tex_image_142, x, y); break;
-               case 143: r = kernel_tex_image_interp(__tex_image_143, x, y); break;
-               case 144: r = kernel_tex_image_interp(__tex_image_144, x, y); break;
-               case 145: r = kernel_tex_image_interp(__tex_image_145, x, y); break;
-               case 146: r = kernel_tex_image_interp(__tex_image_146, x, y); break;
-               case 147: r = kernel_tex_image_interp(__tex_image_147, x, y); break;
-               case 148: r = kernel_tex_image_interp(__tex_image_148, x, y); break;
-               case 149: r = kernel_tex_image_interp(__tex_image_149, x, y); break;
-               case 150: r = kernel_tex_image_interp(__tex_image_150, x, y); break;
-#endif
-
                default: 
                        kernel_assert(0);
                        return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
index b29dc9cbd45c436e8e3c287b40386a1e623fc875..0f16ef838942890a0ef15f8fda82ec7d0a79eb0a 100644 (file)
@@ -34,6 +34,7 @@ __device void svm_node_light_path(ShaderData *sd, float *stack, uint type, uint
                case NODE_LP_transmission: info = (path_flag & PATH_RAY_TRANSMIT)? 1.0f: 0.0f; break;
                case NODE_LP_backfacing: info = (sd->flag & SD_BACKFACING)? 1.0f: 0.0f; break;
                case NODE_LP_ray_length: info = sd->ray_length; break;
+               case NODE_LP_ray_depth: info = (float)sd->ray_depth; break;
        }
 
        stack_store_float(stack, out_offset, info);
index 6c47fbc14be0382f889fe97b1153a5e810f001ef..dbfb8d48fbf317b9b4918331a66fea6943f373d5 100644 (file)
@@ -157,7 +157,8 @@ typedef enum NodeLightPath {
        NODE_LP_reflection,
        NODE_LP_transmission,
        NODE_LP_backfacing,
-       NODE_LP_ray_length
+       NODE_LP_ray_length,
+       NODE_LP_ray_depth
 } NodeLightPath;
 
 typedef enum NodeLightFalloff {
@@ -231,20 +232,15 @@ typedef enum NodeVectorMath {
 
 typedef enum NodeVectorTransformType {
        NODE_VECTOR_TRANSFORM_TYPE_VECTOR,
-       NODE_VECTOR_TRANSFORM_TYPE_POINT
+       NODE_VECTOR_TRANSFORM_TYPE_POINT,
+       NODE_VECTOR_TRANSFORM_TYPE_NORMAL
 } NodeVectorTransformType;
 
-typedef enum NodeVectorTransformConvertFrom {
-       NODE_VECTOR_TRANSFORM_CONVERT_FROM_WORLD,
-       NODE_VECTOR_TRANSFORM_CONVERT_FROM_OBJECT,
-       NODE_VECTOR_TRANSFORM_CONVERT_FROM_CAMERA
-} NodeVectorTransformConvertFrom;
-
-typedef enum NodeVectorTransformConvertTo {
-       NODE_VECTOR_TRANSFORM_CONVERT_TO_WORLD,
-       NODE_VECTOR_TRANSFORM_CONVERT_TO_OBJECT,
-       NODE_VECTOR_TRANSFORM_CONVERT_TO_CAMERA
-} NodeVectorTransformConvertTo;
+typedef enum NodeVectorTransformConvertSpace {
+       NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD,
+       NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT,
+       NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA
+} NodeVectorTransformConvertSpace;
 
 typedef enum NodeConvert {
        NODE_CONVERT_FV,
index 8b5369ab62682d4e13f55da6d52d24f567f24de8..17dd72d4f3030b4f38aefd680ba35ca1cd317d0b 100644 (file)
@@ -31,23 +31,24 @@ __device void svm_node_vector_transform(KernelGlobals *kg, ShaderData *sd, float
        float3 in = stack_load_float3(stack, vector_in);
        
        NodeVectorTransformType type = (NodeVectorTransformType)itype;
-       NodeVectorTransformConvertFrom from = (NodeVectorTransformConvertFrom)ifrom;
-       NodeVectorTransformConvertTo to = (NodeVectorTransformConvertTo)ito;
+       NodeVectorTransformConvertSpace from = (NodeVectorTransformConvertSpace)ifrom;
+       NodeVectorTransformConvertSpace to = (NodeVectorTransformConvertSpace)ito;
        
        Transform tfm;
        int is_object = (sd->object != ~0);
+       int is_direction = (type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR || type == NODE_VECTOR_TRANSFORM_TYPE_NORMAL);
        
        /* From world */
-       if(from == NODE_VECTOR_TRANSFORM_CONVERT_FROM_WORLD) {
-               if(to == NODE_VECTOR_TRANSFORM_CONVERT_TO_CAMERA) {
+       if(from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD) {
+               if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) {
                        tfm = kernel_data.cam.worldtocamera;
-                       if(type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR)
+                       if(is_direction)
                                in = transform_direction(&tfm, in);
                        else
                                in = transform_point(&tfm, in);
                }
-               else if (to == NODE_VECTOR_TRANSFORM_CONVERT_TO_OBJECT && is_object) {
-                       if(type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR)
+               else if (to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT && is_object) {
+                       if(is_direction)
                                object_inverse_dir_transform(kg, sd, &in);
                        else
                                object_inverse_position_transform(kg, sd, &in);
@@ -55,16 +56,16 @@ __device void svm_node_vector_transform(KernelGlobals *kg, ShaderData *sd, float
        }
        
        /* From camera */
-       else if (from == NODE_VECTOR_TRANSFORM_CONVERT_FROM_CAMERA) {
-               if(to == NODE_VECTOR_TRANSFORM_CONVERT_TO_WORLD || to == NODE_VECTOR_TRANSFORM_CONVERT_TO_OBJECT) {
+       else if (from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) {
+               if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD || to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) {
                        tfm = kernel_data.cam.cameratoworld;
-                       if(type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR)
+                       if(is_direction)
                                in = transform_direction(&tfm, in);
                        else
                                in = transform_point(&tfm, in);
                }
-               if(to == NODE_VECTOR_TRANSFORM_CONVERT_TO_OBJECT && is_object) {
-                       if(type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR)
+               if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT && is_object) {
+                       if(is_direction)
                                object_inverse_dir_transform(kg, sd, &in);
                        else
                                object_inverse_position_transform(kg, sd, &in);
@@ -72,22 +73,26 @@ __device void svm_node_vector_transform(KernelGlobals *kg, ShaderData *sd, float
        }
        
        /* From object */
-       else if(from == NODE_VECTOR_TRANSFORM_CONVERT_FROM_OBJECT) {
-               if((to == NODE_VECTOR_TRANSFORM_CONVERT_TO_WORLD || to == NODE_VECTOR_TRANSFORM_CONVERT_TO_CAMERA) && is_object) {
-                       if(type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR)
+       else if(from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) {
+               if((to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD || to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) && is_object) {
+                       if(is_direction)
                                object_dir_transform(kg, sd, &in);
                        else
                                object_position_transform(kg, sd, &in);
                }
-               if(to == NODE_VECTOR_TRANSFORM_CONVERT_TO_CAMERA) {
+               if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) {
                        tfm = kernel_data.cam.worldtocamera;
-                       if(type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR)
+                       if(is_direction)
                                in = transform_direction(&tfm, in);
                        else
                                in = transform_point(&tfm, in);
                }
        }
        
+       /* Normalize Normal */
+       if(type == NODE_VECTOR_TRANSFORM_TYPE_NORMAL)
+               in = normalize(in);
+       
        /* Output */    
        if(stack_valid(vector_out)) {
                        stack_store_float3(stack, vector_out, in);
index 75b515aa3cbabd146582efccaca4a7abb8eed56d..467368935d7c8053e810e19f2cc842d0604955f3 100644 (file)
--- a/