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-08-19Cleanup: replace CHECK_TYPE macro with static_assertBrecht Van Lommel
To avoid conflicts with BLI headers and simplify code.
2022-05-18Cleanup: fix Cycles asan warningBrecht Van Lommel
Not sure why constructing a ustring inside [] is causing issues here, but it's slightly more efficient to construct it once anyway.
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-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-11-30Cleanup: capitalize NOTE tagCampbell Barton
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-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-05-03Cleanup: formatKévin Dietrich
2021-05-03Cycles: add reference counting to NodesKévin Dietrich
This adds a reference count to Nodes which is incremented or decremented whenever they are added to or removed from a socket, which will help us track used Nodes throughout the scene graph generically without having to add an explicit count or flag on specific Node types. This is especially useful to track Nodes defined through Procedurals out of Cycles' control. This also modifies the order in which nodes are deleted to ensure that upon deletion, a Node does not attempt to decrement the reference count of another Node which was already freed or deleted. This is not currently used, but will be in the next commit. Reviewed By: brecht Differential Revision: https://developer.blender.org/D10965
2021-04-29Fix T87317: Cycles XML parsing broken after bugfix for initialization orderBrecht Van Lommel
2021-03-15Fix Cycles rendering crash on OpenBSDBrecht Van Lommel
Static initialization order was not guaranteed to be correct for node base types. Now wrap all initialization in accessor functions to ensure the order is correct. Did not cause any known bug on Linux/macOS/Windows, but showed up on this platform.
2021-02-17Cycles: add support for Arm Neon instructions using sse2neonBrecht Van Lommel
Based on patch contributed by Apple and Stefan Werner. Ref D8237, T78710
2020-11-09Cycles: fix Node::tag_modified not setting modified flag's upper bitsKévin Dietrich
Previous code was flipping the bits on a 32-bit number and doing a zero extension to cast to 64-bit, so mark the constant as long to begin with. This would also erase previously set bits in this part the flag.
2020-11-04Cycles API: encapsulate Node socket membersKévin Dietrich
This encapsulates Node socket members behind a set of specific methods; as such it is no longer possible to directly access Node class members from exporters and parts of Cycles. The methods are defined via the NODE_SOCKET_API macros in `graph/ node.h`, and are for getting or setting a specific socket's value, as well as querying or modifying the state of its update flag. The setters will check whether the value has changed and tag the socket as modified appropriately. This will let us know how a Node has changed and what to update, which is the first concrete step toward a more granular scene update system. Since the setters will tag the Node sockets as modified when passed different data, this patch also removes the various modified methods on Nodes in favor of Node::is_modified which checks the sockets' update flags status. Reviewed By: brecht Maniphest Tasks: T79174 Differential Revision: https://developer.blender.org/D8544
2020-10-27Revert "Cycles API: encapsulate Node socket members"Brecht Van Lommel
This reverts commit 527f8b32b32187f754e5b176db6377736f9cb8ff. It is causing motion blur test failures and crashes in some renders, reverting until this is fixed.
2020-10-27Cycles API: encapsulate Node socket membersKévin Dietrich
This encapsulates Node socket members behind a set of specific methods; as such it is no longer possible to directly access Node class members from exporters and parts of Cycles. The methods are defined via the NODE_SOCKET_API macros in `graph/ node.h`, and are for getting or setting a specific socket's value, as well as querying or modifying the state of its update flag. The setters will check whether the value has changed and tag the socket as modified appropriately. This will let us know how a Node has changed and what to update, which is the first concrete step toward a more granular scene update system. Since the setters will tag the Node sockets as modified when passed different data, this patch also removes the various `modified` methods on Nodes in favor of `Node::is_modified` which checks the sockets' update flags status. Reviewed By: brecht Maniphest Tasks: T79174 Differential Revision: https://developer.blender.org/D8544
2020-10-09Cycles: fix incorrect default value for node array socket typeKévin Dietrich
2020-10-09Cycles: fix incorrect asserts in node socket set functionsKévin Dietrich
2020-10-01Cycles: Fix broken 32 bit shift.Ray Molenkamp
1ul << n will still be a 32 bit integer regardless of the value of n, given the target here is 64 bits the upper 32 bits will always be zero. Using 1ull will yield the expected result.
2020-09-29Fix T81100: ccl::Node: ASan SEGV due to bad pointerAnkit Meel
`SOCKET_OFFSETOF` was added in the initial commit {rBec51175f1fd6c91d5} when `offsetof` [1] was not supported well enough. GCC and LLVM support it since C++17. Other two changes: type and size check can be done without creating an invalid address too. [1] https://cppreference.com/w/cpp/types/offsetof Reviewed By: campbellbarton, brecht Maniphest Tasks: T81100 Differential Revision: https://developer.blender.org/D9042
2020-09-22Cycles: add update flags to Node and SocketTypeKévin Dietrich
Those flags are meant for detecting which socket has changed, so in the future we can have more granular updates. `Node` now stores an `update_flags` member which is modified every time a socket is changed though `Node::set`. The flags are or-able bits stored in `SocketType` instances. Each `SocketType` stores a unique bit out of 64, for the 64 bits of an uint64_t; the bit corresponds to the index of the socket in the `Node`'s sockets array + 1, so the socket at index 5 will have the 6th bit set as its flag. This limits us to 64 sockets per Node, which should be plenty for the current set of `Nodes` that we have. This does not change the behavior of other parts of Cycles. This is part of T79131. Reviewed By: brecht Maniphest Tasks: T79131 Differential Revision: https://developer.blender.org/D8644
2020-09-04CMake: refresh building and external library handling of Cycles standaloneBrecht Van Lommel
* Support precompiled libraries on Linux * Add license headers * Refactoring to deduplicate code Includes work by Ray Molenkamp and Grische for precompiled libraries. Ref D8769
2020-09-01Cycles: Followup fixes for node ownership refactor.Stefan Werner
There were some places where nodes still would end up without owners. See D8540 and 429afe0c626a
2020-08-31Cycles: introduce an ownership system to protect nodes from unwanted deletions.Kévin Dietrich
Problem: the Blender synchronization process creates and tags nodes for usage. It does this by directly adding and removing nodes from the scene data. If some node is not tagged as used at the end of a synchronization, it then deletes the node from the scene. This poses a problem when it comes to supporting procedural nodes who can create other nodes not known by the Blender synchonization system, which will remove them. Nodes now have a NodeOwner, which is set after creation. Those owners for now are the Scene for scene level nodes and ShaderGraph for shader nodes. Instead of creating and deleting nodes using `new` and `delete` explicitely, we now use `create_node` and `delete_node` methods found on the owners. `delete_node` will assert that the owner is the right one. Whenever a scene level node is created or deleted, the appropriate node manager is tagged for an update, freeing this responsability from BlenderSync or other software exporters. Concerning BlenderSync, the `id_maps` do not explicitely manipulate scene data anymore, they only keep track of which nodes are used, employing the scene to create and delete them. To achieve this, the ParticleSystem is now a Node, although it does not have any sockets. This is part of T79131. Reviewed By: #cycles, brecht Maniphest Tasks: T79131 Differential Revision: https://developer.blender.org/D8540
2020-05-12Fix incorrect assert in Cycles node socket get/set functionsBrecht Van Lommel
Thanks to Subrahmanya Oruganti for spotting these.
2020-02-07Cleanup: split Cycles Hair and Mesh classes, with Geometry base classBrecht Van Lommel
2020-02-07Cleanup: add type inheritance for Cycles nodesBrecht Van Lommel
2020-01-23CMake: Refactor external dependencies handlingSergey Sharybin
This is a more correct fix to the issue Brecht was fixing in D6600. While the fix in that patch worked fine for linking it broke ASAN runtime under some circumstances. For example, `make full debug developer` would compile, but trying to start blender will cause assert failure in ASAN (related on check that ASAN is not running already). Top-level idea: leave it to CMake to keep track of dependency graph. The root of the issue comes to the fact that target like "blender" is configured to use a lot of static libraries coming from Blender sources and to use external static libraries. There is nothing which ensures order between blender's and external libraries. Only order of blender libraries is guaranteed. It was possible that due to a cycle or other circumstances some of blender libraries would have been passed to linker after libraries it uses, causing linker errors. For example, this order will likely fail: libbf_blenfont.a libfreetype6.a libbf_blenfont.a This change makes it so blender libraries are explicitly provided their dependencies to an external libraries, which allows CMake to ensure they are always linked against them. General rule here: if bf_foo depends on an external library it is to be provided to LIBS for bf_foo. For example, if bf_blenkernel depends on opensubdiv then LIBS in blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES. The change is made based on searching for used include folders such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries to LIBS ion that CMakeLists.txt. Transitive dependencies are not simplified by this approach, but I am not aware of any downside of this: CMake should be smart enough to simplify them on its side. And even if not, this shouldn't affect linking time. Benefit of not relying on transitive dependencies is that build system is more robust towards future changes. For example, if bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES and all such code is moved to bf_blenkernel this will not break linking. The not-so-trivial part is change to blender_add_lib (and its version in Cycles). The complexity is caused by libraries being provided as a single list argument which doesn't allow to use different release and debug libraries on Windows. The idea is: - Have every library prefixed as "optimized" or "debug" if separation is needed (non-prefixed libraries will be considered "generic"). - Loop through libraries passed to function and do simple parsing which will look for "optimized" and "debug" words and specify following library to corresponding category. This isn't something particularly great. Alternative would be to use target_link_libraries() directly, which sounds like more code but which is more explicit and allows to have more flexibility and control comparing to wrapper approach. Tested the following configurations on Linux, macOS and Windows: - make full debug developer - make full release developer - make lite debug developer - make lite release developer NOTE: Linux libraries needs to be compiled with D6641 applied, otherwise, depending on configuration, it's possible to run into duplicated zlib symbols error. Differential Revision: https://developer.blender.org/D6642
2019-08-27Fix undefined symbols for ccl::Node with some compilers and build optionsAlex Fuller
Differential Revision: https://developer.blender.org/D5590
2019-06-21Fix (harmless) Cycles ASAN warningsBrecht Van Lommel
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-04-16CMake: cleanup, arg rename, add definitions lastCampbell Barton
2019-01-14Cleanup: add begin/end iterators to Cycles NodeEnum.Alex Fuller
Differential Revision: https://developer.blender.org/D4173
2018-12-11Update code to be compatible with OIIO 2.0Sergey Sharybin
There are some changes in API of OpenImageIO, but those are quite simple to keep working with older and newer library versions. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4064
2018-11-09Cycles: Cleanup, split array from vectorSergey Sharybin
Those are similar but different types, no reason to keep their definitions in a single file.
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-27Cycles: Add utility function to query graph node size in bytesSergey Sharybin
2018-07-27Cycles: Cleanup, indentationSergey Sharybin
2018-07-06Cleanup: strip trailing space for cyclesCampbell Barton
2018-06-29Cleanup: trailing newlinesCampbell Barton
2018-05-27Cycles: Add Support for IES files as textures for light strengthLukas Stockner
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources. The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp. Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried. Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file. The user interface of the node is similar to the script node, the user can either select an internal Text or load a file. Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot. The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light, rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport. Reviewers: #cycles, dingto, sergey, brecht Reviewed By: #cycles, dingto, brecht Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey Differential Revision: https://developer.blender.org/D1543
2018-03-10Code refactor: make Transform always affine, dropping last row.Brecht Van Lommel
This save a little memory and copying in the kernel by storing only a 4x3 matrix instead of a 4x4 matrix. We already did this in a few places, and those don't need to be special exceptions anymore now.
2018-02-15Code cleanup: simplify switch statement, ensure we catch missing enums.Brecht Van Lommel
2018-02-15Fix T54073: crash and uninitialized memory in Cycles displacement hashing.Brecht Van Lommel
2018-02-04msvc: Use source folder structure for project file.Ray Molenkamp
This patch changes the huge list of projects in visual studio into a nice tree matching the source folder structure. see D2823 for details. Differential Revision: http://developer.blender.org/D2823
2018-01-29Fix Cycles viewport render not updating when tweaking displacement shader.Brecht Van Lommel
This was disabled to avoid updating the geometry every time when the material includes displacement, because there was no way to distinguish between surface shader and displacement updates. As a solution, we now compute an MD5 hash of the nodes linked to the displacement socket, and only update the mesh if that changes. Differential Revision: https://developer.blender.org/D3018
2017-11-10Cycles: Fix compilation error with latest OIIOSergey Sharybin
There was some changes about namespaces, which causes ambiguities. Replaces using namespace with an explicit symbols we need. Is good idea to NOT pull in the whole namespace anyway!
2017-03-29Cycles: Make all #include statements relative to cycles source directorySergey Sharybin
The idea is to make include statements more explicit and obvious where the file is coming from, additionally reducing chance of wrong header being picked up. For example, it was not obvious whether bvh.h was refferring to builder or traversal, whenter node.h is a generic graph node or a shader node and cases like that. Surely this might look obvious for the active developers, but after some time of not touching the code it becomes less obvious where file is coming from. This was briefly mentioned in T50824 and seems @brecht is fine with such explicitness, but need to agree with all active developers before committing this. Please note that this patch is lacking changes related on GPU/OpenCL support. This will be solved if/when we all agree this is a good idea to move forward. Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner Reviewed By: lukasstockner97, maiself, nirved, dingto Subscribers: brecht Differential Revision: https://developer.blender.org/D2586
2016-10-24Cycles: Don't use guarded vector for statically initialized dataSergey Sharybin
This will confuse hell of a guarded allocators because it is possible to have allocation happened prior to Blender's guarded allocator is fully initialized. This was causing crashes and assert failures when running blender with fully guarded memory allocator.
2016-10-24Cycles: Remove explicit std:: from types where possibleSergey Sharybin
We have our own abstraction level on top of the STL's implementation. This commit will guarantee our tweaks are used for all cases.