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
AgeCommit message (Collapse)Author
2015-07-20OpenSubdiv: Commit of OpenSubdiv integration into BlenderSergey Sharybin
This commit contains all the remained parts needed for initial integration of OpenSubdiv into Blender's subdivision surface code. Includes both GPU and CPU backends which works in the following way: - When SubSurf modifier is the last in the modifiers stack then GPU pipeline of OpenSubdiv is used, making viewport performance as fast as possible. This also requires graphscard with GLSL 1.5 support. If this requirement is not met, then no GPU pipeline is used at all. - If SubSurf is not a last modifier or if DerivesMesh is being evaluated for rendering then CPU limit evaluation API from OpenSubdiv is used. This only replaces the legacy evaluation code from CCGSubSurf_legacy, but keeps CCG structures exactly the same as they used to be for ages now. This integration is fully covered with ifdef and not enabled by default because there are several TODOs to be solved first: - Face varying data interpolation is not really cleanly implemented for GPU in OpenSubdiv 3.0. It is also not implemented for limit evaluation API. This basically means we'll have really hard time supporting UVs. - Limit evaluation only works with adaptivly subdivided meshes so far, which basically means all the points of CCG are pushed to the limit. This gives different result from old code. - There are some serious optimizations possible on the topology refiner creation, which would speed up initial OpenSubdiv mesh creation. - There are some hardcoded asumptions in the GPU and DerivedMesh areas which could be generalized. That's something where Antony and Campbell can help, making it so the code is structured in a way which is reusable by all planned viewport projects. - There are also some workarounds in the dependency graph to make sure OpenGL buffers are only freed from the main thread. Those who'll be wanting to make experiments with this code should grab dev branch (NOT master) from https://github.com/Nazg-Gul/OpenSubdiv/tree/dev There are some patches applied in there which we're working on on getting into upstream.
2015-07-20CCGSubSurf: Split file into several smaller onesSergey Sharybin
This is a preparation commit for having OpenSubdiv integrated into Blender and new layout is the following: - CCGSubSurf.c contains implementation of common functions used by both legacy subdivisions code and by the new code in the future. - CCGSubSurf_inline.h contains internal functions which are to be inlined due to the performance reasons. Those functions are only ment to be used bu CCGSubSurf* files. - CCGSubSurf_intern.h contains declarations of private functions and data structures used by CCGSubSurf module. - CCGSubSurf_legacy.c contains legacy implementation of subdivision algorithm. - CCHSubSurf_util.c contains utility functions which are not directly related on the subdivision code (i.e. debug functions, hash implementation etc). There should be no functional changes so far.
2015-02-23Subsurf: missing NULL checks on freeCampbell Barton
2015-02-17Subsurf: Use guarded allocator for non-arena CCGSergey Sharybin
Our new guarded allocator implementation has much smaller memory block size overhead and doesn't have any locks now. So in order to make fuller track of what's happening in blender and avoid confusion why certain circumstances reports much less memory than others we'll now switch to guarded allocator. This was actually one of the biggest reasons of the confusion in the recent memory usage investigation. There's still some overhead is happening due to non-freeing nature of arena allocator but the things are not nearly as bad as they looked before: memory overhead is measured in tens of megabytes, not hundreds as it looked before. Plus with some smarter allocation policy we can almost eliminate this overhead.
2014-12-10Fix T42748: Crash in subsurf, threaded accessCampbell Barton
Allocating the iterator from a BLI_memarena wasn't threadsafe. Change the API to use stack memory for iterators. Thanks to @mont29 for finding exact cause of the bug.
2014-08-14hint checks to re-alloc as unlikelyCampbell Barton
also edit comments for knife tool
2014-02-21Fix T38736: ShrinkWrap modifier doesn't work after SubsurfCampbell Barton
2013-12-22Style Cleanup: remove preprocessor indentation (updated wiki style guide too)Campbell Barton
2013-10-01Mark some CCG funcrions as inlinedSergey Sharybin
This seems to be giving speedup up to 10% in own tests. -- svn merge -r60104:60105 ^/branches/soc-2013-depsgraph_mt
2013-07-02add missing gpl headersCampbell Barton
2013-05-28move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)Campbell Barton
remove MEM_sys_types.h which was a duplicate.
2013-04-26add subsurf limits, in RNA, there were none, but subsurf would assert at 29.Campbell Barton
Checked and subsurf level 11 gives over 3 million faces from a single triangle. So use this as a limit.
2013-04-05code cleanup: include orderCampbell Barton
2013-02-04style cleanup: spaces -> tabsCampbell Barton
2013-01-20code cleanup: remove some paranoid checks which would have crashed anyway ↵Campbell Barton
earlier on. Also some minor formatting.
2013-01-12patch from Harley Acheson to remove multiple inline defines.Campbell Barton
2012-10-21style cleanup: trailing tabs & expand some non prefix tabs into spaces.Campbell Barton
2012-09-20code cleanup: remove unused macros, commet some which may be useful later - ↵Campbell Barton
or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc
2012-08-18Fix simple subsurf on wire edgesNicholas Bishop
Subsurf on wire edges gave smooth results even if set to simple subdiv. Added a field to the CCG meshIFC to flag simple subdivision, then when syncing vertices simply skip moving vertices if in simple-subdiv mode. This change affects two places, the level-1 build in sync and the subdivision up to other levels. Fixes bug [#32268] Simple Subsurf Modifier gives unexpected results on edges without faces projects.blender.org/tracker/index.php?func=detail&aid=32268&group_id=9&atid=498
2012-07-08style cleanupCampbell Barton
2012-06-24style cleanypCampbell Barton
2012-06-19Fix for subsurf oscillations along creased boundary edgesNicholas Bishop
Changed the "exterior edge interior shift" section of subsurf calc to always treat boundary edges the same, regardless of sharpness. We should revisit subsurf creasing to see if more consistent and predictable results are possible, but for now this a non-intrusive way to avoid wavyness along the boundary. Fixes bug [#31864] Artifacts when using Subsurf+Crease on plane http://projects.blender.org/tracker/index.php?func=detail&aid=31864&group_id=9&atid=498
2012-06-19Code cleanup: use float* rather than void* in subsurf calculationNicholas Bishop
No functional changes.
2012-06-17style cleanup:Campbell Barton
also fix for building ghost test and fix double free in one of the tests
2012-05-27code cleanup: defines with braces - end with '(void)0' so callers must end ↵Campbell Barton
with ';' like normal function. ... without this some editors dont parse the source so well.
2012-05-20code cleanup:Campbell Barton
- style - multi-line ifs move braces onto new lines. - iterators - convert some to macros, other split up and move brace.
2012-05-17style cleanup: block commentsCampbell Barton
2012-05-14style cleanup: imbuf & iconsCampbell Barton
2012-05-13code cleanup: minor improvements to float/vector usage.Campbell Barton
2012-05-12style cleanup: whitespaceCampbell Barton
2012-05-11Add mask support to CCGSubSurf and multires.Nicholas Bishop
* Add new CCG function ccgSubSurf_setAllocMask(). Similar to to ccgSubSurf_setCalcVertexNormals(), it sets whether the CCG elements have a mask layer and what that layer's offset is. Unlike normals however, it doesn't change any behavior during CCG calculation; it's there only to give CCGKey information on the mask. * Add a new flag to _getSubSurf(), CCG_ALLOC_MASK. If set, space for an extra layer is allocated, but the number of CCG layers is not set to include it. This is done because GridPaintMasks are absolute, rather than being relative to the subdivided output (as MDisp displacements are), so we skip subdividing paint masks here. * Add a new flag to subsurf_make_derived_from_derived(), SUBSURF_ALLOC_PAINT_MASK. This controls whether CCG_ALLOC_MASK is set for _getSubSurf(). Related, masks are never loaded in during ss_sync_from_derivedmesh(). After subdivision is finished, if the alloc mask flag is set, the number of CCG layers is increase to 4 with ccgSubSurf_setNumLayers(). * Add a new flag to multires_make_from_derived(), MULTIRES_ALLOC_PAINT_MASK. Not all multires functions need paint mask data (e.g. multiresModifier_base_apply.) This flag is always set in MOD_multires.c so that subdividing a mesh with a mask updates properly even when not in sculpt mode. * Update multiresModifier_disp_run() to apply, calculate, and add mask elements. It's almost the same as the existing operations with xyz coordinates, but treats masks as absolute rather than displacements relative to subdivided values. * Update multires_customdata_delete to free CD_GRID_PAINT_MASK in addition to CD_MDISPS. * Update multires_del_higher() to call the new function multires_grid_paint_mask_downsample(), which allocates a lower-resolution paint mask grid and copies values over from the high-resolution grid.
2012-05-11Add CCGKey/CCGElem for accessing CCGSubSurf elements.Nicholas Bishop
CCGKey caches information about the CCGSubSurf element layout. This data, along with the CCG_* inline functions, allows access to CCGSubSurf elements with an arbitrary number of layers (as opposed to the hardcoded DMGridData structure which assumes xyz coordinates followed by three normal components.) The CCGElem structure is declared but not defined anywhere, just used as a convenient type.
2012-05-11Modify CCGSubsurf to subdivide an arbitrary number of (float) layers.Nicholas Bishop
The layout of vert data in CCGSubSurf is almost the same; previously it was three floats (for xyz coordinate) optionally followed by three floats for the normal. The only change is that the first three floats can now be any number of floats. * _getSubSurf takes a numLayers parameter to set the number of layers, stored in CCGMeshIFC.numLayers. * All calls to _getSubSurf currently have numLayers set to 3, except for UV subsurf, where it is reduced to 2 (with a corresponding change when reading the results out to use float (*)[2] rather than float (*)[3].) * The various VertData* macros in CCGSubSurf.c are now functions that take a CCGSubSurf pointer, which provides access to CCGMeshIFC, which has numLayers. * Add ccgSubSurf_setNumLayers() to the API. Only changes the number of layers that get subdivided, doesn't change the amount of memory allocated. So if space for N layers is allocated, it's safe to set the number of layers to less than N, but not more. * The rest of the changes are just adding the 'ss' parameter.
2012-04-28style cleanup: changes to brace placement / newlines - for/while/if/switchCampbell Barton
2012-04-22small speedup to VertDataMulN(av, n), when passed expressions to 'n' they ↵Campbell Barton
were calculated 3 times, cuts 78 instructions from resulting assembly (gcc -O2).
2012-04-22subsurf - avoid 'for' loop finding the edge index in a face multiple times ↵Campbell Barton
when calling _face_getIFCoEdge. add asset so passing wrong value errors out in debug mode. gives small speedup to subsurf.
2012-04-22style cleanupCampbell Barton
2012-04-11code cleanup: float formatting was confusing in some cases - eg: (0.,0.,0.)Campbell Barton
2012-03-14Add new CCG accessor functions.Nicholas Bishop
ccg_gridsize() converts a level into gridsize, ccg_factor() is for converting coordinates between different multires levels.
2012-03-09Use sqrtf rather than sqrt in CCGSubSurf.cNicholas Bishop
2012-03-06Code cleanup: remove unused parameter from some ccgSubSurf accessors.Nicholas Bishop
Remove 'CCGSubSurf *ss' parameter from ccgSubSurf_getFaceFaceHandle, ccgSubSurf_getFaceVert, and ccgSubSurf_getFaceEdge.
2012-03-04style cleanup / comment formatting for bli/bke/bmeshCampbell Barton
2012-02-29Code cleanup: replace a few macros in CCGSubSurf with inline functions.Nicholas Bishop
2012-02-27Code cleanup, remove redefinition of UNUSED macro.Nicholas Bishop
Patch from Jason Wilkins: http://projects.blender.org/tracker/index.php?func=detail&aid=30350&group_id=9&atid=127
2012-02-26Style cleanup: remove underscore prefix from CCG struct names.Nicholas Bishop
2012-02-23Code cleanup: replace some common CCG operations with functions.Nicholas Bishop
The new functions are ccg_gridsize, ccg_edgesize, ccg_spacing, and ccg_edgebase. These target most of the left-shift operations in the code.
2012-02-23style cleanup for blenkernel, no functional changes.Campbell Barton
2011-12-17use 2d copy functions with UV's in more places.Campbell Barton
2011-11-24Fix #29366: multires crash with meshes that had verts/edges not connected to ↵Brecht Van Lommel
any face.
2011-10-23remove $Id: tags after discussion on the mailign list: ↵Campbell Barton
http://markmail.org/message/fp7ozcywxum3ar7n