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
2022-07-15Cycles: refactor rays to have start and end distance, fix precision issuesBrecht Van Lommel
For transparency, volume and light intersection rays, adjust these distances rather than the ray start position. This way we increment the start distance by the smallest possible float increment to avoid self intersections, and be sure it works as the distance compared to be will be exactly the same as before, due to the ray start position and direction remaining the same. Fix T98764, T96537, hair ray tracing precision issues. Differential Revision: https://developer.blender.org/D15455
2022-07-15Cycles: Apple Silicon optimization to specialize intersection kernelsMichael Jones
The Metal backend now compiles and caches a second set of kernels which are optimized for scene contents, enabled for Apple Silicon. The implementation supports doing this both for intersection and shading kernels. However this is currently only enabled for intersection kernels that are quick to compile, and already give a good speedup. Enabling this for shading kernels would be faster still, however this also causes a long wait times and would need a good user interface to control this. M1 Max samples per minute (macOS 13.0): PSO_GENERIC PSO_SPECIALIZED_INTERSECT PSO_SPECIALIZED_SHADE barbershop_interior 83.4 89.5 93.7 bmw27 1486.1 1671.0 1825.8 classroom 175.2 196.8 206.3 fishy_cat 674.2 704.3 719.3 junkshop 205.4 212.0 257.7 koro 310.1 336.1 342.8 monster 376.7 418.6 424.1 pabellon 273.5 325.4 339.8 sponza 830.6 929.6 1142.4 victor 86.7 96.4 96.3 wdas_cloud 111.8 112.7 183.1 Code contributed by Jason Fielder, Morteza Mostajabodaveh and Michael Jones Differential Revision: https://developer.blender.org/D14645
2022-07-15Cycles: keep track of SVM nodes used in kernelsMichael Jones
To be used for specialization in Metal, to automatically leave out unused nodes from the kernel. Ref D14645
2022-06-30Cleanup: spelling in commentsCampbell Barton
2022-06-28Fix Cycles assert with mix weights outside of 0..1 rangeBrecht Van Lommel
This could result in wrong skipping of SVM nodes in the graph. Now make the logic consistent with the clamping in the OSL implementation and constant folding. Thanks to Christophe Hery for finding the problem and providing the fix.
2022-06-23Cycles: unify math functions namesAndrii Symkin
This patch unifies the names of math functions for different data types and uses overloading instead. The goal is to make it possible to swap out all the float3 variables containing RGB data with something else, with as few as possible changes to the code. It's a requirement for future spectral rendering patches. Differential Revision: https://developer.blender.org/D15276
2022-06-20Cleanup: renaming and consistency for kernel dataBrecht Van Lommel
* Rename "texture" to "data array". This has not used textures for a long time, there are just global memory arrays now. (On old CUDA GPUs there was a cache for textures but not global memory, so we used to put all data in textures.) * For CUDA and HIP, put globals in KernelParams struct like other devices. * Drop __ prefix for data array names, no possibility for naming conflict now that these are in a struct.
2022-05-23Merge branch 'blender-v3.2-release'Brecht Van Lommel
2022-05-23Fix T98036: Cycles blackbody inaccurate for low temperature and wide gamutBrecht Van Lommel
Regenerate blackbody RGB curve fit to not clamp values, and extend down to 800K since it does now change below 965K. Note that as before, blackbody is only defined in the range 800K to 12000K and has a fixed value outside of that. But within that range there should be no more unnecessary gamut clamping.
2022-05-17Merge branch 'blender-v3.2-release'Antonio Vazquez
2022-05-17Cleanup: fix compiler warningBrecht Van Lommel
2022-05-05Cleanup: formatCampbell Barton
2022-05-05Merge branch 'blender-v3.2-release'Germano Cavalcante
2022-05-04Fix T96718: Cycles invalid pixels when using bump normal for light emissionBrecht Van Lommel
A shader node setup accidentally used the bump normal as emission. Bump mapping nodes are excluded from light shader evaluation to reduce kernel size and register pressure, but in that case should write zero instead of leaving memory uninitialized. Thanks to Lukas for helping identify the cause.
2022-05-04Nodes: Add general Combine/Separate Color nodesHallam Roberts
Inspired by D12936 and D12929, this patch adds general purpose "Combine Color" and "Separate Color" nodes to Geometry, Compositor, Shader and Texture nodes. - Within Geometry Nodes, it replaces the existing "Combine RGB" and "Separate RGB" nodes. - Within Compositor Nodes, it replaces the existing "Combine RGBA/HSVA/YCbCrA/YUVA" and "Separate RGBA/HSVA/YCbCrA/YUVA" nodes. - Within Texture Nodes, it replaces the existing "Combine RGBA" and "Separate RGBA" nodes. - Within Shader Nodes, it replaces the existing "Combine RGB/HSV" and "Separate RGB/HSV" nodes. Python addons have not been updated to the new nodes yet. **New shader code** In node_color.h, color.h and gpu_shader_material_color_util.glsl, missing methods hsl_to_rgb and rgb_to_hsl are added by directly converting existing C code. They always produce the same result. **Old code** As requested by T96219, old nodes still exist but are not displayed in the add menu. This means Python scripts can still create them as usual. Otherwise, versioning replaces the old nodes with the new nodes when opening .blend files. Differential Revision: https://developer.blender.org/D14034
2022-04-28Fix: Sky models can return negative valuesSebastian Herholz
When converting from XYZ to RGB it can happen, in some sky models, that the resulting RGB values are negative. Atm, this is not considered and the returned values for the sky model can be negative. This patch clamps the returned RGB values to be `= 0.f` Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D14777
2022-04-18Fix Cycles blackbody shader not taking into account OpenColorIO configBrecht Van Lommel
Keep the existing Rec.709 fit and convert to other colorspace if needed, it seems accurate enough in practice, and keeps the same performance for the default case.
2022-04-10Fix T97159: AOV Pass in Cycles always gets Alpha Value of 1 for whole imageLukas Stockner
As far as I can see, it makes a lot of sense to have the alpha channel here, it matches the 2.x behavior and also matches what Eevee is doing. Differential Revision: https://developer.blender.org/D14595
2022-04-01Cycles: Use single floating point precision sine/cosine in skyStefan Werner
Should be no functional changes.
2022-04-01Cycles: Optimize Nishita skyStefan Werner
Reduce register pressure. Helps with kernel compile time and render time. Should be no functional changes.
2022-04-01Cycles: approximate shadow caustics using manifold next event estimationOlivier Maury
This adds support for selective rendering of caustics in shadows of refractive objects. Example uses are rendering of underwater caustics and eye caustics. This is based on "Manifold Next Event Estimation", a method developed for production rendering. The idea is to selectively enable shadow caustics on a few objects in the scene where they have a big visual impact, without impacting render performance for the rest of the scene. The Shadow Caustic option must be manually enabled on light, caustic receiver and caster objects. For such light paths, the Filter Glossy option will be ignored and replaced by sharp caustics. Currently this method has a various limitations: * Only caustics in shadows of refractive objects work, which means no caustics from reflection or caustics that outside shadows. Only up to 4 refractive caustic bounces are supported. * Caustic caster objects should have smooth normals. * Not currently support for Metal GPU rendering. In the future this method may be extended for more general caustics. TECHNICAL DETAILS This code adds manifold next event estimation through refractive surface(s) as a new sampling technique for direct lighting, i.e. finding the point on the refractive surface(s) along the path to a light sample, which satisfies Fermat's principle for a given microfacet normal and the path's end points. This technique involves walking on the "specular manifold" using a pseudo newton solver. Such a manifold is defined by the specular constraint matrix from the manifold exploration framework [2]. For each refractive interface, this constraint is defined by enforcing that the generalized half-vector projection onto the interface local tangent plane is null. The newton solver guides the walk by linearizing the manifold locally before reprojecting the linear solution onto the refractive surface. See paper [1] for more details about the technique itself and [3] for the half-vector light transport formulation, from which it is derived. [1] Manifold Next Event Estimation Johannes Hanika, Marc Droske, and Luca Fascione. 2015. Comput. Graph. Forum 34, 4 (July 2015), 87–97. https://jo.dreggn.org/home/2015_mnee.pdf [2] Manifold exploration: a Markov Chain Monte Carlo technique for rendering scenes with difficult specular transport Wenzel Jakob and Steve Marschner. 2012. ACM Trans. Graph. 31, 4, Article 58 (July 2012), 13 pages. https://www.cs.cornell.edu/projects/manifolds-sg12/ [3] The Natural-Constraint Representation of the Path Space for Efficient Light Transport Simulation. Anton S. Kaplanyan, Johannes Hanika, and Carsten Dachsbacher. 2014. ACM Trans. Graph. 33, 4, Article 102 (July 2014), 13 pages. https://cg.ivd.kit.edu/english/HSLT.php The code for this samping technique was inserted at the light sampling stage (direct lighting). If the walk is successful, it turns off path regularization using a specialized flag in the path state (PATH_MNEE_SUCCESS). This flag tells the integrator not to blur the brdf roughness further down the path (in a child ray created from BSDF sampling). In addition, using a cascading mechanism of flag values, we cull connections to caustic lights for this and children rays, which should be resolved through MNEE. This mechanism also cancels the MIS bsdf counter part at the casutic receiver depth, in essence leaving MNEE as the only sampling technique from receivers through refractive casters to caustic lights. This choice might not be optimal when the light gets large wrt to the receiver, though this is usually not when you want to use MNEE. This connection culling strategy removes a fair amount of fireflies, at the cost of introducing a slight bias. Because of the selective nature of the culling mechanism, reflective caustics still benefit from the native path regularization, which further removes fireflies on other surfaces (bouncing light off casters). Differential Revision: https://developer.blender.org/D13533
2022-03-23Cleanup: use make_float4(f) zero_float4() to simplify codeEthan-Hall
Differential Revision: https://developer.blender.org/D14426
2022-03-23Cycles: Add Hydra render delegatePatrick Mours
This patch adds a Hydra render delegate to Cycles, allowing Cycles to be used for rendering in applications that provide a Hydra viewport. The implementation was written from scratch against Cycles X, for integration into the Blender repository to make it possible to continue developing it in step with the rest of Cycles. For this purpose it follows the style of the rest of the Cycles code and can be built with a CMake option (`WITH_CYCLES_HYDRA_RENDER_DELEGATE=1`) similar to the existing standalone version of Cycles. Since Hydra render delegates need to be built against the exact USD version and other dependencies as the target application is using, this is intended to be built separate from Blender (`WITH_BLENDER=0` CMake option) and with support for library versions different from what Blender is using. As such the CMake build scripts for Windows had to be modified slightly, so that the Cycles Hydra render delegate can e.g. be built with MSVC 2017 again even though Blender requires MSVC 2019 now, and it's possible to specify custom paths to the USD SDK etc. The codebase supports building against the latest USD release 22.03 and all the way back to USD 20.08 (with some limitations). Reviewed By: brecht, LazyDodo Differential Revision: https://developer.blender.org/D14398
2022-03-21Fix T96132: Cycles RGB/Vector/Float Curve shaders ignore extrapolation settingHallam Roberts
Differential Revision: https://developer.blender.org/D14393
2022-03-07Shader Nodes: add Alpha output to Object Info nodeEthan-Hall
An alpha component can be specified for an object's color. This adds an alpha socket to the object info shader node allowing for the alpha component of the object's color to be accessed in the shader editor. Differential Revision: https://developer.blender.org/D14141
2022-02-26Cleanup: typos in comments.Kévin Dietrich
2022-02-11Cycles: use SPDX license headersBrecht Van Lommel
* Replace license text in headers with SPDX identifiers. * Remove specific license info from outdated readme.txt, instead leave details to the source files. * Add list of SPDX license identifiers used, and corresponding license texts. * Update copyright dates while we're at it. Ref D14069, T95597
2022-01-26Cycles: remove ray offsettingWilliam Leeson
Remove small ray offsets that were used to avoid self intersection, and leave that to the newly added primitive object/prim comparison. These changes together significantly reduce artifacts on small, large or far away objects. The balance here is that overlapping primitives are not handled well and should be avoided (though this was already an issue). The upside is that this is something a user has control over, whereas the other artifacts had no good manual solution in many cases. There is a known issue where the Blender particle system generates overlapping objects and in turn leads to render differences between CPU and GPU. This will be addressed separately. Differential Revision: https://developer.blender.org/D12954
2022-01-26Cycles: explicitly skip self-intersectionWilliam Leeson
Remember the last intersected primitive and skip any intersections with the same primitive. Ref D12954
2022-01-26Cycles: compute triangle location from barycentric instead of re-intersectingWilliam Leeson
This is a bit more efficient than what we did before. Ref D12954
2022-01-25Cycles: add Point Info nodeBrecht Van Lommel
With (center) position, radius and random value outputs. Eevee does not yet support rendering point clouds, but an untested implementation of this node was added for when it does. Ref T92573
2022-01-20Fix T94457: random result using sky texture in light objectBrecht Van Lommel
Still not well defined, but should not longer use uninitialized values that gave different results between CPU/GPU and subsequent renders.
2022-01-10Cleanup: typos in comments, remove libnumaapi referenceCampbell Barton
2021-12-20Fix Cycles OptiX crash with 3D curves after point cloud changesBrecht Van Lommel
Includes refactoring to reduce the number of bits taken by primitive types, so they more easily fit in the OptiX limit.
2021-12-16Cycles: pointcloud renderingBrecht Van Lommel
This add support for rendering of the point cloud object in Blender, as a native geometry type in Cycles that is more memory and time efficient than instancing sphere meshes. This can be useful for rendering sand, water splashes, particles, motion graphics, etc. Points are currently always rendered as spheres, with backface culling. More shapes are likely to be added later, but this is the most important one and can be customized with shaders. For CPU rendering the Embree primitive is used, for GPU there is our own intersection code. Motion blur is suppored. Volumes inside points are not currently supported. Implemented with help from: * Kévin Dietrich: Alembic procedural integration * Patrick Mourse: OptiX integration * Josh Whelchel: update for cycles-x changes Ref T92573 Differential Revision: https://developer.blender.org/D9887
2021-12-14Fix Cycles compilation with CUDA / Optix after recent Map Range additions.Thomas Dinges
2021-12-14Nodes: Add vector support to Map Range nodeCharlie Jolly
This replaces lost functionality from the old GN Attribute Map Range node. This also adds vector support to the shader version of the node. Notes: This breaks forward compatibility as this node now uses data storage. Reviewed By: HooglyBoogly, brecht Differential Revision: https://developer.blender.org/D12760
2021-12-10Fix T92036: `Magic Texture` in Volumetric World Shaders render differently ↵William Leeson
with the CPU and GPU When rendering volume surfaces in unbounded worlds the volume stepping can produce large values. If used with a magic texture node the values can results in a Inf float which when used in a sin or cos produces a NaN. To fix this the input values are mapped into the periodic range of the sin and cos functions (-2*PI 2*PI) this stops the possibility of a Inf occurring and thus the NaN. It also improves the accuracy and smoothness of the result due to loss of precision when large values are summed with smaller ones effectively removing the parts of the smaller number (i.e. those in the -2PI to 2PI range) that result in variation of the output of sin and cos. Reviewed By: brecht Maniphest Tasks: T92036 Differential Revision: https://developer.blender.org/D12821
2021-11-22Merge branch 'blender-v3.0-release'Brecht Van Lommel
2021-11-22Fix part of T93278: transparent glass option not working with environment passBrecht Van Lommel
2021-11-18Cycles: declare constants at program scope on MetalMichael Jones
MSL requires that constant address space literals be declared at program scope. This patch moves the `blackbody_table_r/g/b` and `cie_colour_match` constants into separate files so they can be declared at the appropriate scope. Ref T92212 Differential Revision: https://developer.blender.org/D13241
2021-11-18Cycles: several small fixes and additions for MSLMichael Jones
This patch contains many small leftover fixes and additions that are required for Metal-enablement: - Address space fixes and a few other small compile fixes - Addition of missing functionality to the Metal adapter headers - Addition of various scattered `__KERNEL_METAL__` blocks (e.g. for atomic support & maths functions) Ref T92212 Differential Revision: https://developer.blender.org/D13263
2021-11-02Fix T77681, T92634: noise texture artifacts with high detailBrecht Van Lommel
We run into float precision issues here, clamp the number of octaves to one less, which has little to no visual difference. This was empirically determined to work up to 16 before, but with additional inputs like roughness only 15 appears to work. Also adds misisng clamp for the geometry nodes implementation.
2021-10-27Cycles: Replace saturate with saturatefWilliam Leeson
saturate is depricated in favour of __saturatef this replaces saturate with __saturatef on CUDA by createing a saturatef function which replaces all instances of saturate and are hooked up to the correct function on all platforms. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13010
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-26Cycles: changes to source code folders structureBrecht Van Lommel
* Split render/ into scene/ and session/. The scene/ folder now contains the scene and its nodes. The session/ folder contains the render session and associated data structures like drivers and render buffers. * Move top level kernel headers into new folders kernel/camera/, kernel/film/, kernel/light/, kernel/sample/, kernel/util/ * Move integrator related kernel headers into kernel/integrator/ * Move OSL shaders from kernel/shaders/ to kernel/osl/shaders/ 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-19Cycles: decouple shadow paths from main path on GPUBrecht Van Lommel
The motivation for this is twofold. It improves performance (5-10% on most benchmark scenes), and will help to bring back transparency support for the ambient occlusion pass. * Duplicate some members from the main path state in the shadow path state. * Add shadow paths incrementally to the array similar to what we do for the shadow catchers. * For the scheduling, allow running shade surface and shade volume kernels as long as there is enough space in the shadow paths array. If not, execute shadow kernels until it is empty. * Add IntegratorShadowState and ConstIntegratorShadowState typedefs that can be different between CPU and GPU. For GPU both main and shadow paths juse have an integer for SoA access. Bt with CPU it's a different pointer type so we get type safety checks in code shared between CPU and GPU. * For CPU, add a separate IntegratorShadowStateCPU struct embedded in IntegratorShadowState. * Update various functions to take the shadow state, and make SVM take either type of state using templates. Differential Revision: https://developer.blender.org/D12889
2021-10-19Cleanup: fix compiler warningsBrecht Van Lommel
2021-10-19Cleanup: clang-formatCampbell Barton
2021-10-18Cleanup: consistently use uint32_t for path flagBrecht Van Lommel