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
2020-06-22Cycles: remove SIMD BVH optimizations, to be replaced by EmbreeBrecht Van Lommel
Ref T73778 Depends on D8011 Maniphest Tasks: T73778 Differential Revision: https://developer.blender.org/D8012
2020-03-26Fix T74939: Random Walk subsurface appearance in OptiX does not match other ↵Patrick Mours
engines Random Walk subsurface scattering did look different with OptiX because transmittance is calculated based on the hit distance, but the OptiX implementation of `scene_intersect_local` would return the distance in world space, while the Cycles BVH version returns it in object space. This fixes the problem by simply skipping the object->world transforms in all the places using the result of `scene_intersect_local` with OptiX. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7232
2019-07-05Fix T66296: Black artefacts on materials with refraction on CPUSergey Sharybin
The issue was in the optimization code path for opaque shadow rays which was wrongly considering all primitives in the node to have same visibility flags.
2019-05-01Cleanup: comments (long lines) in cyclesCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2018-11-25Cleanup: trailing spaceCampbell Barton
2018-11-21Fix T57811: Render crashes in certain scenes when AO Bounces are usedSergey Sharybin
2018-11-21Cycles: Cleanup, use utility functionSergey Sharybin
Replaces inlined platform-specific code.
2018-11-21Cycles: Cleanup, reduce indentation levelSergey Sharybin
2018-11-21Cycles: Cleanup, comments and dead codeSergey Sharybin
2018-11-21Cycles: Cleanup, CUDA code path is not possible inside AVX2Sergey Sharybin
2018-11-09Cycles: Cleanup, spacing after preprocessorSergey Sharybin
It is supposed to be two spaces before comment stating which if else/endif statements corresponds to. Was mainly violated in the header guards.
2018-08-29Fix Cycles CUDA build after recent changes.Brecht Van Lommel
2018-08-29Cycles: Add BVH8 and packeted triangle intersectionSergey Sharybin
This is an initial implementation of BVH8 optimization structure and packated triangle intersection. The aim is to get faster ray to scene intersection checks. Scene BVH4 BVH8 barbershop_interior 10:24.94 10:10.74 bmw27 02:41.25 02:38.83 classroom 08:16.49 07:56.15 fishy_cat 04:24.56 04:17.29 koro 06:03.06 06:01.45 pavillon_barcelona 09:21.26 09:02.98 victor 23:39.65 22:53.71 As memory goes, peak usage raises by about 4.7% in a complex scenes. Note that BVH8 is disabled when using OSL, this is because OSL kernel does not get per-microarchitecture optimizations and hence always considers BVH3 is used. Original BVH8 patch from Anton Gavrikov. Batched triangles intersection from Victoria Zhislina. Extra work and tests and fixes from Maxym Dmytrychenko.
2018-06-15Cycles: change Ambient Occlusion shader to output colors.Lukas Stockner
This means the shader can now be used for procedural texturing. New settings on the node are Samples, Inside, Local Only and Distance. Original patch by Lukas with further changes by Brecht. Differential Revision: https://developer.blender.org/D3479
2018-02-09Cycles: random walk subsurface scattering.Brecht Van Lommel
It is basically brute force volume scattering within the mesh, but part of the SSS code for faster performance. The main difference with actual volume scattering is that we assume the boundaries are diffuse and that all lighting is coming through this boundary from outside the volume. This gives much more accurate results for thin features and low density. Some challenges remain however: * Significantly more noisy than BSSRDF. Adding Dwivedi sampling may help here, but it's unclear still how much it helps in real world cases. * Due to this being a volumetric method, geometry like eyes or mouth can darken the skin on the outside. We may be able to reduce this effect, or users can compensate for it by reducing the scattering radius in such areas. * Sharp corners are quite bright. This matches actual volume rendering and results in some other renderers, but maybe not so much real world objects. Differential Revision: https://developer.blender.org/D3054
2017-11-08Code refactor: rename subsurface to local traversal, for reuse.Brecht Van Lommel
2017-03-28Cycles: Switch to reformulated Pluecker ray/triangle intersectionSergey Sharybin
The intention of this commit it to address issues mentioned in the reports T43865,T50164 and T50452. The code is based on Embree code with some extra vectorization to speed up single ray to single triangle intersection. Unfortunately, such a fix is not coming for free. There is some slowdown for AVX2 processors, mainly due to different vectorization code, which caused different number of instructions to be executed and different instructions-per-cycle counters. But on another hand this commit makes pre-AVX2 platforms such as AVX and SSE4.1 a bit faster. The prerformance goes as following: 2.78c AVX2 2.78c AVX Patch AVX2 Patch AVX BMW 05:21.09 06:05.34 05:32.97 (+3.5%) 05:34.97 (-8.5%) Classroom 16:55.36 18:24.51 17:10.41 (+1.4%) 17:15.87 (-6.3%) Fishy Cat 08:08.49 08:36.26 08:09.19 (+0.2%) 08:12.25 (-4.7% Koro 11:22.54 11:45.24 11:13.25 (-1.5%) 11:43.81 (-0.3%) Barcelone 14:18.32 16:09.46 14:15.20 (-0.4%) 14:25.15 (-10.8%) On GPU the performance is about 1.5-2% slower in my tests on GTX1080 but afraid we can't do much as a part of this chaneg here and consider it a price to pay for more proper intersection check. Made in collaboration with Maxym Dmytrychenko, big thanks to him! Reviewers: brecht, juicyfruit, lukasstockner97, dingto Differential Revision: https://developer.blender.org/D1574
2017-03-23Cycles: Remove unused macroSergey Sharybin
2017-03-23Cycles: Fix speed regression on GPUSergey Sharybin
Avoid construction of temporary array and make utility function force-inlined. Additionally avoid calling float4_to_float3 twice. This brings render times to the same values as before current patch series.
2017-03-23Cycles: Use utility function for SSS triangle intersectionSergey Sharybin
This effectively de-duplicates triangle intersection logic implemented for both regular triangle and SSS triangle.
2017-03-23Cycles: Move watertight triangle intersection to an utility fileSergey Sharybin
This way the code can be reused more easily.
2017-03-23Cycles: Move triangle intersection precalc to an util fileSergey Sharybin
This is a preparation work for the followup commit which wil l move remaining parts of Woop intersection logic to an utility file. Doing it as a separate commit to keep changes more atomic and easier to bisect when/if needed.
2017-03-23Cycles: Cleanup, move utility function to utility fileSergey Sharybin
Was an old TODO, this function is handy for some math utilities as well.
2017-03-23Cycles: Cleanup, inline AVX register construction from kernel global dataSergey Sharybin
Currently should be no functional changes, preparing for some upcoming refactor.
2017-03-08Cycles: Remove ccl_fetch and SOAMai Lavelle
2016-12-12Cycles: Cleanup, variable namesSergey Sharybin
Use underscore again and also solve confusing part then in BVH smae thing is called prim_addr but in intersection funcitons it was called triAddr.
2016-12-12Cycles: Cleanup, variables namesSergey Sharybin
Use underscore instead of camel case.
2016-10-26Cycles: Fix compilation error of AVX2 kernel without SSE mathSergey Sharybin
2016-10-25Cycles: Avoid branching in SSE version of intersection pre-calculationSergey Sharybin
Similar to the previous commit, avoid negative effect of bad branch prediction. Gives measurable performance up to ~2% in tests here. Once again, thanks to Maxym Dmytrychenko!
2016-10-24Cycles: Add AVX2 path to subsurface triangle intersectionSergey Sharybin
Similar to regular triangle intersection case. Gives about 3% speedup rendering SSS object on my desktop, Question: how to avoid such a code duplication in a nice way without speed loss?
2016-10-12Cycles: Implement AVX2 version of triangle_intersectSergey Sharybin
This commit basically vectorizes existing code using AVX2 instructions (without modifying algorithm itself). This gives quite nice speedups: BMW: -8% Classroom: -5% Cat: -5% Koro: +1% Barcelona: -8% That's on Linux machine, reported performance improvement on Windows goes up to 20%. Not currently sure why Koro is somewhat slower because it mainly uses curve intersection tests, could be a time noise? Or osmething with the cache utilization perhaps? In any case speedup in other scenes makes me thinking that current state is acceptable for initial implementation. This is again inspired by Maxym Dmytrychenko.
2016-07-31Cleanup: spelling, styleCampbell Barton
2016-07-25Cycles: Fix rays parallel to the surface in the triangle refine and MultiGGX ↵Lukas Stockner
code In the triangle intersection refinement code, rays that are parallel to the triangle caused a divide by zero. These rays might initially hit the triangle due to the watertight intersection test, but are very rare - therefore, just skipping the refinement for them works fine. Also, a few remaining issues in the MultiGGX code are fixed that were caused by rays parallel to the surface (which happened more often there due to smooth shading).
2016-07-24Fix use of uninitialized variable in recent SSS fix.Brecht Van Lommel
2016-07-18Fix T48860: Cycles SSS artifacts with spatially split BVHSergey Sharybin
The issue was caused by SSS intersection code gathering all intersections without check for duplicated ones. This caused situations when same intersection will be recorded twice in the case if triangle is shared by several BVH nodes. Usually this is handled by checking intersection distance after sorting intersections (in shadow_blocked for example) but for SSS we don't do such sorting and using number of intersections to calculate various things. Didn't find anything smarter than to check intersection distance in triangle_intersect_subsurface(). This solves render artifacts in the cost of 1.5% slowdown of extreme case rendering (SSS object filling in whole FullHD screen). Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D2105
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-06-07Cycles: Limit degenerated triangle check got CUDA onlySergey Sharybin
OpenCL seems to work fine here, and for some reason that comparison was giving compilation error on OpenCL here. Better to compile OpenCL kernel than to be fully robust to weird corner cases.
2016-06-03Cycles: Simplify check for degenerated faces on GPUSergey Sharybin
Still not sure how to properly solve the issue, needs some trickery to get actual optimized values from intersection function (using printf() avoids some optimization and makes stuff render correct). For the time being let's just simplify check.
2016-04-11Cycles: Rename tri_woop to tri_storageSergey Sharybin
It's no longer a pre-computed data and just a storage of triangle coordinates which are faster to access to.
2016-03-25Cycles: Cleanup, indent nested preprocessor directivesSergey Sharybin
Quite straightforward, main trick is happening in path_source_replace_includes(). Reviewers: brecht, dingto, lukasstockner97, juicyfruit Differential Revision: https://developer.blender.org/D1794
2016-02-15Cycles: Tweaks for 32bit CUDA binariesSergey Sharybin
Tweak some inline policies. Not totally crazy yet, and in fact we now have one less ifdef statement now.
2016-01-11Cycles: Always inline triangle precalc for CUDA devicesSergey Sharybin
Since the SSS changes compiling Experimental sm_52 kernel seems to work just fine.
2015-12-02Cycles: Fix wrong SSS intersection refinement when this option is disabledSergey Sharybin
The code is disabled by default, but we'd better keep it all correct.
2015-11-25Cysles: Avoid having ShaderData on the stackSergey Sharybin
This commit introduces a SSS-oriented intersection structure which is replacing old logic of having separate arrays for just intersections and shader data and encapsulates all the data needed for SSS evaluation. This giver a huge stack memory saving on GPU. In own experiments it gave 25% memory usage reduction on GTX560Ti (722MB vs. 946MB). Unfortunately, this gave some performance loss of 20% which only happens on GPU. This is perhaps due to different memory access pattern. Will be solved in the future, hopefully. Famous saying: won in memory - lost in time (which is also valid in other way around).
2015-10-22Cycles: Watertight fix for SSS intersectionSergey Sharybin
Same as previous commit, just was missing in there.
2015-10-22Cycles: Fix for watertight intersectionSergey Sharybin
It was possible to miss some intersection caused by wrong barycentric coordinates sign. Cases when one of the coordinate is zero and other are negative was not handled correct.
2015-09-17Fix T46143: Faces missing with GPU renderSergey Sharybin
Epsilon was quite arbitrary for GPU, replaced with checking for zero-sized faces. It should solve both original report and the new one. After the release we can check why GPU doesn't produce accurate math here and go to the root of the issue.
2015-09-09Cycles: Cleanup, typoSergey Sharybin
Spotted by Campbell, thanks!
2015-09-09Cycles: Limit triangle magnitude check for only GPUSergey Sharybin
Found a way to make AVX2 CPUs happy by reshuffling instructions a bit, so now there's no weird precision errors happening in there. This solves some render speed regressions on CPU, but unfortunately this doesn't help for GPU rendering.