July 5, 2021, 20:57 (GMT) |
Import changes from development branch |
July 5, 2021, 20:54 (GMT) |
Merge branch 'master' into subdivision_work |
June 19, 2021, 13:35 (GMT) |
Fix missing subdivision evaluation when modifier is applied. |
June 19, 2021, 08:00 (GMT) |
Merge changes from development branches. |
June 19, 2021, 07:56 (GMT) |
Merge branch 'master' into subdivision_work |
June 13, 2021, 11:03 (GMT) |
Merge branch 'master' into subdivision_work |
June 10, 2021, 16:43 (GMT) |
Vertex crease: import changes from code review |
June 10, 2021, 16:41 (GMT) |
Merge branch 'master' into subdivision_work |
June 8, 2021, 02:42 (GMT) |
Subdivision: basic GPU subdivision for OpenGL This implements GPU subdivision via OpenSubDiv for OpenGL based render engines. At the moment only uniform subdivision is supported. Adaptive subdivision still lacks a way to render triangles from the subdivision patches. The GPUBatch is extended with a new VBO and a new IBO to gather subdivided points and indices. This allows to render the subdivided surface and the original control cage in edit mode without disrupting too much the code. To generate triangles from the subdivided index buffer, a compute shader is used. Although, at the moment normals are not computed there so a CPU fallback is used, where data is read from the GPU, processed on the CPU to generate triangles and normals, and then sent back to the GPU. To compute normals, a secondary compute shader might be used. This is not ideal for performance, but allows to validate that subdivision is indeed performed properly on the GPU. Attributes (including UVs and vertex colors) are not supported yet. For performance, some proper caching mechanism will need to be used. There currently is some logic to cache the subdivision structures that can be reused between updates. However, it is deactivated as it does not properly detect when changes occur, and causes crashes in edit mode. Performance can be further improved by reducing data transfer to the GPU, since OpenSubDiv asks us to allocate buffers big enough for the refined and coarse mesh we also allocate such buffer on the host, and transfer the entier buffer worth of data to the device, although only the coarse part need to be truly allocated on the host and sent to the device. This will require some change to the vertex buffer structure. |
June 8, 2021, 02:39 (GMT) |
Subdivision: store settings in the Mesh datablock This stores the subdivision settings in the Mesh datablock in order to simplify detection of whether subdivision is needed, especially for rendering to avoid subdividing a Mesh twice, one on the Blender side, and once on the render engine side. Ref T68891 |
June 8, 2021, 02:39 (GMT) |
Subdivision: initial support for face holes |
June 8, 2021, 02:38 (GMT) |
Subdivision: add support for vertex creasing This adds vertex creasing support for modeling, rendering, and Alembic IO. This is only implemented for OpenSubDiv. For modeling, vertex creasing follows the edge creasing implementation with an operator accessed through the Vertex menu in Edit Mode, and some parameter in the properties panel. Also added options to the Subsurf and Multires modifiers to disable vertex creasing, the existing option is only affecting edge creasing. Not sure if this is desirable, but I think it makes sense to separate them, as it can help people understand and study the effects of each of them. For Cycles this adds a couple of sockets on the Mesh node to hold data about which vertices are creased (one socket for the indices, one for the weigths). We could have a single socket with a value for every vertex, but this helps reducing memory usage a bit. Crease weights for vertices are then merged with the ones for edge creasing when setting up data for OpenSubDiv. For rendering vertex creasing in the viewport in Edit Mode, I tried to have a similar rendering as for edge creasing, that is with a colored outline, but I could not get it to work properly, so I resorted to mixing the vertex selected color with the edge crease color so the creasing is shown to emanate from the vertices, along the edges. If both vertices of an edge are creased, this would render the edge as creased. This needs improvement. To support rendering vertex and edge creases differently, `EditLoopData` was modified to hold `ushorts` instead of `uchars` in order to store more bit flags as all available bits in `EditLoopData.e_flag` were used. (For those unaware, this structure maps to an `ivec4` in the GLSL shader, so adding another member to hold vertex creasing is not really possible.) For Alembic, vertex creases are read and written in a similar fashion as edge creases (vertex creases are called "corners" in Alembic), so this is only written if a subdivision modifier is present on the Blender Mesh. |
|