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-01-20Cycles: Use dedicated debug passes for traversed nodes and intersection testsSergey Sharybin
This way it's more clear whether some issue is caused by lots of geometry in the node or by lots of "transparent" BVH nodes.
2017-01-20Fix emissive volumes generates unexpected fireflies around intersectionsSergey Sharybin
Discard the whole volume stack on the last bounce (but keep world volume if present). Volumes are expected to be closed manifol meshes, meaning if ray entered the volume there should be an intersection event of ray exisintg the volume. Case when ray hit nothing and there are still non-world volumes in the stack can happen in either of cases. 1. Mesh is not closed manifold. Such configurations are not really supported anyway and should not be used. Previous code would have consider the infinite length of the ray to sample across, so render result wasn't really correct anyway. 2. Exit intersection is more far away than the camera far clip distance. This case also will behave differently now, but previously it wasn't really correct either, so it's not like we're breaking something which was working as expected. 3. We missed exit event due to intersection precision issues. This is exact the case which this patch fixes and avoid fireflies. 4. Volume has Camera only visibility (all the rest visibility is set to off) This is what could be considered a regression but could be solved quite easily by checking volume stack's objects flags and keep entries which doesn't have Volume Scatter visibility (or even better: ensure Volume Scatter visibility for objects with volume closure), Fixes T46108: Cycles - Overlapping emissive volumes generates unexpected bright hotspots around the intersection Also fixes fireflies appearing on the edges of cube with emissive volue. Reviewers: juicyfruit, brecht Reviewed By: brecht Maniphest Tasks: T46108 Differential Revision: https://developer.blender.org/D2212
2017-01-20Cycles: Add comments to endif directivesMai Lavelle
`kernel_path.h` and `kernel_path_branched.h` have a lot of conditional code and it was kind of hard to tell what code belonged to which directive. Should be easier to read now.
2017-01-20Cycles: Deduplicate AO calculationLukas Stockner
No functional changes.
2017-01-20Cycles: Add optional probabilistic termination of light samples based on ↵Lukas Stockner
their expected contribution In scenes with many lights, some of them might have a very small contribution to some pixels, but the shadow rays are traced anyways. To avoid that, this patch adds probabilistic termination to light samples - if the contribution before checking for shadowing is below a user-defined threshold, the sample will be discarded with probability (1 - (contribution / threshold)) and otherwise kept, but weighted more to remain unbiased. This is the same approach that's also used in path termination based on length. Note that the rendering remains unbiased with this option, it just adds a bit of noise - but if the setting is used moderately, the speedup gained easily outweighs the additional noise. Reviewers: #cycles Subscribers: sergey, brecht Differential Revision: https://developer.blender.org/D2217
2016-10-19Fix Cycles CUDA performance on CUDA 8.0.Brecht Van Lommel
Mostly this is making inlining match CUDA 7.5 in a few performance critical places. The end result is that performance is now better than before, possibly due to less register spilling or other CUDA 8.0 compiler improvements. On benchmarks scenes, there are 3% to 35% render time reductions. Stack memory usage is reduced a little too. Reviewed By: sergey Differential Revision: https://developer.blender.org/D2269
2016-08-03Cycles: Recent SSS inline changes broke CPU testsSergey Sharybin
Very weird, but let's just fall back a bit for now.
2016-08-01Cycles: Tweaks to support CUDA 8 toolkitSergey Sharybin
All the changes are mainly giving explicit tips on inlining functions, so they match how inlining worked with previous toolkit. This make kernel compiled by CUDA 8 render in average with same speed as previous kernels. Some scenes are somewhat faster, some of them are somewhat slower. But slowdown is within 1% so far. On a positive side it allows us to enable newer generation cards on buildbots (so GTX 10x0 will be officially supported soon).
2016-07-11Cycles: Move BVK kernel files to own directorySergey Sharybin
BVH traversal is not really that much a geometry and we've got quite some traversals now. Makes sense to keep them separate in the name of source structure clarity.
2016-06-23Cycles: Add multi-scattering, energy-conserving GGX as an option to the ↵Lukas Stockner
Glossy, Anisotropic and Glass BSDFs This commit adds a new distribution to the Glossy, Anisotropic and Glass BSDFs that implements the multiple-scattering microfacet model described in the paper "Multiple-Scattering Microfacet BSDFs with the Smith Model". Essentially, the improvement is that unlike classical GGX, which only models single scattering and assumes the contribution of multiple bounces to be zero, this new model performs a random walk on the microsurface until the ray leaves it again, which ensures perfect energy conservation. In practise, this means that the "darkening problem" - GGX materials becoming darker with increasing roughness - is solved in a physically correct and efficient way. The downside of this model is that it has no (known) analytic expression for evalation. However, it can be evaluated stochastically, and although the correct PDF isn't known either, the properties of MIS and the balance heuristic guarantee an unbiased result at the cost of slightly higher noise. Reviewers: dingto, #cycles, brecht Reviewed By: dingto, #cycles, brecht Subscribers: bliblubli, ace_dragon, gregzaal, brecht, harvester, dingto, marcog, swerner, jtheninja, Blendify, nutel Differential Revision: https://developer.blender.org/D2002
2016-05-25Cycles CUDA: reduce branched path stack memory by sharing indirect ShaderData.Brecht Van Lommel
Saves about 15% for the branched path kernel.
2016-05-23Cycles CUDA: reduce stack memory by reusing ShaderData.Brecht Van Lommel
57% less for path and 48% less for branched path.
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-19Workaround for T47213: branched path sampling issues with CUDA 7.5.Brecht Van Lommel
2016-01-14Cycles: Tweak inline policy for some functionsSergey Sharybin
The goal is to make Experimental kernel closer in performance to the official kernel, avoiding spills and such. There should not be big impact on official kernel, own tests showed few percent performance drop on laptop's GPU. CPU was always the same speed on AVX, AVX2 and SSE4.1 CPUs i've been testing here. This seems to be the last essential step before we can get rid of Experimental kernel and enable SSS officially on GPU without causing some major performance issues. Surely some more tweaks are possibly required, but that we can do for until cows go home anyway.
2016-01-07Cycles: Refactor how we pass bounce info to light path node.Thomas Dinges
This commit changes the way how we pass bounce information to the Light Path node. Instead of manualy copying the bounces into ShaderData, we now directly pass PathState. This reduces the arguments that we need to pass around and also makes it easier to extend the feature. This commit also exposes the Transmission Bounce Depth to the Light Path node. It works similar to the Transparent Depth Output: Replace a Transmission lightpath after X bounces with another shader, e.g a Diffuse one. This can be used to avoid black surfaces, due to low amount of max bounces. Reviewed by Sergey and Brecht, thanks for some hlp with this. I tested compilation and usage on CPU (SVM and OSL), CUDA, OpenCL Split and Mega kernel. Hopefully this covers all devices. :)
2015-12-02Cycles: Fix SSS object not properly reflected in glossy object with indirect ↵Sergey Sharybin
clamping This fixes remained issues reported in T46908.
2015-11-28Cycles: Fix wrong volume stack after SSS bounceSergey Sharybin
Was introduced by a recent fixes, now it should be all correct and additionally it solves the TODO mentioned in the code.
2015-11-28Cycles: Fix wrong original ray used for SSS bakingSergey Sharybin
Also de-duplicated some code by moving to an utility function.
2015-11-28Cycles: Set of fixes for delayed SSS ray tracingSergey Sharybin
There were multiple issues which are solved now: - It was possible that ray wouldn't be bounced off the BSSRDF, for example when PDF or shader eval is zero. In this case PathState might have been left in pre-bounced state which would have been gave incorrect shading results. This is solved by having separate PathState for each of the hits. - Path radiance summing wasn't happening correct as well, indirect rays were using wrong path radiance in the case when there were more than one hit recorded. This is now using a bit trickier state machine which calculates path radiance for just SSS (both direct and indirect) and then sums it back to the final radiance. - Previous commit wasn't totally correct either and was an induced bug due to wrong path state left from the "un-happened" ray bounce. There should be no special case happening here, BSSRDFs will be replaced with diffuse ones due to PATH_RAY_DIFFUSE_ANCESTOR flag. - Merged back codebases for "delayed" and "immediate" indirect SSS ray tracing, hopefully making it easier to maintain the codebase. Sure this changes brings memory usage back by about 4-5%, but overall it's still about 2x memory reduction for the experimental kernel here. Thanks Brecht for the review!
2015-11-28Cycles: Fallback to diffuse BSDF for the indirect SSS rays when BSSRDF is hitSergey Sharybin
This is actually how it was intended to work, just didn't notice it wasn't really happening in the main ray loop. Solves some memory issues reported in T46880.
2015-11-27Cycles: Fully roll-back to non-delayed SSS indirect rays for CPUSergey Sharybin
There are some issues to be solved with the recent optimization we did for the indirect rays for the SSS. Those issues will take a bit of a time to be fully solved still and we need to unlock Caminandes team now, so let's revert some changes back. CUDA will still use delayed indirect rays since it's an experimental feature. For the details about what's to be done still please refer to T46880.
2015-11-27Revert "Cycles: Fix wrong SSS with regular path tracing and clamping enabled"Sergey Sharybin
This wasn't really a complete fix and only worked if there was a single scatter event recorded only. Proper fix requires some more thoughts to make it correct without memory use increase. This reverts commit bf9e88bfbebaf5c6228363560970fa526e779c8b.
2015-11-26Cycles: Fix wrong SSS with regular path tracing and clamping enabledSergey Sharybin
Radiance sum and reset was happening in different order after 26f1c51. This is a quick fix to unlock Caminandes team, perhaps we can avoid having separate variable to detect when radiance is to be sum.
2015-11-25Cycles: Trace indirect subsurface rays by restarting the integrator loopSergey Sharybin
This gives much lower stack usage on GPU and reduces kernel memory size to around 448MB on GTX560Ti (comparing to 652MB with previous commit and 946MB with official release). There's also a barely measurable speedup of around 5%, but this is to be confirmed still. At this stage we're using only ~3% for the experimental kernel and SSS rendering seems to be faster by 40% and after some further testing we might consider making SSS and CMJ official features and remove experimental precompiled kernels.
2015-11-25Cycles: Delay shooting SSS indirect raysSergey Sharybin
The idea is to delay shooting indirect rays for the SSS sampling and trace them after the main integration loop was finished. This reduces GPU stack usage even further and brings it down to around 652MB (comparing to 722MB before the change and 946MB with previous stable release). This also solves the speed regression happened in the previous commit and now simple SSS scene (SSS suzanne on the floor) renders in 0:50 (comparing to 1:16 with previous commit and 1:03 with official release).
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-06-16Cycles: Move branched path tracking into own fileSergey Sharybin
Code there started becoming a bit too big, by splitting it up it'll make it easier to do improvements or extending the features in there. The layout is not totally final yet, would need to try de-duplicating parts of code from split kernel with non-split integrators,
2015-06-12Cycles: Add debug pass which shows number of instance pushes during camera ↵Sergey Sharybin
ray intersection TODO: We might want to refactor debug passes into PASS_DEBUG and some debug_type (similar to Blender's side passes) to avoid issue of running out of bits.
2015-06-11Cycles: Add debug pass showing average number of ray bounces per pixelSergey Sharybin
Quite straightforward implementation, but still needs some work for the split kernel. Includes both regular and split kernel implementation for that. The pass is not exposed to the interface yet because it's currently not really easy to have same pass listed in the menu multiple times.
2015-05-09Cycles: OpenCL kernel splitGeorge Kyriazis
This commit contains all the work related on the AMD megakernel split work which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely someone else which we're forgetting to mention. Currently only AMD cards are enabled for the new split kernel, but it is possible to force split opencl kernel to be used by setting the following environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1. Not all the features are supported yet, and that being said no motion blur, camera blur, SSS and volumetrics for now. Also transparent shadows are disabled on AMD device because of some compiler bug. This kernel is also only implements regular path tracing and supporting branched one will take a bit. Branched path tracing is exposed to the interface still, which is a bit misleading and will be hidden there soon. More feature will be enabled once they're ported to the split kernel and tested. Neither regular CPU nor CUDA has any difference, they're generating the same exact code, which means no regressions/improvements there. Based on the research paper: https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf Here's the documentation: https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit Design discussion of the patch: https://developer.blender.org/T44197 Differential Revision: https://developer.blender.org/D1200
2015-05-08Cleanup: Remove unused ray type flags.Thomas Dinges
They were added for completeness, but it seems we don't need them.
2015-04-28Cleanup: Move Cycles volume stack update for subsurface into kernel_volume.h.Thomas Dinges
2015-03-13Cycles: Simplify volume light connect code.Thomas Dinges
2015-02-26Revert "Cleanup: Simplify camera sample motion blur code."Thomas Dinges
This reverts commit 8197f0bb645f73f41071daaccf205a7583e695f5.
2015-02-26Cleanup: Simplify camera sample motion blur code.Thomas Dinges
2015-02-14Cycles: Small improvement for volume render (decoupled)Thomas Dinges
Simplify branching here a bit, helps ~3% in volume_light_sampling.blend (Branched MIS scene).
2015-02-05Fix T43562: Cycles gets stuck with camera in volume in certain setupSergey Sharybin
The issue was caused by the way how we shoot the ray to see which rays we're inside which might start bouncing back-n-forth between two close to parallel intersecting faces. Real solution would be to record all the intersections when shooting the ray, but it's kinda tricky on GPU because of needed sorting and uncertainty of how huge intersection array should be. For now we'll just limit number of steps in the check so in worst case we'll have some samples not being correct which will be compensated with further sampling. Shouldn't be an issue since probability of such a lock is quite small actually.
2014-12-25Cleanup: Fix Cycles Apache header.Thomas Dinges
This was already mixed a bit, but the dot belongs there.
2014-10-07Cleanup: warningsCampbell Barton
2014-10-06Cycles: Optimize of volume stack update when sampling SSSSergey Sharybin
basically we skip all non-volume objects now in the volume stack function. Depending on the show it might give some percent of speedup. Most of the speedup would be gained in the scenes when having SSS object intersecting the volume and taking a reasonable amount of frame space.
2014-10-05Cycles: Make OpenCL folks happy to use __KERNEL_DEBUG__Sergey Sharybin
Quite straightforward change, the only annoying thing is that we can't use indentation for include directive just because of the way headers inlineing works for OpenCL. Might do smarter job in path_source_replace_includes() but don't want to spend time on this yet.
2014-10-04Cycles: Add support for debug passesSergey Sharybin
Currently only summed number of traversal steps and intersections used by the camera ray intersection pass is implemented, but in the future we will support more debug passes which would help checking what things makes the scene slow. Example of such extra passes could be number of bounces, time spent on the shader tree evaluation and so. Implementation from the Cycles side is pretty much straightforward, could only mention here that it's a build-time option disabled by default. From the blender side it's implemented as a PASS_DEBUG with several subtypes possible. This way we don't need to create an extra DNA pass type for each of the debug passes, saving us a bits. Reviewers: campbellbarton Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D813
2014-10-03Cycles: Implement preliminary test for volume stack update from SSSSergey Sharybin
This adds an AABB collision check for objects with volumes and if there's a collision detected then the object will have SD_OBJECT_INTERSECTS_VOLUME flag. This solves a speed regression introduced by the fix for T39823 by skipping volume stack update in cases no volumes intersects the current SSS object.
2014-09-28Cycles: Avoid temp variable in camera-in-volume checkSergey Sharybin
Was a left-over from some experiments, no need it with the current implementation, and likely wouldn't need in the future.
2014-09-28Cycles: Cleanup of the SSS volume stack update codeSergey Sharybin
Was a leftover after the changed scene_intersect() which used to be ifdefed depending on the __HAIR__ in the original patch.
2014-09-26Code style.Thomas Dinges
2014-09-25Cycles: Add support for cameras inside volumeSergey Sharybin
Basically the title says it all, volume stack initialization now is aware that camera might be inside of the volume. This gives quite noticeable render time regressions in cases camera is in the volume (didn't measure them yet) because this requires quite a few of ray-casting per camera ray in order to check which objects we're inside. Not quite sure if this might be optimized. But the good thing is that we can do quite a good job on detecting whether camera is outside of any of the volumes and in this case there should be no time penalty at all (apart from some extra checks during the sync state). For now we're only doing rather simple AABB checks between the viewplane and volume objects. This could give some false-positives, but this should be good starting point. Need to mention panoramic cameras here, for them it's only check for whether there are volumes in the scene, which would lead to speed regressions even if the camera is outside of the volumes. Would need to figure out proper check for such cameras. There are still quite a few of TODOs in the code, but the patch is good enough to start playing around with it checking whether there are some obvious mistakes somewhere. Currently the feature is only available in the Experimental feature sey, need to solve some of the TODOs and look into making things faster before considering the feature is ready for the official feature set. This would still likely happen in current release cycle. Reviewers: brecht, juicyfruit, dingto Differential Revision: https://developer.blender.org/D794
2014-09-25Fix T39823: SSS scatter doesn't update volume stack, causing shading artifactsSergey Sharybin
Basically the title says it all, we need to update volume stack when doing ray scatter for SSS. This leads to speed regressions in cases scene does have both volume and SSS (performance in case there's no SSS or no volume should be the same). We might try optimizing kernel_path_subsurface_update_volume_stack() a bit by either recording all intersections or using some more appropriate visibility flags. Reviewers: brecht, juicyfruit, dingto Differential Revision: https://developer.blender.org/D795
2014-09-24Cleanup: Avoid some defines for scene_intersect(), related to Min Width.Thomas Dinges