Different Rendering Output when Processing is used with IntelliJ, please help

Hello

I want to use Processing on IntelliJ, so I did the basic setup to keep things working but every time I try to render something, the border of the shapes look jagged.

What is interesting is that if I run the same sketch on the Processing official IDE, everything looks as expected, I can notice too the size of the windows are different. I’m attaching an picture with the code and output. I tried with pixelDensity() and smooth() without success. I’m missing some other method that is called when the sketch runs on the official IDE?

I’m running this on Windows 10, my monitor resolution is 3440x1440 (just in case)
Thanks.

1 Like

Ok, so this was the problem:

you must add P2D on the size method
size(500, 500, P2D) fixes the problem.

Now looking to understand the warnings generated by that:

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/C:/Users/atadres/Desktop/processing-3.5.4/processing-3.5.4/core/library/gluegen-rt.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)

WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

1 Like
1 Like

Any movement on this issue? I’m facing the same problem, getting very different output when using the Processing IDE versus another IDE (VSCode in my case).

I think the common link between me and Bufofa might be a high-density display. Mine is 3840x2160. When using the Processing IDE, I include pixelDensity(displayDensity()) and all my sketches look great. Doing the same in VSCode doesn’t work.

The first image here shows a star shape drawn in the Processing IDE at a size of 100x100 with pixelDensity set at 2. Naturally, the resulting screenshot is 200x200.

starshape100x100_processingIDE_2xpixelDensity

The second image is the same sketch created in VSCode. Taking a screenshot of the sketch using save() produces a 100x100 image, but using Print Screen shows that it is poorly scaled up to 250x250, for some reason.

starshape100x100_vscode_actualSize_cropped

My guess is that when running a Processing app in an IDE like VSCode, it cannot properly determine what sort of display it is rendering to. Calling displayDensity() in VSCode outputs 1 instead of 2. Similarly, adding pixelDensity(2) to the program prints the error “pixelDensity(2) is not available for this display.” Somehow, this results in this weird 2.5x scaling for me.

I would love some thoughts on how to fix this, or work around this. I’m building a small library for Processing in VSCode and I don’t want to have compile it and import it into the Processing IDE every time I want to test it. Beyond the output just looking ugly, I thought I was importing shapes incorrectly because the weird 2.5 scaling made all the vertices look out of place.

1 Like