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-10-26Cycles: remove prefix from source code file namesBrecht Van Lommel
Remove prefix of filenames that is the same as the folder name. This used to help when #includes were using individual files, but now they are always relative to the cycles root directory and so the prefixes are redundant. For patches and branches, git merge and rebase should be able to detect the renames and move over code to the right file.
2021-10-18Cleanup: consistently use uint32_t for path flagBrecht Van Lommel
2021-10-18Cycles: replace integrator state argument macrosBrecht Van Lommel
* Rename struct KernelGlobals to struct KernelGlobalsCPU * Add KernelGlobals, IntegratorState and ConstIntegratorState typedefs that every device can define in its own way. * Remove INTEGRATOR_STATE_ARGS and INTEGRATOR_STATE_PASS macros and replace with these new typedefs. * Add explicit state argument to INTEGRATOR_STATE and similar macros In preparation for decoupling main and shadow paths. Differential Revision: https://developer.blender.org/D12888
2021-10-14Cycles: Kernel address space changes for MSLMichael Jones
This is the first of a sequence of changes to support compiling Cycles kernels as MSL (Metal Shading Language) in preparation for a Metal GPU device implementation. MSL requires that all pointer types be declared with explicit address space attributes (device, thread, etc...). There is already precedent for this with Cycles' address space macros (ccl_global, ccl_private, etc...), therefore the first step of MSL-enablement is to apply these consistently. Line-for-line this represents the largest change required to enable MSL. Applying this change first will simplify future patches as well as offering the emergent benefit of enhanced descriptiveness. The vast majority of deltas in this patch fall into one of two cases: - Ensuring ccl_private is specified for thread-local pointer types - Ensuring ccl_global is specified for device-wide pointer types Additionally, the ccl_addr_space qualifier can be removed. Prior to Cycles X, ccl_addr_space was used as a context-dependent address space qualifier, but now it is either redundant (e.g. in struct typedefs), or can be replaced by ccl_global in the case of pointer types. Associated function variants (e.g. lcg_step_float_addrspace) are also redundant. In cases where address space qualifiers are chained with "const", this patch places the address space qualifier first. The rationale for this is that the choice of address space is likely to have the greater impact on runtime performance and overall architecture. The final part of this patch is the addition of a metal/compat.h header. This is partially complete and will be extended in future patches, paving the way for the full Metal implementation. Ref T92212 Reviewed By: brecht Maniphest Tasks: T92212 Differential Revision: https://developer.blender.org/D12864
2021-10-11Cycles: improve SSS Fresnel and retro-reflection in Principled BSDFBrecht Van Lommel
For details see the "Extending the Disney BRDF to a BSDF with Integrated Subsurface Scattering" paper. We split the diffuse BSDF into a lambertian and retro-reflection component. The retro-reflection component is always handled as a BSDF, while the lambertian component can be replaced by a BSSRDF. For the BSSRDF case, we compute Fresnel separately at the entry and exit points, which may have different normals. As the scattering radius decreases this converges to the BSDF case. A downside is that this increases noise for subsurface scattering in the Principled BSDF, due to some samples going to the retro-reflection component. However the previous logic (also in 2.93) was simple wrong, using a non-sensical view direction vector at the exit point. We use an importance sampling weight estimate for the retro-reflection to try to better balance samples between the BSDF and BSSRDF. Differential Revision: https://developer.blender.org/D12801
2021-10-11Cycles: restore Christensen-Burley SSSBrecht Van Lommel
There is not enough time before the release to improve Random Walk to handle all cases this was used for, so restore it for now. Since there is no more path splitting in cycles-x, this can increase noise in non-flat areas for the sample number of samples, though fewer rays will be traced also. This is fundamentally a trade-off we made in the new design and why Random Walk is a better fit. However the importance resampling we do now does help to reduce noise. Differential Revision: https://developer.blender.org/D12800
2021-10-06Fix T91064: Cycles low poly meshes having black edges when shade smoothedMikhail Matrosov
Fixes:{T91064} Caused by {rBcd118c5581f482afc8554ff88b5b6f3b552b1682} - Applies `ensure_valid_reflection()` to the normal input on all BSDFs for CPU and GPU. - This doesn't affect hair. - Removes `ensure_valid_reflection()` from the output of Bump Map and Normal Map nodes for CPU/GPU as it is not needed. - The fix doesn't touch OSL. Reviewed By: brecht, leesonw Maniphest Tasks: T91064 Differential Revision: https://developer.blender.org/D12403
2021-09-21Cycles: merge of cycles-x branch, a major update to the rendererBrecht Van Lommel
This includes much improved GPU rendering performance, viewport interactivity, new shadow catcher, revamped sampling settings, subsurface scattering anisotropy, new GPU volume sampling, improved PMJ sampling pattern, and more. Some features have also been removed or changed, breaking backwards compatibility. Including the removal of the OpenCL backend, for which alternatives are under development. Release notes and code docs: https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles https://wiki.blender.org/wiki/Source/Render/Cycles Credits: * Sergey Sharybin * Brecht Van Lommel * Patrick Mours (OptiX backend) * Christophe Hery (subsurface scattering anisotropy) * William Leeson (PMJ sampling pattern) * Alaska (various fixes and tweaks) * Thomas Dinges (various fixes) For the full commit history, see the cycles-x branch. This squashes together all the changes since intermediate changes would often fail building or tests. Ref T87839, T87837, T87836 Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-02-22Fix Principled BSDF specular color for black base colorPascal Schön
Specular color is set to black instead of white inside the Principled BSDF when the base color is set to fully black. This is contradictory to the sample code of the Disney BRDF in BRDF Explorer. This patch aligns both implementations. Differential Revision: https://developer.blender.org/D10448
2020-06-22Cycles: always perform backface culling for curve, remove optionBrecht Van Lommel
The hair BSDFs are already designed to assume this, and disabling backface culling would break them in some cases. Ref T73778 Depends on D8009 Maniphest Tasks: T73778 Differential Revision: https://developer.blender.org/D8010
2020-05-15Cycles: Refactor microfacet BSDFs to remove separate anisotropy codeLukas Stockner
Since the sampling and evaluation functions handle both cases anyways, there's not really a point for keeping the distinction in the kernel, so we might as well cut down the number of CLOSURE_BSDF_MICROFACETs a bit. Differential Revision: https://developer.blender.org/D7736
2020-03-20Fix T74345: missing albedo for Cycles principled hair BSDFBrecht Van Lommel
2020-01-21Partial Fix T73043: Denoising Albedo not working well for SheenLukas Stockner
Similar to the Microfacet Closures, the Principled BSDF Sheen closure is added at a high weight but typically results in fairly low values. Therefore, the default weight is a bad indicator of importance. The fix here is the same as it was back then for Microfacets: Compute an average weight using the normal as the half-vector and use it to scale down the sample weight and the albedo channel. In addition to drastically improving denoising of materials with sheen when using the new Denoising node, this also can reduce noise on such materials considerably.
2019-08-26Cycles: change svm node decoding for more efficient code generation on GPUPatrick Mours
These functions no longer accept NULL. They were renamed for clarity and to avoid hidden merge issues. Ref D5363
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-02-19T61513: Refactored Cycles Attribute RetrievalJeroen Bakker
There is a generic function to retrieve float and float3 attributes `primitive_attribute_float` and primitive_attribute_float3`. Inside these functions an prioritised if-else construction checked where the attribute is stored and then retrieved from that location. Actually the calling function most of the time already knows where the data is stored. So we could simplify this by splitting these functions and remove the check logic. This patch splits the `primitive_attribute_float?` functions into `primitive_surface_attribute_float?` and `primitive_volume_attribute_float?`. What leads to less branching and more optimum kernels. The original function is still being used by OSL and `svm_node_attr`. This will reduce the compilation time and render time for kernels. Especially in production scenes there is a lot of benefit. Impact in compilation times job | scene_name | previous | new | percentage -------+-----------------+----------+-------+------------ t61513 | empty | 10.63 | 10.66 | 0% t61513 | bmw | 17.91 | 17.65 | 1% t61513 | fishycat | 19.57 | 17.68 | 10% t61513 | barbershop | 54.10 | 24.41 | 55% t61513 | classroom | 17.55 | 16.29 | 7% t61513 | koro | 18.92 | 18.05 | 5% t61513 | pavillion | 17.43 | 16.52 | 5% t61513 | splash279 | 16.48 | 14.91 | 10% t61513 | volume_emission | 36.22 | 21.60 | 40% Impact in render times job | scene_name | previous | new | percentage -------+-----------------+----------+--------+------------ 61513 | empty | 21.06 | 20.35 | 3% 61513 | bmw | 198.44 | 190.05 | 4% 61513 | fishycat | 394.20 | 401.25 | -2% 61513 | barbershop | 1188.16 | 912.39 | 23% 61513 | classroom | 341.08 | 340.38 | 0% 61513 | koro | 472.43 | 471.80 | 0% 61513 | pavillion | 905.77 | 899.80 | 1% 61513 | splash279 | 55.26 | 54.86 | 1% 61513 | volume_emission | 62.59 | 61.70 | 1% There is also a possitive impact when using CPU and CUDA, but they are small. I didn't split the hair logic from the surface logic due to: * Hair and surface use same attribute types. It was not clear if it could be splitted when looking at the code only. * Hair and surface are quick to compile and to read. So the benefit is quite small. Differential Revision: https://developer.blender.org/D4375
2018-11-15Cycles: Cleanup, code styleSergey 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-09-12Cycles: Don't allocate Extra if BSDF allocation failedSergey Sharybin
Failed as in did not allocate due to possibly weight cutoff. Tryign to allocated Extra storage for closure in such situation will consfuse Cycles and cause crashes later one due to obscure values in ShaderData.
2018-09-10Fix Cycles principled BSDF black with transmission and IOR 1.0.Brecht Van Lommel
2018-08-24Cycles: Cleanup, styleSergey Sharybin
I wouldn't mind changing style to have space after keyword, but there was no official code style change proposed.
2018-07-18Cycles: add Principled Hair BSDF.L. E. Segovia
This is a physically-based, easy-to-use shader for rendering hair and fur, with controls for melanin, roughness and randomization. Based on the paper "A Practical and Controllable Hair and Fur Model for Production Path Tracing". Implemented by Leonardo E. Segovia and Lukas Stockner, part of Google Summer of Code 2018.
2018-07-06Cleanup: strip trailing space for cyclesCampbell Barton
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-06-14Cycles: Query XYZ to/from Scene Linear conversion from OCIO instead of ↵Lukas Stockner
assuming sRGB I've limited it to just the RGB<->XYZ stuff for now, correct image handling is the next step. Reviewers: brecht, sergey Differential Revision: https://developer.blender.org/D3478
2018-03-10Cycles: switch to squared roughness convention for all nodes.Brecht Van Lommel
This was already done for the Principled BSDF to be compatible with typical baked roughness maps in PBR workflows.
2018-02-28Cycles: principled absorption color now has more effect at lower values.Brecht Van Lommel
2018-02-23Cycles: add Principled Volume shader.Brecht Van Lommel
Similar to the Principled BSDF, this should make it easier to set up volume materials. Smoke and fire can be rendererd with just a single principled volume node, the appropriate attributes will be used when available. The node also works for simpler homogeneous volumes like water or mist. Differential Revision: https://developer.blender.org/D3033
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.
2018-02-12Fix random walk SSS issues with different base and subsurface color.Brecht Van Lommel
Burley SSS uses a bit of strange thing where the albedo and closure weight are different, which makes the subsurface color act a bit like a subsurface radius indirectly by the way the Burley SSS profile works. This can't work for random walk SSS though, and it's not clear to me that this is actually a good idea since it's really the subsurface radius that is supposed to control this. For now I'll leave Burley SSS working the same to not break backwards compatibility.
2018-02-09Cycles: add random walk subsurface scattering to Principled BSDF.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D3054
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
2018-02-03Fix more Cycles incorrect principled BSDF mixing due to missing initialization.Brecht Van Lommel
Spotted by Ha Hyung-jin, thanks!
2018-01-30Fix Cycles incorrect principled BSDF mixing with some parameter variatons.Brecht Van Lommel
Spotted by Ha Hyung-jin, thanks!
2018-01-27Code refactor: make mixed small/large BSSRDF radii more robust.Brecht Van Lommel
2018-01-26Code refactor: store RGB BSSRDF in a single closure.Brecht Van Lommel
Previously we stored each color channel in a single closure, which was convenient for sampling a closure and channel together. But this doesn't work so well for algorithms where we want to render multiple color channels together.
2017-12-29Fix mistake in previous fix for T53600, shows we really need a smarter solution.Brecht Van Lommel
2017-12-26Fix T53600: Cycles shader mixing issue with principled BSDF and zero weights.Brecht Van Lommel
SVM nodes need to read all data to get the right offset for the following node. This is quite weak, a more generic solution would be good in the future.
2017-11-09Fix T53270: crash with multiscatter GGX after recent refactoring.Brecht Van Lommel
In fact this was an existing issue when exceeding the number of available closure, but it's more common now that we set the number to 0 for shadows and emission
2017-11-05Code refactor: sum transparent and absorption weights outside closures.Brecht Van Lommel
2017-11-05Code refactor: remove emission and background closures, sum directly.Brecht Van Lommel
2017-07-23Fix T52152: allow zero roughness for Cycles principled BSDF, don't clamp.Brecht Van Lommel
2017-07-12Cycles: Fix comparison in principled BSDFMai Lavelle
Could have lead to black pixels.
2017-07-02Fix principled BSDF incorrectly missing subsurface component with base color ↵Brecht Van Lommel
black.
2017-06-28Fix T51909: Cycles: Uninitialized closure normals for the Hair BSDFLukas Stockner
As the title says, the normal wasn't set for the Hair BSDF because it wasn't needed before. However, the denoiser uses it to store the feature passes, so it needs to be set now.
2017-06-22Cycles: Fix excessive sampling weight of glossy Principled BSDF componentsLukas Stockner
If there was any specularity in the Principled BSDF, it would get a sampling weight of one regardless of its actual impact. This commit makes Cycles estimate the contribution of the component and adjust the weighting accordingly, which greatly improves the noise characteristics of the Principled BSDF in many cases. Note that this commit might slightly change the brightness of areas when using MultiGGX and high roughnesses, but the new brightness is more accurate and closer to the result of Branched Path Tracing. See T51836 for details. Differential Revision: https://developer.blender.org/D2677
2017-06-21Fix T51849: change Cycles clearcoat gloss to roughness.Brecht Van Lommel
This is compatible with UE4 and more consistent with specular and transmission roughness, even if it deviates from the original Disney BRDF.
2017-05-31Improve backscatter color of subsurface scattering in Principled BSDFPascal Schoen
Differential Revision: https://developer.blender.org/D2685
2017-05-24Cycles: Use falltrhough attribute to help catching missing break statementsSergey Sharybin