[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46915] branches/smoke2: Merge from trunk r46815-r46913
Daniel Genrich
daniel.genrich at gmx.net
Wed May 23 01:26:17 CEST 2012
Revision: 46915
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46915
Author: genscher
Date: 2012-05-22 23:26:17 +0000 (Tue, 22 May 2012)
Log Message:
-----------
Merge from trunk r46815-r46913
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46815
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46913
Modified Paths:
--------------
branches/smoke2/CMakeLists.txt
branches/smoke2/build_files/scons/config/win32-mingw-config.py
branches/smoke2/doc/python_api/examples/bpy.types.Mesh.py
branches/smoke2/doc/python_api/rst/include__bmesh.rst
branches/smoke2/intern/cycles/blender/blender_object.cpp
branches/smoke2/intern/cycles/blender/blender_shader.cpp
branches/smoke2/intern/cycles/kernel/kernel_object.h
branches/smoke2/intern/cycles/kernel/kernel_shader.h
branches/smoke2/intern/cycles/kernel/svm/svm.h
branches/smoke2/intern/cycles/kernel/svm/svm_geometry.h
branches/smoke2/intern/cycles/kernel/svm/svm_types.h
branches/smoke2/intern/cycles/render/nodes.cpp
branches/smoke2/intern/cycles/render/nodes.h
branches/smoke2/intern/cycles/render/object.cpp
branches/smoke2/intern/cycles/render/object.h
branches/smoke2/intern/cycles/util/util_hash.h
branches/smoke2/intern/elbeem/CMakeLists.txt
branches/smoke2/intern/guardedalloc/intern/mmap_win.c
branches/smoke2/release/datafiles/blender_icons.png
branches/smoke2/release/scripts/startup/bl_operators/object.py
branches/smoke2/release/scripts/startup/bl_operators/presets.py
branches/smoke2/release/scripts/startup/bl_operators/wm.py
branches/smoke2/release/scripts/startup/bl_ui/properties_data_armature.py
branches/smoke2/release/scripts/startup/bl_ui/properties_data_mesh.py
branches/smoke2/release/scripts/startup/bl_ui/properties_data_modifier.py
branches/smoke2/release/scripts/startup/bl_ui/properties_material.py
branches/smoke2/release/scripts/startup/bl_ui/properties_texture.py
branches/smoke2/release/scripts/startup/bl_ui/space_info.py
branches/smoke2/release/scripts/startup/bl_ui/space_node.py
branches/smoke2/release/scripts/startup/bl_ui/space_view3d_toolbar.py
branches/smoke2/source/blender/avi/intern/avi.c
branches/smoke2/source/blender/blenkernel/BKE_blender.h
branches/smoke2/source/blender/blenkernel/BKE_key.h
branches/smoke2/source/blender/blenkernel/BKE_mesh.h
branches/smoke2/source/blender/blenkernel/BKE_node.h
branches/smoke2/source/blender/blenkernel/BKE_object.h
branches/smoke2/source/blender/blenkernel/BKE_screen.h
branches/smoke2/source/blender/blenkernel/intern/CCGSubSurf.c
branches/smoke2/source/blender/blenkernel/intern/DerivedMesh.c
branches/smoke2/source/blender/blenkernel/intern/blender.c
branches/smoke2/source/blender/blenkernel/intern/brush.c
branches/smoke2/source/blender/blenkernel/intern/cdderivedmesh.c
branches/smoke2/source/blender/blenkernel/intern/cloth.c
branches/smoke2/source/blender/blenkernel/intern/collision.c
branches/smoke2/source/blender/blenkernel/intern/constraint.c
branches/smoke2/source/blender/blenkernel/intern/customdata.c
branches/smoke2/source/blender/blenkernel/intern/displist.c
branches/smoke2/source/blender/blenkernel/intern/dynamicpaint.c
branches/smoke2/source/blender/blenkernel/intern/editderivedmesh.c
branches/smoke2/source/blender/blenkernel/intern/font.c
branches/smoke2/source/blender/blenkernel/intern/image_gen.c
branches/smoke2/source/blender/blenkernel/intern/key.c
branches/smoke2/source/blender/blenkernel/intern/lattice.c
branches/smoke2/source/blender/blenkernel/intern/mesh.c
branches/smoke2/source/blender/blenkernel/intern/mesh_validate.c
branches/smoke2/source/blender/blenkernel/intern/node.c
branches/smoke2/source/blender/blenkernel/intern/object.c
branches/smoke2/source/blender/blenkernel/intern/ocean.c
branches/smoke2/source/blender/blenkernel/intern/particle.c
branches/smoke2/source/blender/blenkernel/intern/particle_system.c
branches/smoke2/source/blender/blenkernel/intern/pointcache.c
branches/smoke2/source/blender/blenkernel/intern/sequencer.c
branches/smoke2/source/blender/blenkernel/intern/smoke.c
branches/smoke2/source/blender/blenkernel/intern/softbody.c
branches/smoke2/source/blender/blenkernel/intern/subsurf_ccg.c
branches/smoke2/source/blender/blenkernel/intern/text.c
branches/smoke2/source/blender/blenkernel/intern/texture.c
branches/smoke2/source/blender/blenkernel/intern/writeffmpeg.c
branches/smoke2/source/blender/blenlib/intern/math_rotation.c
branches/smoke2/source/blender/blenlib/intern/path_util.c
branches/smoke2/source/blender/blenlib/intern/pbvh.c
branches/smoke2/source/blender/blenlib/intern/string.c
branches/smoke2/source/blender/blenloader/intern/readfile.c
branches/smoke2/source/blender/blenloader/intern/versioning_250.c
branches/smoke2/source/blender/blenloader/intern/versioning_legacy.c
branches/smoke2/source/blender/blenloader/intern/writefile.c
branches/smoke2/source/blender/bmesh/bmesh.h
branches/smoke2/source/blender/bmesh/bmesh_class.h
branches/smoke2/source/blender/bmesh/intern/bmesh_construct.c
branches/smoke2/source/blender/bmesh/intern/bmesh_interp.c
branches/smoke2/source/blender/bmesh/intern/bmesh_marking.c
branches/smoke2/source/blender/bmesh/intern/bmesh_mesh_conv.c
branches/smoke2/source/blender/bmesh/intern/bmesh_operators.c
branches/smoke2/source/blender/bmesh/intern/bmesh_queries.c
branches/smoke2/source/blender/bmesh/intern/bmesh_queries.h
branches/smoke2/source/blender/bmesh/operators/bmo_connect.c
branches/smoke2/source/blender/bmesh/operators/bmo_extrude.c
branches/smoke2/source/blender/bmesh/operators/bmo_utils.c
branches/smoke2/source/blender/collada/ArmatureImporter.cpp
branches/smoke2/source/blender/compositor/intern/COM_Node.cpp
branches/smoke2/source/blender/compositor/intern/COM_WorkScheduler.cpp
branches/smoke2/source/blender/compositor/intern/COM_compositor.cpp
branches/smoke2/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
branches/smoke2/source/blender/compositor/nodes/COM_GlareNode.cpp
branches/smoke2/source/blender/compositor/nodes/COM_MovieClipNode.cpp
branches/smoke2/source/blender/compositor/nodes/COM_MovieDistortionNode.cpp
branches/smoke2/source/blender/compositor/nodes/COM_TextureNode.cpp
branches/smoke2/source/blender/compositor/operations/COM_BokehImageOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_CompositorOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_CompositorOperation.h
branches/smoke2/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_DilateErodeOperation.h
branches/smoke2/source/blender/compositor/operations/COM_GlareBaseOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_ImageOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_MovieClipOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_MovieDistortionOperation.h
branches/smoke2/source/blender/compositor/operations/COM_TextureOperation.cpp
branches/smoke2/source/blender/compositor/operations/COM_TextureOperation.h
branches/smoke2/source/blender/editors/armature/editarmature.c
branches/smoke2/source/blender/editors/armature/meshlaplacian.c
branches/smoke2/source/blender/editors/armature/reeb.c
branches/smoke2/source/blender/editors/curve/editcurve.c
branches/smoke2/source/blender/editors/datafiles/blender_icons.png.c
branches/smoke2/source/blender/editors/datafiles/startup.blend.c
branches/smoke2/source/blender/editors/include/ED_node.h
branches/smoke2/source/blender/editors/include/ED_transform.h
branches/smoke2/source/blender/editors/include/UI_icons.h
branches/smoke2/source/blender/editors/include/UI_resources.h
branches/smoke2/source/blender/editors/interface/interface_draw.c
branches/smoke2/source/blender/editors/interface/interface_handlers.c
branches/smoke2/source/blender/editors/interface/interface_regions.c
branches/smoke2/source/blender/editors/interface/interface_templates.c
branches/smoke2/source/blender/editors/interface/interface_widgets.c
branches/smoke2/source/blender/editors/interface/resources.c
branches/smoke2/source/blender/editors/mesh/editface.c
branches/smoke2/source/blender/editors/mesh/editmesh_knife.c
branches/smoke2/source/blender/editors/mesh/editmesh_rip.c
branches/smoke2/source/blender/editors/mesh/editmesh_select.c
branches/smoke2/source/blender/editors/mesh/editmesh_tools.c
branches/smoke2/source/blender/editors/mesh/mesh_data.c
branches/smoke2/source/blender/editors/object/object_bake.c
branches/smoke2/source/blender/editors/object/object_intern.h
branches/smoke2/source/blender/editors/object/object_modifier.c
branches/smoke2/source/blender/editors/object/object_ops.c
branches/smoke2/source/blender/editors/object/object_select.c
branches/smoke2/source/blender/editors/screen/screen_edit.c
branches/smoke2/source/blender/editors/sculpt_paint/paint_cursor.c
branches/smoke2/source/blender/editors/sculpt_paint/paint_image.c
branches/smoke2/source/blender/editors/sculpt_paint/paint_intern.h
branches/smoke2/source/blender/editors/sculpt_paint/paint_mask.c
branches/smoke2/source/blender/editors/sculpt_paint/paint_ops.c
branches/smoke2/source/blender/editors/sculpt_paint/paint_stroke.c
branches/smoke2/source/blender/editors/sculpt_paint/paint_vertex.c
branches/smoke2/source/blender/editors/sculpt_paint/sculpt.c
branches/smoke2/source/blender/editors/space_clip/clip_draw.c
branches/smoke2/source/blender/editors/space_clip/clip_ops.c
branches/smoke2/source/blender/editors/space_file/filesel.c
branches/smoke2/source/blender/editors/space_file/fsmenu.c
branches/smoke2/source/blender/editors/space_graph/graph_edit.c
branches/smoke2/source/blender/editors/space_image/image_ops.c
branches/smoke2/source/blender/editors/space_logic/logic_window.c
branches/smoke2/source/blender/editors/space_node/drawnode.c
branches/smoke2/source/blender/editors/space_node/node_buttons.c
branches/smoke2/source/blender/editors/space_node/node_draw.c
branches/smoke2/source/blender/editors/space_node/node_edit.c
branches/smoke2/source/blender/editors/space_node/node_intern.h
branches/smoke2/source/blender/editors/space_node/node_ops.c
branches/smoke2/source/blender/editors/space_node/node_select.c
branches/smoke2/source/blender/editors/space_node/node_templates.c
branches/smoke2/source/blender/editors/space_node/space_node.c
branches/smoke2/source/blender/editors/space_outliner/outliner_draw.c
branches/smoke2/source/blender/editors/space_sequencer/sequencer_add.c
branches/smoke2/source/blender/editors/space_sequencer/sequencer_draw.c
branches/smoke2/source/blender/editors/space_sequencer/sequencer_edit.c
branches/smoke2/source/blender/editors/space_text/text_draw.c
branches/smoke2/source/blender/editors/space_view3d/drawobject.c
branches/smoke2/source/blender/editors/space_view3d/view3d_draw.c
branches/smoke2/source/blender/editors/space_view3d/view3d_fly.c
branches/smoke2/source/blender/editors/space_view3d/view3d_view.c
branches/smoke2/source/blender/editors/transform/transform.c
branches/smoke2/source/blender/editors/transform/transform.h
branches/smoke2/source/blender/editors/transform/transform_conversions.c
branches/smoke2/source/blender/editors/transform/transform_input.c
branches/smoke2/source/blender/editors/transform/transform_ops.c
branches/smoke2/source/blender/editors/transform/transform_snap.c
branches/smoke2/source/blender/editors/uvedit/uvedit_ops.c
branches/smoke2/source/blender/editors/uvedit/uvedit_smart_stitch.c
branches/smoke2/source/blender/gpu/intern/gpu_buffers.c
branches/smoke2/source/blender/gpu/intern/gpu_draw.c
branches/smoke2/source/blender/gpu/intern/gpu_material.c
branches/smoke2/source/blender/gpu/shaders/gpu_shader_material.glsl
branches/smoke2/source/blender/gpu/shaders/gpu_shader_material.glsl.c
branches/smoke2/source/blender/imbuf/intern/anim_movie.c
branches/smoke2/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
branches/smoke2/source/blender/imbuf/intern/filter.c
branches/smoke2/source/blender/imbuf/intern/indexer_dv.c
branches/smoke2/source/blender/imbuf/intern/tiff.c
branches/smoke2/source/blender/imbuf/intern/util.c
branches/smoke2/source/blender/makesdna/DNA_customdata_types.h
branches/smoke2/source/blender/makesdna/DNA_meshdata_types.h
branches/smoke2/source/blender/makesdna/DNA_modifier_types.h
branches/smoke2/source/blender/makesdna/DNA_node_types.h
branches/smoke2/source/blender/makesdna/DNA_object_types.h
branches/smoke2/source/blender/makesdna/DNA_scene_types.h
branches/smoke2/source/blender/makesdna/DNA_userdef_types.h
branches/smoke2/source/blender/makesdna/intern/dna_genfile.c
branches/smoke2/source/blender/makesdna/intern/makesdna.c
branches/smoke2/source/blender/makesrna/RNA_access.h
branches/smoke2/source/blender/makesrna/RNA_enum_types.h
branches/smoke2/source/blender/makesrna/intern/makesrna.c
branches/smoke2/source/blender/makesrna/intern/rna_access.c
branches/smoke2/source/blender/makesrna/intern/rna_dynamicpaint.c
branches/smoke2/source/blender/makesrna/intern/rna_key.c
branches/smoke2/source/blender/makesrna/intern/rna_lamp.c
branches/smoke2/source/blender/makesrna/intern/rna_lattice.c
branches/smoke2/source/blender/makesrna/intern/rna_mesh.c
branches/smoke2/source/blender/makesrna/intern/rna_modifier.c
branches/smoke2/source/blender/makesrna/intern/rna_nodetree.c
branches/smoke2/source/blender/makesrna/intern/rna_nodetree_types.h
branches/smoke2/source/blender/makesrna/intern/rna_object_api.c
branches/smoke2/source/blender/makesrna/intern/rna_scene.c
branches/smoke2/source/blender/makesrna/intern/rna_sculpt_paint.c
branches/smoke2/source/blender/makesrna/intern/rna_userdef.c
branches/smoke2/source/blender/makesrna/intern/rna_wm.c
branches/smoke2/source/blender/modifiers/CMakeLists.txt
branches/smoke2/source/blender/modifiers/MOD_modifiertypes.h
branches/smoke2/source/blender/modifiers/intern/MOD_dynamicpaint.c
branches/smoke2/source/blender/modifiers/intern/MOD_solidify.c
branches/smoke2/source/blender/modifiers/intern/MOD_util.c
branches/smoke2/source/blender/nodes/CMakeLists.txt
branches/smoke2/source/blender/nodes/NOD_shader.h
branches/smoke2/source/blender/nodes/composite/node_composite_tree.c
branches/smoke2/source/blender/nodes/composite/nodes/node_composite_boxmask.c
branches/smoke2/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c
branches/smoke2/source/blender/nodes/composite/nodes/node_composite_defocus.c
branches/smoke2/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c
branches/smoke2/source/blender/nodes/intern/node_common.c
branches/smoke2/source/blender/nodes/intern/node_util.c
branches/smoke2/source/blender/python/bmesh/bmesh_py_types.c
branches/smoke2/source/blender/python/bmesh/bmesh_py_types_customdata.c
branches/smoke2/source/blender/python/generic/bpy_internal_import.c
branches/smoke2/source/blender/python/generic/idprop_py_api.c
branches/smoke2/source/blender/python/intern/bpy_interface.c
branches/smoke2/source/blender/python/intern/bpy_library.c
branches/smoke2/source/blender/python/intern/bpy_operator.c
branches/smoke2/source/blender/python/intern/bpy_rna.c
branches/smoke2/source/blender/python/mathutils/mathutils_Quaternion.c
branches/smoke2/source/blender/quicktime/apple/quicktime_export.c
branches/smoke2/source/blender/render/intern/source/convertblender.c
branches/smoke2/source/blender/render/intern/source/pipeline.c
branches/smoke2/source/blender/render/intern/source/render_texture.c
branches/smoke2/source/blender/windowmanager/intern/wm_event_system.c
branches/smoke2/source/blender/windowmanager/intern/wm_files.c
branches/smoke2/source/blender/windowmanager/intern/wm_keymap.c
branches/smoke2/source/blender/windowmanager/intern/wm_operators.c
branches/smoke2/source/blenderplayer/bad_level_call_stubs/stubs.c
branches/smoke2/source/creator/CMakeLists.txt
branches/smoke2/source/creator/creator.c
branches/smoke2/source/gameengine/Converter/BL_MeshDeformer.cpp
branches/smoke2/source/gameengine/GameLogic/SCA_IController.h
branches/smoke2/source/gameengine/GameLogic/SCA_ISensor.cpp
branches/smoke2/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
branches/smoke2/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h
branches/smoke2/source/gameengine/Rasterizer/RAS_IRasterizer.h
branches/smoke2/source/gameengine/SceneGraph/SG_Spatial.cpp
Added Paths:
-----------
branches/smoke2/source/blender/modifiers/intern/MOD_skin.c
branches/smoke2/source/blender/nodes/shader/nodes/node_shader_object_info.c
Property Changed:
----------------
branches/smoke2/source/blender/editors/space_outliner/
Modified: branches/smoke2/CMakeLists.txt
===================================================================
--- branches/smoke2/CMakeLists.txt 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/CMakeLists.txt 2012-05-22 23:26:17 UTC (rev 46915)
@@ -238,8 +238,14 @@
option(WITH_CYCLES "Enable cycles Render Engine" ON)
option(WITH_CYCLES_TEST "Build cycles test application" OFF)
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
-set(CYCLES_CUDA_BINARIES_ARCH sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build binaries for")
+if(WIN32 AND NOT CMAKE_CL_64 AND NOT WITH_MINGW64)
+ set(PLATFORM_DEFAULT sm_20 sm_21)
+else()
+ set(PLATFORM_DEFAULT sm_13 sm_20 sm_21)
+endif()
+set(CYCLES_CUDA_BINARIES_ARCH ${PLATFORM_DEFAULT} CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
+unset(PLATFORM_DEFAULT)
# disable for now, but plan to support on all platforms eventually
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
Modified: branches/smoke2/build_files/scons/config/win32-mingw-config.py
===================================================================
--- branches/smoke2/build_files/scons/config/win32-mingw-config.py 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/build_files/scons/config/win32-mingw-config.py 2012-05-22 23:26:17 UTC (rev 46915)
@@ -169,6 +169,11 @@
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
+#CUDA
+WITH_BF_CYCLES_CUDA_BINARIES = False
+#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
+BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21'] # don't build sm_13 until the compile can fit in 32bit process again :)
+
##
CC = 'gcc'
CXX = 'g++'
Modified: branches/smoke2/doc/python_api/examples/bpy.types.Mesh.py
===================================================================
--- branches/smoke2/doc/python_api/examples/bpy.types.Mesh.py 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/doc/python_api/examples/bpy.types.Mesh.py 2012-05-22 23:26:17 UTC (rev 46915)
@@ -28,7 +28,7 @@
import bpy
me = bpy.context.object.data
-uv_layer = me.uv.layers.active.data
+uv_layer = me.uv_layers.active.data
for poly in me.polygons:
print("Polygon index: %d, length: %d" % (poly.index, poly.loop_total))
Modified: branches/smoke2/doc/python_api/rst/include__bmesh.rst
===================================================================
--- branches/smoke2/doc/python_api/rst/include__bmesh.rst 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/doc/python_api/rst/include__bmesh.rst 2012-05-22 23:26:17 UTC (rev 46915)
@@ -99,9 +99,11 @@
uv_lay = bm.loops.layers.uv.active
for face in bm.faces:
- for loop in f.loops:
- uv = loop[uv_lay]
- print("Loop UV: %f, %f" % (uv.x, uv.y))
+ for loop in face.loops:
+ uv = loop[uv_lay].uv
+ print("Loop UV: %f, %f" % uv[:])
+ vert = loop.vert
+ print("Loop Vert: (%f,%f,%f)" % vert.co[:])
.. code-block:: python
Modified: branches/smoke2/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/smoke2/intern/cycles/blender/blender_object.cpp 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/blender/blender_object.cpp 2012-05-22 23:26:17 UTC (rev 46915)
@@ -245,6 +245,7 @@
/* object sync */
if(object_updated || (object->mesh && object->mesh->need_update)) {
object->name = b_ob.name().c_str();
+ object->instance_id = b_index;
object->pass_id = b_ob.pass_index();
object->tfm = tfm;
object->motion.pre = tfm;
Modified: branches/smoke2/intern/cycles/blender/blender_shader.cpp
===================================================================
--- branches/smoke2/intern/cycles/blender/blender_shader.cpp 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/blender/blender_shader.cpp 2012-05-22 23:26:17 UTC (rev 46915)
@@ -334,6 +334,10 @@
node = new LightFalloffNode();
break;
}
+ case BL::ShaderNode::type_OBJECT_INFO: {
+ node = new ObjectInfoNode();
+ break;
+ }
case BL::ShaderNode::type_TEX_IMAGE: {
BL::ShaderNodeTexImage b_image_node(b_node);
BL::Image b_image(b_image_node.image());
Modified: branches/smoke2/intern/cycles/kernel/kernel_object.h
===================================================================
--- branches/smoke2/intern/cycles/kernel/kernel_object.h 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/kernel/kernel_object.h 2012-05-22 23:26:17 UTC (rev 46915)
@@ -117,6 +117,16 @@
#endif
}
+__device_inline float3 object_location(KernelGlobals *kg, ShaderData *sd)
+{
+#ifdef __MOTION__
+ return make_float3(sd->ob_tfm.x.w, sd->ob_tfm.y.w, sd->ob_tfm.z.w);
+#else
+ Transform tfm = object_fetch_transform(kg, sd->object, 0.0f, OBJECT_TRANSFORM);
+ return make_float3(tfm.x.w, tfm.y.w, tfm.z.w);
+#endif
+}
+
__device_inline float object_surface_area(KernelGlobals *kg, int object)
{
int offset = object*OBJECT_SIZE + OBJECT_PROPERTIES;
@@ -134,5 +144,20 @@
return f.y;
}
+__device_inline float object_random_number(KernelGlobals *kg, int object)
+{
+ if(object == ~0)
+ return 0.0f;
+
+ int offset = object*OBJECT_SIZE + OBJECT_PROPERTIES;
+ float4 f = kernel_tex_fetch(__objects, offset);
+ return f.z;
+}
+
+__device int shader_pass_id(KernelGlobals *kg, ShaderData *sd)
+{
+ return kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*2 + 1);
+}
+
CCL_NAMESPACE_END
Modified: branches/smoke2/intern/cycles/kernel/kernel_shader.h
===================================================================
--- branches/smoke2/intern/cycles/kernel/kernel_shader.h 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/kernel/kernel_shader.h 2012-05-22 23:26:17 UTC (rev 46915)
@@ -679,11 +679,6 @@
}
#endif
-__device int shader_pass_id(KernelGlobals *kg, ShaderData *sd)
-{
- return kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*2 + 1);
-}
-
/* Free ShaderData */
__device void shader_release(KernelGlobals *kg, ShaderData *sd)
Modified: branches/smoke2/intern/cycles/kernel/svm/svm.h
===================================================================
--- branches/smoke2/intern/cycles/kernel/svm/svm.h 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/kernel/svm/svm.h 2012-05-22 23:26:17 UTC (rev 46915)
@@ -266,6 +266,9 @@
case NODE_LIGHT_PATH:
svm_node_light_path(sd, stack, node.y, node.z, path_flag);
break;
+ case NODE_OBJECT_INFO:
+ svm_node_object_info(kg, sd, stack, node.y, node.z);
+ break;
#endif
case NODE_CONVERT:
svm_node_convert(sd, stack, node.y, node.z, node.w);
Modified: branches/smoke2/intern/cycles/kernel/svm/svm_geometry.h
===================================================================
--- branches/smoke2/intern/cycles/kernel/svm/svm_geometry.h 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/kernel/svm/svm_geometry.h 2012-05-22 23:26:17 UTC (rev 46915)
@@ -74,5 +74,25 @@
#endif
}
+/* Object Info */
+
+__device void svm_node_object_info(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset)
+{
+ float data;
+
+ switch(type) {
+ case NODE_INFO_OB_LOCATION: {
+ stack_store_float3(stack, out_offset, object_location(kg, sd));
+ return;
+ }
+ case NODE_INFO_OB_INDEX: data = object_pass_id(kg, sd->object); break;
+ case NODE_INFO_MAT_INDEX: data = shader_pass_id(kg, sd); break;
+ case NODE_INFO_OB_RANDOM: data = object_random_number(kg, sd->object); break;
+ default: data = 0.0f; break;
+ }
+
+ stack_store_float(stack, out_offset, data);
+}
+
CCL_NAMESPACE_END
Modified: branches/smoke2/intern/cycles/kernel/svm/svm_types.h
===================================================================
--- branches/smoke2/intern/cycles/kernel/svm/svm_types.h 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/kernel/svm/svm_types.h 2012-05-22 23:26:17 UTC (rev 46915)
@@ -92,7 +92,8 @@
NODE_RGB_RAMP = 5900,
NODE_RGB_CURVES = 6000,
NODE_MIN_MAX = 6100,
- NODE_LIGHT_FALLOFF = 6200
+ NODE_LIGHT_FALLOFF = 6200,
+ NODE_OBJECT_INFO = 6300
} NodeType;
typedef enum NodeAttributeType {
@@ -109,6 +110,13 @@
NODE_GEOM_uv
} NodeGeometry;
+typedef enum NodeObjectInfo {
+ NODE_INFO_OB_LOCATION,
+ NODE_INFO_OB_INDEX,
+ NODE_INFO_MAT_INDEX,
+ NODE_INFO_OB_RANDOM
+} NodeObjectInfo;
+
typedef enum NodeLightPath {
NODE_LP_camera = 0,
NODE_LP_shadow,
Modified: branches/smoke2/intern/cycles/render/nodes.cpp
===================================================================
--- branches/smoke2/intern/cycles/render/nodes.cpp 2012-05-22 23:19:45 UTC (rev 46914)
+++ branches/smoke2/intern/cycles/render/nodes.cpp 2012-05-22 23:26:17 UTC (rev 46915)
@@ -1699,7 +1699,7 @@
compiler.add(this, "node_light_path");
}
-/* Light Path */
+/* Light Falloff */
LightFalloffNode::LightFalloffNode()
: ShaderNode("light_path")
@@ -1746,6 +1746,49 @@
compiler.add(this, "node_light_falloff");
}
+/* Object Info */
+
+ObjectInfoNode::ObjectInfoNode()
+: ShaderNode("object_info")
+{
+ add_output("Location", SHADER_SOCKET_VECTOR);
+ add_output("Object Index", SHADER_SOCKET_FLOAT);
+ add_output("Material Index", SHADER_SOCKET_FLOAT);
+ add_output("Random", SHADER_SOCKET_FLOAT);
+}
+
+void ObjectInfoNode::compile(SVMCompiler& compiler)
+{
+ ShaderOutput *out = output("Location");
+ if(!out->links.empty()) {
+ compiler.stack_assign(out);
+ compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_OB_LOCATION, out->stack_offset);
+ }
+
+ out = output("Object Index");
+ if(!out->links.empty()) {
+ compiler.stack_assign(out);
+ compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_OB_INDEX, out->stack_offset);
+ }
+
+ out = output("Material Index");
+ if(!out->links.empty()) {
+ compiler.stack_assign(out);
+ compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_MAT_INDEX, out->stack_offset);
+ }
+
+ out = output("Random");
+ if(!out->links.empty()) {
+ compiler.stack_assign(out);
+ compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_OB_RANDOM, out->stack_offset);
+ }
+}
+
+void ObjectInfoNode::compile(OSLCompiler& compiler)
+{
+ compiler.add(this, "node_object_info");
+}
+
/* Value */
ValueNode::ValueNode()
Modified: branches/smoke2/intern/cycles/render/nodes.h
===================================================================
--- branches/smoke2/intern/cycles/render/nodes.h 2012-05-22 23:19:45 UTC (rev 46914)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list