Note: This is an archived version of the Blender Developer Wiki (archived 2024). The current developer documentation is available on developer.blender.org/docs.

User:KevinDietrich/Reports2022

Weekly Reports 2021

Week 1 3 - 7 January 2022

This week was mostly spent doing bug triaging and fixing, mostly following the GPU subdivision merge. There are still some issues to fix regarding performances regressions. I also updated my work on the subdivision settings as part of the mesh datablock #68891.

  • Features:
    • Cycles: support rendering PointCloud motion blur from attribute (rB4c3f52e7)
  • Fixes:
    • Fix #94713: Alembic crash with empty frames and velocities (rB45bc4e32)
    • Fix #94672: incorrect Workbench shadows with GPU subdivision (rB0c6b29ee)
    • GPU subdiv: fix wrong data sizes used for lines adjacency IBO (rBc2089ae5)
    • Fix #94674: crash reading ORCOs from an Alembic animation. (rB88e15ff1)
  • Active patches:
    • D13603: Alembic: add support for reading override layers.
    • D13730: Fix #93179: geonodes UVs and Vertex colors do not work in EEVEE.
    • D10145: Subdivision: add support for vertex creasing.

Week 2 10 - 14 January 2022

This week was also mostly spent doing bug triaging and fixes for the GPU subdivision code. Some bugs are a bit tricky to solve, and will continue next week. One tough bug, which is present in multiple reports already, is caused by the fact that the GPU subdivision code does not support meshes will loose geometry only (such as meshes used for custom bone shape). The code presumes that we will always at least one polygon. There seem to be more cases of AMD only bugs, I ordered an AMD card so that I can try to fix those. I also did some maintenance in the Alembic code.

  • Features:
    • Alembic: add support for reading override layers (rB45bc4e32)
  • Active patches
    • D13730: Fix #93179: geonodes UVs and Vertex colors do not work in EEVEE.
    • D10145: Subdivision: add support for vertex creasing.

Weeks 3-6 17 January - 11 Februart 2022

TODO: forgot to them, need to gather data.

Week 7 14 - 18 February 2022

This week was spent doing bug fixing for the GPU subdivision integration, and starting implementing the edit mode for the new Curves object.

  • Features
    • Curves: add initial edit mode support (rB5f16e24c)
  • Code reviews
    • D14117: Curves: Initial brush system integration for curves sculpt mode.
  • Bug Fixes
    • Fix #94881: GPU subdivision fails with high polycount coarse meshes (rBc5dcfb63)
    • Fix #95827: vertex groups do not display correctly with GPU subdivision (rBbe3047c5)
    • Fix #95806: subdivision missing in Cycles when using autosmooth (rB53fe4f62)
    • (unreported) GPU subdiv: fix custom data interpolation for N-gons (rB430ced76)
    • Fix #94479: GPU Subdivision surface modifier does not apply to Cycles renders. (rB56407432)
    • Fix #95320: CacheFile templates crash when used through Python (rB0999a01b)
    • Fix #95177: GPU subdiv crashes mirror modifier in edit-mode (rB993839ce)
    • Fix #95697: GPU subdivision ignores custom normals (rB48b26d9c)
  • Active Patches
    • D14038: Geometry Component: add access to vertex creases.

Week 8 21 - 25 February 2022

This week was mostly spent doing bug fixing. A bit of time was spent continuing work on the Curves edit mode overlay drawing.

  • Notable commits
    • rBc8b4e0c0: Disable GPU subdivision if autosmooth or split normals are used
  • Open Patches
    • D14199: Subdivision node: add input for vertex creases.
    • D14171: Fix #94729: GPU subdivision does not support meshes without polygons.

Week 9 - 28 February - 4 March

  • New or active patches
    • D14199: Subdivision node: add input for vertex creases
  • Bug Fixes
    • Fix #94729: GPU subdivision does not support meshes without polygons. (6883c47bb5)
    • Fix #94952: normals maps don't render correctly with GPU subdivision. (4932269ec3)

Week 10 - 7 - 11 March

Work on curves edit mode, GPU subdivision fixes, and bug triaging.

  • Bug fixes
  • Commits/maintenance
    • GPU: disable compute shader for problematic drivers (3a672fe6fb)
    • Fix wrong edge crease validity check in the Cycles Alembic procedural (64a5fd7a1d)
  • New or active patches
    • D14262: Curves edit mode: show dots for points.

Week 11 - 14 - 18 March

Work on curves edit mode, GPU subdivision fixes, and bug triaging.

  • Commits/maintenance
    • Fix wrong documentation/UI text for NodeLink (89ab3cdc56)
    • Cleanup: unused class members. (8407c0b64e)
    • Fix typo in smooth brush tooltip (a67c7693a7)
    • Disable GPU subdivision if the maximum number of SSBO binding is reached (3bb4597b2d)
    • GPU capabilities: detect max SSBO bindings (45b637e1e7)
  • New or active patches
    • D14335: Curves edit mode: support point selection.
    • D14262: Curves edit mode: show dots for points.
    • D14330: Curves: add an EditCurves structure.
    • D14336: ViewLayer AOVs: add "remove" and "clear" to Python API.

Week 12 - 21 - 25 March

Work on curves edit mode locally, GPU subdivision fixes, bug triaging, some maintenance and finishing up the Alembic arbitrary attribute import patch.

  • Bug Fixes
    • Fix #96372: UV editor selection display wrong with GPU subdivision. (612ec0ecdf)
  • Maintenance
    • Cleanup: extra property update for ShaderFxGlow.opacity (ead9ed7e16)
    • Cleanup/fix wrong enum items for object.gpencil_modifier_add (ead2c71a90)
    • Fix compile error on GCC (d84b4becd3)
    • Cleanup: use nullptr (03a7747aa6)
    • Cleanup: add const qualifier (945dfd200b)
    • Cleanup: move Mesh Sequence Cache modifier to C++ (d40d5e8d0f)

Week 13 - 28 March - April 1st

Further work on GPU subdivision bug fixes and regressions, as usual.

Refactored the Alembic attribute import patch based on code review. Geometry set support for Alembic and USD was also sent to code review.

Worked on edit curves:

  • refactor detection of edit mode
  • reworked the base patch for selection, still needs to add the StaticAnonymousAttribute as suggested by Hans.

While working on finishing up the Alembic/USD geometry set support, dusted off an old patch to use PointCloud as input type for gas simulations. This patch was made a few months ago as some sort of proof of concept, as PointCloud could now come from other software, which include simulation caches. This requires to move files to C++, and one case seems to be tricky: storing previous vertices. This cannot use a blender::Vector as it is declared in DNA, it might need to add a runtime structure which is only known to the C++ code. It would be nice to also directly use the velocity attribute if present instead of computing one.

  • Commits:
    • Cycles: enable Alembic procedural for final renders (e81d7bfcc9)
  • Bug Fixes:
  • New or Active Patches
    • D14484: Cleanup: Alembic, use a structure to pass parameters
    • D11591: Alembic: import arbitrary attributes
    • D11592: Alembic/USD: use Geometry Sets to import data
    • D13855: Cleanup: CacheFile, use double precision for time: Alembic, Pipeline, Assets & I/O.
    • D11156: Alembic: operator to set the Scene frame range from the Archive time information
    • D12411: Cleanup: move ABC sequence length computation to Cachefile.
    • D14491: Fix #96338: crash with GPU subdivision switching to UV editing tab.
    • D14489: Fix #96327: data transfer crash with GPU subdivision.
    • D14488: Fix #96283: last disabled subsurf is used for GPU subdivision.
    • D14330: Curves: use a flag to detect edit mode
    • D14262: Curves edit mode: show dots for points.

Week 14 4 - 7 April 2022

Some bug triaging. Replied to various code reviews. Some of the patches for curves edit mode were finally accepeted and merged after some redesigns so work on more featurs here will resume. Looked into (without a fix yet) #96829: Cycles: modifying properties through the Python console does not trigger updates. This seems to be a general problem for addons, not just Cycles.

  • Fixes (unreported)
    • Curves: fix edit mode detection (fc8bcd26c0)
    • Curves: fix missing updates switching to sculpt mode (a3e122b9ae)
    • Alembic: fix clamping of frame offset during exports (c0a9ec222f)
  • Code reviews
    • Quick review of Template:PhaDiff: Shader nodes: Cubemap projection extension for the environment texture node. This was mostly a code style review, the actual feature is much more complicated to implement than the patch.
  • Active/updated patches
    • D11156: Alembic: operator to set the Scene frame range from the Archive time information.
    • D11592: Alembic/USD: use geometry sets to import data
    • D14605: BMesh Python API: add access to vertex crease layer


Week 15 11 - 15 April 2022

Some bug triaging again, and updates for ongoing code reviews. Spent a bit of time finishing a patch to support volume motion in Cycles, which still needs revision. Also spent some time updating Tangent's work on modernizing volume rendering. Curves edit mode work was not resumed.

For a personal project, I worked on adding support to create CurveMapping throught the Python API (via bpy.props.CurveMapping). It would be nice to also add support for CurveProfile and ColorRamp, as those are highly requested by the addon developers. This might remain a project done outside of Fondation time, but may be done during at least for code review. There was also some work on improving the node API, which will also at some point cross with Blender Fondation time.

  • Active patches
    • D11592: Alembic/USD: use geometry sets to import data
    • D11591: Alembic: import arbitraty attributes. (there were some unnoticed regressions which probably prevented its acceptance...)
    • D14629: Cycles: add support for volume motion blur
    • D14656: Cycles: ratio tracking for volume rendering. This is a draft, and work on it happen based on available time, most likely very low priority.
  • Commits
    • BMesh Python API: add access to vertex crease layer (b2143da253)
  • Bug Fixes

Week 16 18 - 22 April 2022

As the report was not done readily, I don't remember a lot. Although, I really needed to upgrade my workstation, as I kept postponing it, especially since some tools like Clang Format were outdated on my platform (and thus producing wrong outputs that I needed to manually fix), this went bad and cost me a couple of days to reset.

Commits:

  • Cycles: add support for volume motion blur (2890c11cd7)

Updated Patches:

  • D11591: Alembic: import arbitrary attributes.

Week 17 25 - 29 April 2022

Some bug triaging. Investigated #96338. It took a while to figure out the cause of the crash, but could not find a proper fix for it. Essentially the UV stretch angles buffer is requested but not the position buffer, which is needed in the subdivision case and leads to a crash. Trying to generate the buffer using the coarse with interpolation on the GPU did not work. Probably a simpler fix is to temporarily compute the positions in the function.

Tried to implement attribute rendering in EEVEE for the new curves objects based on some of the refactors I did for the curves edit mode, without any luck so far. I am not sure if deeper refactors are necessary, or if there is a simpler solution.

  • Patches
    • D14773: Fix #96836: UV points missing with some modifiers
    • D14199: Subdivision node: add input for vertex creases.
    • D14775: BPY types: add default Geometry Node poll function. (fix for GeometryNodeCustomGroup registration)

Week 18 2 - 6 May 2022

Some bug triaging and fixing. Partial work on curves attributes rendering in EEVEE.

  • Features
    • Subdivision node: add input for vertex creases (1a98bec40e)
    • BPY types: add default Geometry Node poll function (2062116924)

Week 19 9 - 13 May 2022

A fair amount of time was spent reworking (and simplifying) curves attribute rendering support in EEVEE, following a discussion with the module members. Got a working implementation for curves attribute rendering in EEVEE, although I forgot to implement point attribute subdivision before sending to code review, that will need to be fixed, but luckily is/should be straightforward as it can reuse the interpolation routines used for the positions.

Investigated some of the remaining GPU subdivision bugs. Those are the complicated ones, but could not really understand/try to fix them. Some smaller bugs do exist and will be fixed next week.

Week 20 16 - 20 May 2022

Finalized implementation of curves attribute rendering with proper support for point attribute refinement. Also some updates to patches currently in code review (merged conflicts, compile errors, etc.).

  • Commits:
    • GPU subdiv: smoothly interpolate orco layer (9d9f2f1a03)
  • Active or updated patches:
    • D11591: Alembic: import arbitrary attributes.
    • D11592: Alembic/USD: use geometry sets to import data.
    • D14916: EEVEE/Workbench: support Curves attributes rendering.
    • D14335: Curves edit mode: support point selection.
  • Code reviews:
    • D14969: Fix #98052: Eevee / Workbench background render crash with GPU subdivision.
    • D14958: Cleanup: Deduplicate Alembic procedural bounding box mesh creation.

Week 21 23 - 27 May 2022

Finalized curves attribute rendering based on last code reviews, and merged the code. Fixed a few GPU subdivision bugs. There are two big ones that remain but seem a bit tricky.

#97086: corrupted UVs display with multiple objects in edit mode. Since it works fine in debug builds, but not release builds, it looks like this is a synchronization issue, where we read data before the compute shaders have done executing. It could be that in debug builds, as execution is a bit slower, the data arrives in time. As far as I can tell, the coarse UV data is properly setup inside of the OpenSubDiv evaluator, but after running the compute the refined UVs have no data or unitialized data. This does not happen for the first mesh though, only the others. I tried scattering memory barriers and calls to glFinish but to no avail. Either it is a weird synchronization problem, or there is something else.

#97877: Broken shadow in solid mode with GPU Subdiv. At first it looked like some edge case with the shadowing technique, but in the end it looks like that there several levels of floating precision issues due to compression of UV coordinates used for patch interpolation happening both in Blender and in OpenSubDiv which result in the mesh not being exactly watertight. In Blender, UVs are stored in 16-bits to reduce data transfer. Removing this improves the situation but does not fix it. OpenSubDiv stores the UVs for the first corner of each patch as 10-bit integers, which is then used to offset the patch UVs that we use for evaluation. It could be that this may lead to further precision issues. Since the OpenSubDiv code for CPU and GPU are slightly different here, it could be that the GPU is less robust to this kind of floating point compression. I would need to port over the GLSL code from OpenSubDiv and modify it to try and see if it fixes the issue.

  • Commits
    • EEVEE: support Curves attributes rendering (cd968a3273)

Week 22 30 may - 3 June 2022

Fixed the last remaining high priority bugs for GPU subdivision.

  • Active Patches
    • D11591: Alembic: import arbitrary attributes.

Week 23 - 24 7 - 17 June 2022

Worked on fixing some bugs and shaky logic in the Alembic arbitrary attributes patch. This patch introduces some complexity to the Alembic importer in order to support files created by as many external sofware as possible (it would be helpful if people would just abide by the standard...). Creating test files to test the remapping logic was a bit tedious though. This was based on another (not shared yet) patch to implement exporting arbitrary attributes to Alembic and required to modify the exported data types to only output floats instead of float3, color, etc. This other patch has some issue where default custom data layers like positions and normals are also exported (so they are exported twice: once as geometric data, and once as attributes), probably there needs to be some mechanism to detect them, if there is none already.

For curves edit mode, one issue that was found is that the curves that are drawn in edit mode are the final curves with modifiers applied, which is wrong. I tried some simple things to go around that, but I feel a proper refactor to separate final and edit data in the draw code has to happen first. Since there is some active development happening in this area for other reasons, it should be done in a way that avoid too many merge conflicts for everyone involved.

As this is nearing the end of the contract, I also spent some time factoring out some patches from personal branches that I think could be useful to the community. Those patches relate to the node editor API, and should help addon developer have more control, especially for custom node groups. Python defined node groups can be powerful, but some features are missing to really unleash their power. For example, switch or mix nodes with infinite input sockets could be coded, which would help avoid manually managing a hierarchy of switch/mix/etc. nodes, but some events are missing from the node tree API to really implement that.

  • Active Patches
    • D11591: Alembic: import arbitrary attributes.
  • Code reviews
    • D15205: Helped Hans solve an issue, actual review will be done when the patch is ready

Week 25 20 - 24 June 2022

Revised some of the Alembic patches, and investigated some potential issues based on code review (the knots array will not be read anymore, this might cause some discrepancy between applications, although there are currently a lot of issues with curves in Blender so they are not used a lot with Alembic, something that the new Curves is fixing, so I would not worry a lot about potential issues here.)

Started to send OpenSubDiv fixes to Pixar, as some GPU subdivision bugs come from issues in the library, the compute evaluator code was copied to Blender, it would nice to send the fixes upstream.

  • Bug Fixes
    • Fix #98773: GPU Subdivision breaks auto selection in UV edit mode. 6c3965c027
    • GPU subdiv: fix hidden faces in paint mode when hidden in edit mode 697363545f
    • Fix #99016: GPU subdiv artifacts in weight paint with smooth shading d7fbc5708a
    • Fix artefacts with GPU subdiv and weight paint face selection 72a5bb8ba9
    • Fix #98913: GPU Subdivision: "Show Wire" overlay glitch b73a52302e