Go to file
Jeroen Bakker e96a809a68 PBVH Pixel extractor.
This patch contains an initial pixel extractor for PBVH and an initial paint brush implementation.
PBVH is an accelleration structure blender uses internally to speed up 3d painting operations.
At this moment it is extensively used by sculpt, vertex painting and weight painting.

For the 3d texturing brush we will be using the PBVH for texture painting.
Currently PBVH is organized to work on geometry (vertices, polygons and triangles).
For texture painting this should be extended it to use pixels.

{F12995467}

Screen recording has been done on a Mac Mini with a 6 core 3.3 GHZ Intel processor.

# Scope

This patch only contains an extending uv seams to fix uv seams. This is not actually we want, but was easy to add
to make the brush usable.

Pixels are places in the PBVH_Leaf nodes. We want to introduce a special node for pixels, but that will be done
in a separate patch to keep the code review small. This reduces the painting performance when using
low and medium poly assets.

In workbench textures aren't forced to be shown. For now use Material/Rendered view.

# Rasterization process

The rasterization process will generate the pixel information for a leaf node. In the future those
leaf nodes will be split up into multiple leaf nodes to increase the performance when there
isn't enough geometry. For this patch this was left out of scope.

In order to do so every polygon should be uniquely assigned to a leaf node.

For each leaf node
   for each polygon
     If polygon not assigned
       assign polygon to node.

Polygons are to complicated to be used directly we have to split the polygons into triangles.

For each leaf node
  for each polygon
    extract triangles from polygon.

The list of triangles can be stored inside the leaf node. The list of polygons aren't needed anymore.
Each triangle has:

    poly_index.
    vert_indices
    delta barycentric coordinate between x steps.

Each triangle is rasterized in rows. Sequential pixels (in uv space) are stored in a single structure.

    image position
    barycentric coordinate of the first pixel
    number of pixels
    triangle index inside the leaf node.

During the performed experiments we used a fairly simple rasterization process by
finding the UV bounds of an triangle and calculate the barycentric coordinates per
pixel inside the bounds. Even for complex models and huge images this process is
normally finished within 0.5 second. It could be that we want to change this algorithm
to reduce hickups when nodes are initialized during a stroke.

Reviewed By: brecht

Maniphest Tasks: T96710

Differential Revision: https://developer.blender.org/D14504
2022-04-15 16:40:01 +02:00
.github GitHub: add PR template 2021-10-23 10:49:51 +05:30
build_files install_deps: Tweak rBbc9c9631a46f, libwebp is not only a dependency from ffmpeg. 2022-04-11 14:52:26 +02:00
doc API doc: Tweak sphinx to get date of source commit instead of build date. 2022-04-06 11:43:14 +02:00
extern OBJ: use fmt library instead of sprintf for faster formatting 2022-03-27 14:25:48 +03:00
intern Cycles: Add support for "stageMetersPerUnit" Hydra render setting 2022-04-13 12:24:21 +02:00
release Curves: initial geometry nodes support for curves objects 2022-04-15 09:08:50 +02:00
source PBVH Pixel extractor. 2022-04-15 16:40:01 +02:00
tests Tests: Change force disable render test messages to be warnings 2022-04-14 13:10:26 +02:00
.arcconfig Fix .arcconfig not working with latest arcanist version 2020-03-01 22:35:31 +01:00
.clang-format Cleanup: clang-format 2022-04-04 12:35:33 +10:00
.clang-tidy Clang Tidy: ignore some passes that changed or were added in version 13 2021-11-23 19:45:05 +01:00
.editorconfig GNUmakefile: move editor settings to .editorconfig 2022-02-10 09:20:34 +11:00
.git-blame-ignore-revs Cleanup: git-blame-ignore-revs: Update policy & commits 2021-01-29 13:20:32 +05:30
.gitignore Compositor automated testing 2021-03-26 16:15:02 +01:00
.gitmodules Update for moving blender2.8 to master. 2018-12-21 12:15:21 +01:00
CMakeLists.txt Revert "Cycles: enable HIP for Vega and Vega II (Radeon 7) GPUs on Windows" 2022-04-12 19:18:58 +02:00
COPYING == docs == 2010-10-13 14:44:22 +00:00
GNUmakefile Cleanup: fix source comment typos 2022-03-11 18:27:58 +01:00
make.bat make.bat: unify python detection 2022-01-25 09:19:03 -07:00
readme.rst Blender README: Fix the full license name. 2021-04-09 12:39:33 +02:00

.. Keep this document short & concise,
   linking to external resources instead of including content in-line.
   See 'release/text/readme.html' for the end user read-me.


Blender
=======

Blender is the free and open source 3D creation suite.
It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing,
motion tracking and video editing.

.. figure:: https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg
   :scale: 50 %
   :align: center


Project Pages
-------------

- `Main Website <http://www.blender.org>`__
- `Reference Manual <https://docs.blender.org/manual/en/latest/index.html>`__
- `User Community <https://www.blender.org/community/>`__

Development
-----------

- `Build Instructions <https://wiki.blender.org/wiki/Building_Blender>`__
- `Code Review & Bug Tracker <https://developer.blender.org>`__
- `Developer Forum <https://devtalk.blender.org>`__
- `Developer Documentation <https://wiki.blender.org>`__


License
-------

Blender as a whole is licensed under the GNU General Public License, Version 3.
Individual files may have a different, but compatible license.

See `blender.org/about/license <https://www.blender.org/about/license>`__ for details.