Page MenuHome

WIP: Support UV coordinates in CCG path of multires
AcceptedPublic

Authored by Sergey Sharybin (sergey) on Sep 24 2019, 12:09 PM.

Details

Summary

Store UVs in a loop custom data where indexing is done in a
grid element manner. This allows to extend attributes further
to support vertex colors as well.

Currently only default UV layer is sent to GPU.
This is something where i would hope to have help from Clement :)

Fixes T63581: Multires: textures not displayed in sculpt mode

Diff Detail

Repository
rB Blender
Branch
multires_ccg_uv_v2 (branched from master)
Build Status
Buildable 5071
Build 5071: arc lint + arc unit

Event Timeline

Another note: only works with flat shading. Smooth shading should be starightforward as well, but first would be nice to know if the approach is good in general and that we can indeed do all the required attributes from GPU_pbvh_grid_buffers_update().

Currently only default UV layer is sent to GPU.
This is something where i would hope to have help from Clement :)

All you need is to mimic what happens in extract_uv_init for the GPUVertFormat creation.

The other issue then is how to pass the GPUMaterials to get the needed layers. Computing the needed layer could be done in DRW and only pass the layer list to the buffer update function.

The patch looks fine for the areas that concerns me.

source/blender/gpu/intern/gpu_buffers.c
138

unrelated to this patch but add alias to "c"

139

add alias to "au"

This revision is now accepted and ready to land.Mar 23 2020, 9:35 PM
source/blender/gpu/intern/gpu_buffers.c
138

Unrelated to the degree that can just be ignored "for now" ?

What is alias, how to add it and what is "c" ?

139

What is "au" ?

source/blender/gpu/intern/gpu_buffers.c
138

what is "c" ?

same as u

Unrelated to the degree that can just be ignored "for now" ?

Doesn't hurt to add it.

What is alias, how to add it

it is another name for the attrib so that both name can be used in the shaders.
GPU_vertformat_alias_add will add an alias to the last added attribute of the format.

139

au is active uv layer and u is active uv layer for render.

@Sergey Sharybin (sergey) ou mentioned in the other task that you wanted me to take over this. Is this still the case?