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:08:54 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-01-03 16:08:54 +0400
commit57cf48e7c6fd04f864072c21433a822907774f78 (patch)
tree45f3fa51f532a03e25c4d8ffa0c1be58027d01b2 /intern/cycles/render/mesh.h
parent8ca977b16e745f716d044a5b6ccbb5be4a70ac94 (diff)
Cycles Hair: refactoring to support generic attributes for hair curves. There
should be no functional changes yet. UV, tangent and intercept are now stored as attributes, with the intention to add more like multiple uv's, vertex colors, generated coordinates and motion vectors later. Things got a bit messy due to having both triangle and curve data in the same mesh data structure, which also gives us two sets of attributes. This will get cleaned up when we split the mesh class.
Diffstat (limited to 'intern/cycles/render/mesh.h')
-rw-r--r--intern/cycles/render/mesh.h30
1 files changed, 9 insertions, 21 deletions
diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h
index 24d3f02e082..ca8c755671f 100644
--- a/intern/cycles/render/mesh.h
+++ b/intern/cycles/render/mesh.h
@@ -50,26 +50,16 @@ public:
int v[3];
};
- /* Mesh Strand Data*/
- struct CurveSeg {
+ /* Mesh Curve */
+ struct CurveSegment {
int v[2];
- uint curveshader;
+ uint shader;
int curve;
};
- struct Curve_Attribute {
- float uv[2];
- };
-
struct CurveKey {
- float3 loc;
+ float3 co;
float radius;
- float time;
- };
-
- /*curve data for hair - currently only contains key tangent instead*/
- struct CurveData {
- float3 tg;
};
/* Displacement */
@@ -88,12 +78,11 @@ public:
vector<bool> smooth;
vector<CurveKey> curve_keys;
- vector<CurveData> curve_keysCD;
- vector<CurveSeg> curve_segs;
- vector<Curve_Attribute> curve_attrib;
+ vector<CurveSegment> curve_segments;
vector<uint> used_shaders;
AttributeSet attributes;
+ AttributeSet curve_attributes;
BoundBox bounds;
bool transform_applied;
@@ -116,12 +105,11 @@ public:
Mesh();
~Mesh();
- void reserve(int numverts, int numfaces);
+ void reserve(int numverts, int numfaces, int numcurves, int numcurvekeys);
void clear();
void add_triangle(int v0, int v1, int v2, int shader, bool smooth);
- void add_curvekey(float3 loc, float radius, float time);
- void add_curve(int v0, int v1, int shader, int curveid);
- void add_curveattrib(float u, float v);
+ void add_curve_key(float3 loc, float radius);
+ void add_curve_segment(int v0, int v1, int shader, int curveid);
void compute_bounds();
void add_face_normals();