Commit b27ec892 by Philipp Adolf

Use edge sharpness in buffer

parent b1575591
...@@ -40,6 +40,12 @@ void main(){ ...@@ -40,6 +40,12 @@ void main(){
vec3 pos; vec3 pos;
if (s > 0){
edges[output_offset + gl_GlobalInvocationID.x].pos = 0.5f*a.pos + 0.5f*b.pos;
edges[output_offset + gl_GlobalInvocationID.x].norm = normalize(0.5f*a.norm + 0.5f*b.norm);
}
else {
edges[output_offset + gl_GlobalInvocationID.x].pos = 3.0f/8.0f * a.pos + 3.0f/8.0f * b.pos + 1.0f/8.0f * c.pos + 1.0f/8.0f * d.pos; edges[output_offset + gl_GlobalInvocationID.x].pos = 3.0f/8.0f * a.pos + 3.0f/8.0f * b.pos + 1.0f/8.0f * c.pos + 1.0f/8.0f * d.pos;
edges[output_offset + gl_GlobalInvocationID.x].norm = normalize(3.0f/8.0f * a.norm + 3.0f/8.0f * b.norm + 1.0f/8.0f * c.norm + 1.0f/8.0f * d.norm); edges[output_offset + gl_GlobalInvocationID.x].norm = normalize(3.0f/8.0f * a.norm + 3.0f/8.0f * b.norm + 1.0f/8.0f * c.norm + 1.0f/8.0f * d.norm);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment