Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This allows adding a "fake" sun beam effect, simulating crepuscular rays
from light being scattered in a medium like the atmosphere or deep water.
Such effects can be created also by renderers using volumetric lighting,
but the compositor feature is a lot cheaper and is independent from 3D
rendering. This makes it ideally suited for motion graphics.
The implementation uses am optimized accumulation method for gathering
color values along a line segment. The inner buffer loop uses fixed
offset increments to avoid unnecessary multiplications and avoids
variables by using compile-time specialization (see inline comments
for further details).
|
|
Added a lock to the Main which is getting acquired and released
when modifying it's lists.
Should not be any functional changes now, it just means Main is
now considered safe without worrying about locks in the callee.
|
|
This was already possible via the RGB nodes, but that seems weird.
|
|
Noticed by @bdancer on IRC. Happens e.g. when loading a file with
pynodes which haven't been registered yet.
|
|
bNodeTree blocks.
This was broken by rB6e99fb0 (own commit). I expected the `do_action`
argument to be of no importance in this case due to node trees using
material animation, but this is not the case.
Anyway, this patch adds back a do_action to the BKE_libblock_copy_nolib
function as well to restore the previous behavior.
|
|
data.
Saving a file with a new blender node that uses bNode->storage data and
then loading that in an older version will make the node undefined, but
still retain the original type identifier (in case it is defined later).
If the file is then saved over and loaded again in the newer version,
where the node type is defined, it won't have a valid storage struct.
To handle such cases gracefully, check if storage data is expected but
doesn't exist when initializing node types. User then at least get a
chance of fixing the problem manually.
Suggested fix by @brecht.
|
|
Paolo Acampora.
Reviewers: brecht, kjym3, #freestyle
Reviewed By: brecht, kjym3
Differential Revision: https://developer.blender.org/D246
|
|
Opted to keep includes if they are used indirectly (even if removing is possible).
|
|
- BLI_ghashutil_strhash_n takes string length, to avoid terminating the string before hashing.
- BLI_ghashutil_inthash/uinthash take ints, to avoid casting to (void *)
This also showed up incorrect use of inthash, which was using a pointer.
|
|
complete.
Fixes T37954.
Reviewed By: brecht, dingto
Differential Revision: https://developer.blender.org/D230
|
|
|
|
|
|
as well.
These were already doing the same thing, just not as nice. Only
difference is the do_action argument (false for BKE_libblock_copy_nolib)
but this is of no consequence because the function is only called for
trees nested inside material, scene, etc., which never have own actions.
|
|
transformation.
This was suggested by Christopher Barrett (terrachild). Corner pin is a common feature in compositing.
The corners for the plane warping can be defined by using vector node inputs to allow using perspective plane transformations without having to go via the MovieClip editor tracking data.
Uses the same math as the PlaneTrack node, but without the link to MovieClip and Object.
{F78199}
The code for PlaneTrack operations has been restructured a bit to share it with the CornerPin node.
* PlaneDistortCommonOperation.h/.cpp: Shared generic code for warping images based on 4 plane corners and a perspective matrix generated from these. Contains operation base classes for both the WarpImage and Mask operations.
* PlaneTrackOperation.h/.cpp: Current plane track node operations, based on the common code above. These add pointers to MovieClip and Object which define the track data from wich to read the corners.
* PlaneCornerPinOperation.h/.cpp: New corner pin variant, using explicit input sockets for the plane corners.
One downside of the current compositor design is that there is no concept of invariables (constants) that don't vary over the image space. This has already been an issue for Blur nodes (size input is usually constant except when "variable size" is enabled) and a few others. For the corner pin node it is necessary that the corner input sockets are also invariant. They have to be evaluated for each tile now, otherwise the data is not available. This in turn makes it necessary to make the operation "complex" and request full input buffers, which adds unnecessary overhead.
|
|
|
|
|
|
don't get updated based on context.
As discussed in T38340 the solution is to use the current scene from
context whenever feasible.
Composite does not use node->id at all now, the scene which owns the
compositing node tree is retrieved from context instead.
Defocus node->id is made editable by the user. By default it is not set,
which also will make it use the contextual scene and camera info.
The node->id pointer in Defocus is **not** cleared in older blend files.
This is done for backward compatibility: the node will then behave as
before in untouched scenes.
File Output nodes also don't store scene in node->id. This is only needed
when creating a new node for initializing the file format.
Reviewers: brecht, jbakker, mdewanchand
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D290
|
|
|
|
|
|
|
|
This is because of the animdata cleanup in rBd2e55cb. This works ok in
general, but causes issues with the localized node trees used for compo/
shader/texture previews. These localized trees share the same default
action as their original trees, and then remove fcurves when removing
muted nodes (which should affect the localized tree only).
node_free_node_ex now has an argument for disabling animdata cleanup,
which is also not necessary when freeing the whole node tree (because
animdata is freed in advance anyway). In addition to that it also checks
the NTREE_IS_LOCALIZED flag to prevent freeing of fcurves in the action.
|
|
Previously this only worked for some datablocks relevant to rendering, now it
can be used to detect if any type of datablock was added or removed (but not
yet to detect if it was modified, we need many more depsgraph tags for that).
Most of the changes are some function parameter changes, the important parts
are the DAG_id_type_tag calls.
Reviewed By: sergey, brecht
Differential Revision: https://developer.blender.org/D195
|
|
group default values.
This can happen when using value sliders for node group input values.
The localized copies were setting the "interface_type" runtime pointer
of the original tree to NULL instead of the new tree (which is created
on-the-fly in general). This type is used in RNA update functions
however, the original tree DNA should not be modified there.
|
|
This is done by adding a Volume Scatter node. In many cases you will want to
add together a Volume Absorption and Volume Scatter node with the same color
and density to get the expected results.
This should work with branched path tracing, mixing closures, overlapping
volumes, etc. However there's still various optimizations needed for sampling.
The main missing thing from the volume branch is the equiangular sampling for
homogeneous volumes.
The heterogeneous scattering code was arranged such that we can use a single
stratified random number for distance sampling, which gives less noise than
pseudo random numbers for each step. For volumes where the color is textured
there still seems to be something off, needs to be investigated.
|
|
absorption.
This is the simplest possible volume rendering case, constant density inside
the volume and no scattering or emission. My plan is to tweak, verify and commit
more volume rendering effects one by one, doing it all at once makes it
difficult to verify correctness and track down bugs.
Documentation is here:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Materials/Volume
Currently this hooks into path tracing in 3 ways, which should get us pretty
far until we add more advanced light sampling. These 3 hooks are repeated in
the path tracing, branched path tracing and transparent shadow code:
* Determine active volume shader at start of the path
* Change active volume shader on transmission through a surface
* Light attenuation over line segments between camera, surfaces and background
This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
|
|
* Henyey-Greenstein scattering closure implementation.
* Rename transparent to absorption node and isotropic to scatter node.
* Volume density is folded into the closure weights.
* OSL support for volume closures and nodes.
* This commit has no user visible changes, there is no volume render code yet.
This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
|
|
tree ID data when freeing bNodeTree data blocks, while also making sure
localized node group copies get freed properly.
|
|
|
|
|
|
moved the hide preview logic to a method on bNodeTreeType. This way the node.c keeps clean, but logic could still be shared.
Implementing this per node, can lead to future errors.
|
|
only input nodes will show the preview by default.
|
|
python nodes on Blender exit.
The nodeFreeNode function is calling a customizable freefunc callback,
which can be implemented by python. However, the context is invalid when
using this callback while the node tree data block is freed on exit.
Luckily it is also not necessary: When freeing the bNodeTree data blocks
all that is needed is freeing of the DNA data, no other side effects
should happen. So now disable the api callbacks when freeing nodes in
the ntreeFreeTree function.
Also some minor cleanup: checking node->typeinfo is not necessary, all
nodes will always have a valid typeinfo pointer - if a node type is
unknown this will be a stub bNodeType to avoid the need for such checks.
|
|
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
|
|
information such as light vector from specified Lamp.
For now this provides the following outputs:
- Color
- Light Vector
- Distance
- Shadow
- Visibility Factor
Note: Color output is multiplied by the lamp energy. Multiplication of
color*max(dot(light_vector,normal_vector),0)*shadow*visibility_factor
produces the exact same result as the Lambert shader.
Many thanks to Brecht for code review and discussion!
|
|
(simple 'label' identifier is already in use, need to avoid API breakage). This should simply return a string. The dynamic label can still be overridden by the user-defined node.label string.
|
|
callback function, let it write into a mutable string buffer. This will allow actual dynamic labels for nodes using the python
API.
|
|
The way node groups check for localized trees in the ntreeFreeTree_ex function does not work. When the main library is freed on exit it also frees genuine node groups trees (which is correct), but then
node groups referencing these trees will not find them in the library and interpret that as a localized group, attempting to free them a second time ... Nicer solution is to just use a special flag on
localized node trees so we can clearly distinguish them from genuine trees in main.
|
|
The operator exits early when there are no internal links. This prevents it from removing links which have no internal connection.
|
|
shade, and the Blender Engine (or Game Engine).
The "active ID node" concept has become slightly more complex with pynodes. To find the active material or other ID links in a node tree recursively requires a hash key based on the "parent" tree of the
current node group. To avoid returning NULL in case this key is not yet initialized (i.e. ID node has not been activated yet), just accept 0 key as well for the base node tree.
|
|
The same bug happens for modifiers, but better to address it separately.
Contribution and review by Lukas Toenne and Brecht van Lommel
|
|
|
|
|
|
can not be used to free localized node groups, because it is not commonly called to free the localized node trees. Instead these
data blocks are freed using the standard ntreeFreeTree function, so freeing localized node groups has to be done there. This means an ugly loop over G.main to detect localized groups, but should not be a
big problem in practice.
|
|
main library ... This was because of the G.main check in ntreeCopyTree_internal, which determines whether a node tree gets put
into main or is an independent data block. This can now be controlled by passing an explicit Main pointer, so we can ensure localized node groups don't pollute main.
|
|
This problem was introduced with pynodes merge in r55373. It's caused by missing localization of node groups in shaders in cases where GLSL + node previews causes threading conflicts. I'm not quite sure why
we didn't do this before, but now all node groups also get localized recursively.
|
|
A new hair bsdf node, with two closure options, is added. These closures allow the generation of the reflective and transmission components of hair. The node allows control of the highlight colour, roughness and angular shift.
Llimitations include:
-No glint or fresnel adjustments.
-The 'offset' is un-used when triangle primitives are used.
|
|
CTX_DATA_BEGIN/END)
|