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.


 * Features:
 * Cycles: support rendering PointCloud motion blur from attribute


 * Fixes:
 * Fix : Alembic crash with empty frames and velocities
 * Fix : incorrect Workbench shadows with GPU subdivision
 * GPU subdiv: fix wrong data sizes used for lines adjacency IBO
 * Fix : crash reading ORCOs from an Alembic animation.


 * Active patches:
 * : Alembic: add support for reading override layers.
 * : Fix : geonodes UVs and Vertex colors do not work in EEVEE.
 * : 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


 * Bug fixes:
 * Fix : GPU subdiv crash switching to texpaint area
 * Fix : GPU subdivision uses viewport levels for final render
 * Fix : performance regression with subsurf modifier


 * Active patches
 * : Fix : geonodes UVs and Vertex colors do not work in EEVEE.
 * : 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


 * Code reviews
 * : Curves: Initial brush system integration for curves sculpt mode.


 * Bug Fixes
 * Fix : GPU subdivision fails with high polycount coarse meshes
 * Fix : vertex groups do not display correctly with GPU subdivision
 * Fix : subdivision missing in Cycles when using autosmooth
 * (unreported) GPU subdiv: fix custom data interpolation for N-gons
 * Fix : GPU Subdivision surface modifier does not apply to Cycles renders.
 * Fix : CacheFile templates crash when used through Python
 * Fix : GPU subdiv crashes mirror modifier in edit-mode
 * Fix : GPU subdivision ignores custom normals


 * Active Patches
 * : 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
 * : Disable GPU subdivision if autosmooth or split normals are used


 * Bug Fixes
 * Fix : viewport lags with custom attributes
 * Fix, : Fix different shading between CPU and GPU subdivision
 * Fix : on cage GPU subdivision breaks X-ray selection
 * Fix : crash when exporting subdivision to Alembic.


 * Open Patches
 * : Subdivision node: add input for vertex creases.
 * : Fix : GPU subdivision does not support meshes without polygons.

Week 9 - 28 February - 4 March

 * New or active patches
 * : Subdivision node: add input for vertex creases


 * Bug Fixes
 * Fix : GPU subdivision does not support meshes without polygons.
 * Fix : normals maps don't render correctly with GPU subdivision.

Week 10 - 7 - 11 March
Work on curves edit mode, GPU subdivision fixes, and bug triaging.


 * Bug fixes
 * Fix : GPU subdiv crash with smooth normals and tangents


 * Commits/maintenance
 * GPU: disable compute shader for problematic drivers
 * Fix wrong edge crease validity check in the Cycles Alembic procedural


 * New or active patches
 * : 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
 * Cleanup: unused class members.
 * Fix typo in smooth brush tooltip
 * Disable GPU subdivision if the maximum number of SSBO binding is reached
 * GPU capabilities: detect max SSBO bindings


 * New or active patches
 * : Curves edit mode: support point selection.
 * : Curves edit mode: show dots for points.
 * : Curves: add an EditCurves structure.
 * : 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 : UV editor selection display wrong with GPU subdivision.


 * Maintenance
 * Cleanup: extra property update for ShaderFxGlow.opacity
 * Cleanup/fix wrong enum items for object.gpencil_modifier_add
 * Fix compile error on GCC
 * Cleanup: use nullptr
 * Cleanup: add const qualifier
 * Cleanup: move Mesh Sequence Cache modifier to C++

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


 * Bug Fixes:
 * Fix : GPU subdivision modifier: Smooth Shade doesn't work
 * Fix : edit mode GPU subdivision crashes with X-ray mode and modifiers
 * Fix : artefacts with GPU subdivision and vertex paint mask.
 * Fix : Alembic, wrong result importing back exported
 * Fix : GPU subdivision modifier: Smooth Shade doesn't work.


 * New or Active Patches
 * : Cleanup: Alembic, use a structure to pass parameters
 * : Alembic: import arbitrary attributes
 * : Alembic/USD: use Geometry Sets to import data
 * : Cleanup: CacheFile, use double precision for time: Alembic, Pipeline, Assets & I/O.
 * : Alembic: operator to set the Scene frame range from the Archive time information
 * : Cleanup: move ABC sequence length computation to Cachefile.
 * : Fix : crash with GPU subdivision switching to UV editing tab.
 * : Fix : data transfer crash with GPU subdivision.
 * : Fix : last disabled subsurf is used for GPU subdivision.
 * : Curves: use a flag to detect edit mode
 * : 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) : 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
 * Curves: fix missing updates switching to sculpt mode
 * Alembic: fix clamping of frame offset during exports


 * Code reviews
 * Quick review of : 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
 * : Alembic: operator to set the Scene frame range from the Archive time information.
 * : Alembic/USD: use geometry sets to import data
 * : 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
 * : Alembic/USD: use geometry sets to import data
 * : Alembic: import arbitraty attributes. (there were some unnoticed regressions which probably prevented its acceptance...)
 * : Cycles: add support for volume motion blur
 * : 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


 * Bug Fixes
 * Fix : Oject Info node does not work with GPU subdivided meshes
 * Fix : tangents artifacts with GPU subdivision
 * Fix part of : wrong generated coordinates with GPU subdivision
 * Fix : on cage GPU subdivision shows subdivided edges as actual edges

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

