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-12-25Fix T94362: GPUMaterialTexture references freed ImageUserJacques Lucke
The issue was caused by rB7e712b2d6a0d257d272ed35622b41d06274af8df and the fact that `GPUMaterialTexture` contains an `ImageUser *` which references the `ImageUser` on e.g. `NodeTexImage`. Since the node tree update refactor, it is possible that the node tree changes without changing the actual material. Therefore, either the renderer should check if the node tree has changed or it should not store pointers to data in node storage. The latter approach is implemented in this patch. Differential Revision: https://developer.blender.org/D13663
2021-12-25Cleanup: use new c++ guarded allocator APIAaron Carlisle
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
2021-12-18GPU: add memory barriers for vertex and index buffersKévin Dietrich
This adds memory barriers to use with `GPU_memory_barrier` to ensure that writes to a vertex or index buffer issued before the barrier are completed after it, so they can be safely read later by another shader. `GPU_BARRIER_VERTEX_ATTRIB_ARRAY` should be used for vertex buffers (`GPUVertBuf`), and `GPU_BARRIER_ELEMENT_ARRAY` should be used for index buffers (`GPUIndexBuf`). Reviewed By: fclem Differential Revision: https://developer.blender.org/D13595
2021-12-17GPU: Sort SSBOs In Shader Interface.Jeroen Bakker
SSBOs weren't sorted, but other types were. This was an oversight when SSBOs were introduced (GPU compute pipeline). Issue identified by @fclem.
2021-12-14Nodes: Add vector support to Map Range nodeCharlie Jolly
This replaces lost functionality from the old GN Attribute Map Range node. This also adds vector support to the shader version of the node. Notes: This breaks forward compatibility as this node now uses data storage. Reviewed By: HooglyBoogly, brecht Differential Revision: https://developer.blender.org/D12760
2021-12-14Cleanup: resolve parameter mis-matches in doc-stringsCampbell Barton
Renamed or removed parameters which no longer exist.
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-10Fix T92036: `Magic Texture` in Volumetric World Shaders render differently ↵William Leeson
with the CPU and GPU When rendering volume surfaces in unbounded worlds the volume stepping can produce large values. If used with a magic texture node the values can results in a Inf float which when used in a sin or cos produces a NaN. To fix this the input values are mapped into the periodic range of the sin and cos functions (-2*PI 2*PI) this stops the possibility of a Inf occurring and thus the NaN. It also improves the accuracy and smoothness of the result due to loss of precision when large values are summed with smaller ones effectively removing the parts of the smaller number (i.e. those in the -2PI to 2PI range) that result in variation of the output of sin and cos. Reviewed By: brecht Maniphest Tasks: T92036 Differential Revision: https://developer.blender.org/D12821
2021-12-09Cleanup: move public doc-strings into headers for 'gpu'Campbell Barton
Ref T92709
2021-12-08Cleanup: Clang-Tidy modernize-redundant-void-argAaron Carlisle
2021-11-30Cleanup: capitalize NOTE tagCampbell Barton
2021-11-25Merge branch 'blender-v3.0-release'Philipp Oeser
2021-11-25Fix T92609 Default Compositing tab shows red overlay when stereoscopy is ↵Clément Foucault
turned on This was caused by the drawing not being done on the right frammebuffer.
2021-11-20Merge branch 'blender-v3.0-release'Brecht Van Lommel
2021-11-20Fix T92090: Eevee crash with Intel HD 4000 and macOS 10.15.7Brecht Van Lommel
A recent security update to macOS 10.15.7 causes crashes when using Eevee and various other 3D viewport features. It appears that glGenerateMipmap is broken, causing a crash whenever its commands are flushed/submitted to the GPU. Ideally this would be fixed in a driver update, however it's unlikely this will happen. Earlier macOS versions have been receiving security updates for 2 years, and that window has just passed for 10.15. Further, computers with these GPUs can't upgrade to a newer macOS version. As a workaround, disable mipmaps on these GPUs, by setting the mipmap max level to 0 and not calling glGenerateMipmaps. Effects like depth of field also use mipmaps, but fill in the mip levels by other means. In those cases we keep the mipmap level. Differential Revision: https://developer.blender.org/D13295
2021-11-18Revert "Revert "Revert "Revert "Adjust snap source drawing when adding ↵Germano Cavalcante
multiple snap points"""" This reverts commit b8bf40ed4bf618a6bc908e39278cfbfd385e0d4b.
2021-11-18Revert "Revert "Revert "Revert "Transform: interactive mode for editing a ↵Germano Cavalcante
'Snap Source'"""" This reverts commit 701f2dfd5bc61c0f37603880fa21abfe8b1d9620.
2021-11-18Revert "Revert "Revert "Transform: interactive mode for editing a 'Snap ↵Germano Cavalcante
Source'""" This reverts commit 25fa6c74b977ac983a34b9adf5ab2f20fe2f4932.
2021-11-18Revert "Revert "Revert "Adjust snap source drawing when adding multiple snap ↵Germano Cavalcante
points""" This reverts commit c7f9a782aafcdd08868504584b2621afcf1356c2.
2021-11-18Revert "Revert "Adjust snap source drawing when adding multiple snap points""Germano Cavalcante
This reverts commit 77df32548b9f377a834b54d0b740a6a51bb2f0a5.
2021-11-18Revert "Revert "Transform: interactive mode for editing a 'Snap Source'""Germano Cavalcante
This reverts commit 805181bffae647a24e939c651da72a08c5c2b7cb.
2021-11-18Revert "Transform: interactive mode for editing a 'Snap Source'"Germano Cavalcante
This reverts commit f19bd637e2c38b8b967944a88609a190b5179439.
2021-11-18Revert "Adjust snap source drawing when adding multiple snap points"Germano Cavalcante
This reverts commit cb3ba68ec4470a170905a2dc9ea64b8fa1f8ace3.
2021-11-18Adjust snap source drawing when adding multiple snap pointsGermano Cavalcante
2021-11-18Transform: interactive mode for editing a 'Snap Source'Germano Cavalcante
This patch implements part of what was stated in {T66484}, with respect to `Base Point`. ## Introduction The snapping feature of the transform tools has a variety of applications: - Organization of nodes. - Positioning of frames in precise time units. - Retopology with snap to face - Creation of armatures with bone positioning through the snap to volume - Precise positioning of 3D or 2D objects in the surrounding geometry (CAD modeling) The goal of this document is to make it more powerful for precision modeling and still supporting the old use cases without extra complexity. The main topic addressed here is the introduction of a **interactive mode for setting a snap source** (See terminology). ## Terminology * **Snap Source**: 3d coordinate * we want to snap from. (Currently defined by the `Snap With` options: `Closest`, `Center`, `Median` and `Active`). * **Snap Target**: 3d coordinate* we want to snap to. (Vertices, Edges, Faces, Grid...) ## Interactive Mode for Editing a Snap Source Currently the fixed snap point can only be obtained through the `Snap With` options. So it's a little tricky for the user to define a snap source point having so much geometry on an object. Because of this, the user needs to resort to impractical solutions to get a point in the geometry. See example of an impractical use: {F11714181, layout=left, width=960, alt="The user used the cursor (which can be snapped) to choose the snap origin point."} The user used the cursor (which can be snapped) to choose the snap source point. While it is possible to work around this current limitation, it is important to reduce the number of steps and allow the user to set a snap source point through an optional interactive mode during a transformation. The proposed solution is to be able to move the current snap source point through a modal modifier activated with a key (eg. B). The snap source point can thus "snap" to the elements in the scene (vertex, mid-edge, Lamp, …) during this mode. {F9122814, layout=left, width=960, alt="Base Point Snap, example of transform operation via the shortcut (not the tool). After pressing g and the snap base change shortcut (e.g., shift + ctrl) the user set the base point. The base point is then visible until the end of the operation. The z axis constrains the final position."} ## Implementation Details - The feature will only be available in 3D View. - The feature will only be available for `Move`, `Rotate` and `Scale` transform modes. - The snap source editing will be enabled with a single click on the modifier key (B). - Having a snap point indicated, the new snap origin point will be confirmed with the same buttons that confirms the transformation (but the transformation will not be concluded). - The snap source editing can be canceled with the same key that activated it (B). - If the transformation is done with "release_confirm" (common for gizmos), the new feature cannot be enabled. - During the transformation, when enabling the feature, if the snap option is turned off in the scene, the snap will be forced on throughout the rest of the transformation (unless interactive mode is canceled). - During a transformation, if no snap target is set for an element in the scene (Vertex, Grid...), the snap targets to geometry Vertex, Edge, Face, Center of Edge and Perpendicular of Edge will be set automatically. - Snap cannot be turned off during the snap source editing. - Constraint or similar modification features will not be available during the snap source editing. - Text input will not be available during the snap source editing. - When adding multiple snap points (A) the new prone snap source point will be indicated with an "X" drawing. {F11817267} Maniphest Tasks: T66484 Differential Revision: https://developer.blender.org/D9415
2021-11-12Cleanup: move 'imm_drawcircball' to 'gpu_immediate_util.c'Germano Cavalcante
2021-11-08GPUTest: Add support to test on Windows.Jeroen Bakker
On windows the OpenGL context wasn't activated when created, on Linux it is. This patch will activate the context in gpu/draw test cases.
2021-11-05Merge branch 'blender-v3.0-release'Bastien Montagne
2021-11-05Cleanup (UI): Add/use type for operator context enumJulian Eisel
Adds a `wmOperatorCallContext` typedef for the existing `WM_OP_XXX` operator context enum. This adds type safety, allows the compiler to produce better warnings and helps understanding what a variable is for. Differential Revision: https://developer.blender.org/D13113 Reviewed by: Campbell Barton
2021-11-05Fix T92807: Incorrect display planar tracking.Jeroen Bakker
Issue introduced in {7e66616b7e15} where the shader was replaced with a 2d image shader. This patch reverts several commits that removed the 3d image shader.
2021-11-02Fix T77681, T92634: noise texture artifacts with high detailBrecht Van Lommel
We run into float precision issues here, clamp the number of octaves to one less, which has little to no visual difference. This was empirically determined to work up to 16 before, but with additional inputs like roughness only 15 appears to work. Also adds misisng clamp for the geometry nodes implementation.
2021-11-01GPUState: Fix enum max value for enum operator macroClément Foucault
Simple oversight.
2021-10-27Cleanup: remove underscore prefix from variableCampbell Barton
Avoid using underscore prefix since these typically mean the variable shouldn't be accessed directly (it may be accessed from a macro, or memory on the stack which is assigned to a pointer). In this case a more meaningful name can be used for the argument that was shadowed.
2021-10-27Revert "Revert "Eevee: support accessing custom mesh attributes""Germano Cavalcante
This reverts commit e7fedf6dba5fe2ec39260943361915a6b2b8270a. And also fix a compilation issue on windows. Differential Revision: https://developer.blender.org/D12969
2021-10-26Revert "Eevee: support accessing custom mesh attributes"Ray Molenkamp
This reverts commit 03013d19d16704672f9db93bc62547651b6a5cb8. This commit broke the windows build pretty badly and I don't feel confident landing the fix for this without review. Will post a possible fix in D12969 and we'll take it from there.
2021-10-26Eevee: support accessing custom mesh attributesKévin Dietrich
This adds generic attribute rendering support for meshes for Eevee and Workbench. Each attribute is stored inside of the `MeshBufferList` as a separate VBO, with a maximum of `GPU_MAX_ATTR` VBOs for consistency with the GPU shader compilation code. Since `DRW_MeshCDMask` is not general enough, attribute requests are stored in new `DRW_AttributeRequest` structures inside of a convenient `DRW_MeshAttributes` structure. The latter is used in a similar manner as `DRW_MeshCDMask`, with the `MeshBatchCache` keeping track of needed, used, and used-over-time attributes. Again, `GPU_MAX_ATTR` is used in `DRW_MeshAttributes` to prevent too many attributes being used. To ensure thread-safety when updating the used attributes list, a mutex is added to the Mesh runtime. This mutex will also be used in the future for other things when other part of the rendre pre-processing are multi-threaded. `GPU_BATCH_VBO_MAX_LEN` was increased to 16 in order to accommodate for this design. Since `CD_PROP_COLOR` are a valid attribute type, sculpt vertex colors are now handled using this system to avoid to complicate things. In the future regular vertex colors will also use this. From this change, bit operations for DRW_MeshCDMask are now using uint32_t (to match the representation now used by the compiler). Due to the difference in behavior for implicit type conversion for scalar types between OpenGL and what users expect (a scalar `s` is converted to `vec4(s, 0, 0, 1)` by OpenGL, vs. `vec4(s, s, s, 1)` in Blender's various node graphs) , all scalar types are using a float3 internally for now, which increases memory usage. This will be resolved during or after the EEVEE rewrite as properly handling this involves much deeper changes. Ref T85075 Reviewed By: fclem Maniphest Tasks: T85075 Differential Revision: https://developer.blender.org/D12969
2021-10-25Cleanup: silence warningsGermano Cavalcante
``` warning: assignment discards ‘const’ qualifier from pointer target warning: declaration of ‘co’ shadows a parameter ```
2021-10-25Assets: Snapping with visual feedback while draggingGermano Cavalcante
The drag and drop feature of objects in 3D View has been modified to include: - Snap the object being dragged. - Visual feedback through a box and the placement tool grid. Maniphest Tasks: T90198 Differential Revision: https://developer.blender.org/D12912
2021-10-21Nodes: Fix missing variablePablo Vazquez
2021-10-21Node Editor: Introduce color overlay and dashed wires theme settingPablo Vazquez
This patch includes code from D9891 and D12754, so credit goes to Juanfran and Dalai. I updated the patches to work with `master` and with the new overlay toggle. The reason to include both changes as part of one patch is that the dimmed dashed lines work much better together with colored wires. Theme setting for dash opacity: {F11370574, size=full} {F11286177, size=full, autoplay, loop} {F11149912, size=full} For adding the overlay I used `SpaceImageOverlay` as reference, although I'm not familiar with this code so there might be mistakes. Reviewed By: #user_interface, HooglyBoogly Differential Revision: https://developer.blender.org/D12886
2021-10-20Cleanup: spelling in commentsCampbell Barton
2021-10-14GPUTexture: Fix assert when using stereo viewport with EEVEEClément Foucault
Stereo viewport means the depth buffer is use twice as often as a framebuffer attachment.
2021-10-13Fix T88766 EEVEE: Missing glossy reflections with Shader to RGB & SSR is active.Clément Foucault
This was due to the shading evaluation being outdated inside the ShaderToRGBA glsl code.
2021-10-05Cleanup: Geometry Nodes dashed linesDalai Felinto
No functional change, just cleaning up the shader code a bit. Part of this is removing dead code (the discard was never called), and part is shuffling mix/max around based on feedback by Sybren Stüvel.
2021-10-05DRW: Move buffer & temp textures & framebuffer management to DrawManagerClément Foucault
This is a necessary step for EEVEE's new arch. This moves more data to the draw manager. This makes it easier to have the render or draw engines manage their own data. This makes more sense and cleans-up what the GPUViewport holds Also rewrites the Texture pool manager to be in C++. This also move the DefaultFramebuffer/TextureList and the engine related data to a new `DRWViewData` struct. This struct manages the per view (as in stereo view) engine data. There is a bit of cleanup in the way the draw manager is setup. We now use a temporary DRWData instead of creating a dummy viewport. Development: fclem, jbakker Differential Revision: https://developer.blender.org/D11966
2021-10-05Cleanup: use doxygen sectionsCampbell Barton
2021-10-03Cleanup: spelling in commentsCampbell Barton
2021-10-01GPU: set 'GL_PACK_ALIGNMENT' 1 as defaultGermano Cavalcante
This fixes T91828. The current value of `GL_PACK_ALIGNMENT` may result in crash in the `gpu` module if the buffer is not aligned. Differential Revision: https://developer.blender.org/D12720
2021-09-30Nodes: Add Float Curve for GN and Shader nodes.Charlie Jolly
Replacement for float curve in legacy Attribute Curve Map node. Float Curve defaults to [0.0-1.0] range. Reviewed By: JacquesLucke, brecht Differential Revision: https://developer.blender.org/D12683
2021-09-28Geometry Nodes: Dashed lines for function flowDalai Felinto
Use dashes to represent the function flow (while keeping continuous lines for the data-flow). It is important to tell both flows apart (the data and the function flow). The sockets help with that, the noodles help this further. The "data flow" is evaluated at every single node. A user can inspect the output sockets of those nodes and have a glimpse at their values. The "function flow" (nodes) however is only evaluated in the geometry nodes. The noodles are not transporting data in the same sense of the "data flow". All that can be inspected are the attributes the functions depend on. Having this clearly communicated should help users to inspect the nodetrees, read and understand the different flows in the same tree. --- Known limitations: At the moment the dash lines are not equidistant: * It would be nice to get the "uv.x" to be resampled for the bezier curve so the dashes are equally distributed in the curve. * Using distance between the P3 and P0 instead of the real bezier curve length seems to be fine. --- Full disclaimer: Changes with that much of a visual impact tend to be controversial. So far the main feedback is that dashed lines can be associated to broken link, and that there are better ways to represent the flows (or different information that should be visually represented). I'm fully aware of that. However dashed lines are already used in the viewport and outliner to indicate (hierarchical) relation. Besides, other approaches (double-lines, having the data flow to be more distinct, ...) didn't pan out in the end (or didn't look as good as this). --- Impact in other editors: The compositor uses mostly a "data flow" nodetree, so no change is expected there. The shader nodetree is one that could but doesn't have to change its visual language. The shader nodetree uses mostly "function flow" with some "data flow" nodes. One can argue that it should be adapted to follow the same pattern as geometry nodes (with the new noodles and the diamond sockets). Oh the other hand, a shader nodetree has a single context. When a node depends on the "UV", there is only one UV at a time for the entire nodetree. So it can also be treated as a psedo "data flow" nodetree if we want to avoid too many changes in other parts of Blender. Differential Revision: https://developer.blender.org/D12602