GPv3: Populate part of the buffer data #109093

Merged
Falk David merged 21 commits from casey-bianco-davis/blender:GPv3-populate-buffer-data into main 2024-01-19 11:47:10 +01:00
2 changed files with 9 additions and 12 deletions
Showing only changes of commit fab38f8a69 - Show all commits

View File

@ -54,30 +54,18 @@ vec3 gpencil_lighting(void)
return clamp(light_accum, 0.0, 1e10);
}
vec4 debug_texture(vec2 uv)
{
vec4 col = vec4(mod(uv.xy, 1.0), 0.0, 1.0);
return col * min(length(uv.xy * 2 - 1), 1);
}
void main()
{
vec4 col;
if (flag_test(gp_interp_flat.mat_flag, GP_STROKE_TEXTURE_USE)) {
bool premul = flag_test(gp_interp_flat.mat_flag, GP_STROKE_TEXTURE_PREMUL);
col = texture_read_as_linearrgb(gpStrokeTexture, premul, gp_interp.uv);
/* Debug color. (Because textures are not yet implemented) */
col = debug_texture(gp_interp.uv);
}
else if (flag_test(gp_interp_flat.mat_flag, GP_FILL_TEXTURE_USE)) {
bool use_clip = flag_test(gp_interp_flat.mat_flag, GP_FILL_TEXTURE_CLIP);
vec2 uvs = (use_clip) ? clamp(gp_interp.uv, 0.0, 1.0) : gp_interp.uv;
bool premul = flag_test(gp_interp_flat.mat_flag, GP_FILL_TEXTURE_PREMUL);
col = texture_read_as_linearrgb(gpFillTexture, premul, uvs);
/* Debug color. (Because textures are not yet implemented) */
col = debug_texture(gp_interp.uv);
}
else if (flag_test(gp_interp_flat.mat_flag, GP_FILL_GRADIENT_USE)) {
bool radial = flag_test(gp_interp_flat.mat_flag, GP_FILL_GRADIENT_RADIAL);

View File

@ -54,12 +54,21 @@ vec3 gpencil_lighting(void)
return clamp(light_accum, 0.0, 1e10);
}
vec4 debug_texture(vec2 uv)
{
vec4 col = vec4(mod(uv.xy, 1.0), 0.0, 1.0);
return col * min(length(uv.xy * 2 - 1), 1);
}
void main()
{
vec4 col;
if (flag_test(gp_interp_flat.mat_flag, GP_STROKE_TEXTURE_USE)) {
bool premul = flag_test(gp_interp_flat.mat_flag, GP_STROKE_TEXTURE_PREMUL);
col = texture_read_as_linearrgb(gpStrokeTexture, premul, gp_interp.uv);
/* Debug color. (Because textures are not yet implemented) */
col = debug_texture(gp_interp.uv);
}
else if (flag_test(gp_interp_flat.mat_flag, GP_FILL_TEXTURE_USE)) {
bool use_clip = flag_test(gp_interp_flat.mat_flag, GP_FILL_TEXTURE_CLIP);