Skip to content

Instantly share code, notes, and snippets.

@pragma37
Created January 19, 2021 15:16
Show Gist options
  • Save pragma37/54fc99bef4a164104f8e3369f92c45ea to your computer and use it in GitHub Desktop.
Save pragma37/54fc99bef4a164104f8e3369f92c45ea to your computer and use it in GitHub Desktop.
//Copyright (c) 2020 BlenderNPR and contributors. MIT license.
#include "Pipelines/NPR_Pipeline.glsl"
uniform int choose_color_0_texture_1_vertex_2 = 0;
uniform vec3 color;
uniform sampler2D color_texture;
uniform int color_texture_uv_index;
uniform int color_vertex_index;
void COMMON_PIXEL_SHADER(Surface S, inout PixelOutput PO)
{
if(choose_color_0_texture_1_vertex_2 == 0)
{
PO.color.rgb = color;
}
else if(choose_color_0_texture_1_vertex_2 == 1)
{
PO.color = texture(color_texture, S.uv[color_texture_uv_index]);
}
else if(choose_color_0_texture_1_vertex_2 == 1)
{
PO.color.rgb = S.color[color_vertex_index].rgb;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment