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-04-18Cycles: Remove meaningless volume shadersSergey Sharybin
This is possible to use surface-only nodes and connect them to volume output. If there was something connected to surface output those extra connections will not change anything visually but will force volume features to be included into feature-adaptive kernels. In fact, this exact reason seems to be causing slowdown of Barcelone file comparing AMD OpenCL to NVidia CUDA. Currently only supported by the final F12 renders because of the current design of what gets optimized out when and how feature-adaptive kernel accesses list of required features. Reviewers: dingto, nirved, maiself, lukasstockner97, brecht Reviewed By: brecht Subscribers: bliblubli Differential Revision: https://developer.blender.org/D2569
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
2017-03-27Cycles: Optimize shaders earlier to skip unneccessary attributes for ↵Lukas Stockner
noninteractive rendering Before, Cycles would first sync the shader exactly as shown in the UI, then determine and sync the used attributes and later optimize the shader. Therefore, even completely unconnected nodes would cause unneccessary attributes to be synced. The reason for this is to avoid frequent resyncs when editing shaders interactively, but it can still be avoided for noninteractive renders - which is what this commit does. Reviewed by: sergey Differential Revision: https://developer.blender.org/D2285
2017-03-06Cycles: Fix strict -Wpedantic warnings with GCCSergey Sharybin
Patch by Stefan Werner, thanks!
2016-09-11Cycles: Fix bump mapping to use object space when used with true displacementMai Lavelle
Bump mapping was happening in world space while displacement happens in object space, causing shading errors when displacement type was used with bump mapping. To fix this the proper transforms are added to bump nodes. This is only done for automatic bump mapping however, to avoid visual changes from other uses of bump mapping. It would be nice to do this for all bump mapping to be consistent but that will have to wait till we can break compatibility. Reviewed By: brecht Differential Revision: https://developer.blender.org/D2191
2016-07-18Cycles: add ConstantFolder class for constant folding boilerplate.Alexander Gavrilov
Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D2089
2016-06-19Code refactor: small code simplification for Cycles constant folding.Brecht Van Lommel
2016-06-11Cycles: nodify shader nodesBrecht Van Lommel
Differential Revision: https://developer.blender.org/D2038
2016-05-29Code refactor: pass ShaderInput to constant_fold, so it supports arbitrary ↵Brecht Van Lommel
types.
2016-05-28Code refactor: make ShaderNode match Node a bit more, reusing types and enums.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D2016
2016-05-23Cycles: Fix wrong closure counter in feature adaptive kernelSergey Sharybin
Some closures were missing from calculation, leading to an array under-allocation, presumable causing memory corruption issues with emission shaders on OpenCL and was causing issues with Volume 3D textures with CUDA. The issue was identified by Thomas Dinges, the patch is different from the original D2006. See the brief discussion there. Current approach is similar (or the same) as Brecht suggested.
2016-05-11Cycles: Use explicit qualifier for single-argument constructorsSergey Sharybin
Almost in all cases we want such constructors to be explicit, there are exceptions but only in few places.
2016-05-08Code cleanup: use special type instead of node names.Brecht Van Lommel
2016-05-05Code refactor: reduce special node types, use generic constant folding.Brecht Van Lommel
2016-01-05Cycles: Fix memory leak in shader graph when bump graph is usedSergey Sharybin
2015-12-28Cycles: Implement node deduplication routinesSergey Sharybin
The idea of this commit is to merge nodes which has identical settings and matching inputs into a single node in order to minimize number of SVM instructions. This is quite simple bottom-top graph traversal and the trickiest part is how to compare node settings without too much trouble which seems to be solved is quite clean way. Still possibilities for further improvements: - Support comparison of BSDF nodes - Support comparison of volume nodes - Support comparison of curve mapping/ramp nodes Reviewers: brecht, juicyfruit, dingto Differential Revision: https://developer.blender.org/D1673
2015-12-15Cycles: De-duplicate utility functions in ccl::GraphSergey Sharybin
2015-12-02Cycles: Avoid recursion when doing constant foldSergey Sharybin
This reduces stress on the the stack memory which could be really handy on certain operation systems which applies strict limits on the stack. Reviewers: brecht, juicyfruit, dingto Reviewed By: brecht, juicyfruit, dingto Differential Revision: https://developer.blender.org/D1656
2015-11-25Cycles: Refactor of constant fold.Thomas Dinges
* Move constant folding from nodes to the shader graph. This way it's part of our (later) 4-step optimization process. * Instead of only doing a one level constant fold, we can now do a recursive constant fold, allowing us to simplify shaders much further. Constant folding is implemented for Blackbody, Math and VectorMath nodes. Example (the highlighted nodes are removed before rendering): Before: http://archive.dingto.org/2015/blender/code/one_level_constant_fold.jpg Now: http://archive.dingto.org/2015/blender/code/multi_level_constant_fold.jpg Thanks to Sergey and Brecht for Review! Differential Revision: https://developer.blender.org/D1626
2015-11-25Cycles: Ensure order of shader nodes in the dependnecies setSergey Sharybin
The issue was than nodes dependencies were stored as set<ShaderNode*> which is actually a so called "strict weak ordered", meaning order of nodes in the set is strictly defined, but based on the ShaderNode pointer. This means that between different render invokations order of original nodes could be different due to different pointers allocated for ShaderNode. This commit makes it so dependencies and maps used for ShaderNodes are based on the node->id which has much more predictable order. It's still possible to trick the system by doing some crazy edits during viewport rendfer and cause difference between viewport and final render stacks. Reviewers: brecht Reviewed By: brecht Subscribers: LazyDodo Differential Revision: https://developer.blender.org/D1630
2015-11-20Cycles: Fix filter glossy being broken after recent changesSergey Sharybin
Basically we can not use sharp closure as a substitude when filter glossy is used. This is because we can not blur sharp reflection/refraction. This is quite quick and not really clean implementation. Not really happy with manual handling of original settings, but this is as good as we can do in the quick patch. It's a good acknowledgment and we now can re-consider some aspects of graph simplification to make such cases more natively supported. P.S. This failure would have been shown by our regression tests, so please, bother a bit to run Cycles's test sweep before doing such optimizations.
2015-11-18Cycles / Shader graph: Fallback to Sharp closures for very small roughness.Thomas Dinges
We fallback to Sharp closures for Glossy, Glass and Refraction nodes now, in case the Roughness input is disconnected and 0 (< 1e-4f to be exact). This way we gain a few percentages of performance, in case the user did not manually set the closure type to "Sharp" in the UI. Sharp will probably be removed from the UI as a followup, not needed anymore with this internal optimization. Original idea by Lukas Stockner(Differential Revision: https://developer.blender.org/D1439), code implementation by myself.
2015-11-18Cycles: Add utility functions to get a ShaderInput / ShaderOutput by name.Thomas Dinges
2015-06-12Cycles: Remove Bump Node from the graph, if Height input is not connected.Thomas Dinges
This way we can avoid building the split kernel with NODE_FEATURE_BUMP enabled, in case we don't need it.
2015-06-01Cycles: Add bump feature for selective nodes compilationSergey Sharybin
For now it is unused in the kernel, actual usage will come with the next commits.
2015-05-14Cycles: Remove Emission shaders from the graph if color or strength is 0.Thomas Dinges
2015-05-09Cycles: Initial work towards selective nodes support compilationSergey Sharybin
The goal is to be able to compile kernel with nodes which are actually needed to render current scene, hence improving performance of the kernel, The idea is: - Have few node groups, starting with a group which contains nodes are used really often, and then couple of groups which will be extension of this one. - Have feature-based nodes disabling, so it's possible to disable nodes related to features which are not used with the currently used nodes group. This commit only lays down needed routines for this approach, actual split will happen later after gathering statistics from bunch of production scenes.
2015-05-09Cycles: Add utility function to graph to query number of closures used in itSergey Sharybin
Currently unused but will be needed soon for the split kernel work.
2015-05-05Cycles: Use curve approximation for blackbody instead of lookup tableSv. Lockal
Now we calculate color in range 800..12000 using an approximation a/x+bx+c for R and G and ((at + b)t + c)t + d) for B. Max absolute error for RGB for non-lut function is less than 0.0001, which is enough to get the same 8 bit/channel color as for OSL with a noticeable performance difference. However there is a slight visible difference between previous non-OSL implementation because of lookup table interpolation and offset-by-one mistake. The previous implementation gave black color outside of soft range (t > 12000), now it gives the same color as for 12000. Also blackbody node without input connected is being converted to value input at shader compile time. Reviewers: dingto, sergey Reviewed By: dingto Subscribers: nutel, brecht, juicyfruit Differential Revision: https://developer.blender.org/D1280
2015-04-20Cycles: Synchronize images after building mesh BVHSergey Sharybin
This way memory overhead caused by the BVH building is not so visible and peak memory usage will be reduced. Implementing this idea is not so straightforward actually, because we need to synchronize images used for true displacement before meshes. Detecting whether image is used for true displacement is not so striaghtforward, so for now all all displacement types will synchronize images used for them. Such change brings memory usage from 4.1G to 4.0G with the 01_01_01_D scene from gooseberry. With 01_01_01_G scene it's 7.6G vs. 6.8G (before and after the patch). Reviewers: campbellbarton, juicyfruit, brecht Subscribers: eyecandy Differential Revision: https://developer.blender.org/D1217
2015-01-27Cycles: Support texture coordinate from another objectSergey Sharybin
This is the same as blender internal's texture mapping from another object, so this way it's possible to control texture space of one object by another. Quite straightforward change apart from the workaround for the stupidness of the dependency graph. Now shader has flag telling that it depends on object transform. This is the simplest way to know which shaders needs to be tagged for update when object changes. This might give some false-positive tags now but reducing them should not be priority for Cycles and rather be a priority to bring new dependency graph. Also GLSL preview does not support using other object for mapping. This is actually correct for BI shading as well and to be addressed as a part of general GLSL viewport improvements since it's not really clear how to support this in GLSL. Reviewers: brecht, juicyfruit Subscribers: eyecandy, venomgfx Differential Revision: https://developer.blender.org/D1021
2015-01-22Cleanup / Cycles: Code de-duplication for graph node relinking.Thomas Dinges
Differential Revision: https://developer.blender.org/D1018
2015-01-21Cycles: Optimization for black world backgroundsThomas Dinges
* If a Background node is set to a black color or zero strength, it now gets removed from the shader graph. * In case the graph is empty (no background node), the kernel will skip evaluating it and save some rendertime. This can help quite a bit in scenes, where the majority of the image consists of a black background. Example: http://www.pasteall.org/pic/show.php?id=82650 In this case the render is ~16% faster. Differential Revision: https://developer.blender.org/D972
2014-12-25Cleanup: Fix Cycles Apache header.Thomas Dinges
This was already mixed a bit, but the dot belongs there.
2014-09-25Cycles: Add method to dump current shader graph to the graphiz fileSergey Sharybin
This is rather useful to see how good optimization went and so. Currently uses quite simple notation: shader nodes are nodes on the graph, connects between graph nodes are named by the sockets names, so i.e. connection between BSDF and Mix would be named bsdf:closure1. Could be improved in the feature to draw fancier graph, but it's good enough already. Use in the following way: - To create graphix file call graph->dump_graph("graph.dot") - To visualize the grapf call: dot -Tpng graph.dot -o graph.png
2014-09-24Cycles: Shader Graph Optimization for Mix RGB nodes.Thomas Dinges
Basically the same as AC2c58e96685e8, but for Mix RGB Shaders, in case we use the Mix type. This way the node can be used as texture switch for example, setting the Factor to 0.0 or 1.0, without wasting extra memory / render time.
2014-04-21Code cleanup: remove old closure sampling code Cycles.Brecht Van Lommel
This was the original code to get things working on old GPUs, but now it is no longer in use and various features in fact depend on this to work correctly to the point that enabling this code is too buggy to be useful.
2014-04-04Cycles volume: detect homogeneous volume automatically in common cases.Brecht Van Lommel
In practice this means that if you don't connect a texture to your volume nodes it will figure that out and render the node faster, rather than you having to specify it manually. Main weakness is custom OSL nodes where we have to assume it is heterogeneous because we don't know what kind of data the node accesses.
2013-12-31Cycles Volume Render: optimization to avoid exporting surface attributes whenBrecht Van Lommel
only a volume shader is used.
2013-10-30Fix #37194, OSL script crashes blender. The lookup functions for finding ↵Lukas Toenne
Cycles shader inputs/outputs based on socket names are using a few modifications on the Blender socket names. But these only apply to standard nodes where the Blender socket names can differ from associated Cycles names and may require additional indices to make them unique. Script node sockets are already unique and exact due to being generated from the script function parameters.
2013-08-18Cycles: relicense GNU GPL source code to Apache version 2.0.Brecht Van Lommel
More information in this post: http://code.blender.org/ Thanks to all contributes for giving their permission!
2013-08-18Cycles: Subsurface ScatteringBrecht Van Lommel
New features: * Bump mapping now works with SSS * Texture Blur factor for SSS, see the documentation for details: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering Work in progress for feedback: Initial implementation of the "BSSRDF Importance Sampling" paper, which uses a different importance sampling method. It gives better quality results in many ways, with the availability of both Cubic and Gaussian falloff functions, but also tends to be more noisy when using the progressive integrator and does not give great results with some geometry. It works quite well for the non-progressive integrator and is often less noisy there. This code may still change a lot, so unless you're testing it may be best to stick to the Compatible falloff function. Skin test render and file that takes advantage of the gaussian falloff: http://www.pasteall.org/pic/show.php?id=57661 http://www.pasteall.org/pic/show.php?id=57662 http://www.pasteall.org/blend/23501
2013-08-01Cycles / Blackbody to RGB node:Thomas Dinges
* Added a node to convert a temperature in Kelvin to an RGB color. This can be used e.g. for lights, to easily find the right color temperature. = Some common temperatures = Candle light: 1500 Kelvin Sunset/Sunrise: 1850 Kelvin Studio lamps: 3200 Kelvin Horizon daylight: 5000 Kelvin Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Blackbody Thanks to Philipp Oeser (lichtwerk), who essentially contributed to this with a patch! :) This is part of my GSoC 2013 project. SVN merge of r57424, r57487, r57507, r57525, r58253 and r58774
2013-06-23Fix #35847: cycles group nodes did not work well exposing inputs like normal orBrecht Van Lommel
texture coordinate that should automatically use the default normal or texture coordinate appropriate for that node, rather than some fixed value specified by the user.
2013-05-10Fix for recent bugfix with anisotropic node crash, could do invalid memory ↵Brecht Van Lommel
access.
2013-05-10Fix #35272: cycles GPU crash with anisotropic shader in group node.Brecht Van Lommel
Problem was that due to group proxy node the anisotropic node did not detect early enough that it needs generated texture coordinate data to generate the tangent. Now the proxy nodes are removed earlier.
2013-04-02Cycles: initial subsurface multiple scattering support. It's not working asBrecht Van Lommel
well as I would like, but it works, just add a subsurface scattering node and you can use it like any other BSDF. It is using fully raytraced sampling compatible with progressive rendering and other more advanced rendering algorithms we might used in the future, and it uses no extra memory so it's suitable for complex scenes. Disadvantage is that it can be quite noisy and slow. Two limitations that will be solved are that it does not work with bump mapping yet, and that the falloff function used is a simple cubic function, it's not using the real BSSRDF falloff function yet. The node has a color input, along with a scattering radius for each RGB color channel along with an overall scale factor for the radii. There is also no GPU support yet, will test if I can get that working later. Node Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#BSSRDF Implementation notes: http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/Subsurface_Scattering
2013-03-18Merge of the PyNodes branch (aka "custom nodes") into trunk.Lukas Toenne
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements. === Dynamic node type registration === Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes. Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2]. === Node group improvements === Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3]. The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there. [1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes [2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender [3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2012-12-12Fix #33485: cycles OSL now autodetects the presence of emission and transparentBrecht Van Lommel
closures to enable multiple importance sampling and transparent shadows.
2012-11-27Fix #32907: failure rendering a complex node setup, hitting fixed max numberBrecht Van Lommel
of closures limit. Optimized the code now so it can handle more. Change SVM mix/add closure handling, now we transform the node graph so that the mix weights are fed into the closure nodes directly.