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
2020-08-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-08-07Cleanup: declare arrays arrays where possibleCampbell Barton
2020-08-07Cleanup: GPU, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/gpu` module. No functional changes.
2020-07-13Clang Tidy: enable readability-non-const-parameter warningJacques Lucke
Clang Tidy reported a couple of false positives. I disabled those `NOLINTNEXTLINE`. Differential Revision: https://developer.blender.org/D8199
2020-07-09Sculpt: Make Sculpt Vertex Colors features experimentalPablo Dobarro
This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8239
2020-06-24Fix T78188: Sculpt mask glitching after using sculpt vertex colorsPablo Dobarro
The face sets color copy to the GPU was done outside of the loop, probably after a merge error in a rebase. Also, the default color was initialized using the wrong type. Reviewed By: sergey Maniphest Tasks: T78188 Differential Revision: https://developer.blender.org/D8106
2020-06-23Sculpt Vertex Colors: Initial implementationPablo Dobarro
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time. This commit includes: - SCULPT_UNDO_COLOR for undo support in sculpt mode - SCULPT_UPDATE_COLOR and PBVH flags and rendering - Sculpt Color API functions - Sculpt capability for sculpt tools (only enabled in the Paint Brush for now) - Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint) - Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint) - Remesher reprojection in the Voxel Remehser - Paint Brush and Smear Brush with color smoothing in alt-smooth mode - Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors - Color Filter - Color picker (uses S shortcut, replaces smooth) - Color selector in the top bar Reviewed By: brecht Maniphest Tasks: T72866 Differential Revision: https://developer.blender.org/D5975
2020-05-20Fix unnecessary buffer reallocation in sculpt mode, causing an assertBrecht Van Lommel
Probably did not cause an actual, the assert is a performance warning. Ref T76858
2020-05-18Fix potential crash due to dyntopo GPU buffer invalid memory accessBrecht Van Lommel
When the number of triangles in a node became zero, the wireframe batch was not freed along with the triangles batch and could still reference a freed vertex buffer. Ref T76858
2020-05-14Sculpt: Render Face Sets always as flat shadingPablo Dobarro
This removes the smooth shading rendering from the face set overlay when smooth shading is enabled. Reviewed By: jbakker Maniphest Tasks: T74906, T74622, T75331, T76530 Differential Revision: https://developer.blender.org/D7105
2020-04-22Cleanup: Spelling in function nameSergey Sharybin
Should be no functional changes.
2020-04-20Fix T75329: Missing show_face_sets checks for MultiresPablo Dobarro
These values were hardcoded before Face Sets were enabled for Multires, so enable the show_face_sets checks now. Reviewed By: jbakker Maniphest Tasks: T75329 Differential Revision: https://developer.blender.org/D7444
2020-04-01Cleanup: quiet discarded-qualifiers, unused warningsCampbell Barton
2020-04-01Multires: Initial Face Sets supportPablo Dobarro
This implements the Sculpt Mode API functions needed for Face Sets and visibility management for PBVH_GRIDS. No major changes were needed in the operators and the sculpt mode code. This implementation stores the face sets in the base mesh, so faces created in higher subdivision levels can't be modified individually. Also, we are not checking for multiple face sets per vertex (that can be added in the future), so relax tools don't work yet. The rest of the features (paint, undo, visibility operators..) work as expected. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7168
2020-03-26Sculpt: Use uchar to store the sculpt mask in the GPUPablo Dobarro
Using a float to store and render the mask seems like a waste of memory without any noticeable difference in the viewport for its use case. After this commit, the mask and the face sets combined should take the same amount of GPU memory than only the mask in previous versions. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7148
2020-03-26Fix T74780: Face sets operators not aware of SCULPT_FACE_SET_NONEPablo Dobarro
SCULPT_FACE_SET_NONE default value is 0 and it is rendered hidden, so the invert sign operation to show it was not working. Now the show all function sets this face set to ID 1 before setting its sign. I also refactored this check in gpu_buffers. Not related to the reported issue, but the mesh in attached contains non manifold geometry with hidden loose vertices, so the visibility state was not syncing correctly to those vertices. Now the toggle operators checks the current visibility only on the face sets, so no manifold vertices are ignored (as they are in the rest of operations in sculpt mode). Reviewed By: jbakker Maniphest Tasks: T74780 Differential Revision: https://developer.blender.org/D7188
2020-03-26Fix T74692: Do not draw nodes with the default face setPablo Dobarro
The default face set color is white, so we can skip drawing the default face set. This allows to enable again the optimization of not drawing overlays in nodes where the mask is empty. This will still slow down the viewport when a new face set is created for the whole mesh or when inverting the mask, like in previous versions. I also renamed the function to make more clear that now it is checking for both mask and face sets. Reviewed By: brecht Maniphest Tasks: T74692 Differential Revision: https://developer.blender.org/D7207
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-16Fix T74626: Wrong Face Sets overlay rendering in smooth shadingPablo Dobarro
The face set color variable needs to be declared inside of the loop in order to reset it per iteration. Reviewed By: jbakker Maniphest Tasks: T74626 Differential Revision: https://developer.blender.org/D7096
2020-03-12Use golden ratio conjugate for Face Sets hue generationPablo Dobarro
The face set ID is sequential, so implementing this was straightforward. Suggested by Jeroen Bakker Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7123
2020-03-09Face Sets: Use white color for a default Face Set to enable the overlayPablo Dobarro
This introduces a variable to store a face set ID which is going to be rendered white. When initializing a mesh or randomizing the colors, this variable gets updated to always render a white face set. This way the face set overlay can be enabled without adding colors to the mesh if face sets are not in use. After creating the first face set, new colors are generated randomly like usual. The face set stored as default does not have any special meaning for tools or brushes, it just affects the rendering color. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7035
2020-03-09Cleanup: Move Face Sets random color generation to its own functionPablo Dobarro
This way we can change the color generation easily if we want to improve it in the future. I also added more values to randomize a little bit the saturation and value of the colors, as previously it was too easy to get similar colors when creating new faces, forcing you to use the randomize colors more than necessary. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7042
2020-03-09Fix T74533: Crash when entering sculpt modeGermano Cavalcante
Apparently this happened when the object is in a flat view and has customdata `CD_SCULPT_FACE_SETS` Differential Revision: https://developer.blender.org/D7073
2020-03-09Cleanup: Replace ABS/SQUARE/CUBE with function callsSergey Sharybin
While it might be handy to have type-less functionality which is similar to how C++ math is implemented it can not be easily achieved with just preprocessor in a way which does not have side-effects on wrong usage. There macros where often used on a non-trivial expression, and there was at least one usage where it was causing an actual side effect/bug on Windows (see change around square_f(sh[index++]) in studiolight.c). For such cases it is handy to have a function which is guaranteed to have zero side-effects. The motivation behind actually removing the macros is that there is already a way to do similar calculation. Also, not having such macros is a way to guarantee that its usage is not changed in a way which have side-effects and that it's not used as an inspiration for cases where it should not be used. Differential Revision: https://developer.blender.org/D7051
2020-03-05Sculpt Face SetsPablo Dobarro
Face Sets are the new system to control the visibility state of the mesh in sculpt and paint modes. They are designed to work in modes where brushes are the primary way of interaction and they provide much more control when working with meshes with complex shapes and overlapping surfaces. This initial commit includes: - Sculpt Face Sets data structures and PBVH rendering. - Face Set overlay and opacity controls. - Sculpt Undo support. - Remesher reprojection support. The visibility state of the mesh is also preserved when remeshing. - Automasking and Mesh filter support. - Mask expand operator mode to expand Face Sets (Shift + W) and flood fill areas by connectivity (press Ctrl while expanding). - Sculpt Mode Face Sets and Visibility API. - Sculpt Face Sets creation and visibility management operators. - Operator to randomize the Face Sets colors. - Draw Face Sets brush tool to create and edit the Face Sets. Drawing on the mesh creates a new Face Set. Pressing Ctrl before drawing modifies the Face Set under the brush at the beginning of the stroke. - Updated keymap and menu to work with Face Sets from Sculpt Mode (H to toggle visibility, Alt + H to show all, Shit + H to hide). - Pie menu on the W key with Face common Sets operations. Know limitations: - Multires support. The Face Sets and Visibility API needs to be implemented for Multires. Reviewed By: jbakker, #user_interface, Severin Differential Revision: https://developer.blender.org/D6070
2020-01-17DRW: Use USHORT for vertex color and upload them in linear color to the GPUClément Foucault
This way we remove the need for the srgb boolean uniform and a lot of code complexity. However, mesh update is going to be a bit slower. I did not benchmark the performance impact. This also fix a typo in draw_cache_impl_particles.c and fix hair not using vertex color in workbench. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6610
2019-10-09Sculpt: Fix wireframe drawingPablo Dobarro
With this commit sculpt mode draws the real mesh wireframe instead of the triangulated version by ignoring non real edges when building the PBVH GPU buffers Reviewed By: brecht Differential Revision: https://developer.blender.org/D6032
2019-10-02Fix T70390: dyntopo smooth shading broken after recent changesBrecht Van Lommel
Made the code fully thread safe now.
2019-10-01Cleanup: compiler warningBrecht Van Lommel
2019-09-30Fix wrong sculpt flat shaded normals after recent optimizationsBrecht Van Lommel
2019-09-29Sculpt: minor optimizations for GPU draw buffer fillingBrecht Van Lommel
Ref T70295
2019-09-29Sculpt: multithread GPU draw buffer filling for workbenchBrecht Van Lommel
This improves performance of some sculpt tools, particularly those that modify many vertices like filter and mask tools, or use brushes with large radius. For mask expand it can make updates up to 2x faster on heavy meshes, but for most tools it's more on the order of 1-1.1x. There are bigger bottlenecks to solve, like normal updates. Ref T70295 Differential Revision: https://developer.blender.org/D5926
2019-09-14Cleanup: use const args, variablesCampbell Barton
2019-09-13Cleanup: compiler warningsBrecht Van Lommel
2019-09-13Cleanup: unused headers (GPU)Campbell Barton
2019-09-07Cleanup: use post increment/decrementCampbell Barton
When the result isn't used, prefer post increment/decrement (already used nearly everywhere in Blender).
2019-08-06Fix T67437: Vertex Colors Not Visible In SculptModeJeroen Bakker
Recently Shader parameter names for UVMaps and vertex colors were renamed. The sculpt drawing code still used the old parameter names. Reviewed By: fclem Differential Revision: https://developer.blender.org/D5320
2019-07-08Fix T66351 Wireframe display in sculpt-mode broke when hiding partsClément Foucault
2019-06-06Fix T58920: Dyntopo sculpt and snake hook brush artifacts.mano-wii
This is a mix of solutions rBe60b18d51d58 and rB52af5fa31fbc. What happened was that when a node of the BVH gets 0 vertices, the batch is untouched and therefore still drawn.
2019-05-04Cleanup: GPU_buffers: Remove obsolete debug drawingClément Foucault
2019-05-04GPUBuffers: Save / expose material index per buffersClément Foucault
2019-05-01ClangFormat: run with ReflowComments on source/Campbell Barton
Prepare for enabling ReflowComments.
2019-04-23GPUBuffers: Fix wrong assertClément Foucault
For good this time... forgot to commit it in the previous commit rBedde48f57844.
2019-04-23Workbench: Support Active Vertex ColorJeroen Bakker
Currently it is not possible to view the vertex colors of an object. To optimize the workflow, workbench will need to support Vertex Colors. The Vertex Colors is a new option in `shading->color_type`. When objects do not have vertex color, the objects will be rendered with the `V3D_SHADING_OBJECT_COLOR`. In order to support vertex colors in workbench the current texture/solid shading structure is migrated to a primary shaders and fallback shaders. Fix: T57000 Reviewers: brecht, fclem Differential Revision: https://developer.blender.org/D4694
2019-04-22Cleanup: style, use braces for gpuCampbell Barton
2019-04-17GPUBuffers: Remove wrong assertClément Foucault
The assert was not true if the pbvh node had no triangle. Also update the comment to reflect that.
2019-04-17ClangFormat: adjust '#if 0' to fix gpu_buffers.c indentCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-26Cleanup: indentation, trailing spaceCampbell Barton
2019-02-24GPUBuffer: Fix fast navigate in on smoooth multires gridClément Foucault