Updated Patches:
 * : Alembic: import arbitrary attributes.

Week 17 25 - 29 April 2022
Some bug triaging. Investigated. 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
 * : Fix : UV points missing with some modifiers
 * : Subdivision node: add input for vertex creases.
 * : BPY types: add default Geometry Node poll function. (fix for GeometryNodeCustomGroup registration)


 * Bug fixes
 * Fix : bad performance with viewport statistics and GPU
 * Fix : data transfer crash with GPU subdivision
 * Fix : last disabled subsurf is used for GPU subdivision

Week 18 2 - 6 May 2022
Some bug triaging and fixing. Partial work on curves attributes rendering in EEVEE.


 * Bug Fixes
 * Fix : artifacts with GPU subdivision and mirror modifier
 * Fix : material preview not displaying textures
 * Fix : geonodes UVs and Vertex colors do not work in EEVEE
 * Fix : GPU subdiv crash switching to UV editing


 * Features
 * Subdivision node: add input for vertex creases
 * BPY types: add default Geometry Node poll function

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.


 * Bug Fixes
 * Fix : UV points missing with some modifiers

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


 * Active or updated patches:
 * : Alembic: import arbitrary attributes.
 * : Alembic/USD: use geometry sets to import data.
 * : EEVEE/Workbench: support Curves attributes rendering.
 * : Curves edit mode: support point selection.


 * Code reviews:
 * : Fix : Eevee / Workbench background render crash with GPU subdivision.
 * : 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.


 * 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.


 * 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.


 * Bug Fixes:
 * Fix : Color attributes not working with GPU subdivision
 * Fix : GPU subdivision crash with knife tools
 * Fix : hiding elements does not work with GPU subdiv


 * Commits
 * EEVEE: support Curves attributes rendering

Week 22 30 may - 3 June 2022
Fixed the last remaining high priority bugs for GPU subdivision.


 * Bug Fixes
 * Fix : broken corner attributes with GPU subdivision
 * Fix : corrupted face selection drawing with GPU subdivision
 * Fix : broken shadows with GPU subdivision
 * Fix : corrupted UVs with GPU subdivision.


 * Active Patches
 * : 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.


 * Bug Fixes
 * Fix : GPU subdiv crash in edit mode with loose geometry
 * Fix : GPU subdiv displays normals for all elements


 * Active Patches
 * : Alembic: import arbitrary attributes.


 * Code reviews
 * : 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 : GPU Subdivision breaks auto selection in UV edit mode.
 * GPU subdiv: fix hidden faces in paint mode when hidden in edit mode
 * Fix : GPU subdiv artifacts in weight paint with smooth shading
 * Fix artefacts with GPU subdiv and weight paint face selection
 * Fix : GPU Subdivision: "Show Wire" overlay glitch