We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi guys I'm running a sketch with masks and I keep getting this error
"The smooth/noSmooth functions are being called too often. This results in screen flickering, so they will be disabled for the rest of the sketch's execution."
Anybody else faced this issue? Any way to avoid this or to force smooth() to stay enable?
Also any other way to have any kind of anti-aliasing beside smooth()?
Thanks, did some research first but can't find an answer
PS No GPU, doesn't seem to be an issue when running on a GPU system
Answers
Call smooth() only once, in setup().
Hi PhiLho smooth is only being called once in the setup. Also it seems I'm guetting the same error even when I use smooth(0)
Not sure what's going on here. Are PGraphics, masks using smooth by default and overwriting the smooth setting in setup?
Thanks!
Function noSmooth() is a more compatible alternative for
smooth(0);
:http://processing.org/reference/noSmooth_.html
A simple sketch reproducing your problem would be interesting to see. I don't understand why you get a warning about using smooth() too often if you call it only once.
Here are the errors I'm currently getting:
A question, I can't seem to find an answer for: Can smooth run without a GPU? On a CPU only system?
Thanks guys!
I see this error as well. For me, the inability to override automatic disabling of smooth() is a serious problem.
My use case: I have a simulation of polymer chains (kind of like a bowl of spaghetti noodles floating around, only the noodles are single molecules) where the chains are made of complicated objects. I allow the user to select a renderer on the fly to view an ongoing simulation. The user is free to flick back and forth between simple/low-res/high-frame-rate renderers and detailed/high-res/low-frame-rate renderers as they like, kind of like switching between normal and x-ray vision. There are at present three renderers.
Each renderer has its own smooth() setting. This is desired. Problem is, Processing decides that smooth() is being called too often if the user switches renderers too often for its taste, and disables the smooth function. This destroys control and information. My user should be able to switch as often as they like -- if they want to hold down the "Renderer switch" key because it looks cool, they should be able to do that.
The present justification for disabling smooth() is to prevent flickering. Flickering is a problem if your renderer is constant, but it's a feature if you're jumping between views.
The smooth() function should have an override to prevent the present intrusion on valuable and intentional decisions by programmers.
Class PGraphicsOpenGL overrides both PGraphics smooth() & noSmooth() in order to cap them:
https://github.com/processing/processing/blob/master/core/src/processing/opengl/PGraphicsOpenGL.java#L3371
What we can do is hack that class by subclassing it like I did below:
http://forum.processing.org/two/discussion/8261/how-to-use-vertexfloat-v-
Here's my simpler adaption of it. It resets both lastSmoothCall & smoothCallCount to some lower value: :ar!
"HackedP3D.java":
"P3D_Subclass.pde":
Thanks for the reply. I confess I don't understand what's essential, here, and what's decoration/aimed at other issues. If my only objective is to override
smooth()
(a great suggestion), must I really subclassPGraphics3D
twice, and include all this other business?No! Class HackedP3D is enough! You can ignore the whole "P3D_Subclass.pde" test. :-B
Apologies, I'm still a bit confused. Simply including HackedP3D in my project is not enough (it appears). What else must I do? I'm hazy on how Processing sets up the graphics context for the user, obviously. Thanks for the assistance.
It's similar to createGraphics(), just pass width & height dimensions:
http://processing.org/reference/createGraphics_.html
Just like I did when instantiating MyP3D. Just replace it w/ HackedP3D: