Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webgl: artifact caused by edge z adjustment #2510

Closed
Spongman opened this issue Jan 7, 2018 · 2 comments · Fixed by #2515
Closed

webgl: artifact caused by edge z adjustment #2510

Spongman opened this issue Jan 7, 2018 · 2 comments · Fixed by #2515

Comments

@Spongman
Copy link
Contributor

Spongman commented Jan 7, 2018

here, the red face is behind the green face, but its edge appears in front (neither faces are transparent):

image

function setup() {
  createCanvas(windowWidth, windowHeight-4, WEBGL);
  stroke(255, 255, 255);
}

function draw() {
  background(0);
  
  fill(255, 0, 0);
  rect(-100, -100, 200, 200, 1, 1);

  translate(0, 0, 0.5);
  fill(0, 255, 0);
  rect(0, 0, 200, 200, 1, 1);
}

https://codepen.io/Spongman/pen/YYEJjy?editors=0010

@stalgiag
Copy link
Contributor

stalgiag commented Jan 7, 2018

Hm this is probably happening because of how the shader is avoiding z-fighting between the stroke and face. Could you try this with your branch that is using the latest Processing shader?

@Spongman
Copy link
Contributor Author

Spongman commented Jan 7, 2018

good call. it looks like the processing shader doesn't have this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants