GPv3: Populate part of the buffer data #109093
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue