Skip to content

webgl: artifact caused by edge z adjustment #2510

Closed
@Spongman

Description

@Spongman

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions