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
2017-02-22Blender 2.78c: Fix wrong cycles hair render results when using BVH motion stepsSergey Sharybin
This commit contains all commits required to get proper hair rendering with BVH motion steps enabled. The issue here was mainly coming from minimal pixel width feature which is quite commonly enabled in production shots. This feature will use some probabilistic heuristic in the curve intersection function to check whether we need to return intersection or not. This probability is calculated for every intersection check. Now, when we use multiple BVH nodes for curve primitives we increase probability of that primitive to be considered a good intersection for us. This is similar to increasing minimal width of curve. What is worst here is that change in the intersection probability fully depends on exact layout of BVH, meaning probability might change differently depending on a view angle, the way how builder binned the primitives and such. This makes it impossible to do simple check like dividing probability by number of BVH steps. Other solution might have been to split BVH into fully independent trees, but that will increase memory usage of all the static objects in the scenes, which is also not something desirable. For now used most simple but robust approach: store BVH primitives time and test it in curve intersection functions. This solves the regression, but has two downsides: - Uses more memory. which isn't surprising, and ANY solution to this problem will use more memory. What we still have to do is to avoid this memory increase for cases when we don't use BVH motion steps. - Reduces number of maximum available textures on pre-kepler cards. There is not much we can do here, hardware gets old but we need to move forward on more modern hardware..
2017-01-26Cycles: Don't rely on indirectly included algorithmSergey Sharybin
2017-01-26Cycles: Use more const qualifiers to avoid possible issuesSergey Sharybin
2017-01-26Cycles: Cleanup, split one gigantic function into two smaller onesSergey Sharybin
2017-01-26Cycles: Store time in BVH nodesSergey Sharybin
This way we can stop traversing BVH node early on. Gives about 2-2.5x times render time improvement with 3 BVH steps. Hopefully this gives no measurable performance loss for scenes with single BVH step. Traversal is currently only implemented for QBVH, meaning old CPUs and GPU do not benefit from this change.
2017-01-26Cycles: Add option to split triangle motion primitives by time stepsSergey Sharybin
Similar to the previous commit, the statistics goes as: BVH Steps Render time (sec) Memory usage (MB) 0 46 260 1 27 373 2 18 598 3 15 826 Scene used for the tests is the agent's body from one of the barber shop scenes (no textures or anything, just a diffuse material). Once again this is limited to regular (non-spatial split) BVH, Support of spatial split to this feature will come later.
2017-01-26Cycles: Add option to split curve motion primitives by time stepsSergey Sharybin
The idea is to create several smaller BVH nodes for each of the motion curve primitives. This acts as a forced spatial split for the single primitive. This gives up render time speedup of motion blurred hair in the cost of extra memory usage. The numbers goes as: BVH Steps Render time (sec) Memory usage (MB) 0 258 191 1 123 278 2 69 453 3 43 627 Scene used for the tests is the agent's hair from one of the barber shop scenes. Currently it's only limited to scenes without spatial split enabled, since the spatial split builder requires some changes to work properly with motion steps coordinates.
2017-01-26Cycles: Cleanup, trailing whitespaceSergey Sharybin
2017-01-26Cycles: Cleanup, better variable nameSergey Sharybin
2017-01-20Cycles: Cleanup, spellingSergey Sharybin
2017-01-20Cycles: Cleanup, avoid shadowingSergey Sharybin
2017-01-20Cycles: Simplify some code in Curve BVH reference fillSergey Sharybin
makes code slightly shorter and uses idea of const qualifiers.
2017-01-20Cycles: Avoid shadowing in BVH codeSergey Sharybin
Run into some nasty bugs while trying various things here. Wouldn't mind enabling -Wshadow for Cycles actually..
2017-01-20Cycles: Allow up to 4 motion curve primitives per BVH nodeSergey Sharybin
This avoids intersection AABB of different curve primitives which makes it less ray-to-primitive intersections. This gives about 30% speedup of hair rendering in the barber shop scenes here. There is still some work to be done on those files to solve major speed issues on certain frames.
2017-01-20Cycles: Use separate limit for motion primitives for BVH node limitsSergey Sharybin
This way we can have different limits for regular and motion curves which we'll do in one of the upcoming commits in order to gain some percents of speedup. The reasoning here is that motion curves are usually intersecting lots of others bounding boxes, which makes it inefficient to have single primitive in the leaf node.
2017-01-20Cycles: Change confusing logic of max leaf size checkSergey Sharybin
Maximal number of elements is supposed to be inclusive. That is what it was always meant in this file and what @brecht considered still the case in 6974b69c6172. In fact, the commit message to that change mentions that we allowed up to 2 curve primitives per leaf while in fact it was doing up to 1 curve primitive. Making it real 2 primitives at a max gives about 5% slowdown for the koro.blend scene. This is a reason why BVHParams.max_curve_leaf_size was changed to 1 by this change.
2017-01-20Cycles: Cleanup, styleSergey Sharybin
2017-01-20Revert "Cycles: Tweak empty boundbox children"Sergey Sharybin
This reverts commit ecbfa31caaadb03c53c0fe1459718b99613c8804. Original commit broke logic in nodes re-fitting. That area can access non-existing children momentarely. Not sure what would be best solution here, for now simply reverting the change/
2017-01-20Cycles: Tweak empty boundbox childrenSergey Sharybin
The idea here is to make assert failure to fail sooner on an incorrect node address rather than later with stack overflow.
2017-01-20Cycles: Deduplicate QBVH node packing across BVH build and refitSergey Sharybin
2016-10-24Cycles: Fix uninitialized variable from the previous commitSergey Sharybin
2016-10-24Blender 2.78: Port style cleanup from CyclesSergey Sharybin
Kinda nice to have official release code to be really clean.
2016-10-24Fix T49818: Crash when rendering with motion blurSergey Sharybin
It was possible to have non-initialized unaligned BVH split to be used when regular BVH split SAH was inf. Now we ensure that unaligned splitter is only used when it's really initialized. It's a regression and should be in 2.78a.
2016-10-24Cycles: Cleanup, spacesSergey Sharybin
2016-09-14Fix T49290: Specific .blend with hair crashes in MacOS 2.78 RC1 on renderSergey Sharybin
The issue was caused by some false-positive empty non-AABB intersection. Tried to tweak it a bit so it does not record intersection anymore. Hopefully will work for all platforms. Tested here on iMac and Debian.
2016-09-14Cycles: Fix regular BVH nodes refitSergey Sharybin
For proper indexing to work we need to use unaligned node with identity transform instead of aligned nodes when doing refit. To be backported to 2.78 release.
2016-09-14Cycles: Add asserts to BVH node packingSergey Sharybin
2016-09-14Cycles: Cleanup: line wrappingSergey Sharybin
2016-08-18Cycles: Fix wrong allocator used for spatial builderSergey Sharybin
2016-07-15Cycles: Fix refitting of regular BVHSergey Sharybin
Was causing CUDA issues on viewport edits.
2016-07-07Cycles: Implement unaligned nodes BVH builderSergey Sharybin
This is a special builder type which is allowed to orient nodes to strands direction, hence minimizing their surface area in comparison with axis-aligned nodes. Such nodes are much more efficient for hair rendering. Implementation of BVH builder is based on Embree, and generally idea there is to calculate axis-aligned SAH and oriented SAH and if SAH of oriented node is smaller than axis-aligned SAH we create unaligned node. We store both aligned and unaligned nodes in the same tree (which seems to be different from what Embree is doing) so we don't have any any extra calculations needed to set up hair ray for BVH traversal, hence avoiding any possible negative effect of this new BVH nodes type. This new builder is currently not in use, still need to make BVH traversal code aware of unaligned nodes.
2016-07-07Cycles: Switch node address to absolute values in BVH treeSergey Sharybin
This seems to be straightforward way to support heterogeneous nodes in the same tree. There is some penalty related on 4gig limit of the address space now, but here's are the thing: Traversal code was already using ints to store final offset, so there can't be regressions really. This is a required commit to make it possible to encode both aligned and unaligned nodes in the same array. Also, in the future we can use this to get rid of __leaf_nodes array (which is a bit tricky to do since trickery in pack_instances().
2016-07-07Cycles: Reduce memory usage by de-duplicating triangle storageSergey Sharybin
There are several internal changes for this: First idea is to make __tri_verts to behave similar to __tri_storage, meaning, __tri_verts array now contains all vertices of all triangles instead of just mesh vertices. This saves some lookup when reading triangle coordinates in functions like triangle_normal(). In order to make it efficient needed to store global triangle offset somewhere. So no __tri_vindex.w contains a global triangle index which can be used to read triangle vertices. Additionally, the order of vertices in that array is aligned with primitives from BVH. This is needed to keep cache as much coherent as possible for BVH traversal. This causes some extra tricks needed to fill the array in and deal with True Displacement but those trickery is fully required to prevent noticeable slowdown. Next idea was to use this __tri_verts instead of __tri_storage in intersection code. Unfortunately, this is quite tricky to do without noticeable speed loss. Mainly this loss is caused by extra lookup happening to access vertex coordinate. Fortunately, tricks here and there (i,e, some types changes to avoid casts which are not really coming for free) reduces those losses to an acceptable level. So now they are within couple of percent only, On a positive site we've achieved: - Few percent of memory save with triangle-only scenes. Actual save in this case is close to size of all vertices. On a more fine-subdivided scenes this benefit might become more obvious. - Huge memory save of hairy scenes. For example, on koro.blend there is about 20% memory save. Similar figure for bunny.blend. This memory save was the main goal of this commit to move forward with Hair BVH which required more memory per BVH node. So while this sounds exciting, this memory optimization will become invisible by upcoming Hair BVH work. But again on a positive side, we can add an option to NOT use Hair BVH and then we'll have same-ish render times as we've got currently but will have this 20% memory benefit on hairy scenes.
2016-07-07Cycles: Support visibility check for inner nodes of QBVHSergey Sharybin
It was initially unsupported because initial idea of checking visibility of all children was slowing scenes down a lot. Now the idea has changed and we only perform visibility check of current node. This avoids huge slowdown (from tests here it seems to be withing 1-2%, but more tests would never hurt) and gives nice speedup of ray traversal for complex scenes which utilized ray visibility. Here's timing of koro.blend: Without visibility check With visibility check Original file 4min 20sec 4min 23sec Camera rays only 1min 43 sec 55sec Unfortunately, this doesn't come for free and requires extra data in BVH node, which increases memory usage of BVH nodes by 15%. This we can solve with some future trickery of avoiding __tri_storage created for curve segments.
2016-07-04Cycles: remove extended precision hacks, no longer needed with SSE2 requirement.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D2079
2016-06-08Cycles: Fix crash after recent zero scale instance optimizationSergey Sharybin
2016-06-07Cycles: Fix regression introduced in c96a4c8Mai Lavelle
A few places still needed to be updated to use the new Mesh::num_triangles() method; wrong number from triangles.size() was causing crashes.
2016-06-06Cycles: Ignore zero size instances in BVHSergey Sharybin
In certain types of animation it's possible to have some objects scaling to zero. In this case we can save render times by avoid traversing such instances. Better to do ti ahead of a time, so traversal stays simple. Reviewers: lukasstockner97, dingto, brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D2048
2016-05-31Cycles: Add human readable sizes to debug outputMai Lavelle
Some of these values can get quite large and are hard to read, adding this makes it easy to read them at a glance. Reviewed By: sergey Differential Revision: https://developer.blender.org/D2039
2016-05-28Code refactor: modify mesh storage to use arrays rather than vectors, ↵Brecht Van Lommel
separate some arrays. Differential Revision: https://developer.blender.org/D2016
2016-05-22Code refactor: add generic Cycles node infrastructure.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D2016
2016-05-18Cleanup code style inconsistency in last commits.Brecht Van Lommel
2016-05-17Fix C++11 build issues on OS X, remove references to outdated libs.Brecht Van Lommel
2016-05-11Cycles: Use explicit qualifier for single-argument constructorsSergey Sharybin
Almost in all cases we want such constructors to be explicit, there are exceptions but only in few places.
2016-05-04Cycles: Fix hair minimal size doesn't work on GPU and SSE2 only CPUsSergey Sharybin
2016-04-25Cycles: Proper pack of leaves which are bigger than single float4Sergey Sharybin
2016-04-25Cycles: Move vector re-allocation out of loopsSergey Sharybin
2016-04-20Cycles: Use threads to sort reference arrays when searching for splitSergey Sharybin
This commits implements threaded sorting of references when looking for object spatial split. It mainly useful when doing initial binning, which happens from main thread. Gives nice speedup of BVH build for Bunny.blend: 36sec vs. 55sec for the Rabbit mesh BVH build. On more complex scenes the speedup is probably minimal, but still nice to have more instant rendering for simplier scenes. Some further tests with production scenes would be interesting. Reviewers: juicyfruit, dingto, lukasstockner97, brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D1928
2016-04-20Cycles: Avoid reference copySergey Sharybin
2016-04-15Cycles: Optimization to spatial BVH buildSergey Sharybin
Simple fix: release lock earlier. Reduces spatial split build time from 96 to 53sec on the Bunny.blend (using studio Intel for benchmark). NOTE: Timing difference is not that spectacular when comparing numbers with builds before memory optimization, but even then it's about 20% faster build.