Skip to content

How to add outline at the material boundary #105

Answered by pragma37
HSDSZ asked this question in Q&A
Discussion options

You must be logged in to vote

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.

#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_h…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HSDSZ
Comment options

Answer selected by pragma37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants