Skip to content

filter() incompatible with high pixel density on P2D and P3D #429

Closed
@processing-bot

Description

@processing-bot

Created by: HectorCarral

Description

Using filter() (for example, filter(GRAY), filter(INVERT)) in combination with a higher pixel density (set for example with pixelDensity(displayDensity())) behaves weirdly when using P2D or P3D.

Expected Behavior

The filter would be applied with P2D/P3D and high pixel density in the same way as with the default renderer or with default pixel density.

Current Behavior

The frame is drawn zoomed in on the top left corner. If the default renderer is used, everything works as expected. If no higher pixel density is used, everything works as expected. Interestingly, if we use saveFrame(), the saved image looks fine even though it is rendered wrong in Processing. Therefore, I'm attaching here screenshots instead of saved frames.

Default renderer or default pixel density:
Captura de pantalla 2022-03-02 a las 12 37 44

High pixel density and P2D/P3D:
Captura de pantalla 2022-03-02 a las 12 37 31

Steps to Reproduce

  1. Set P2D or P3D as the renderer.
  2. Set a high pixel density.
  3. Use filter().
void setup() {
  size(500, 500, P3D);
  pixelDensity(displayDensity());
  rectMode(CENTER);
  noLoop();
  
  background(0);
  noStroke();
  fill(255, 0, 0);
}

void draw() {
  rect(width*0.5, height*0.5, width*0.5, height*0.5);
  filter(GRAY);
}

Your Environment

  • Processing version: Processing 4.0b6 (x64)
  • Operating System and OS version: macOS 12.2.1
  • Other information: Apple M1 chip

Metadata

Metadata

Assignees

No one assigned

    Labels

    has attachmentAttachment was not transfered from GitLabhelp wantedExtra attention is neededopengl

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions