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-04-08Fix T87107 EEVEE: Principled BSDF doesn't handle negative specularClément Foucault
Negative speculars are evil.
2021-04-08Cleanup: enable modernize-use-equals-default checkJacques Lucke
This removes a lot of unnecessary code that is generated by the compiler automatically. In very few cases, a defaulted destructor in a .cc file is still necessary, because of forward declarations in the header. I removed some defaulted virtual destructors, because they are not necessary, when the parent class has a virtual destructor already. Defaulted constructors are only necessary when there is another constructor, but the class should still be default constructible. Differential Revision: https://developer.blender.org/D10911
2021-03-24Cleanup: remove stdio.h header from MEM_guardedalloc.hCampbell Barton
This was included for `FILE *` which isn't used in the header. Ref D10799
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-18Cleanup: spellingCampbell Barton
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-08Cleanup: use ofs instead of offs as an abbreviation for offsetCampbell Barton
Used for local structs/variables, since `ofs` is by far the most widely used abbreviation.
2021-03-04Cleanup: use const arraysCampbell Barton
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 line width broken for consecutive line draw callsJulian Eisel
D9054 did multiple consecutive `immBegin()`/`immEnd()` draw calls to draw multiple lines at varying thickness. This would only work for the first line, then they'd all get a 1px thickness (at least on macOS). Issue was that `wide_line_workaround_end()` called `immBindShader()` directly to restore the old shader (which the workaround overrides). However this doesn't set `imm->builtin_shader_bound` which has to be done for the workaround to work on the next `immBegin()` call. Instead `immBindBuiltinProgram()` can be called. Differential Revision: https://developer.blender.org/D10520 Reviewed by: Clément Foucault
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-21GPU: Add define to ouput more context lines for GLSL errorsClément Foucault
This is work in progress, but it is very useful even as it is.
2021-02-21GPU: Add RGB10_A2 format supportClément Foucault
Nice format to output high definition normals or normalized colors.
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-20Cleanup: doxygen sectionsCampbell Barton
2021-02-18Cleanup: spelling, correct doc-string argumentsCampbell Barton
2021-02-17Cleanup: Abbreviate enums with 'UNSIGNED_' in the nameGermano Cavalcante
2021-02-17Python: gpu module: add new submodules and typesGermano Cavalcante
This commit extends the gpu python API with: ``` gpu.types.Buffer #"__init__", "to_list" gpu.types.GPUTexture #"__init__", "clear", "read", "format" gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__", "__exit__" with "GPUFrameBufferStackContext") gpu.types.GPUUniformBuf #"__init__", "update" gpu.state #"blend_set", "blend_get", "depth_test_set", "depth_test_get", "depth_mask_set", "depth_mask_get", "viewport_set", "viewport_get", "line_width_set", "line_width_get", "point_size_set", "color_mask_set", "face_culling_set", "front_facing_set", "program_point_size_set" ``` Add these methods to existing objects: ``` gpu.types.GPUShader #"uniform_sample", "uniform_buffer" ``` Maniphest Tasks: T80481 Differential Revision: https://developer.blender.org/D8826
2021-02-17Cleanup: spellingCampbell Barton
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-09Fix T81206: Do not limit gl texture size in image editorJeroen Bakker
This patch will show textures in the image editor with the maximum available resolution determined by the GPU Hardware/Driver. Currently the size is limited by the user preference texture size limit. An image user can set the `IMA_SHOW_MAX_RESOLUTION` flag to request gpu textures in the max supported resolution. When this flag isn't set the gpu texture is limited by the user preference setting. When the gl resolution limit is disabled the GPU texture is always created for the max supported resolution. Reviewed By: Clément Foucault Maniphest Tasks: T81206 Differential Revision: https://developer.blender.org/D9160
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-02-05Cleanup: outdated/unhelpful commentsCampbell Barton
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-02-03GL: Improve framebuffer error message by adding framebuffer nameClément Foucault
Framebuffer error can be hard to track. This makes it much easier to find the wrong framebuffer configuration.
2021-02-03Merge branch 'blender-v2.92-release'Clément Foucault
2021-02-03Fix T85314 GPU: Drawlist submit data overflows.Clément Foucault
This was caused by an incorrect bound check. Since we now use different data type for indexed and non-indexed drawcalls, we need to check if the next drawcall is going to overflow the buffer.
2021-02-02macOS: fix warning about unkown GPU with Apple M1 chipBrecht Van Lommel
2021-02-01Merge branch 'blender-v2.92-release'Clément Foucault
2021-02-01GPU: Fix performance regression on AMD GPUClément Foucault
This was caused by a missing check left over during the GL isolation. Fix T84277 Solid and Wireframe viewport performance hit on AMD Radeon GPUs
2021-01-28Merge branch 'blender-v2.92-release'Campbell Barton
2021-01-28Fix T81334: Python view-port drawing depth-test regressionCampbell Barton
Since 216d78687d2b9468b05fb598d1cef0b8424a40d2 the depth function (glDepthFunc) was left in an undefined state for drawing callbacks that use the `bgl` module. This meant enabling depth-test from Python's bgl module also needed to set the depth function (which previously wasn't necessary). Set the depth function as part of GPU_bgl_start
2021-01-27Fix T84329: Crash when loading the blender with deprecated graphics driverGermano Cavalcante
Add the driver `4.5.13467` related to `Radeon R5 Graphics` to the workaround list.
2021-01-26Merge remote-tracking branch 'origin/blender-v2.92-release'Sybren A. Stüvel
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}
2021-01-26GPU: Enable HQ normals workaround for any AMD Drivers on Polaris.Jeroen Bakker
2021-01-26Merge branch 'blender-v2.92-release'Robert Guetzkow
2021-01-26GPU: Enable HQ normals workaround for AMD 21.1.1 driver.Jeroen Bakker
AMD 21.1.1 still has the same issues as reported in T82856.
2021-01-21Docs: add note on convention for setting line-widthCampbell Barton
2021-01-20Cleanup: remove extra in trailing asteriskCampbell Barton
Comment blocks not conforming to convention.
2021-01-12GPU: Remove Limited Support AMD PolarisJeroen Bakker
Removing the limited support message as the known opengl issues of the recent drivers with polaris cards have been tackled.
2021-01-11Revert "Fix typo; Documentation; Expose layer for framebuffer attachament; ↵Germano Cavalcantemano-wii
Add framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask" This reverts commit 9db3d1951da15254efbbcf028176facb78118ec1. This was an accidental commit of the patch D8826
2021-01-11Fix typo; Documentation; Expose layer for framebuffer attachament; Add ↵Germano Cavalcantemano-wii
framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask