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
2021-06-28Cycles: reduce shadow terminator artifactsMikhail Matrosov
Offset rays from the flat surface to match where they would be for a smooth surface as specified by the normals. In the shading panel there is now a Shading Offset (existing option) and Geometry Offset (new). The Geometry Offset works as follows: * 0: disabled * 0.001: only terminated triangles (normal points to the light, geometry doesn't) are affected * 0.1 (default): triangles at grazing angles are affected, and the effect fades out * 1: all triangles are affected Limitations: * The artifact is still visible in some cases, it could be that some quads require to be treated specifically as quads. * Inconsistent normals cause artifacts. * If small objects cast shadows to a big low poly surface, the shadows can appear to be in a wrong place - because the surface moved slightly above the geometry. This can be noticed only at grazing angles to light. * Approximated surfaces of two non-intersecting low-poly objects can overlap that causes off-the-wall shadows. Generally, using one or a few levels of subdivision can get rid of artifacts faster than before. Differential Revision: https://developer.blender.org/D11065
2021-02-17Cycles: add utility functions for zero float2/float3/float4/transformBrecht Van Lommel
Ref D8237, T78710
2020-06-17Cycles: Add new Sky Texture method including direct sunlightLukas Stockner
This commit adds a new model to the Sky Texture node, which is based on a method by Nishita et al. and works by basically simulating volumetric scattering in the atmosphere. By making some approximations (such as only considering single scattering), we get a fairly simple and fast simulation code that takes into account Rayleigh and Mie scattering as well as Ozone absorption. This code is used to precompute a 512x128 texture which is then looked up during render time, and is fast enough to allow real-time tweaking in the viewport. Due to the nature of the simulation, it exposes several parameters that allow for lots of flexibility in choosing the look and matching real-world conditions (such as Air/Dust/Ozone density and altitude). Additionally, the same volumetric approach can be used to compute absorption of the direct sunlight, so the model also supports adding direct sunlight. This makes it significantly easier to set up Sun+Sky illumination where the direction, intensity and color of the sun actually matches the sky. In order to support properly sampling the direct sun component, the commit also adds logic for sampling a specific area to the kernel light sampling code. This is combined with portal and background map sampling using MIS. This sampling logic works for the common case of having one Sky texture going into the Background shader, but if a custom input to the Vector node is used or if there are multiple Sky textures, it falls back to using only background map sampling (while automatically setting the resolution to 4096x2048 if auto resolution is used). More infos and preview can be found here: https://docs.google.com/document/d/1gQta0ygFWXTrl5Pmvl_nZRgUw0mWg0FJeRuNKS36m08/view Underlying model, implementation and documentation by Marco (@nacioss). Improvements, cleanup and sun sampling by @lukasstockner. Differential Revision: https://developer.blender.org/D7896
2020-02-25Cycles: move sss and diffuse transmission into diffuse passBrecht Van Lommel
This simplifies compositors setups and will be consistent with Eevee render passes from D6331. There's a continuum between these passes and it's not clear there is much advantage to having them available separately. Differential Revision: https://developer.blender.org/D6848
2019-12-12Cycles: perform clamping per light contribution instead of whole pathLukas Stockner
With upcoming light group passes, for them to sum up correctly to the combined pass the clamping must be more fine grained. This also has the advantage that if one light is particularly noisy, it does not diminish the contribution from other lights which do not need as much clamping. Clamp values on existing scenes will need to be tweaked to get similar results, there is no automatic conversion possible which would give the same results as before. Implemented by Lukas, with tweaks by Brecht. Part of D4837
2019-12-10Cycles: support for custom shader AOVsLukas Stockner
Custom render passes are added in the Shader AOVs panel in the view layer settings, with a name and data type. In shader nodes, an AOV Output node is then used to output either a value or color to the pass. Arbitrary names can be used for these passes, as long as they don't conflict with built-in passes that are enabled. The AOV Output node can be used in both material and world shader nodes. Implemented by Lukas, with tweaks by Brecht. Differential Revision: https://developer.blender.org/D4837
2019-08-26Cleanup: avoid unnecessary primitive type lookup and variable initializationPatrick Mours
Ref D5363
2019-08-26Cycles: code to optionally zero initialize some structs in the kernelBrecht Van Lommel
This will be used by Optix to help the compiler figure out scoping. It is not used by other devices currently, but worth testing if it helps there too. Ref D5363
2019-08-26Cycles: inline more functions on the GPUPatrick Mours
This makes little difference for CUDA and OpenCL, but will be helpful for Optix.
2019-08-26Cycles: tweaks for better GPU code generationPatrick Mours
Uninitialized variables are harder to handle for the compiler. Ref D5363
2019-05-13Cycles/Eevee: unify light strength and colorBrecht Van Lommel
Cycles lights now use strength and color properties of the light outside of the shading nodes, just like Eevee. The shading nodes then act as a multiplier on this, and become optional unless textures, fallof or other effects are desired. Backwards compatibility is not exact, as we can't be sure which renderer the .blend was designed for or even if it was designed for a single one. If the render engine in the active scene is set to Cycles, lights are converted to ensure overall light strength remains the same, and removing unnecessary shader node setups that only included a single emission node. If the engine is set to Eevee, we increase strength to remove the automatic 100x multiplier that was there to match Cycles. Differential Revision: https://developer.blender.org/D4588
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
2019-03-18Fix T62712: Cycles world light path node not working.Brecht Van Lommel
2019-03-17Cycles: optimization for constant background colors.Brecht Van Lommel
Skip shader evaluation then, as we already do for lights. Less than 1% faster in my tests, but might as well be consistent for both.
2018-07-06Cleanup: strip trailing space for cyclesCampbell Barton
2018-06-14Cycles: Automatically detect HDRI resolution by default and use non-square ↵Lukas Stockner
sampling map The automatic mode checks all Enviroment Texture nodes and picks the largest image's resolution. If there are no Enviroment Textures, it just uses the old default. Also, the sampling map now isn't limited to square shapes. The automatic detection uses the exact image size, the manual UI option now halves the value to get the height. A default aspect ratio of 2:1 makes sense since this is what most HDRIs use. Reviewers: brecht, sergey Differential Revision: https://developer.blender.org/D3477
2018-03-10Code refactor: use KernelShader and KernelParticle instead of float arrays.Stefan Werner
Original patch by Stefan with modifications by Brecht.
2018-02-22Cycles: better path termination for transparency.Brecht Van Lommel
We now continue transparent paths after diffuse/glossy/transmission/volume bounces are exceeded. This avoids unexpected boundaries in volumes with transparent boundaries. It is also required for MIS to work correctly with transparent surfaces, as we also continue through these in shadow rays. The main visible changes is that volumes will now be lit by the background even at volume bounces 0, same as surfaces. Fixes T53914 and T54103.
2017-11-05Cycles: reduce closure memory usage for emission/shadow shader data.Brecht Van Lommel
With a Titan Xp, reduces path trace local memory from 1092MB to 840MB. Benchmark performance was within 1% with both RX 480 and Titan Xp. Original patch was implemented by Sergey. Differential Revision: https://developer.blender.org/D2249
2017-09-20Cycles: slightly improve BSDF sample stratification for path tracing.Brecht Van Lommel
Similar to what we did for area lights previously, this should help preserve stratification when using multiple BSDFs in theory. Improvements are not easily noticeable in practice though, because the number of BSDFs is usually low. Still nice to eliminate one sampling dimension.
2017-09-13Code cleanup: deduplicate some branched and split kernel code.Brecht Van Lommel
Benchmarks peformance on GTX 1080 and RX 480 on Linux is the same for bmw27, classroom, pabellon, and about 2% faster on fishy_cat and koro.
2017-08-24Code cleanup: remove shader context.Brecht Van Lommel
This was needed when we accessed OSL closure memory after shader evaluation, which could get overwritten by another shader evaluation. But all closures are immediatley converted to ShaderClosure now, so no longer needed.
2017-08-19Code cleanup: move rng into path state.Brecht Van Lommel
Also pass by value and don't write back now that it is just a hash for seeding and no longer an LCG state. Together this makes CUDA a tiny bit faster in my tests, but mainly simplifies code.
2017-08-17Improved triangle sampling for mesh lightsStefan Werner
This implements Arvo's "Stratified sampling of spherical triangles". Similar to how we sample rectangular area lights, this is sampling triangles over their solid angle. It does significantly improve sampling close to the triangle, but doesn't do much for more distant triangles. So I added a simple heuristic to switch between the two methods. Unfortunately, I expect this to add render time in any case, even when it does not make any difference whatsoever. It'll take some benchmarking with various scenes and hardware to estimate how severe the impact is and if it is worth the change. Reviewers: #cycles, brecht Reviewed By: #cycles, brecht Subscribers: Vega-core, brecht, SteffenD Tags: #cycles Differential Revision: https://developer.blender.org/D2730
2017-03-27Cycles: First implementation of shadow catcherSergey Sharybin
It uses an idea of accumulating all possible light reachable across the light path (without taking shadow blocked into account) and accumulating total shaded light across the path. Dividing second figure by first one seems to be giving good estimate of the shadow. In fact, to my knowledge, it's something really similar to what is happening in the denoising branch, so we are aligned here which is good. The workflow is following: - Create an object which matches real-life object on which shadow is to be catched. - Create approximate similar material on that object. This is needed to make indirect light properly affecting CG objects in the scene. - Mark object as Shadow Catcher in the Object properties. Ideally, after doing that it will be possible to render the image and simply alpha-over it on top of real footage.
2017-03-20Fix T50975: Cycles: Light sampling threshold inadvertently clamps negative lampsSergey Sharybin
2017-03-08Cycles: Remove ccl_fetch and SOAMai Lavelle
2016-10-30Cycles: 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-29Cycles: Implement texture coordinates for Point, Spot and Area LampsLukas Stockner
When using the Normal output of the Texture Coordinate node on Point and Spot lamps, the coordinates now depend on the rotation of the lamp. On Area lamps, the Parametric output of the Geometry node now returns UV coordinates on the area lamp. Credit for the Area lamp part goes to Stefan Werner (from D1995).
2016-09-14Cycles: Also support the constant emission speedup for mesh lightsLukas Stockner
Reviewers: brecht, sergey, dingto, juicyfruit Differential Revision: https://developer.blender.org/D2220
2016-09-11Cycles: Replace object index hack with actual checks for SD_TRANSFORM_APPLIEDMai Lavelle
Using ones complement for detecting if transform has been applied was confusing and led to several bugs. With this proper checks are made. Also added a few transforms where they were missing, mostly affecting baking and displacement when `P` is used in the shader (previously `P` was in the wrong space for these shaders) Also removed `TIME_INVALID` as this may have resulted in incorrect transforms in some cases. Reviewed By: brecht Differential Revision: https://developer.blender.org/D2192
2016-09-09Cycles: Don't run full shader evaluation for constant emission lampsLukas Stockner
Most of the time, Lamps in Cycles are just a constant emission closure, no texturing etc. Therefore, running a full shader evaluation is wasteful. To avoid that, Cycles now detects these constant emission shaders and stores their value in the lamp data along with a flag in the shader. Then, at runtime, if this flag is set, the lamp code just uses this value and only runs the full shader evaluation if it is neccessary. In scenes with a lot of lamps and with "Sample all direct/indirect" enabled, this saves up to 20% of rendering time in my tests. Reviewers: #cycles Differential Revision: https://developer.blender.org/D2193
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-06-21Fix T48698: Rays from SSS act as diffuse for normal objects but have an ↵Lukas Stockner
undefined type for lamp objects The problem here was that there are five path types internally (diffuse, glossy, transmission, subsurface and volume scatter), but subsurface isn't exposed to the user. This caused some weird behaviour - if all four types are disabled on the lamp, Cycles doesn't even try sampling it, but if any type was active, the lamp would illuminate the cube since none of the options set subsurface to zero. In the future, it might be reasonable to add subsurface visibility as an option - but for now the weird and inconsistent behaviour can be fixed simply by setting both diffuse and subsurface to zero if the user disables diffuse visibility.
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-01-28Cycles: Remove few function arguments needed only for the split kernelSergey Sharybin
Use KernelGlobals to access all the global arrays for the intermediate storage instead of passing all this storage things explicitly. Tested here with Intel OpenCL, NVIDIA GTX580 and AMD Fiji, didn't see any artifacts, so guess it's all good. Reviewers: juicyfruit, dingto, lukasstockner97 Differential Revision: https://developer.blender.org/D1736
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-11-26Fix T46760: Branched Path Tracing converges to different result than plain ↵Stefan Werner
Path Tracing Multiple importance sampling for branched path tracing light samples needs to be calculated separately per BSDF, not with Veach's one sample model.
2015-05-21Cleanup: Remove some outdated comments related to split kernel.Thomas Dinges
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-04-27Cycles: Added support for light portalsLukas Stockner
This patch adds support for light portals: objects that help sampling the environment light, therefore improving convergence. Using them tor other lights in a unidirectional pathtracer is virtually useless. The sampling is done with the area-preserving code already used for area lamps. MIS is used both for combination of different portals and for combining portal- and envmap-sampling. The direction of portals is considered, they aren't used if the sampling point is behind them. Reviewers: sergey, dingto, #cycles Reviewed By: dingto, #cycles Subscribers: Lapineige, nutel, jtheninja, dsisco11, januz, vitorbalbio, candreacchio, TARDISMaker, lichtwerk, ace_dragon, marcog, mib2berlin, Tunge, lopataasdf, lordodin, sergey, dingto Differential Revision: https://developer.blender.org/D1133
2015-03-25Fix T44128: Ray visibility only enables diffuse if glossy is also enabledSergey Sharybin
Issue was caused by accident in c8a9a56 which not only disabled glossy reflection if Glossy visibility is disabled, but also Diffuse reflection. Quite safe and should go to final release branch.
2015-01-14Fix T42621: Glossy world ray visibility affects on transmission raysSergey Sharybin
There seems to be inconsistency in flags checks in Cycles kernel. In the interface glossy means "Glossy Reflection" and it is properly taken into account when doing visibility check in BVH traversal. The check in indirect background/light emission was treating this flags as "any of glossy reflection or transmission" which is kind of weird. Made it so emission code follows ray visibility assumptions in other parts of the kernel now.
2014-12-25Cleanup: Fix Cycles Apache header.Thomas Dinges
This was already mixed a bit, but the dot belongs there.
2014-09-05Cycles: Initial support for volume ray visibility.Thomas Dinges
This adds a new "Volume Scatter" option to the "Ray Visibility" panels and can be used to e.g. exclude lamps from having an influence on the volume. See release logs for an example: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Cycles Differential revision: https://developer.blender.org/D771
2014-06-14Cycles: volume light samplingBrecht Van Lommel
* Volume multiple importace sampling support to combine equiangular and distance sampling, for both homogeneous and heterogeneous volumes. * Branched path "Sample All Direct Lights" and "Sample All Indirect Lights" now apply to volumes as well as surfaces. Implementation note: For simplicity this is all done with decoupled ray marching, the only case we do not use decoupled is for distance only sampling with one light sample. The homogeneous case should still compile on the GPU because it only requires fixed size storage, but the heterogeneous case will be trickier to get working.
2014-06-14Cycles code refactor: minor changes to light emission code.Brecht Van Lommel
2014-05-04Style cleanup: indentation, bracesCampbell Barton
2014-05-01Cycles: MIS for lamps now loops over all lamps instead of picking one.Brecht Van Lommel
Probably will not be noticed in most scenes. This helps reduce noise when you have multiple lamps with MIS enabled, at the cost of some performance, but from testing some scenes this seems better.