You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking into porting p5.brush to Java Processing (at least the core bits).
I've tried to get the KM colour blending working first (using MixBox so far), and have a solution based on a double buffer (where the existing graphics/canvas reside in one PGraphics buffer, and the new geometry primitive to blend resides in another, then mixing is ran pixel-wise using a shader on these two).
I have a question about an aspect of the approach you took -- namely, the need to mask the colour-mixing.
I'm failing to see why the whole masking thing is necessary, since the unfilled pixels (e.g. white region in the MaskBuffer below) are transparent and mixing these empty/transparent pixels with the existing canvas fully preserves the canvas' pixel colour values. Am I missing something (other than possible performance improvements)?
The text was updated successfully, but these errors were encountered:
Good point...
I originally did this because I used different colours in the mask in order to add effects.
When the pixel had green or blue components, apart from red, I performed specific actions within the shader.
Now I'm not doing that anymore, I just inherited my old approach...
At the end is basically the same, if I'm not understanding you wrongly. The only difference is that your blend color values are in the buffer/texture itself, rather than passed as a uniform. If you want to mix pigments, you still need to do various passes for each of the colours, which is what makes the whole thing a bit slow, particularly for high res canvas.
You are anyway right, maybe I should move this to a more logic approach, less variables.
Thx!
On other note, @micycle1, I strongly suggest to try Spectral.js rather than Mixbox.
It's an open source alternative with basically the same functionality, and smaller in size.
I'm looking into porting p5.brush to Java Processing (at least the core bits).
I've tried to get the KM colour blending working first (using MixBox so far), and have a solution based on a double buffer (where the existing graphics/canvas reside in one PGraphics buffer, and the new geometry primitive to blend resides in another, then mixing is ran pixel-wise using a shader on these two).
I have a question about an aspect of the approach you took -- namely, the need to mask the colour-mixing.
I'm failing to see why the whole masking thing is necessary, since the unfilled pixels (e.g. white region in the
MaskBuffer
below) are transparent and mixing these empty/transparent pixels with the existing canvas fully preserves the canvas' pixel colour values. Am I missing something (other than possible performance improvements)?The text was updated successfully, but these errors were encountered: