diff options
author | Stuart Broadfoot <gbroadfoot@hotmail.com> | 2013-01-29 16:32:43 +0400 |
---|---|---|
committer | Stuart Broadfoot <gbroadfoot@hotmail.com> | 2013-01-29 16:32:43 +0400 |
commit | 6d2f104884f706b0358a9f6393e32cdc0430adac (patch) | |
tree | 885b900707b6eea4e04048a9c1a06a6d04d37242 /intern/cycles/render/object.cpp | |
parent | 1a750e00e72c06fc3acf883c436dc147d0626e52 (diff) |
Cycles Hair: Addition of render settings and static BVH strand width scaling
Addition of a RNA function to toggle between the hair settings and rebuild the cache. This enables the usage of the render step, child number and full display percentage with f12 rendering.
A scaling to the strand radius has also been added for the static bvh. This only matches up with dynamic for uniform scaling.
A very small fix is included for multiple uvs/vertex colours when using child particles.
Diffstat (limited to 'intern/cycles/render/object.cpp')
-rw-r--r-- | intern/cycles/render/object.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index 8d8087266c1..b31650c160a 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -84,12 +84,20 @@ void Object::apply_transform() { if(!mesh || tfm == transform_identity()) return; - + + float3 c0 = transform_get_column(&tfm, 0); + float3 c1 = transform_get_column(&tfm, 1); + float3 c2 = transform_get_column(&tfm, 2); + float scalar = pow(fabsf(dot(cross(c0, c1), c2)), 1.0f/3.0f); + for(size_t i = 0; i < mesh->verts.size(); i++) mesh->verts[i] = transform_point(&tfm, mesh->verts[i]); - for(size_t i = 0; i < mesh->curve_keys.size(); i++) + for(size_t i = 0; i < mesh->curve_keys.size(); i++) { mesh->curve_keys[i].co = transform_point(&tfm, mesh->curve_keys[i].co); + /* scale for strand radius - only correct for uniform transforms*/ + mesh->curve_keys[i].radius *= scalar; + } /* store matrix to transform later. when accessing these as attributes we * do not want the transform to be applied for consistency between static |