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
2021-05-19EEVEE: Geometry info -> tangent: Make consistent with Cycles for hairMikhail Matrosov
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
2021-04-13Fix T78803: Bad widget drawing with the R600g driverOmar Emara
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
2021-04-08Fix T87107 EEVEE: Principled BSDF doesn't handle negative specularClément Foucault
Negative speculars are evil.
2021-03-23Nodes: Add Refract and Faceforward functions to Vector Maths nodesCharlie Jolly
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
2021-03-17Nodes: Add support to mute node wiresCharlie Jolly
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
2021-03-14EEVEE: Specular Occlusion: Avoid overdarkening on smooth surfacesClément Foucault
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.
2021-03-13EEVEE: Fix wrong sss component being affected by alphaClément Foucault
This fixes NaNs / blown up values when using alpha-hashed transparency or alpha clip with SSS.
2021-03-08EEVEE: Ambient Occlusion: Add sample parameter support for the AO nodeClément Foucault
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).
2021-03-01Fix T84658: Anisotropic BSDF - most modes not using Screen SpacePhilipp Oeser
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
2021-02-24Fix T85939: Eevee Specular BSDF shader compile errorJeroen Bakker
Introduced by 7f7e6830991b.
2021-02-22Fix Principled BSDF specular color for black base colorPascal Schön
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
2021-02-21Cleanup: EEVEE: change cameraVec macro to cameraVec(P)Clément Foucault
This makes is clearer and avoid having to setup worldPosition if shader is not a material shader.
2021-02-21EEVEE: Ambient Occlusion Node: Support inverted and distance parametersClément Foucault
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.
2021-02-21EEVEE: Ambient Occlusion: RefactorClément Foucault
- 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.
2021-02-13EEVEE: Update LUT GGX generation shaderClément Foucault
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
2021-02-13EEVEE: Refactor closure_lit_lib.glslClément Foucault
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
2021-02-06UI: Fix Typos in Comments and Docsluzpaz
Approximately 91 spelling corrections, almost all in comments. Differential Revision: https://developer.blender.org/D10288 Reviewed by Harley Acheson
2021-01-26Viewport Rendering: Don't clamp when overlays are disabled.Jeroen Bakker
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}
2020-12-18Fix T83494: Eevee clamp node incorrect when min > max.Jeroen Bakker
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.
2020-12-04EEVEE: Arbitrary Output VariablesJeroen Bakker
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
2020-11-26GPencil: Cleanup - Remove unused old shadersAntonio Vazquez
These fill shaders were used with the old draw engine.
2020-11-17Merge branch 'blender-v2.91-release'Richard Antalik
Conflicts: source/blender/editors/render/render_opengl.c source/blender/sequencer/intern/effects.c
2020-11-17Fix T81827: MacOS lines that should be thick are green insteadClément Foucault
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.
2020-11-04Merge branch 'blender-v2.91-release'Richard Antalik
2020-11-04Fix T82385 EEVEE: Alpha Clip shadows actually using Alpha Hashed shadowsClément Foucault
The shadow path was not using the alpha threshold.
2020-11-04Cleanup: make formatAaron Carlisle
2020-11-03Materials: support true float4 attributes in the Attribute node.Alexander Gavrilov
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
2020-10-22EEVEE: Principle BSDF: Use multi-scatter switch for the glass variantClément Foucault
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.
2020-10-20EEVEE: ShaderToRGB alpha inversedJeroen Bakker
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
2020-10-14Cleanup: multi-line comment blocksCampbell Barton
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-10-08Fix T80974 GPU: Wide Line emulation shader does not always worksClément Foucault
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.
2020-09-29Revert "Fix T81002: Images drawn with the Python gpu module no longer draw ↵Jeroen Bakker
on top in the Image Editor" This reverts commit 085329f114beb904ed3ef0c8ec6894ee26916704. It didn't render rendered viewport overlays correctly.
2020-09-22Fix T81002: Images drawn with the Python gpu module no longer draw on top in ↵Jeroen Bakker
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.
2020-09-19Cleanup: consistent TODO/FIXME formatting for namesCampbell Barton
Following the most widely used convention for including todo's in the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
2020-09-19EEVEE: Fix Missing GGX multi-scattering on Glass BSDFClément Foucault
Oversight that should have been in rB6f3c279d9e70
2020-09-19EEVEE: Add support for GGX Multi-scatterClément Foucault
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
2020-09-19Fix T79557 EEVEE: Normalize in vector math node is not null vector safeClément Foucault
This add basic null safe handling for this operation.
2020-09-18GPUShader: Fix wide line emulation with flat color interpolation.Clément Foucault
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.
2020-09-18EEVEE: Fixed Compilation ErrorJeroen Bakker
Regression from {b248ec97769f}. A new parameter was introduced, but the stub shader macros still had the old number of parametes. This change adds a new dummy parameter to the stub macros.
2020-09-17Shaders: add emission strength input to Principled BSDF nodeAlex Strand
This impacts I/O add-ons. OBJ, FBX and Collada have been updated, glTF not yet. Differential Revision: https://developer.blender.org/D4971
2020-09-09UI: Fix Icon drawing on MacOSClément Foucault
It seems that using a vertex shader using both `gl_InstanceID` and `gl_VertexID` is causing some issues on MacOS + Intel Iris. Regression introduced by rB052538edc1fba109d3427471047611888ed13bea
2020-09-05Cleanup: clang-formatCampbell Barton
2020-09-03Fix T79803: Wrong Distance To Edge 1D VoronoiOmarSquircleArt
The current 1D Voronoi implementation for the Distance to Edge option computes the distance to the cells instead. This patch fixes that and compute the distance to the edge. Reviewed By: JacquesLucke, brecht Differential Revision: https://developer.blender.org/D8634
2020-09-01UI: Widget: Add conservative raster to avoid cut widget bordersClément Foucault
This avoids incorrect AA when the widget is not perfectly alligned with the pixel grid.
2020-09-01Cleanup: Use GPUBatch for icon and area drawingClément Foucault
This is in order to remove GPU_draw_primitive to streamline the drawing abstraction.
2020-08-18Fix T79568 EEVEE: Film transparent not workingClément Foucault
Since world shader use the same standard output and are considered opaque, we need to set alpha as holdout.
2020-07-30EEVEE: GLSL refactor/cleanupClément Foucault
- add the use of DRWShaderLibrary to EEVEE's glsl codebase to reduce code complexity and duplication. - split bsdf_common_lib.glsl into multiple sub library which are now shared with other engines. - the surface shader code is now more organised and have its own files. - change default world to use a material nodetree and make lookdev shader more clear. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D8306
2020-07-20Fix T78977 GPU: blf fonts are not gamma correctedClément Foucault
2020-07-18Cleanup: GPUShader: Remove unused builtin shaderClément Foucault