WIP: Onion Skinning Prototype #107641
|
@ -12,12 +12,19 @@ void OVERLAY_onion_skin_init(OVERLAY_Data *vedata)
|
|||
GPUShader *shader = OVERLAY_shader_onion_skin_mesh();
|
||||
DRWShadingGroup *grp;
|
||||
pd->onion_skin_grp = grp = DRW_shgroup_create(shader, psl->onion_skin_ps);
|
||||
|
||||
DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
|
||||
}
|
||||
|
||||
void OVERLAY_onion_skin_populate(OVERLAY_Data *vedata, Object *ob)
|
||||
{
|
||||
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
||||
DRWShadingGroup *grp = pd->onion_skin_grp;
|
||||
|
||||
float color[3] = {1, 1, 0};
|
||||
DRW_shgroup_uniform_vec3_copy(grp, "color", color);
|
||||
DRW_shgroup_uniform_float_copy(grp, "alpha", 0.2f);
|
||||
|
||||
struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
|
||||
if (geom) {
|
||||
DRW_shgroup_call(pd->onion_skin_grp, geom, ob);
|
||||
|
|
|
@ -257,6 +257,8 @@ GPU_SHADER_CREATE_INFO(overlay_onion_skin_mesh)
|
|||
.do_static_compilation(true)
|
||||
.vertex_in(0, Type::VEC3, "pos")
|
||||
.vertex_out(onion_skin_iface)
|
||||
.push_constant(Type::VEC3, "color")
|
||||
.push_constant(Type::FLOAT, "alpha")
|
||||
.fragment_out(0, Type::VEC4, "fragColor")
|
||||
.fragment_source("overlay_onion_skin_mesh_frag.glsl")
|
||||
.vertex_source("overlay_onion_skin_mesh_vert.glsl")
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
void main()
|
||||
{
|
||||
interp.color.rgb = vec3(1, 0, 1);
|
||||
interp.color.a = 0.5f;
|
||||
interp.color.rgb = color;
|
||||
interp.color.a = alpha;
|
||||
vec3 world_pos = point_object_to_world(pos);
|
||||
gl_Position = point_world_to_ndc(world_pos);
|
||||
/* view_clipping_distances(world_pos); */
|
||||
|
|
Loading…
Reference in New Issue