[Bf-codereview] Some more attributes in particle info node (issue 6458110)

lukas.toenne at gmail.com lukas.toenne at gmail.com
Fri Aug 10 15:17:28 CEST 2012


Reviewers: bf-codereview_blender.org, brechtvl,

Description:
Added a bunch of additional particle state attributes to the Cycles
particle info node:

* Location: Basically the same as the location from Object Info node for
object instances on particles, but in principle there could be
additional offsets for dupli objects, so included for completeness.
* Size: Single float scale of the particle. Also directly translates to
object scale for current dupli objects, but handy to have as a single
float to start with instead of a scale vector (currently not even
exposed in Object Info).
* Rotation: This is a quaternion, which are not yet supported by Cycles
nodes. The float4 is copied to internal Cycles data and stored in the
particles texture data, but the node doesn't have a socket for it yet
and the data is not yet written to the stack. Code is just commented out
so could be enabled quickly if/when rotation support is added to cycles.
* Velocity: Linear velocity vector of particles.
* Angular Velocity: Angular velocity around principle axes.

The texture data is currently packed tightly into the particles texture,
which saves a few bytes, but requires an additional texture lookup for
some vector attributes which spread over two float4s. Could also add
another float4 to particle size to avoid this.


Please review this at http://codereview.appspot.com/6458110/

Affected files:
   intern/cycles/blender/blender_particles.cpp
   intern/cycles/blender/blender_util.h
   intern/cycles/kernel/kernel_object.h
   intern/cycles/kernel/kernel_types.h
   intern/cycles/kernel/svm/svm_geometry.h
   intern/cycles/kernel/svm/svm_types.h
   intern/cycles/render/nodes.cpp
   intern/cycles/render/object.cpp
   intern/cycles/render/object.h
   source/blender/nodes/shader/nodes/node_shader_particle_info.c




More information about the Bf-codereview mailing list