Age | Commit message (Collapse) | Author |
|
|
|
|
|
This makes node trees with long links that cross other nodes easier to work with.
Dimmed links will be ignored by various modal operators like cut and reroute insertion.
Differential Revision: https://developer.blender.org/D11813
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
Currently the emboss is only fading on left side of the widget,
resulting in the emboss extending vertically on the right side
and ending abruptly. This patch fixes this by also fading the
emboss on the right side and making it symmetric.
Differential Revision: https://developer.blender.org/D10810
|
|
Apparently `textureSize` doesn't work with
`sampler1DArray` on this OS.
Thanks to @dave1853 for finding the source of the
problem.
|
|
Cycles, Eevee, OSL, Geo, Attribute
This operator provides consistency with the standard math node. Allows users to use a single node instead of two nodes for this common operation.
Reviewed By: HooglyBoogly, brecht
Differential Revision: https://developer.blender.org/D10808
|
|
Includes fixes to misspelled function names.
Ref D11280
|
|
This patch adds wavelength node support to Eevee, similar to how
Eevee Blackbody node works, thus it is a little off from Cycles.
Reviewed By: #eevee_viewport, fclem, brecht
Differential Revision: https://developer.blender.org/D11326
|
|
Fixes T86097 EEVEE Subsurface Node give blurry edges
|
|
Changes output for geometry info node in Eevee to be consistent with Cycles (w/o osl)
Before this patch Eevee outputs Z-tangent even for hair. This patch changes it to output hair tangent (growth direction). Hair tangent is impossible to derive otherwise from normal or view direction.
Reviewed By: fclem, brecht
Differential Revision: https://developer.blender.org/D10841
|
|
The SB back-end optimizer for the mesa R600g driver corrupts the vertex
shader for widget drawing. This will not be fixed upstream because SB is
getting replaced as part of the new NIR path. This was thought to be an
issue with instancing and an attempted fix was submitted in D8374, but
it did not fix the issue.
This patch reimplements the array look-up part of the code using switch
case as a workaround and removes the old workaround implemented as part
of D8374.
Reviewed By: Clement Foucault
Differential Revision: https://developer.blender.org/D10967
|
|
Negative speculars are evil.
|
|
Cycles, Eevee, OSL, Geo, Attribute
Based on outdated refract patch D6619 by @cubic_sloth
`refract` and `faceforward` are standard functions in GLSL, OSL and Godot shader languages.
Adding these functions provides Blender shader artists access to these standard functions.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D10622
|
|
This patch adds the ability to mute individual wires in the node editor.
This is invoked like the cut links operator but with a new shortcut.
Mute = Ctrl + Alt
Cut = Ctrl
Dragging over wires will toggle the mute state for that wire.
The muted wires are drawn in red with a bar across the center.
Red is used in the nodes context to indicate invalid links, muted links and internal links.
When a wire is muted it exposes the original node buttons which are normally hidden when a wire is connected.
Downstream and upstream links connected using reroute nodes are also muted.
Outside scope of patch:
- Add support for pynodes e.g. Animation Nodes
- Requires minor change to check for muted links using the `is_muted` link property or the `is_linked` socket property.
Maniphest Tasks: T52659
Differential Revision: https://developer.blender.org/D2807
|
|
Accumulate error caused by the low amount of integration slices and
correct it for the low roughness surfaces.
This increases light leak but it is less distracting than dark fringe
everywhere.
|
|
This fixes NaNs / blown up values when using alpha-hashed transparency
or alpha clip with SSS.
|
|
The actual sample count is rounded up to a multiple of 4 because we
sample 4 horizons directions.
Changing this setting forces the shader to recompile (because using a
GPU_constant).
|
|
Reflection
Anisotropic is not really supported in Eevee, but since code looks like
it is just intended to make it behave like glossy, it should function
like it too.
Seems like the internal calling from `node_bsdf_glossy` from
`node_bsdf_anisotropic` has swapped arguments.
Also: ssr_id is available for SH_NODE_BSDF_ANISOTROPIC as well (see
`ntree_tag_bsdf_cb`), so why not use it?
Maniphest Tasks: T84658
Differential Revision: https://developer.blender.org/D10547
|
|
Introduced by 7f7e6830991b.
|
|
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
|
|
This makes is clearer and avoid having to setup worldPosition if
shader is not a material shader.
|
|
This adds an approximation of inverted AO by reversing the max horizon
search (becoming a min horizon). The horizons are correctly clamped in
the reverse direction to the shading and geometric normals.
The arc integration is untouched as it seems to be symetrical.
The limitation of this technique is that since it is still screen-space
AO you don't get other hidden surfaces occlusion. This is more
problematic in the case of inverted AO than for normal AO but it's
better than no support AO.
Support of distance parameter was easy thanks to recent AO refactor.
|
|
- Fix noise/banding artifact on distant geometry.
- Fix overshadowing on un-occluded surfaces at grazing angle producing "fresnel"
like shadowing. Some of it still appears but this is caused to the low number
of horizons per pixel.
- Improve performance by using a fixed number of samples and fixing the
sampling area size. A better sampling pattern is planned to recover
the lost precision on large AO radius.
- Improved normal reconstruction for the AO pass.
- Improve Bent Normal reconstruction resulting in less faceted look on
smoothed geometry.
- Add Thickness heuristic to avoid overshadowing of thin objects.
Factor is currently hardcoded.
- Add bent normal support to Glossy reflections.
- Change Glossy occlusion to give less light leaks from lightprobes.
It can overshadow on smooth surface but this should be mitigated by
using SSR.
- Use Bent Normal for rough Glossy surfaces.
- Occlusion is now correctly evaluated for each BSDF. However this does make
everything slower. This is mitigated by the fact the search is a lot faster
than before.
|
|
This modifies the principled BSDF and the Glass BSDF which now
have better fit to multiscatter GGX.
Code to generate the LUT have been updated and can run at runtime.
The refraction LUT has been changed to have the critical angle always
centered around one pixel so that interpolation can be mitigated.
Offline LUT data will be updated in another commit
This simplify the BTDF retreival removing the manual clean cut at
low roughness. This maximize the precision of the LUT by scalling
the sides by the critical angle.
I also touched the ior > 1.0 approximation to be smoother.
Also incluse some cleanup of bsdf_sampling.glsl
|
|
This refactor was needed for some reasons:
- closure_lit_lib.glsl was unreadable and could not be easily extended to use new features.
- It was generating ~5K LOC for any shader. Slowing down compilation.
- Some calculations were incorrect and BSDF/Closure code had lots of workaround/hacks.
What this refactor does:
- Add some macros to define the light object loops / eval.
- Clear separation between each closures which now have separate files. Each closure implements the eval functions.
- Make principled BSDF a bit more correct in some cases (specular coloring, mix between glass and opaque).
- The BSDF term are applied outside of the eval function and on the whole lighting (was separated for lights before).
- Make light iteration last to avoid carrying more data than needed.
- Makes sure that all inputs are within correct ranges before evaluating the closures (use `safe_normalize` on normals).
- Making each BSDF isolated means that we might carry duplicated data (normals for instance) but this should be optimized by compilers.
- Makes Translucent BSDF its own closure type to avoid having to disable raytraced shadows using hacks.
- Separate transmission roughness is now working on Principled BSDF.
- Makes principled shader variations using constants. Removing a lot of duplicated code. This needed `const` keyword detection in `gpu_material_library.c`.
- SSR/SSS masking and data loading is a bit more consistent and defined outside of closure eval. The loading functions will act as accumulator if the lighting is not to be separated.
- SSR pass now do a full deferred lighting evaluation, including lights, in order to avoid interference with the closure eval code. However, it seems that the cost of having a global SSR toggle uniform is making the surface shader more expensive (which is already the case, by the way).
- Principle fully black specular tint now returns black instead of white.
- This fixed some artifact issue on my AMD computer on normal surfaces (which might have been some uninitialized variables).
- This touched the Ambient Occlusion because it needs to be evaluated for each closure. But to avoid the cost of this, we use another approach to just pass the result of the occlusion on interpolated normals and modify it using the bent normal for each Closure. This tends to reduce shadowing. I'm still looking into improving this but this is out of the scope of this patch.
- Performance might be a bit worse with this patch since it is more oriented towards code modularity. But not by a lot.
Render tests needs to be updated after this.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10390
# Conflicts:
# source/blender/draw/engines/eevee/eevee_shaders.c
# source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl
# source/blender/draw/intern/shaders/common_math_lib.glsl
|
|
Approximately 91 spelling corrections, almost all in comments.
Differential Revision: https://developer.blender.org/D10288
Reviewed by Harley Acheson
|
|
During viewport rendering the color values were clamped in order to
apply the overlay on top of it. This clamping would show the scene
colors washed out.
This patch adds a work around to skip the clamping when the overlays are
turned off.
Parial fix for {T77909}
|
|
In glsl the clamp function has undefined behavior when min > max. For
the clamp node this resulted in differences between cycles and eevee.
This patch adds the expected implementation for minmax.
The old clamp function is still used in cases where we know for certain
that the input values are correct (math node clamp option). GPU uses
optimized code and silicon in these cases.
|
|
This patch adds support for AOVs in EEVEE. AOV Outputs can be defined in the
render pass tab and used in shader materials. Both Object and World based
shaders are supported. The AOV can be previewed in the viewport using the
renderpass selector in the shading popover.
AOV names that conflict with other AOVs are automatically corrected. AOV
conflicts with render passes get a warning icon. The reason behind this is that
changing render engines/passes can change the conflict, but you might not notice
it. Changing this automatically would also make the materials incorrect, so best
to leave this to the user.
**Implementation**
The patch adds a copies the AOV structures of Cycles into Blender. The goal is
that the Cycles will use Blenders AOV defintions. In the Blender kernel
(`layer.c`) the logic of these structures are implemented.
The GLSL shader of any GPUMaterial can hold multiple outputs (the main output
and the AOV outputs) based on the renderPassUBO the right output is selected.
This selection uses an hash that encodes the AOV structure. The full AOV needed
to be encoded when actually drawing the material pass as the AOV type changes
the behavior of the AOV. This isn't known yet when the GLSL is compiled.
**Future Developments**
* The AOV definitions in the render layer panel isn't shared with Cycles.
Cycles should be migrated to use the same viewlayer aovs. During a previous
attempt this failed as the AOV validation in cycles and in Blender have
implementation differences what made it crash when an aov name was invalid.
This could be fixed by extending the external render engine API.
* Add support to Cycles to render AOVs in the 3d viewport.
* Use a drop down list for selecting AOVs in the AOV Output node.
* Give user feedback when multiple AOV output nodes with the same AOV name
exists in the same shader.
* Fix viewing single channel images in the image editor [T83314]
* Reduce viewport render time by only render needed draw passes. [T83316]
Reviewed By: Brecht van Lommel, Clément Foucault
Differential Revision: https://developer.blender.org/D7010
|
|
These fill shaders were used with the old draw engine.
|
|
Conflicts:
source/blender/editors/render/render_opengl.c
source/blender/sequencer/intern/effects.c
|
|
The issue was the use of alpha values of 0 when there were no blending
enabled.
This patch just disables the smoothing of the wires in this case.
|
|
|
|
The shadow path was not using the alpha threshold.
|
|
|
|
Add a new Alpha socket to the Attribute node that outputs the
fourth component of the attribute. Currently the only such
attribute is vertex color, but there may be more in the future.
If the attribute has no alpha channel, the expected value is 1.
The Cycles code is already refactored and committed by Brecht.
Ref D2057
|
|
This avoid strange discrepency between the general purpose variant and
the specialized glass variant which did not have a way to turn
multi-scatter off.
|
|
The alpha out socket output the average transmittance, not the alpha.
This patch will convert the transmittance to alpha.
Found during research of T80919; Issue introduced when `Closure.opacity` was migrated to `Closure.transmittance`.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D9010
|
|
|
|
Follow our code style guide by using C-comments for text descriptions.
|
|
This was caused by points well behind the near clip making the
computation of the width wrong.
The fix is to clip the line to the near clip plane.
|
|
on top in the Image Editor"
This reverts commit 085329f114beb904ed3ef0c8ec6894ee26916704.
It didn't render rendered viewport overlays correctly.
|
|
the Image Editor
Since {D8234} the image editor is drawn using a depth buffer.
When using `draw_texture_2d` the image is drawn using the 2D_IMAGE
shader. inside the vertex buffer the image was pushed to the background.
This was introduced by {648924333234} what seems to be out dated as we
have done several overhauls in this area. (workbench refactor, overlay
engine refactor, color management pipeline).
This patch removes the pushing of the image to the background.
|
|
Following the most widely used convention for including todo's in
the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
|
|
Oversight that should have been in rB6f3c279d9e70
|
|
Based on http://jcgt.org/published/0008/01/03/
This is a simple trick that does *not* have a huge performance impact but
does work pretty well. It just modifies the Fresnel term to account for
the multibounce energy loss (coloration).
However this makes the shader variations count double. To avoid this we
use a uniform and pass the multiscatter use flag inside the sign of f90.
This is a bit hacky but avoids many code duplication.
This uses the simplification proposed by McAuley in
A Journey Through Implementing Multiscattering BRDFs and Area Lights
This does not handle area light differently than the IBL case but that's
already an issue in current implementation.
This is related to T68460.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8912
|
|
This add basic null safe handling for this operation.
|
|
This was causing flashing colors in the node editor grid.
This is because in some cases the flat color is only set on the provoking
vertex which is the last of the primitive by default.
|