diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-12-05 15:40:54 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-12-05 15:40:54 +0300 |
commit | 29d87d64caac51fc900825063421a35ac9a7c7ae (patch) | |
tree | d0ee294c6a4960a986c6e722d2c34b98c562c642 /source/blender/blenkernel/intern/displist.c | |
parent | 2422b1e401aac4ae6fbe33764ffc337e5eb8fd79 (diff) |
Particles
=========
- Texture orco coordinates for particles are now actual orcos instead
of just the vertex positions, which means they are the same under
deformations and the same as the ones on the mesh.
- Particle distribution now uses these orcos to get consistent
distributions independent of deformation.
- This required changing the way orco's are computed for meshes. Now
instead of generating an orco derivedmesh separately, the derivedmesh
is generated alongside the regular one and stored in an orco custom
data layer.
Diffstat (limited to 'source/blender/blenkernel/intern/displist.c')
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 82a108a20eb..bea0626286e 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -485,9 +485,11 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un CustomDataMask dataMask = CD_MASK_BAREMESH | CD_MASK_MCOL | CD_MASK_MTFACE | CD_MASK_NORMAL; + init_fastshade_for_ob(re, ob, &need_orco, mat, imat); - orco = (need_orco)? mesh_create_orco(ob): NULL; + if(need_orco) + dataMask |= CD_MASK_ORCO; if (onlyForMesh) dm = mesh_get_derived_deform(ob, dataMask); @@ -499,6 +501,7 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un nors = dm->getFaceDataArray(dm, CD_NORMAL); totvert = dm->getNumVerts(dm); totface = dm->getNumFaces(dm); + orco= dm->getVertDataArray(dm, CD_ORCO); if (onlyForMesh) { col1 = *col1_r; @@ -577,9 +580,6 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un } MEM_freeN(vnors); - if (orco) - MEM_freeN(orco); - dm->release(dm); end_fastshade_for_ob(ob); |