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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-01-03 16:09:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-01-03 16:09:09 +0400
commitbf25f1ea96d01b513907cf3067e8e2dd3c7e41b4 (patch)
tree822c28fa6ecf5e08c051e5eb7a05f6bc6e2e8742 /intern/cycles/render/mesh.h
parent57cf48e7c6fd04f864072c21433a822907774f78 (diff)
Cycles Hair: refactoring to store curves with the index of the first key and the
number of keys in the curve, rather than curve segments with the indices of two keys. ShaderData.segment now stores the segment number in the curve.
Diffstat (limited to 'intern/cycles/render/mesh.h')
-rw-r--r--intern/cycles/render/mesh.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h
index ca8c755671f..b83752ad8df 100644
--- a/intern/cycles/render/mesh.h
+++ b/intern/cycles/render/mesh.h
@@ -51,10 +51,13 @@ public:
};
/* Mesh Curve */
- struct CurveSegment {
- int v[2];
+ struct Curve {
+ int first_key;
+ int num_keys;
uint shader;
- int curve;
+ uint pad;
+
+ int num_segments() { return num_keys - 1; }
};
struct CurveKey {
@@ -78,7 +81,7 @@ public:
vector<bool> smooth;
vector<CurveKey> curve_keys;
- vector<CurveSegment> curve_segments;
+ vector<Curve> curves;
vector<uint> used_shaders;
AttributeSet attributes;
@@ -98,7 +101,7 @@ public:
size_t tri_offset;
size_t vert_offset;
- size_t curveseg_offset;
+ size_t curve_offset;
size_t curvekey_offset;
/* Functions */
@@ -109,7 +112,7 @@ public:
void clear();
void add_triangle(int v0, int v1, int v2, int shader, bool smooth);
void add_curve_key(float3 loc, float radius);
- void add_curve_segment(int v0, int v1, int shader, int curveid);
+ void add_curve(int first_key, int num_keys, int shader);
void compute_bounds();
void add_face_normals();
@@ -117,7 +120,7 @@ public:
void pack_normals(Scene *scene, float4 *normal, float4 *vnormal);
void pack_verts(float4 *tri_verts, float4 *tri_vindex, size_t vert_offset);
- void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_seg_keys, size_t curvekey_offset);
+ void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset);
void compute_bvh(SceneParams *params, Progress *progress, int n, int total);
bool need_attribute(Scene *scene, AttributeStandard std);