Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Broadfoot <gbroadfoot@hotmail.com>2013-04-16 01:38:31 +0400
committerStuart Broadfoot <gbroadfoot@hotmail.com>2013-04-16 01:38:31 +0400
commit638b084f824bc345468bc8e02422b5da65a641a7 (patch)
tree0e5e9cd1bcdc09492ac6c5966dcc2b7c28b5f96b /intern/cycles/blender/blender_curves.cpp
parentceb61eb14d86132522e38c238bf249dbeb84b237 (diff)
Cycles Hair: Strand Minimum Pixel Size
Code is added to restrict the pixel size of strands in cycles. It works best with ribbon primitives and a preset for these is included. It uses distance dependent expansion of the strands and then stochastic strand removal to give a fading. To prevent a slowdown for triangle mesh objects in the BVH an extra visibility flag has been added. It is also only applied for camera rays. The strand width settings are also changed, so that the particle size is not included in the width calculation. Instead there is a separate particle system parameter for width scaling.
Diffstat (limited to 'intern/cycles/blender/blender_curves.cpp')
-rw-r--r--intern/cycles/blender/blender_curves.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 768a5a6ee3a..4e0aad8ad14 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -195,7 +195,7 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
CData->psys_curvenum.push_back(totcurves);
CData->psys_shader.push_back(shader);
- float radius = b_psys.settings().particle_size() * 0.5f;
+ float radius = get_float(cpsys, "radius_scale") * 0.5f;
CData->psys_rootradius.push_back(radius * get_float(cpsys, "root_width"));
CData->psys_tipradius.push_back(radius * get_float(cpsys, "tip_width"));
@@ -884,6 +884,8 @@ void BlenderSync::sync_curve_settings()
CurveSystemManager prev_curve_system_manager = *curve_system_manager;
curve_system_manager->use_curves = get_boolean(csscene, "use_curves");
+ curve_system_manager->minimum_width = get_float(csscene, "minimum_width");
+ curve_system_manager->maximum_width = get_float(csscene, "maximum_width");
if(preset == CURVE_CUSTOM) {
/*custom properties*/
@@ -957,6 +959,12 @@ void BlenderSync::sync_curve_settings()
curve_system_manager->use_backfacing = true;
curve_system_manager->subdivisions = 4;
break;
+ case CURVE_SMOOTH_RIBBONS:
+ /*Cardinal ribbons preset*/
+ curve_system_manager->primitive = CURVE_RIBBONS;
+ curve_system_manager->use_backfacing = false;
+ curve_system_manager->subdivisions = 4;
+ break;
}
}