diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-10-01 01:19:10 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-10-01 01:19:10 +0300 |
commit | 5b0485fd7711494ecc927e97adbeb2655d940af6 (patch) | |
tree | 179a1c3da56ad707bd189bed2e366eadd8b0a38b /source/blender/draw/intern | |
parent | 1eba76d8eda60a0110460e6c880ae0875dd7fd5f (diff) |
Sculpt: Upload white for color attributes in multires in sculpt
Even if multires in sculpt mode doesn't yet support color
attributes, we should at least upload white color to avoid
making everything black.
Also fixed a bug where multires PBVHs didn't have access to
their CustomData attribute layout, which PBVH draw needs.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/draw_pbvh.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_pbvh.cc b/source/blender/draw/intern/draw_pbvh.cc index fbee8313041..e0231e36e8e 100644 --- a/source/blender/draw/intern/draw_pbvh.cc +++ b/source/blender/draw/intern/draw_pbvh.cc @@ -345,6 +345,19 @@ struct PBVHBatches { GPU_vertbuf_attr_get_raw_data(vbo.vert_buf, 0, &access); switch (vbo.type) { + case CD_PROP_COLOR: + case CD_PROP_BYTE_COLOR: { + /* TODO: Implement color support for multires similar to the mesh cache + * extractor code. For now just upload white. + */ + const ushort4 white(USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX); + + foreach_grids( + [&](int /*x*/, int /*y*/, int /*grid_index*/, CCGElem * /*elems*/[4], int /*i*/) { + *static_cast<ushort4 *>(GPU_vertbuf_raw_step(&access)) = white; + }); + break; + } case CD_PBVH_CO_TYPE: foreach_grids([&](int /*x*/, int /*y*/, int /*grid_index*/, CCGElem *elems[4], int i) { float *co = CCG_elem_co(&args->ccg_key, elems[i]); |