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-08-31Cycles: Fix typo in commentSergey Sharybin
2017-08-25Cycles: Fix stack overflow during traversal caused by floating overflowSergey Sharybin
Would be nice to be able to catch this with assert as well, will see what would be the best way to do this/.\ Need to verify with Mai that this solves crash for her and maybe consider porting this to 2.79.
2017-08-23Cycles: Add maximum depth stat to bvh builderMai Lavelle
2017-08-14Cycles: Guard memcpy to potentially re-allocating memory with lockSergey Sharybin
Basically, make re-alloc and memcpy from the same lock, otherwise one thread might be re-allocating thread while another one is trying to copy data there. Reported by Mohamed Sakr in IRC, thanks!
2017-08-10Cycles: Fix instanced shadow catcher objects influencing each otherSergey Sharybin
2017-08-10Cycles: De-duplicate trace-time object visibility calculationSergey Sharybin
We already have enough files to worry about in BVH builders. no need to add yet another copy-paste code which is tempting to be running out of sync.
2017-08-07Fix Cycles shadow catcher objects influencing each other.Brecht Van Lommel
Since all the shadow catchers are already assumed to be in the footage, the shadows they cast on each other are already in the footage too. So don't just let shadow catchers skip self, but all shadow catchers. Another justification is that it should not matter if the shadow catcher is modeled as one object or multiple separate objects, the resulting render should be the same. Differential Revision: https://developer.blender.org/D2763
2017-04-13Cycles: Header cleanup in BVH: move self header to be the first oneSergey Sharybin
This makes us more sure that header files are more self-sufficient.
2017-04-13Cycles: Split BVH implementations into separate filesSergey Sharybin
2017-04-13Cycles: Use more explicit and commonly used names for BVH structuresSergey Sharybin
This renames BinaryBVH to BVH2 and QBVH to BVH8. There is no user measurable difference, but allows us to add more types of BVH trees such as BVH8.
2017-03-30Cycles: Cleanup, rename RegularBVH to BinaryBVHSergey Sharybin
Makes it more explicit what the structure is from it's name.
2017-03-29Cycles: Cleanup, don't use m_ prefix for public propertiesSergey Sharybin
2017-03-29Cycles: Make all #include statements relative to cycles source directorySergey Sharybin
The idea is to make include statements more explicit and obvious where the file is coming from, additionally reducing chance of wrong header being picked up. For example, it was not obvious whether bvh.h was refferring to builder or traversal, whenter node.h is a generic graph node or a shader node and cases like that. Surely this might look obvious for the active developers, but after some time of not touching the code it becomes less obvious where file is coming from. This was briefly mentioned in T50824 and seems @brecht is fine with such explicitness, but need to agree with all active developers before committing this. Please note that this patch is lacking changes related on GPU/OpenCL support. This will be solved if/when we all agree this is a good idea to move forward. Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner Reviewed By: lukasstockner97, maiself, nirved, dingto Subscribers: brecht Differential Revision: https://developer.blender.org/D2586
2017-02-25Fix build error with macOS / clang / c++11.Brecht Van Lommel
2017-02-15Cycles: Don't calculate primitive time if BVH motion steps are not usedSergey Sharybin
Solves memory regression by the default configuration.
2017-02-15Cycles: Fix wrong hair render results when using BVH motion stepsSergey Sharybin
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-02-15Cycles: Fix missing initialization of triangle BVH stepsSergey Sharybin
Likely was harmless for Blender, but better be safe here.
2017-01-24Cycles: Don't rely on indirectly included algorithmSergey Sharybin
2017-01-20Cycles: Use more const qualifiers to avoid possible issuesSergey Sharybin
2017-01-20Cycles: Cleanup, split one gigantic function into two smaller onesSergey Sharybin
2017-01-20Cycles: 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-20Cycles: 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-20Cycles: 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-20Cycles: Cleanup, trailing whitespaceSergey Sharybin
2017-01-20Cycles: Cleanup, better variable nameSergey Sharybin
2017-01-16Cycles: Cleanup, spellingSergey Sharybin
2017-01-16Cycles: Cleanup, avoid shadowingSergey Sharybin
2017-01-13Cycles: Simplify some code in Curve BVH reference fillSergey Sharybin
makes code slightly shorter and uses idea of const qualifiers.
2017-01-13Cycles: 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-12Cycles: 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-12Cycles: 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-12Cycles: 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.
2016-10-24Cycles: Fix uninitialized variable from the previous commitSergey Sharybin
2016-10-24Cycles: Cleanup, styleSergey Sharybin
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-15Revert "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/
2016-09-13Cycles: 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.
2016-09-13Fix 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-09Cycles: Deduplicate QBVH node packing across BVH build and refitSergey Sharybin
2016-09-08Cycles: 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-08Cycles: Add asserts to BVH node packingSergey Sharybin
2016-09-08Cycles: 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