Open
Description
Most appropriate sub-area of Processing 4?
OpenGL
Processing version
4.4.3
Operating system
Tested on macOS 13.4
Steps to reproduce this
-
Open Processing 4.4.3
-
Run examples in
Topics/Shaders
(for example Conway); -
Notice the rendering is wrong
snippet
n/a
Additional context
Since version 4.4.3, the default pixelDensity
is set to match the display's density. During testing, we found that some shader examples break on high-density displays because they implicitly relied on pixelDensity
being set to 1.
Some investigation in how shader()
is implemented and what assumptions are made there might be needed.
Would you like to work on the issue?
This can be assigned
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog
Activity
vsquared commentedon Apr 27, 2025
This is what I see on macos 14.6.1 M2; not sure how it's supposed to look:
perminder-17 commentedon Apr 27, 2025
Hey, @vsquared I think it should look something like this:
Screencast.from.28-04-25.01.35.32.AM.IST.webm
When I try to run in linux, it's working as expected, so probably it's a mac specific issue. Mac are sometimes really weird when working with opengl.
Btw, @vsquared do you mind removing this line in the code and build again to see what you get, probably you should get the correct result then. I can't debug since I am not a user of mac.
processing4/core/src/processing/core/PApplet.java
Line 10108 in c83f44c
We should probably work with shader on how it works with mac for pixel Density?
perminder-17 commentedon Apr 27, 2025
Hi @SableRaf , From what I can see, the Conway Game-of-Life example (https://processing.org/examples/gameoflife.html) is rendered with Processing’s default renderer. So does it actually uses any OpenGL pipeline or custom shaders?
I’ve been investigating the flickering you noted in the shader reference sketches. Even after commenting out the line that syncs
pixelDensity
to the display density the problem persists, so it looks independent ofpixelDensity
.processing4/core/src/processing/core/PApplet.java
Line 10108 in c83f44c
the shader still don't work and shows kind of flickering effect :
Screencast.from.28-04-25.02.01.24.AM.IST.webm
That makes me suspect the issue lies elsewhere. Would you agree this is independent of pixel density? If so, I can prepare a minimal example and file a new issue—just let me know if there’s anything else we should check first. Not sure if conway example we are using uses any opengl context or works on the GPU side.
SableRaf commentedon Apr 27, 2025
This is the correct appearance. The issue in question is specific to Processing 4.4.3 (the latest beta at the time of posting). We changed the default behavior so that
pixelDensity
matches thedisplayDensity
. However that causes issues with some shader examples. The temporary workaround is to addpixelDensity(1)
to thesetup()
in these examples. However, we'd like to fix the underlying issue which is that shader examples should be working regardless of pixelDensity.If you want to investigate further, make sure you're testing on Processing 4.4.3 or building from the latest source. We suspect the issue may be related to the built-in
PShader
uniforms, or something in the way theshader()
function is implemented.@perminder-17 You're looking at
Topics > Cellular Automata > Game of Life
. This is not a shader-based example. @vsquared has the correct one which is inTopics > Shaders > Conway
. As for the flickering you mentioned, it seems unrelated to this issue. Please open a new issue with details about which version of Processing you are using and the code you are running.vsquared commentedon Apr 28, 2025
My mistake; I tested on Processing 4.4.1. Sorry for the confusion.
AhmedMagedC commentedon May 5, 2025
@SableRaf, i have tried to build the Processing 4.4.3 source code to test
but I can't reproduce this bug on windows! i can see the exact same pic as @vsquared posted, maybe it is macOS specific issue?
Stefterv commentedon May 5, 2025
@AhmedMagedC Do you have a high-density display? Otherwise you'd need to set
pixelDensity(2)
manuallyAhmedMagedC commentedon May 5, 2025
i have 1920 * 1080 screen monitor (using laptop)
is that considered high-density? anyway when i set
pixelDensity(2)
insetup()
i see this message in consolepixelDensity(2) is not available for this display
and still nothing changes i see the same picStefterv commentedon May 5, 2025
Yeah that message indicates that you do not have a high-density display, you can go into settings -> system -> display (iirc) and change the display scaling to 200% for example. Not sure if you could work this way though
AhmedMagedC commentedon May 5, 2025
is that how it looks like?
and do you mean i can't work on this issue due to not having high-density display?
6 remaining items