-
I have a plane. For the left half, I assign a blue color with an outline. For the right half, I assign a red color with an outline. The plane has a perfect outline. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
At the moment, IDs are per object so all materials in the same object share the same ID. #include "Pipelines/NPR_Pipeline.glsl"
uniform vec3 ambient_color = vec3(0.1,0.1,0.1);
uniform vec3 diffuse_color = vec3(1.0,0.1,0.1);
uniform vec3 specular_color = vec3(1.0,1.0,1.0);
uniform float roughness = 0.5;
uniform vec4 line_color = vec4(0.0,0.0,0.0,1.0);
uniform float line_width = 1.0;
uniform float line_depth_threshold = 0.5;
uniform float line_normal_threshold = 1.0;
uniform int custom_id_offset = 0;
void COMMON_PIXEL_SHADER(Surface S, inout PixelOutput PO)
{
PO.id += custom_id_offset;
vec3 diffuse = diffuse_color * get_diffuse_half();
vec3 specular = specular_color * get_specular(roughness);
vec3 color = ambient_color + diffuse + specular;
PO.color = vec4(color, 1.0);
PO.line_color = line_color;
PO.line_width = get_line_simple(line_width, line_depth_threshold, line_normal_threshold);
} You should use a large value for the custom_id_offset, so it doesn't overlap with other objects. This is an area that needs a redesign. |
Beta Was this translation helpful? Give feedback.
At the moment, IDs are per object so all materials in the same object share the same ID.
You can, however, set a per-material custom ID.