New feature

Patch [#33445] - Experimental Cycles Hair Rendering (CPU only)

This patch allows hair data to be exported to cycles and introduces a new line segment primitive to render with.

The UI appears under the particle tab and there is a new hair info node available.

It is only available under the experimental feature set and for cpu rendering.
This commit is contained in:
Stuart Broadfoot
2012-12-28 14:21:30 +00:00
parent 857df8065f
commit e9ba345c46
50 changed files with 3126 additions and 245 deletions

View File

@@ -19,6 +19,7 @@
#include "device.h"
#include "light.h"
#include "mesh.h"
#include "curves.h"
#include "object.h"
#include "scene.h"
@@ -45,6 +46,7 @@ Object::Object()
motion.post = transform_identity();
use_motion = false;
use_holdout = false;
curverender = false;
}
Object::~Object()
@@ -86,6 +88,13 @@ void Object::apply_transform()
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++)
mesh->curve_keys[i].loc = transform_point(&tfm, mesh->curve_keys[i].loc);
for(size_t i = 0; i < mesh->curve_keysCD.size(); i++)
mesh->curve_keysCD[i].tg = transform_direction(&tfm, mesh->curve_keysCD[i].tg);
Attribute *attr_fN = mesh->attributes.find(ATTR_STD_FACE_NORMAL);
Attribute *attr_vN = mesh->attributes.find(ATTR_STD_VERTEX_NORMAL);
@@ -133,6 +142,7 @@ void Object::tag_update(Scene *scene)
}
}
scene->curve_system_manager->need_update = true;
scene->mesh_manager->need_update = true;
scene->object_manager->need_update = true;
}
@@ -189,6 +199,16 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene
surface_area += triangle_area(p1, p2, p3);
}
foreach(Mesh::CurveSeg& t, mesh->curve_segs) {
float3 p1 = mesh->curve_keys[t.v[0]].loc;
float r1 = mesh->curve_keys[t.v[0]].radius;
float3 p2 = mesh->curve_keys[t.v[1]].loc;
float r2 = mesh->curve_keys[t.v[1]].radius;
/* currently ignores segment overlaps*/
surface_area += M_PI_F *(r1 + r2) * len(p1 - p2);
}
surface_area_map[mesh] = surface_area;
}
else
@@ -204,6 +224,16 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene
surface_area += triangle_area(p1, p2, p3);
}
foreach(Mesh::CurveSeg& t, mesh->curve_segs) {
float3 p1 = mesh->curve_keys[t.v[0]].loc;
float r1 = mesh->curve_keys[t.v[0]].radius;
float3 p2 = mesh->curve_keys[t.v[1]].loc;
float r2 = mesh->curve_keys[t.v[1]].radius;
/* currently ignores segment overlaps*/
surface_area += M_PI_F *(r1 + r2) * len(p1 - p2);
}
}
/* pack in texture */
@@ -355,6 +385,7 @@ void ObjectManager::apply_static_transforms(Scene *scene, uint *object_flag, Pro
void ObjectManager::tag_update(Scene *scene)
{
need_update = true;
scene->curve_system_manager->need_update = true;
scene->mesh_manager->need_update = true;
scene->light_manager->need_update = true;
}