From 3d75cb1cf4684e3b24664f83571b85df55a6ef74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sun, 14 Jan 2024 17:06:13 +0100 Subject: [PATCH 001/387] use UV textures by default Closes: https://github.com/umlaeute/Gem/issues/398 --- src/Geos/model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Geos/model.cpp b/src/Geos/model.cpp index ad6c8b45c..905514634 100644 --- a/src/Geos/model.cpp +++ b/src/Geos/model.cpp @@ -47,7 +47,7 @@ model :: model(t_symbol* filename) , m_drawType(GL_TRIANGLES) , m_blend(false) , m_linewidth(1.0) - , m_texType(gem::modelGL::texturetype::LINEAR) + , m_texType(gem::modelGL::texturetype::UV) , m_rescale(gem::modelGL::rescale::NORMALIZE_CENTER) , m_useMaterial(false) { From 307d43681c9455432455066e8eefbebde494e7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 15 Jan 2024 11:40:31 +0100 Subject: [PATCH 002/387] indent --- plugins/GMERLIN/filmGMERLIN.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/GMERLIN/filmGMERLIN.cpp b/plugins/GMERLIN/filmGMERLIN.cpp index 40d670d80..663157397 100644 --- a/plugins/GMERLIN/filmGMERLIN.cpp +++ b/plugins/GMERLIN/filmGMERLIN.cpp @@ -286,8 +286,7 @@ bool filmGMERLIN :: open(const std::string&sfilename, #endif m_finalframe = gavl_video_frame_create_nopad(finalformat); - m_doConvert= (gavl_video_converter_init (m_gconverter, gformat, - finalformat)>0); + m_doConvert = (gavl_video_converter_init (m_gconverter, gformat, finalformat)>0); m_image.image.xsize=gformat->frame_width; m_image.image.ysize=gformat->frame_height; #ifdef __APPLE__ From 0a4169ecdb65c60f9d812d9b62ec86b47717add2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 15 Jan 2024 11:41:00 +0100 Subject: [PATCH 003/387] note on bgav_options_set_sample_accurate() leading to crashes Related: https://github.com/umlaeute/Gem/issues/110 --- plugins/GMERLIN/filmGMERLIN.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/GMERLIN/filmGMERLIN.cpp b/plugins/GMERLIN/filmGMERLIN.cpp index 663157397..c1c775d5a 100644 --- a/plugins/GMERLIN/filmGMERLIN.cpp +++ b/plugins/GMERLIN/filmGMERLIN.cpp @@ -186,6 +186,11 @@ bool filmGMERLIN :: open(const std::string&sfilename, bgav_options_set_network_bandwidth(m_opt, network_bandwidth); */ bgav_options_set_seek_subtitles(m_opt, 0); + + /* requesting seample-accurate seeking here, and opening a single-frame file (foo.jpg) + * will crash on bgav_open()! + * OTOH, we do want sample accurate seeking whenever possible. how to fix this? + */ bgav_options_set_sample_accurate(m_opt, 1); SET_LOG_CALLBACK(m_opt, this); From ec5042909d235c8abf01a69ce5932113972dbb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 11:59:11 +0100 Subject: [PATCH 004/387] Image: local helper to get csize from format --- src/Gem/Image.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/Gem/Image.cpp b/src/Gem/Image.cpp index dde26dab2..609ec8e15 100644 --- a/src/Gem/Image.cpp +++ b/src/Gem/Image.cpp @@ -278,6 +278,32 @@ namespace { return buf; } + const unsigned char format2csize(int fmt) { + switch(fmt) { + case GL_LUMINANCE: + return 1; + case GL_YUV422_GEM: + return 2; + case GL_RGB: + case GL_BGR: + return 3; + case GL_RGBA: + case GL_BGRA: +#ifdef GL_ABGR_EXT + case GL_ABGR_EXT: +#endif +#ifdef GL_ARGB_EXT + case GL_ARGB_EXT: +#endif + return 4; + default: + break; + } + /* default */ + return 4; + } + + const bool needsReverseOrdering(unsigned int type) { const bool isBigEndian = #ifdef __BIG_ENDIAN__ @@ -520,11 +546,11 @@ imageStruct&imageStruct::operator=(const imageStruct&org) GEM_EXTERN int imageStruct::setCsizeByFormat(int setformat) { + csize = format2csize(setformat); switch(setformat) { case GL_LUMINANCE: format=setformat; type=GL_UNSIGNED_BYTE; - csize=1; break; case GL_YUV422_GEM: @@ -540,14 +566,12 @@ GEM_EXTERN int imageStruct::setCsizeByFormat(int setformat) GL_UNSIGNED_BYTE #endif ; - csize=2; break; case GL_RGB: case GL_BGR: format=setformat; type=GL_UNSIGNED_BYTE; - csize=3; break; case GL_RGBA: @@ -569,12 +593,12 @@ GEM_EXTERN int imageStruct::setCsizeByFormat(int setformat) # endif #endif ; - csize=4; break; } return csize; } + GEM_EXTERN int imageStruct::setCsizeByFormat(void) { return setCsizeByFormat(format); From 9b056ce9bc24821e343a42980db3d4c826d02234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 13:47:48 +0100 Subject: [PATCH 005/387] pix_test: pass both width and height of image to SMTPE generators rather than just the height... Closes: https://github.com/umlaeute/Gem/issues/401 Closes: https://github.com/umlaeute/Gem/issues/402 --- src/Pixes/pix_test.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Pixes/pix_test.cpp b/src/Pixes/pix_test.cpp index 00b9890ae..bb3c6dfa2 100644 --- a/src/Pixes/pix_test.cpp +++ b/src/Pixes/pix_test.cpp @@ -50,7 +50,7 @@ static volatile unsigned char getRandom(void) return (random_nextseed % 0xFF); } -static void makeSMPTE_RGBA(unsigned int rows, unsigned int cols, +static void makeSMPTE_RGBA(unsigned int cols, unsigned int rows, unsigned char*DATA, float scale) { unsigned char*data=DATA; @@ -104,7 +104,7 @@ static void makeSMPTE_RGBA(unsigned int rows, unsigned int cols, data+=4; } } -static void makeSMPTE_RGB(unsigned int rows, unsigned int cols, +static void makeSMPTE_RGB(unsigned int cols, unsigned int rows, unsigned char*DATA, float scale) { unsigned char*data=DATA; @@ -154,7 +154,7 @@ static void makeSMPTE_RGB(unsigned int rows, unsigned int cols, data+=3; } } -void makeSMPTE_YUV(unsigned int rows, unsigned int cols, +void makeSMPTE_YUV(unsigned int cols, unsigned int rows, unsigned char*DATA, float scale) { unsigned char*data=DATA; @@ -206,7 +206,7 @@ void makeSMPTE_YUV(unsigned int rows, unsigned int cols, data+=2; } } -void makeSMPTE_Grey(unsigned int rows, unsigned int cols, +void makeSMPTE_Grey(unsigned int cols, unsigned int rows, unsigned char*data, float scale) { unsigned int r,c; @@ -311,19 +311,19 @@ void pix_test :: render(GemState*state) unsigned char* data=m_pix.image.data; switch (m_pix.image.format) { case GEM_RGBA: - makeSMPTE_RGBA(m_pix.image.ysize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_RGBA(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, scale); break; case GEM_RGB: - makeSMPTE_RGB(m_pix.image.ysize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_RGB(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, scale); break; case GEM_YUV: - makeSMPTE_YUV(m_pix.image.ysize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_YUV(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, scale); break; case GEM_GRAY: - makeSMPTE_Grey(m_pix.image.ysize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_Grey(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, scale); break; } From 10202bed8707f657741262e37955c02aa275ece5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 13:49:05 +0100 Subject: [PATCH 006/387] pix_test: fix colorspace validation --- src/Pixes/pix_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Pixes/pix_test.cpp b/src/Pixes/pix_test.cpp index bb3c6dfa2..4f87b0c35 100644 --- a/src/Pixes/pix_test.cpp +++ b/src/Pixes/pix_test.cpp @@ -356,6 +356,7 @@ void pix_test :: csMess(std::string cs) for(i=0; i Date: Tue, 16 Jan 2024 13:49:37 +0100 Subject: [PATCH 007/387] pix_test: make sure that YUV data does not have an odd width --- src/Pixes/pix_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Pixes/pix_test.cpp b/src/Pixes/pix_test.cpp index 4f87b0c35..b2dfea300 100644 --- a/src/Pixes/pix_test.cpp +++ b/src/Pixes/pix_test.cpp @@ -373,8 +373,8 @@ void pix_test :: csMess(std::string cs) return; } m_pix.image.setCsizeByFormat(fmt); - m_pix.image.reallocate(); - m_pix.newfilm=true; + dimenMess(m_pix.image.xsize, m_pix.image.ysize); + } void pix_test :: postrender(GemState *state) { @@ -387,6 +387,8 @@ void pix_test :: dimenMess(unsigned int w, unsigned int h) { m_pix.image.xsize=w; m_pix.image.ysize=h; + if(GEM_YUV == m_pix.image.format && m_pix.image.xsize%2) + m_pix.image.xsize+=1; m_pix.image.reallocate(); m_pix.newfilm=true; } From d3f4626af70264654141963be8baacf14719c096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 14:17:22 +0100 Subject: [PATCH 008/387] towards image::getRGBA() for GL_FLOATs --- src/Gem/Image.cpp | 143 +++++++++++++++++++++++++--------------------- 1 file changed, 77 insertions(+), 66 deletions(-) diff --git a/src/Gem/Image.cpp b/src/Gem/Image.cpp index 609ec8e15..e420d4ff2 100644 --- a/src/Gem/Image.cpp +++ b/src/Gem/Image.cpp @@ -1474,78 +1474,89 @@ GEM_EXTERN void imageStruct::fixUpDown(void) upsidedown=true; } +namespace { + template + void _yuv2rgb(const T y, const T u, const T v, + T&r, T&g, T&b) { + const T Y = y*static_cast(YUV2RGB_11); + r = CLAMP(Y + u*static_cast(YUV2RGB_12) + v*static_cast(YUV2RGB_13)); + g = CLAMP(Y + u*static_cast(YUV2RGB_22) + v*static_cast(YUV2RGB_23)); + b = CLAMP(Y + u*static_cast(YUV2RGB_32) + v*static_cast(YUV2RGB_33)); + } + template<> + void _yuv2rgb(const unsigned char y, const unsigned char u, const unsigned char v, + unsigned char&r, unsigned char&g, unsigned char&b) { + const int Y = YUV2RGB_11*(y - Y_OFFSET); + const int U = u - UV_OFFSET; + const int V = v - UV_OFFSET; + const int uv_r=YUV2RGB_12*U + YUV2RGB_13*V; + const int uv_g=YUV2RGB_22*U + YUV2RGB_23*V; + const int uv_b=YUV2RGB_32*U + YUV2RGB_33*V; + r = CLAMP((Y + uv_r) >> 8); + g = CLAMP((Y + uv_g) >> 8); + b = CLAMP((Y + uv_b) >> 8); + } + + template + void _getRGB(const T*data, unsigned int format, size_t position, T&red, T&green, T&blue, T&alpha) { + int csize = format2csize(format); + const T*pixels = data+position*csize; + switch(format) { + case GL_LUMINANCE: + red=green=blue=pixels[0]; + alpha=255; + break; + case GL_RGB: + red=pixels[0]; + green=pixels[1]; + blue=pixels[2]; + break; + case GL_BGR: + red=pixels[0]; + green=pixels[1]; + blue=pixels[2]; + break; + case GL_RGBA: + red=pixels[0]; + green=pixels[1]; + blue=pixels[2]; + alpha=pixels[3]; + break; + case GL_BGRA: +#ifdef __APPLE__ + /* ARGB */ + red=pixels[1]; + green=pixels[2]; + blue=pixels[3]; + alpha=pixels[0]; +#else + red=pixels[2]; + green=pixels[1]; + blue=pixels[0]; + alpha=pixels[3]; +#endif + break; + case GL_YUV422_GEM: + pixels = data + ((position>>1)<<1)*csize; + _yuv2rgb(pixels[(position%2)?chY1:chY0], pixels[chU], pixels[chV], red, green, blue); + break; + default: + break; + } + } +}; GEM_EXTERN bool imageStruct::getRGB(int X, int Y, unsigned char*r, unsigned char*g, unsigned char*b, unsigned char*a) const { + bool reverse = needsReverseOrdering(type); unsigned char red=0, green=0, blue=0, alpha=255; int position = (X+(upsidedown?(ysize-Y-1):Y)*xsize); - const unsigned char*pixels=data+position*csize; - - switch(format) { - case GL_LUMINANCE: - red=green=blue=pixels[0]; - alpha=255; - break; - case GL_RGB: - red=pixels[0]; - green=pixels[1]; - blue=pixels[2]; - break; - case GL_BGR: - red=pixels[0]; - green=pixels[1]; - blue=pixels[2]; - break; - case GL_RGBA: - red=pixels[0]; - green=pixels[1]; - blue=pixels[2]; - alpha=pixels[3]; - break; - case GL_BGRA: -#ifdef __APPLE__ - red=pixels[1]; - green=pixels[2]; - blue=pixels[3]; - alpha=pixels[0]; -#else - red=pixels[2]; - green=pixels[1]; - blue=pixels[0]; - alpha=pixels[3]; -#endif - break; - case GL_YUV422_GEM: { - position = (((X+(upsidedown?(ysize-Y-1):Y)*xsize)>>1)<<1); - pixels=data+position*csize; - int y=YUV2RGB_11*(pixels[(X%2)?chY1:chY0]-Y_OFFSET); - int u=pixels[chU] - UV_OFFSET; - int v=pixels[chV] - UV_OFFSET; - int uv_r=YUV2RGB_12*u+YUV2RGB_13*v; - int uv_g=YUV2RGB_22*u+YUV2RGB_23*v; - int uv_b=YUV2RGB_32*u+YUV2RGB_33*v; - - red = CLAMP((y + uv_r) >> 8); - green = CLAMP((y + uv_g) >> 8); - blue = CLAMP((y + uv_b) >> 8); - } - break; - default: - break; - } - if(r) { - *r=red; - } - if(g) { - *g=green; - } - if(b) { - *b=blue; - } - if(a) { - *a=alpha; - } + _getRGB(data, format, position, red, green, blue, alpha); + if(r) *r=red; + if(g) *g=green; + if(b) *b=blue; + if(a) *a=alpha; return true; } GEM_EXTERN bool imageStruct::getGrey(int X, int Y, unsigned char*g) const From cdbb276d4f5e1f309a7f5b774b89ef520d23ce74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 14:50:31 +0100 Subject: [PATCH 009/387] replace imageStruct::setCsizeByFormat() with imageStruct::setFormat() and deprecate the former --- src/Gem/Image.cpp | 6 +++--- src/Gem/Image.h | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Gem/Image.cpp b/src/Gem/Image.cpp index e420d4ff2..2a9877908 100644 --- a/src/Gem/Image.cpp +++ b/src/Gem/Image.cpp @@ -544,7 +544,7 @@ imageStruct&imageStruct::operator=(const imageStruct&org) } -GEM_EXTERN int imageStruct::setCsizeByFormat(int setformat) +GEM_EXTERN int imageStruct::setFormat(int setformat) { csize = format2csize(setformat); switch(setformat) { @@ -599,9 +599,9 @@ GEM_EXTERN int imageStruct::setCsizeByFormat(int setformat) return csize; } -GEM_EXTERN int imageStruct::setCsizeByFormat(void) +GEM_EXTERN int imageStruct::setFormat(void) { - return setCsizeByFormat(format); + return setFormat(format); } void pix_addsat(unsigned char *leftPix, unsigned char *rightPix, diff --git a/src/Gem/Image.h b/src/Gem/Image.h index b56aee0b9..c73b5d050 100644 --- a/src/Gem/Image.h +++ b/src/Gem/Image.h @@ -168,8 +168,11 @@ struct GEM_EXTERN imageStruct { * and set and return the correct csize (like 1) * if no format is given the current format is used */ - virtual int setCsizeByFormat(int format); - virtual int setCsizeByFormat(void); + virtual int setFormat(int format); + virtual int setFormat(void); + + GEM_DEPRECATED int setCsizeByFormat(int format) { return setFormat(format); } + GEM_DEPRECATED int setCsizeByFormat(void) { return setFormat(); } /* various copy functions From 2c42e5f1e000fe6c1e0927b24f4305f35778e9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 14:50:47 +0100 Subject: [PATCH 010/387] use setFormat() rather than setCsizeByFormat() --- src/Gem/Image.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Gem/Image.cpp b/src/Gem/Image.cpp index 2a9877908..50c3a66ac 100644 --- a/src/Gem/Image.cpp +++ b/src/Gem/Image.cpp @@ -691,7 +691,7 @@ GEM_EXTERN bool imageStruct::convertFrom(const imageStruct *from, ysize=from->ysize; if(to_format>0) { - setCsizeByFormat(to_format); + setFormat(to_format); } upsidedown=from->upsidedown; @@ -747,7 +747,7 @@ GEM_EXTERN bool imageStruct::fromRGB(const unsigned char *rgbdata) if(!rgbdata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -795,7 +795,7 @@ GEM_EXTERN bool imageStruct::fromRGB16(const unsigned char *rgb16data) return false; } const unsigned short*rgbdata=(const unsigned short*)rgb16data; - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -827,7 +827,7 @@ GEM_EXTERN bool imageStruct::fromRGBA(const unsigned char *rgbadata) if(!rgbadata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -881,7 +881,7 @@ GEM_EXTERN bool imageStruct::fromBGR(const unsigned char *bgrdata) if(!bgrdata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -925,7 +925,7 @@ GEM_EXTERN bool imageStruct::fromBGRA(const unsigned char *bgradata) if(!bgradata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -973,7 +973,7 @@ GEM_EXTERN bool imageStruct::fromABGR(const unsigned char *abgrdata) if(!abgrdata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1023,7 +1023,7 @@ GEM_EXTERN bool imageStruct::fromARGB(const unsigned char *argbdata) if(!argbdata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1075,7 +1075,7 @@ GEM_EXTERN bool imageStruct::fromGray(const unsigned char *greydata) if(!greydata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1120,7 +1120,7 @@ GEM_EXTERN bool imageStruct::fromGray(const short *greydata_) if(!greydata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1186,7 +1186,7 @@ GEM_EXTERN bool imageStruct::fromYV12(const unsigned char*Y, return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1244,7 +1244,7 @@ GEM_EXTERN bool imageStruct::fromYV12(const short*Y, const short*U, return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1292,7 +1292,7 @@ GEM_EXTERN bool imageStruct::fromUYVY(const unsigned char *yuvdata) if(!yuvdata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1352,7 +1352,7 @@ GEM_EXTERN bool imageStruct::fromYUY2(const unsigned char*yuvdata) // YUYV if(!yuvdata) { return false; } - setCsizeByFormat(); + setFormat(); reallocate(); bool reverse = needsReverseOrdering(type); @@ -1396,7 +1396,7 @@ GEM_EXTERN bool imageStruct::fromYVYU(const unsigned char *yuvdata) if(!yuvdata) { return false; } - setCsizeByFormat(); + setFormat(); bool reverse = needsReverseOrdering(type); reallocate(); From baac40fe48d3fb3f8b8a5fae5bb007096b40a754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 14:55:07 +0100 Subject: [PATCH 011/387] linebreak --- src/Gem/Image.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gem/Image.h b/src/Gem/Image.h index c73b5d050..0b0359f91 100644 --- a/src/Gem/Image.h +++ b/src/Gem/Image.h @@ -181,8 +181,8 @@ struct GEM_EXTERN imageStruct { * into a new imageStruct */ virtual void copy2Image(imageStruct *to) const; - virtual void copy2ImageStruct(imageStruct *to) - const; // copy the imageStruct (but not the actual data) + virtual void copy2ImageStruct(imageStruct *to) const; + // copy the imageStruct (but not the actual data) /* this is a sort of better copy2Image, * which only copies the imageStruct-data if it is needed */ From 73c9475b63a1c2aa97912f9a2842069f3eb3e60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 14:56:24 +0100 Subject: [PATCH 012/387] Pixes: replace imageStruct::setCsizeByFormat() with imageStruct::setFormat() --- src/Pixes/pix_background.cpp | 16 ++++++++-------- src/Pixes/pix_backlight.cpp | 4 ++-- src/Pixes/pix_biquad.cpp | 20 ++++++++++---------- src/Pixes/pix_buffer.cpp | 2 +- src/Pixes/pix_colorreduce.cpp | 4 ++-- src/Pixes/pix_convert.cpp | 8 ++++---- src/Pixes/pix_deinterlace.cpp | 4 ++-- src/Pixes/pix_delay.cpp | 2 +- src/Pixes/pix_dot.cpp | 6 +++--- src/Pixes/pix_freeframe.cpp | 4 ++-- src/Pixes/pix_frei0r.cpp | 6 +++--- src/Pixes/pix_grey.cpp | 2 +- src/Pixes/pix_halftone.cpp | 6 +++--- src/Pixes/pix_kaleidoscope.cpp | 6 +++--- src/Pixes/pix_levels.cpp | 4 ++-- src/Pixes/pix_lumaoffset.cpp | 6 +++--- src/Pixes/pix_metaimage.cpp | 6 +++--- src/Pixes/pix_motionblur.cpp | 12 ++++++------ src/Pixes/pix_movement.cpp | 4 ++-- src/Pixes/pix_movement2.cpp | 10 +++++----- src/Pixes/pix_multiblob.cpp | 4 ++-- src/Pixes/pix_noise.cpp | 4 ++-- src/Pixes/pix_puzzle.cpp | 10 +++++----- src/Pixes/pix_rds.cpp | 8 ++++---- src/Pixes/pix_refraction.cpp | 4 ++-- src/Pixes/pix_resize.cpp | 2 +- src/Pixes/pix_rgba.cpp | 6 +++--- src/Pixes/pix_rtx.cpp | 4 ++-- src/Pixes/pix_set.cpp | 2 +- src/Pixes/pix_share_read.cpp | 2 +- src/Pixes/pix_share_write.cpp | 2 +- src/Pixes/pix_sig2pix~.cpp | 4 ++-- src/Pixes/pix_snap.cpp | 2 +- src/Pixes/pix_tIIR.cpp | 4 ++-- src/Pixes/pix_tIIRf.cpp | 4 ++-- src/Pixes/pix_test.cpp | 6 +++--- src/Pixes/pix_texture.cpp | 2 +- src/Pixes/pix_write.cpp | 6 +++--- src/Pixes/pix_yuv.cpp | 2 +- 39 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/Pixes/pix_background.cpp b/src/Pixes/pix_background.cpp index 87137a775..c257e45d4 100644 --- a/src/Pixes/pix_background.cpp +++ b/src/Pixes/pix_background.cpp @@ -29,7 +29,7 @@ pix_background :: pix_background(int argc, t_atom*argv) : m_savedImage.xsize=320; m_savedImage.ysize=240; - m_savedImage.setCsizeByFormat(GEM_RGBA); + m_savedImage.setFormat(GEM_RGBA); m_savedImage.reallocate(); switch(argc) { case 4: @@ -73,7 +73,7 @@ void pix_background :: processRGBAImage(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if (m_reset) { @@ -122,7 +122,7 @@ void pix_background :: processGrayImage(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if (m_reset) { @@ -163,7 +163,7 @@ void pix_background :: processYUVImage(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if (m_reset) { @@ -217,7 +217,7 @@ void pix_background :: processRGBAMMX(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if (m_reset) { @@ -271,7 +271,7 @@ void pix_background :: processYUVMMX(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if (m_reset) { @@ -334,7 +334,7 @@ void pix_background :: processGrayMMX(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if (m_reset) { @@ -396,7 +396,7 @@ void pix_background :: processYUVAltivec(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if (m_reset) { diff --git a/src/Pixes/pix_backlight.cpp b/src/Pixes/pix_backlight.cpp index 4014fd828..089b8ec85 100644 --- a/src/Pixes/pix_backlight.cpp +++ b/src/Pixes/pix_backlight.cpp @@ -83,7 +83,7 @@ void pix_backlight :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = (U32*)myImage.data; @@ -294,7 +294,7 @@ void pix_backlight :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = (U32*)myImage.data; diff --git a/src/Pixes/pix_biquad.cpp b/src/Pixes/pix_biquad.cpp index 6e2527c0b..0caa1b893 100644 --- a/src/Pixes/pix_biquad.cpp +++ b/src/Pixes/pix_biquad.cpp @@ -45,13 +45,13 @@ pix_biquad :: pix_biquad(int argc, t_atom*argv) : { prev.xsize = 64; prev.ysize = 64; - prev.setCsizeByFormat(GEM_RGBA); + prev.setFormat(GEM_RGBA); prev.reallocate(); prev.setBlack(); last.xsize = 64; last.ysize = 64; - last.setCsizeByFormat(GEM_RGBA); + last.setFormat(GEM_RGBA); last.reallocate(); last.setBlack(); @@ -80,11 +80,11 @@ void pix_biquad :: processRGBAImage(imageStruct &image) || image.csize!=prev.csize); prev.xsize = image.xsize; prev.ysize = image.ysize; - prev.setCsizeByFormat(image.format); + prev.setFormat(image.format); prev.reallocate(); last.xsize = image.xsize; last.ysize = image.ysize; - last.setCsizeByFormat(image.format); + last.setFormat(image.format); last.reallocate(); if (set) { @@ -153,11 +153,11 @@ void pix_biquad :: processYUVImage(imageStruct &image) || image.csize!=prev.csize); prev.xsize = image.xsize; prev.ysize = image.ysize; - prev.setCsizeByFormat(image.format); + prev.setFormat(image.format); prev.reallocate(); last.xsize = image.xsize; last.ysize = image.ysize; - last.setCsizeByFormat(image.format); + last.setFormat(image.format); last.reallocate(); if (set) { @@ -231,11 +231,11 @@ void pix_biquad :: processRGBAMMX(imageStruct &image) || image.csize!=prev.csize); prev.xsize = image.xsize; prev.ysize = image.ysize; - prev.setCsizeByFormat(image.format); + prev.setFormat(image.format); prev.reallocate(); last.xsize = image.xsize; last.ysize = image.ysize; - last.setCsizeByFormat(image.format); + last.setFormat(image.format); last.reallocate(); if (set) { @@ -378,11 +378,11 @@ void pix_biquad :: processYUVAltivec(imageStruct &image) || image.csize!=prev.csize); prev.xsize = image.xsize; prev.ysize = image.ysize; - prev.setCsizeByFormat(image.format); + prev.setFormat(image.format); prev.reallocate(); last.xsize = image.xsize; last.ysize = image.ysize; - last.setCsizeByFormat(image.format); + last.setFormat(image.format); last.reallocate(); if (set) { diff --git a/src/Pixes/pix_buffer.cpp b/src/Pixes/pix_buffer.cpp index a36c74c4b..79207388a 100644 --- a/src/Pixes/pix_buffer.cpp +++ b/src/Pixes/pix_buffer.cpp @@ -167,7 +167,7 @@ void pix_buffer :: allocateMess(unsigned int x, unsigned int y, while(i--) { m_buffer[i].xsize=x; m_buffer[i].ysize=y; - m_buffer[i].setCsizeByFormat(format); + m_buffer[i].setFormat(format); m_buffer[i].reallocate(); m_buffer[i].setBlack(); } diff --git a/src/Pixes/pix_colorreduce.cpp b/src/Pixes/pix_colorreduce.cpp index ae1e2cbd9..12888acee 100644 --- a/src/Pixes/pix_colorreduce.cpp +++ b/src/Pixes/pix_colorreduce.cpp @@ -52,7 +52,7 @@ pix_colorreduce :: pix_colorreduce(t_floatarg fcount) : tempImage.xsize=0; tempImage.ysize=0; - tempImage.setCsizeByFormat(GEM_RGBA); + tempImage.setFormat(GEM_RGBA); } ///////////////////////////////////////////////////////// @@ -108,7 +108,7 @@ void pix_colorreduce :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = reinterpret_cast(myImage.data); diff --git a/src/Pixes/pix_convert.cpp b/src/Pixes/pix_convert.cpp index d1c32f4ce..ec3d02714 100644 --- a/src/Pixes/pix_convert.cpp +++ b/src/Pixes/pix_convert.cpp @@ -34,7 +34,7 @@ pix_convert :: pix_convert(t_symbol*s) m_image.xsize=128; m_image.ysize=128; int fmt = getPixFormat(s->s_name); - m_image.setCsizeByFormat(fmt?fmt:GEM_RGBA); + m_image.setFormat(fmt?fmt:GEM_RGBA); m_image.reallocate(); } @@ -56,7 +56,7 @@ void pix_convert :: processImage(imageStruct &image) if (image.format==m_image.format) { return; } - m_image.setCsizeByFormat(); + m_image.setFormat(); if(!m_image.convertFrom(&image)) { post("no method for this format !!!"); post("if you know how to convert this format (0x%X) to (0x%X),\n" @@ -66,7 +66,7 @@ void pix_convert :: processImage(imageStruct &image) } image.data = m_image.data; image.not_owned = true; - image.setCsizeByFormat(m_image.format); + image.setFormat(m_image.format); } @@ -82,7 +82,7 @@ void pix_convert :: colorMess(t_symbol*s) { int fo = getPixFormat(s->s_name); if(fo) { - m_image.setCsizeByFormat(fo); + m_image.setFormat(fo); } setPixModified(); } diff --git a/src/Pixes/pix_deinterlace.cpp b/src/Pixes/pix_deinterlace.cpp index da5c80592..dc179fceb 100644 --- a/src/Pixes/pix_deinterlace.cpp +++ b/src/Pixes/pix_deinterlace.cpp @@ -25,7 +25,7 @@ pix_deinterlace :: pix_deinterlace() : { m_savedImage.xsize=320; m_savedImage.ysize=240; - m_savedImage.setCsizeByFormat(GEM_RGBA); + m_savedImage.setFormat(GEM_RGBA); m_savedImage.reallocate(); m_savedImage.setBlack(); } @@ -49,7 +49,7 @@ void pix_deinterlace :: processRGBAImage(imageStruct &image) || (m_savedImage.ysize != image.ysize)) { m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); } // if(saved!=m_savedImage.data)m_savedImage.setBlack();saved=m_savedImage.data; diff --git a/src/Pixes/pix_delay.cpp b/src/Pixes/pix_delay.cpp index 6eedaf9e8..c7d99641c 100644 --- a/src/Pixes/pix_delay.cpp +++ b/src/Pixes/pix_delay.cpp @@ -75,7 +75,7 @@ void pix_delay :: processImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); dest = myImage.data+m_curframe*dataSize; diff --git a/src/Pixes/pix_dot.cpp b/src/Pixes/pix_dot.cpp index 5a298dd17..928977a15 100644 --- a/src/Pixes/pix_dot.cpp +++ b/src/Pixes/pix_dot.cpp @@ -370,7 +370,7 @@ void pix_dot :: processRGBAImage(imageStruct &image) } myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); if(!alreadyInit) { @@ -435,7 +435,7 @@ void pix_dot :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); if(!alreadyInit) { @@ -502,7 +502,7 @@ void pix_dot :: processGrayImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); if(!alreadyInit) { diff --git a/src/Pixes/pix_freeframe.cpp b/src/Pixes/pix_freeframe.cpp index 184ce5b58..3ef5dd19f 100644 --- a/src/Pixes/pix_freeframe.cpp +++ b/src/Pixes/pix_freeframe.cpp @@ -917,7 +917,7 @@ pix_freeframe :: pix_freeframe(t_symbol*s) const char *pluginname = s->s_name; m_plugin = new FFPlugin(pluginname, getCanvas()); - m_image.setCsizeByFormat(m_plugin->GLformat()); + m_image.setFormat(m_plugin->GLformat()); unsigned int numparams = m_plugin->getNumParameters(); char tempVt[5]; @@ -1010,7 +1010,7 @@ void pix_freeframe :: processImage(imageStruct &image) } // convert the current image into a format that suits the FreeFrame-plugin - m_image.setCsizeByFormat(); + m_image.setFormat(); if(image.format != m_image.format) { if(m_image.convertFrom(&image)) { m_plugin->processFrame(m_image); diff --git a/src/Pixes/pix_frei0r.cpp b/src/Pixes/pix_frei0r.cpp index c4baec325..746d4c945 100644 --- a/src/Pixes/pix_frei0r.cpp +++ b/src/Pixes/pix_frei0r.cpp @@ -440,8 +440,8 @@ pix_frei0r :: pix_frei0r(t_symbol*s) { // throw(GemException("Gem has been compiled without Frei0r-support!")); int can_rgba=0; - m_image.setCsizeByFormat(GEM_RGBA); - m_converterImage.setCsizeByFormat(GEM_RGBA); + m_image.setFormat(GEM_RGBA); + m_converterImage.setFormat(GEM_RGBA); if(!s || s==&s_) { m_canopen=true; @@ -592,7 +592,7 @@ void pix_frei0r :: processRGBAImage(imageStruct &image) swapBytes(image); } image.not_owned = true; - image.setCsizeByFormat(m_image.format); + image.setFormat(m_image.format); } void pix_frei0r :: parmMess(const std::string&key, int argc, t_atom *argv) diff --git a/src/Pixes/pix_grey.cpp b/src/Pixes/pix_grey.cpp index 70e399246..eda784cad 100644 --- a/src/Pixes/pix_grey.cpp +++ b/src/Pixes/pix_grey.cpp @@ -31,7 +31,7 @@ CPPEXTERN_NEW(pix_grey); ///////////////////////////////////////////////////////// pix_grey :: pix_grey() { - m_image.setCsizeByFormat(GEM_GRAY); + m_image.setFormat(GEM_GRAY); } ///////////////////////////////////////////////////////// diff --git a/src/Pixes/pix_halftone.cpp b/src/Pixes/pix_halftone.cpp index 4f7e5584e..a13186238 100644 --- a/src/Pixes/pix_halftone.cpp +++ b/src/Pixes/pix_halftone.cpp @@ -67,7 +67,7 @@ void pix_halftone :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); U32*pOutput = reinterpret_cast(myImage.data); @@ -254,7 +254,7 @@ void pix_halftone :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); U32*pOutput = reinterpret_cast(myImage.data); @@ -460,7 +460,7 @@ void pix_halftone :: processGrayImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); unsigned char* pOutput = myImage.data; diff --git a/src/Pixes/pix_kaleidoscope.cpp b/src/Pixes/pix_kaleidoscope.cpp index 7c2209e5f..c18eeb38f 100644 --- a/src/Pixes/pix_kaleidoscope.cpp +++ b/src/Pixes/pix_kaleidoscope.cpp @@ -119,7 +119,7 @@ void pix_kaleidoscope :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = reinterpret_cast(myImage.data); @@ -574,7 +574,7 @@ void pix_kaleidoscope :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = reinterpret_cast(myImage.data); @@ -1026,7 +1026,7 @@ void pix_kaleidoscope :: processGrayImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); unsigned char*pOutputP=myImage.data; pOutput = reinterpret_cast(pOutputP); diff --git a/src/Pixes/pix_levels.cpp b/src/Pixes/pix_levels.cpp index ac90d673e..bf7f92a66 100644 --- a/src/Pixes/pix_levels.cpp +++ b/src/Pixes/pix_levels.cpp @@ -95,7 +95,7 @@ void pix_levels :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = reinterpret_cast(myImage.data); @@ -121,7 +121,7 @@ void pix_levels :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = reinterpret_cast(myImage.data); diff --git a/src/Pixes/pix_lumaoffset.cpp b/src/Pixes/pix_lumaoffset.cpp index a311f58c7..ee8fc7e9e 100644 --- a/src/Pixes/pix_lumaoffset.cpp +++ b/src/Pixes/pix_lumaoffset.cpp @@ -63,7 +63,7 @@ void pix_lumaoffset :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); U32*pOutput = reinterpret_cast(myImage.data); @@ -269,7 +269,7 @@ void pix_lumaoffset :: processGrayImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); U8* pOutput = static_cast(myImage.data); @@ -448,7 +448,7 @@ void pix_lumaoffset :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); myImage.setBlack(); U32*pOutput = reinterpret_cast(myImage.data); diff --git a/src/Pixes/pix_metaimage.cpp b/src/Pixes/pix_metaimage.cpp index a2648e865..bee9ddbed 100644 --- a/src/Pixes/pix_metaimage.cpp +++ b/src/Pixes/pix_metaimage.cpp @@ -64,7 +64,7 @@ void pix_metaimage :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = reinterpret_cast(myImage.data); @@ -116,7 +116,7 @@ void pix_metaimage :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); // myImage.setBlack(); pOutput = reinterpret_cast(myImage.data); @@ -168,7 +168,7 @@ void pix_metaimage :: processGrayImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); // myImage.setBlack(); pOutput = reinterpret_cast(myImage.data); diff --git a/src/Pixes/pix_motionblur.cpp b/src/Pixes/pix_motionblur.cpp index da0644bc2..dcbf1a2f2 100644 --- a/src/Pixes/pix_motionblur.cpp +++ b/src/Pixes/pix_motionblur.cpp @@ -33,7 +33,7 @@ pix_motionblur :: pix_motionblur(int argc, t_atom*argv) : m_savedImage.xsize=320; m_savedImage.ysize=240; - m_savedImage.setCsizeByFormat(GEM_RGBA); + m_savedImage.setFormat(GEM_RGBA); m_savedImage.reallocate(); m_savedImage.setBlack(); if(argc) { @@ -63,7 +63,7 @@ void pix_motionblur :: processRGBAImage(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if(saved!=m_savedImage.data) { m_savedImage.setBlack(); @@ -116,7 +116,7 @@ void pix_motionblur :: processGrayImage(imageStruct &image) unsigned char *saved = m_savedImage.data; m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if(saved!=m_savedImage.data) { m_savedImage.setBlack(); @@ -155,7 +155,7 @@ void pix_motionblur :: processYUVImage(imageStruct &image) m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if(saved!=m_savedImage.data) { m_savedImage.setBlack(); @@ -256,7 +256,7 @@ void pix_motionblur :: processMMX(imageStruct &image) { m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); int pixsize=image.ysize*image.xsize*image.csize; @@ -318,7 +318,7 @@ void pix_motionblur :: processYUVAltivec(imageStruct &image) unsigned char *saved = m_savedImage.data; m_savedImage.xsize=image.xsize; m_savedImage.ysize=image.ysize; - m_savedImage.setCsizeByFormat(image.format); + m_savedImage.setFormat(image.format); m_savedImage.reallocate(); if(saved!=m_savedImage.data) { m_savedImage.setBlack(); diff --git a/src/Pixes/pix_movement.cpp b/src/Pixes/pix_movement.cpp index 558b2ab30..8843e303e 100644 --- a/src/Pixes/pix_movement.cpp +++ b/src/Pixes/pix_movement.cpp @@ -40,10 +40,10 @@ CPPEXTERN_NEW_WITH_ONE_ARG(pix_movement,t_floatarg, A_DEFFLOAT); pix_movement :: pix_movement(t_floatarg f) { buffer.xsize = buffer.ysize = 64; - buffer.setCsizeByFormat(GEM_GRAY); + buffer.setFormat(GEM_GRAY); buffer.reallocate(); buffer2.xsize = buffer2.ysize = 64; - buffer2.setCsizeByFormat(GEM_GRAY); + buffer2.setFormat(GEM_GRAY); buffer2.reallocate(); if(f<=0.) { diff --git a/src/Pixes/pix_movement2.cpp b/src/Pixes/pix_movement2.cpp index 7e1c74933..c8962c99e 100644 --- a/src/Pixes/pix_movement2.cpp +++ b/src/Pixes/pix_movement2.cpp @@ -34,22 +34,22 @@ pix_movement2 :: pix_movement2(t_float lothresh, t_float hithresh): while(i--) { m_frame[i].xsize=0; m_frame[i].ysize=0; - m_frame[i].setCsizeByFormat(GEM_GRAY); + m_frame[i].setFormat(GEM_GRAY); m_frame[i].reallocate(); } m_output.xsize=0; m_output.ysize=0; - m_output.setCsizeByFormat(GEM_GRAY); + m_output.setFormat(GEM_GRAY); m_output.reallocate(); m_background.xsize=0; m_background.ysize=0; - m_background.setCsizeByFormat(GEM_GRAY); + m_background.setFormat(GEM_GRAY); m_background.reallocate(); m_threshold.xsize=0; m_threshold.ysize=0; - m_threshold.setCsizeByFormat(GEM_GRAY); + m_threshold.setFormat(GEM_GRAY); m_threshold.reallocate(); m_lowthresh=CLAMP(255.f*MIN(lothresh, hithresh)); @@ -125,7 +125,7 @@ void pix_movement2 :: processImage(imageStruct &image) } // 1. store the current frame as gray-image in the appropriate buffer - m_frame[m_frameIndex].setCsizeByFormat(); + m_frame[m_frameIndex].setFormat(); if(!m_frame[m_frameIndex].convertFrom(&image)) { error("no method for this kind of color"); return; diff --git a/src/Pixes/pix_multiblob.cpp b/src/Pixes/pix_multiblob.cpp index ae15c166d..aa0ab831a 100644 --- a/src/Pixes/pix_multiblob.cpp +++ b/src/Pixes/pix_multiblob.cpp @@ -121,7 +121,7 @@ pix_multiblob :: pix_multiblob(t_floatarg f) : // initialize image m_image.xsize=320; m_image.ysize=240; - m_image.setCsizeByFormat(GEM_GRAY); + m_image.setFormat(GEM_GRAY); m_image.allocate(); // outlets @@ -323,7 +323,7 @@ void pix_multiblob :: processImage(imageStruct &image) { // store the image in greyscale // since the algorithm is destructive we do it in a sandbox... - m_image.setCsizeByFormat(); + m_image.setFormat(); m_image.convertFrom(&image); doProcessing(); } diff --git a/src/Pixes/pix_noise.cpp b/src/Pixes/pix_noise.cpp index 8965eab30..ede305024 100644 --- a/src/Pixes/pix_noise.cpp +++ b/src/Pixes/pix_noise.cpp @@ -57,7 +57,7 @@ pix_noise :: pix_noise(t_floatarg xsize, t_floatarg ysize) : // m_pixBlock.image = m_imageStruct; m_pixBlock.image.xsize = (int)xsize; m_pixBlock.image.ysize = (int)ysize; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.allocate(); generateNoise(); @@ -241,7 +241,7 @@ void pix_noise :: SETMess(int xsize, int ysize) m_pixBlock.image.clear(); m_pixBlock.image.xsize = (int)xsize; m_pixBlock.image.ysize = (int)ysize; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); generateNoise(); diff --git a/src/Pixes/pix_puzzle.cpp b/src/Pixes/pix_puzzle.cpp index 281592f20..fe56175ba 100644 --- a/src/Pixes/pix_puzzle.cpp +++ b/src/Pixes/pix_puzzle.cpp @@ -44,7 +44,7 @@ pix_puzzle :: pix_puzzle() : m_game(false) { myImage.xsize=myImage.ysize=512; - myImage.setCsizeByFormat(GEM_RGBA); + myImage.setFormat(GEM_RGBA); myImage.allocate(); } @@ -214,7 +214,7 @@ void pix_puzzle :: processImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); @@ -224,7 +224,7 @@ void pix_puzzle :: processImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); dest = myImage.data; @@ -296,7 +296,7 @@ void pix_puzzle :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); makePuzzleBlocks(image.xsize, image.ysize, image.csize); @@ -305,7 +305,7 @@ void pix_puzzle :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); dest = myImage.data; diff --git a/src/Pixes/pix_rds.cpp b/src/Pixes/pix_rds.cpp index 76d37356e..18b498ef8 100644 --- a/src/Pixes/pix_rds.cpp +++ b/src/Pixes/pix_rds.cpp @@ -39,7 +39,7 @@ pix_rds :: pix_rds(t_floatarg f) : static int count = 0; fastrand_val=count++; myImage.xsize=myImage.ysize=512; - myImage.setCsizeByFormat(GEM_RGBA); + myImage.setFormat(GEM_RGBA); myImage.allocate(); inlet_new(this->x_obj, &this->x_obj->ob_pd, gensym("float"), @@ -71,7 +71,7 @@ void pix_rds :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.upsidedown = image.upsidedown; myImage.reallocate(); @@ -180,7 +180,7 @@ void pix_rds :: processGrayImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(GEM_GRAY); + myImage.setFormat(GEM_GRAY); myImage.upsidedown = image.upsidedown; myImage.reallocate(); @@ -291,7 +291,7 @@ void pix_rds :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(GEM_GRAY); + myImage.setFormat(GEM_GRAY); myImage.upsidedown = image.upsidedown; myImage.reallocate(); diff --git a/src/Pixes/pix_refraction.cpp b/src/Pixes/pix_refraction.cpp index 7813abcfb..e4fb00ac5 100644 --- a/src/Pixes/pix_refraction.cpp +++ b/src/Pixes/pix_refraction.cpp @@ -60,7 +60,7 @@ void pix_refraction :: processRGBAImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = (U32*)myImage.data; @@ -148,7 +148,7 @@ void pix_refraction :: processYUVImage(imageStruct &image) myImage.xsize = image.xsize; myImage.ysize = image.ysize; - myImage.setCsizeByFormat(image.format); + myImage.setFormat(image.format); myImage.reallocate(); pOutput = (U32*)myImage.data; diff --git a/src/Pixes/pix_resize.cpp b/src/Pixes/pix_resize.cpp index 1a4c272b5..fe6fcab33 100644 --- a/src/Pixes/pix_resize.cpp +++ b/src/Pixes/pix_resize.cpp @@ -58,7 +58,7 @@ void pix_resize :: processImage(imageStruct &image) if (wN != image.xsize || hN != image.ysize) { m_image.xsize=wN; m_image.ysize=hN; - m_image.setCsizeByFormat(image.format); + m_image.setFormat(image.format); m_image.reallocate(); // just for safety: it seems like gluScaleImage needs more memory then just the x*y*c diff --git a/src/Pixes/pix_rgba.cpp b/src/Pixes/pix_rgba.cpp index 6be0a4bf4..1237d8a34 100644 --- a/src/Pixes/pix_rgba.cpp +++ b/src/Pixes/pix_rgba.cpp @@ -31,7 +31,7 @@ CPPEXTERN_NEW(pix_rgba); ///////////////////////////////////////////////////////// pix_rgba :: pix_rgba() { - m_image.setCsizeByFormat(GEM_RGBA); + m_image.setFormat(GEM_RGBA); } ///////////////////////////////////////////////////////// @@ -50,7 +50,7 @@ void pix_rgba :: processImage(imageStruct &image) // note: [pix_yuv] and [pix_grey] inherit this function from [pix_rgba] // thus you shouldn't undefine anything below for performance reasons - m_image.setCsizeByFormat(); + m_image.setFormat(); if (image.format==m_image.format) { return; // we don't need to convert as we are already there } @@ -64,7 +64,7 @@ void pix_rgba :: processImage(imageStruct &image) image.data = m_image.data; image.not_owned = true; - image.setCsizeByFormat(m_image.format); + image.setFormat(m_image.format); } ///////////////////////////////////////////////////////// diff --git a/src/Pixes/pix_rtx.cpp b/src/Pixes/pix_rtx.cpp index 8cff528f3..26091abae 100644 --- a/src/Pixes/pix_rtx.cpp +++ b/src/Pixes/pix_rtx.cpp @@ -55,7 +55,7 @@ bool refresh_buffer(const imageStruct&reference, imageStruct&buffer) buffer.xsize = reference.xsize; buffer.ysize = reference.ysize; - buffer.setCsizeByFormat(reference.format); + buffer.setFormat(reference.format); if(data!=buffer.reallocate( dataSize ) || refresh) { buffer.setBlack(); @@ -80,7 +80,7 @@ pix_rtx :: pix_rtx() imageStruct image; image.xsize = image.ysize = 64; - image.setCsizeByFormat(GEM_RGBA); + image.setFormat(GEM_RGBA); refresh_buffer(image, buffer); diff --git a/src/Pixes/pix_set.cpp b/src/Pixes/pix_set.cpp index 9ba932ec0..48b285e91 100644 --- a/src/Pixes/pix_set.cpp +++ b/src/Pixes/pix_set.cpp @@ -269,7 +269,7 @@ void pix_set :: SETMess(int xsize, int ysize) m_pixBlock.image.clear(); m_pixBlock.image.xsize = (int)xsize; m_pixBlock.image.ysize = (int)ysize; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); m_pixBlock.image.setBlack(); } diff --git a/src/Pixes/pix_share_read.cpp b/src/Pixes/pix_share_read.cpp index a8055be85..14ae66734 100644 --- a/src/Pixes/pix_share_read.cpp +++ b/src/Pixes/pix_share_read.cpp @@ -37,7 +37,7 @@ void pix_share_read :: render(GemState *state) if (shm_addr) { t_pixshare_header *h=(t_pixshare_header *)shm_addr; unsigned char* data=shm_addr+sizeof(t_pixshare_header); - int csize=pix.image.setCsizeByFormat(h->format); + int csize=pix.image.setFormat(h->format); int imgsize=csize*h->xsize*h->ysize; if(imgsize) { pix.image.xsize=h->xsize; diff --git a/src/Pixes/pix_share_write.cpp b/src/Pixes/pix_share_write.cpp index d689c0ce8..278adafb0 100644 --- a/src/Pixes/pix_share_write.cpp +++ b/src/Pixes/pix_share_write.cpp @@ -270,7 +270,7 @@ int pix_share_write :: getShm(int argc,t_atom*argv) } imageStruct dummy; - dummy.setCsizeByFormat(color); + dummy.setFormat(color); m_size = (size)?(size):(xsize * ysize * dummy.csize); diff --git a/src/Pixes/pix_sig2pix~.cpp b/src/Pixes/pix_sig2pix~.cpp index de3a9f130..a6fce555b 100644 --- a/src/Pixes/pix_sig2pix~.cpp +++ b/src/Pixes/pix_sig2pix~.cpp @@ -77,10 +77,10 @@ void pix_sig2pix :: dimenMess(int width, int height) m_pixBlock.image.xsize =(GLint) width; m_pixBlock.image.ysize =(GLint) height; - m_pixBlock.image.setCsizeByFormat(m_reqFormat); + m_pixBlock.image.setFormat(m_reqFormat); if(m_reqType) { if(GEM_RGBA == m_reqFormat) - m_pixBlock.image.setCsizeByFormat(GL_RGBA); + m_pixBlock.image.setFormat(GL_RGBA); m_pixBlock.image.type = m_reqType; } diff --git a/src/Pixes/pix_snap.cpp b/src/Pixes/pix_snap.cpp index bef1a3a5b..4e752c8cb 100644 --- a/src/Pixes/pix_snap.cpp +++ b/src/Pixes/pix_snap.cpp @@ -137,7 +137,7 @@ void pix_snap :: snapMess(void) m_originalImage = new imageStruct; m_originalImage->xsize = m_width; m_originalImage->ysize = m_height; - m_originalImage->setCsizeByFormat(GEM_RGBA); + m_originalImage->setFormat(GEM_RGBA); if(m_reqType) m_originalImage->type = m_reqType; m_reqType = m_originalImage->type; diff --git a/src/Pixes/pix_tIIR.cpp b/src/Pixes/pix_tIIR.cpp index 61d519aa5..ddf3bd689 100644 --- a/src/Pixes/pix_tIIR.cpp +++ b/src/Pixes/pix_tIIR.cpp @@ -80,7 +80,7 @@ pix_tIIR :: pix_tIIR(t_floatarg fb_numf, t_floatarg ff_numf) : m_buffer.xsize=64; m_buffer.ysize=64; - m_buffer.setCsizeByFormat(GEM_RGBA); + m_buffer.setFormat(GEM_RGBA); m_buffer.allocate(m_buffer.xsize*m_buffer.ysize*m_buffer.csize*m_bufnum); } @@ -225,7 +225,7 @@ void pix_tIIR :: processRGBAMMX(imageStruct &image) || m_buffer.format!=image.format) { m_buffer.xsize=image.xsize; m_buffer.ysize=image.ysize; - m_buffer.setCsizeByFormat(image.format); + m_buffer.setFormat(image.format); set=true; set_zero=true; diff --git a/src/Pixes/pix_tIIRf.cpp b/src/Pixes/pix_tIIRf.cpp index e1eb02be4..57feabddb 100644 --- a/src/Pixes/pix_tIIRf.cpp +++ b/src/Pixes/pix_tIIRf.cpp @@ -73,7 +73,7 @@ pix_tIIRf :: pix_tIIRf(t_floatarg fb_numf, t_floatarg ff_numf) m_image.xsize=0; m_image.ysize=0; - m_image.setCsizeByFormat(GEM_RGBA); + m_image.setFormat(GEM_RGBA); } ///////////////////////////////////////////////////////// @@ -129,7 +129,7 @@ void pix_tIIRf ::allocate(imageStruct&img) m_image.xsize=img.xsize; m_image.ysize=img.ysize; - m_image.setCsizeByFormat(img.format); + m_image.setFormat(img.format); m_image.reallocate(); m_image.setBlack(); diff --git a/src/Pixes/pix_test.cpp b/src/Pixes/pix_test.cpp index b2dfea300..0a826db33 100644 --- a/src/Pixes/pix_test.cpp +++ b/src/Pixes/pix_test.cpp @@ -281,13 +281,13 @@ pix_test :: pix_test(int argc, t_atom*argv) break; } - m_pix.image.setCsizeByFormat(GEM_RGBA); + m_pix.image.setFormat(GEM_RGBA); m_pix.image.reallocate(); } pix_test :: pix_test() { m_pix.image.xsize=m_pix.image.ysize=128; - m_pix.image.setCsizeByFormat(GEM_RGBA); + m_pix.image.setFormat(GEM_RGBA); m_pix.image.reallocate(); } @@ -372,7 +372,7 @@ void pix_test :: csMess(std::string cs) cs.c_str()); return; } - m_pix.image.setCsizeByFormat(fmt); + m_pix.image.setFormat(fmt); dimenMess(m_pix.image.xsize, m_pix.image.ysize); } diff --git a/src/Pixes/pix_texture.cpp b/src/Pixes/pix_texture.cpp index 9d5adf598..7ed517c71 100644 --- a/src/Pixes/pix_texture.cpp +++ b/src/Pixes/pix_texture.cpp @@ -430,7 +430,7 @@ void pix_texture :: render(GemState *state) //(skip Alpha since it isn't used) const bool do_yuv = m_yuv && GLEW_APPLE_ycbcr_422; if (!do_yuv && m_imagebuf.format == GEM_YUV) { - m_imagebuf.setCsizeByFormat(GL_RGB); + m_imagebuf.setFormat(GL_RGB); m_imagebuf.reallocate(); if(img) { m_imagebuf.fromYUV422(img->image.data); diff --git a/src/Pixes/pix_write.cpp b/src/Pixes/pix_write.cpp index 2a7f37e53..4d6679cc1 100644 --- a/src/Pixes/pix_write.cpp +++ b/src/Pixes/pix_write.cpp @@ -84,7 +84,7 @@ pix_write :: pix_write(int argc, t_atom *argv) m_originalImage = new imageStruct(); m_originalImage->xsize=m_width; m_originalImage->ysize=m_height; - m_originalImage->setCsizeByFormat(m_color); + m_originalImage->setFormat(m_color); m_originalImage->allocate(); } @@ -130,9 +130,9 @@ void pix_write :: doWrite(void) m_originalImage->ysize = height; #ifndef __APPLE__ - m_originalImage->setCsizeByFormat(m_color); + m_originalImage->setFormat(m_color); #else - m_originalImage->setCsizeByFormat(GEM_RGBA); + m_originalImage->setFormat(GEM_RGBA); #endif /* APPLE */ m_originalImage->reallocate(); diff --git a/src/Pixes/pix_yuv.cpp b/src/Pixes/pix_yuv.cpp index 538d9e152..6c1bf85c2 100644 --- a/src/Pixes/pix_yuv.cpp +++ b/src/Pixes/pix_yuv.cpp @@ -31,7 +31,7 @@ CPPEXTERN_NEW(pix_yuv); ///////////////////////////////////////////////////////// pix_yuv :: pix_yuv() { - m_image.setCsizeByFormat(GEM_YUV); + m_image.setFormat(GEM_YUV); } ///////////////////////////////////////////////////////// From bc332c9396aa72982ce96272e3acdba02317eecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 14:58:38 +0100 Subject: [PATCH 013/387] plugins: replace imageStruct::setCsizeByFormat() with imageStruct::setFormat() --- plugins/AVI/filmAVI.cpp | 4 ++-- plugins/AVIPLAY/filmAVIPLAY.cpp | 4 ++-- plugins/AVT/videoAVT.cpp | 2 +- plugins/DC1394/videoDC1394.cpp | 4 ++-- plugins/DECKLINK/recordDECKLINK.cpp | 2 +- plugins/DECKLINK/videoDECKLINK.cpp | 4 ++-- plugins/DV4L/videoDV4L.cpp | 4 ++-- plugins/FFMPEG/filmFFMPEG.cpp | 4 ++-- plugins/GMERLIN/filmGMERLIN.cpp | 4 ++-- plugins/HALCON/videoHALCON.cpp | 2 +- plugins/JPEG/imageJPEG.cpp | 6 +++--- plugins/MPEG1/filmMPEG1.cpp | 2 +- plugins/MPEG3/filmMPEG3.cpp | 4 ++-- plugins/NDI/videoNDI.cpp | 2 +- plugins/OptiTrack/videoOptiTrack.cpp | 2 +- plugins/PIPEWIRE/recordPIPEWIRE.cpp | 4 ++-- plugins/PIPEWIRE/videoPIPEWIRE.cpp | 10 +++++----- plugins/PYLON/videoPYLON.cpp | 2 +- plugins/QT4L/filmQT4L.cpp | 6 +++--- plugins/QuickTime/filmQT.cpp | 4 ++-- plugins/QuickTime/imageQT.cpp | 6 +++--- plugins/SGI/imageSGI.cpp | 4 ++-- plugins/STB/imageSTB.cpp | 2 +- plugins/TEST/filmTEST.cpp | 2 +- plugins/TEST/videoTEST.cpp | 4 ++-- plugins/TIFF/imageTIFF.cpp | 8 ++++---- plugins/V4L/recordV4L.cpp | 6 +++--- plugins/V4L/videoV4L.cpp | 2 +- plugins/V4L2/recordV4L2.cpp | 6 +++--- plugins/V4L2/videoV4L2.cpp | 2 +- plugins/VFW/videoVFW.cpp | 4 ++-- plugins/VIDS/videoVIDS.cpp | 2 +- plugins/VLC/videoVLC.cpp | 2 +- plugins/VNC/videoVNC.cpp | 4 ++-- plugins/filmAVF/filmAVF.mm | 4 ++-- plugins/filmDS/filmDS.cpp | 4 ++-- plugins/filmDSATL/filmDS.cpp | 2 +- plugins/filmDarwin/filmDarwin.cpp | 2 +- plugins/imageIO/imageIO.mm | 2 +- plugins/imageMAGICK/MagickCore.cpp | 2 +- plugins/imageMAGICK/MagickPlusPlus.cpp | 2 +- plugins/videoAVF/AVFVideoGrabber.mm | 2 +- plugins/videoDS/videoDS.cpp | 8 ++++---- plugins/videoDarwin/videoDarwin.cpp | 6 +++--- 44 files changed, 82 insertions(+), 82 deletions(-) diff --git a/plugins/AVI/filmAVI.cpp b/plugins/AVI/filmAVI.cpp index d2b754861..9234bd08e 100644 --- a/plugins/AVI/filmAVI.cpp +++ b/plugins/AVI/filmAVI.cpp @@ -184,7 +184,7 @@ bool filmAVI :: open(const std::string&filename, m_image.image.xsize = streaminfo.rcFrame.right - streaminfo.rcFrame.left; m_image.image.ysize = streaminfo.rcFrame.bottom - streaminfo.rcFrame.top; - m_image.image.setCsizeByFormat(m_wantedFormat); + m_image.image.setFormat(m_wantedFormat); m_image.image.reallocate(); if (!(m_hic = ICLocate(ICTYPE_VIDEO, 0, m_pbmihRaw, m_pbmihDst, @@ -239,7 +239,7 @@ pixBlock* filmAVI :: getFrame(void) m_image.newimage=1; m_image.image.upsidedown=false; - m_image.image.setCsizeByFormat(m_wantedFormat); + m_image.image.setFormat(m_wantedFormat); m_image.image.reallocate(); if (!AVIStreamRead(m_streamVid, diff --git a/plugins/AVIPLAY/filmAVIPLAY.cpp b/plugins/AVIPLAY/filmAVIPLAY.cpp index 3c5f5d61e..b51d9f6b1 100644 --- a/plugins/AVIPLAY/filmAVIPLAY.cpp +++ b/plugins/AVIPLAY/filmAVIPLAY.cpp @@ -135,7 +135,7 @@ bool filmAVIPLAY :: open(const std::string&filename, m_image.image.ysize = l_info->GetVideoHeight(); m_fps= l_info->GetFps(); } - m_image.image.setCsizeByFormat(m_wantedFormat); + m_image.image.setFormat(m_wantedFormat); if (!(m_image.image.xsize*m_image.image.ysize*m_image.image.csize)) { goto unsupported; } @@ -172,7 +172,7 @@ pixBlock* filmAVIPLAY :: getFrame() if (m_aviimage) { int format = m_aviimage->Format(); m_rawdata=m_aviimage->Data(); - m_image.image.setCsizeByFormat(m_wantedFormat); + m_image.image.setFormat(m_wantedFormat); switch(format) { case IMG_FMT_RGB24: m_image.image.fromRGB (m_rawdata); diff --git a/plugins/AVT/videoAVT.cpp b/plugins/AVT/videoAVT.cpp index d751086c6..701af8c0b 100644 --- a/plugins/AVT/videoAVT.cpp +++ b/plugins/AVT/videoAVT.cpp @@ -140,7 +140,7 @@ void videoAVT::grabbedFrame(const tPvFrame&pFrame) lock(); m_image.image.xsize=pFrame.Width; m_image.image.ysize=pFrame.Height; - m_image.image.setCsizeByFormat(GEM_RGBA); + m_image.image.setFormat(GEM_RGBA); m_image.image.reallocate(); switch(pFrame.Format) { diff --git a/plugins/DC1394/videoDC1394.cpp b/plugins/DC1394/videoDC1394.cpp index f81ef36ca..6811c5222 100644 --- a/plugins/DC1394/videoDC1394.cpp +++ b/plugins/DC1394/videoDC1394.cpp @@ -48,7 +48,7 @@ videoDC1394 :: videoDC1394() : videoBase("dc1394"), m_frame.xsize=1600; m_frame.ysize=1200; - m_frame.setCsizeByFormat(GEM_RGBA); + m_frame.setFormat(GEM_RGBA); m_frame.allocate(); provide("iidc"); @@ -92,7 +92,7 @@ bool videoDC1394 :: grabFrame() m_frame.xsize=frame->size[0]; m_frame.ysize=frame->size[1]; - m_frame.setCsizeByFormat(GEM_RGBA); + m_frame.setFormat(GEM_RGBA); m_frame.fromRGB(colframe->image); lock(); diff --git a/plugins/DECKLINK/recordDECKLINK.cpp b/plugins/DECKLINK/recordDECKLINK.cpp index 7a986df3e..0c0c27f41 100644 --- a/plugins/DECKLINK/recordDECKLINK.cpp +++ b/plugins/DECKLINK/recordDECKLINK.cpp @@ -243,7 +243,7 @@ recordDECKLINK :: recordDECKLINK(void) m_pixBlock.image.xsize = 1920; m_pixBlock.image.ysize = 1080; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); m_pixBlock.image.xsize = -1; m_pixBlock.image.ysize = -1; diff --git a/plugins/DECKLINK/videoDECKLINK.cpp b/plugins/DECKLINK/videoDECKLINK.cpp index b1bc30134..964d66de6 100644 --- a/plugins/DECKLINK/videoDECKLINK.cpp +++ b/plugins/DECKLINK/videoDECKLINK.cpp @@ -267,7 +267,7 @@ videoDECKLINK::videoDECKLINK(void) m_pixBlock.image.xsize = 1920; m_pixBlock.image.ysize = 1080; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); m_pixBlock.image.xsize = -1; m_pixBlock.image.ysize = -1; @@ -462,7 +462,7 @@ void videoDECKLINK::setFrame(unsigned int w, unsigned int h, unsigned int format m_mutex.lock(); m_pixBlock.image.xsize=w; m_pixBlock.image.ysize=h; - m_pixBlock.image.setCsizeByFormat(format); + m_pixBlock.image.setFormat(format); m_pixBlock.image.reallocate(); m_pixBlock.image.fromUYVY(data); diff --git a/plugins/DV4L/videoDV4L.cpp b/plugins/DV4L/videoDV4L.cpp index 0f05b07f9..042c92ccc 100644 --- a/plugins/DV4L/videoDV4L.cpp +++ b/plugins/DV4L/videoDV4L.cpp @@ -270,7 +270,7 @@ bool videoDV4L :: startTransfer() m_image.image.data=0; m_image.image.xsize=720; m_image.image.ysize=576; - m_image.image.setCsizeByFormat(m_reqFormat); + m_image.image.setFormat(m_reqFormat); m_image.image.reallocate(); if(NULL==m_raw) { @@ -356,7 +356,7 @@ bool videoDV4L :: setColor(int format) } m_reqFormat=format; lock(); - m_image.image.setCsizeByFormat(m_reqFormat); + m_image.image.setFormat(m_reqFormat); unlock(); return true; } diff --git a/plugins/FFMPEG/filmFFMPEG.cpp b/plugins/FFMPEG/filmFFMPEG.cpp index 3d214f61d..d5c52bb7d 100644 --- a/plugins/FFMPEG/filmFFMPEG.cpp +++ b/plugins/FFMPEG/filmFFMPEG.cpp @@ -179,7 +179,7 @@ bool filmFFMPEG :: open(const std::string&sfilename, m_numFrames = m_avstream->nb_frames; m_image.image.xsize = m_avdecoder->width; m_image.image.ysize = m_avdecoder->height; - m_image.image.setCsizeByFormat(GEM_RGBA); + m_image.image.setFormat(GEM_RGBA); m_image.image.reallocate(); m_image.newfilm = true; @@ -269,7 +269,7 @@ void filmFFMPEG :: initConverter(const int width, const int height, const int fo ) { m_image.image.xsize = width; m_image.image.ysize = height; - m_image.image.setCsizeByFormat(gformat); + m_image.image.setFormat(gformat); m_image.image.reallocate(); m_image.newfilm = true; } diff --git a/plugins/GMERLIN/filmGMERLIN.cpp b/plugins/GMERLIN/filmGMERLIN.cpp index c1c775d5a..6461b4209 100644 --- a/plugins/GMERLIN/filmGMERLIN.cpp +++ b/plugins/GMERLIN/filmGMERLIN.cpp @@ -295,9 +295,9 @@ bool filmGMERLIN :: open(const std::string&sfilename, m_image.image.xsize=gformat->frame_width; m_image.image.ysize=gformat->frame_height; #ifdef __APPLE__ - m_image.image.setCsizeByFormat(GEM_YUV); + m_image.image.setFormat(GEM_YUV); #else - m_image.image.setCsizeByFormat(GEM_RGBA); + m_image.image.setFormat(GEM_RGBA); #endif m_image.image.not_owned=true; m_image.image.upsidedown=true; diff --git a/plugins/HALCON/videoHALCON.cpp b/plugins/HALCON/videoHALCON.cpp index 37b0f02ac..37aee4264 100644 --- a/plugins/HALCON/videoHALCON.cpp +++ b/plugins/HALCON/videoHALCON.cpp @@ -179,7 +179,7 @@ bool videoHALCON :: grabFrame() lock(); m_image.image.xsize=w; m_image.image.ysize=h; - m_image.image.setCsizeByFormat(GEM_RGBA); + m_image.image.setFormat(GEM_RGBA); m_image.image.reallocate(); long row, col; unsigned char*data=m_image.image.data; diff --git a/plugins/JPEG/imageJPEG.cpp b/plugins/JPEG/imageJPEG.cpp index e7211e6b7..ad6e36ddd 100644 --- a/plugins/JPEG/imageJPEG.cpp +++ b/plugins/JPEG/imageJPEG.cpp @@ -150,13 +150,13 @@ bool imageJPEG :: load(std::string filename, imageStruct&result, // do we have an RGB image? if (cinfo.jpeg_color_space == JCS_RGB) { - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); } else if (cinfo.jpeg_color_space == JCS_GRAYSCALE) { // do we have a gray8 image? - result.setCsizeByFormat(GEM_GRAY); + result.setFormat(GEM_GRAY); } else { // something else, so decompress as RGB - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); cinfo.out_color_space = JCS_RGB; } diff --git a/plugins/MPEG1/filmMPEG1.cpp b/plugins/MPEG1/filmMPEG1.cpp index 2fd3fdfd9..ec0ae2cf0 100644 --- a/plugins/MPEG1/filmMPEG1.cpp +++ b/plugins/MPEG1/filmMPEG1.cpp @@ -102,7 +102,7 @@ bool filmMPEG1 :: open(const std::string&filename, int format) goto unsupported; } - m_image.image.setCsizeByFormat(wantedFormat); + m_image.image.setFormat(wantedFormat); m_image.image.reallocate(); int length=m_image.image.xsize*m_image.image.ysize; diff --git a/plugins/MPEG3/filmMPEG3.cpp b/plugins/MPEG3/filmMPEG3.cpp index ed29b8067..f45b858f9 100644 --- a/plugins/MPEG3/filmMPEG3.cpp +++ b/plugins/MPEG3/filmMPEG3.cpp @@ -114,7 +114,7 @@ bool filmMPEG3 :: open(const std::string&filename, } double d; if(wantProps.get("colorspace", d)) { - m_image.image.setCsizeByFormat((int)d); + m_image.image.setFormat((int)d); m_wantedFormat=m_image.image.format; } m_image.image.reallocate(); @@ -144,7 +144,7 @@ pixBlock* filmMPEG3 :: getFrame(void) char*u=NULL,*y=NULL,*v=NULL; - m_image.image.setCsizeByFormat(wantedFormat); + m_image.image.setFormat(wantedFormat); int datasize=m_image.image.xsize*m_image.image.ysize*m_image.image.csize; m_image.image.reallocate(datasize+4); diff --git a/plugins/NDI/videoNDI.cpp b/plugins/NDI/videoNDI.cpp index c57faceff..5569917f4 100644 --- a/plugins/NDI/videoNDI.cpp +++ b/plugins/NDI/videoNDI.cpp @@ -304,7 +304,7 @@ pixBlock*videoNDI::getFrame(void) verbose(1, "[GEM:videoNDI] unknown format..."); return NULL; } - m_pixBlock.image.setCsizeByFormat(); + m_pixBlock.image.setFormat(); m_pixBlock.image.data = m_ndi_frame.p_data; m_pixBlock.image.not_owned = 1; m_pixBlock.newimage = 1; diff --git a/plugins/OptiTrack/videoOptiTrack.cpp b/plugins/OptiTrack/videoOptiTrack.cpp index 1637f985b..1644c1d6c 100644 --- a/plugins/OptiTrack/videoOptiTrack.cpp +++ b/plugins/OptiTrack/videoOptiTrack.cpp @@ -77,7 +77,7 @@ videoOptiTrack::videoOptiTrack(void) : { m_pixBlock.image.xsize = 320; m_pixBlock.image.ysize = 240; - m_pixBlock.image.setCsizeByFormat(GEM_GRAY); + m_pixBlock.image.setFormat(GEM_GRAY); m_pixBlock.image.allocate(); } diff --git a/plugins/PIPEWIRE/recordPIPEWIRE.cpp b/plugins/PIPEWIRE/recordPIPEWIRE.cpp index 5b3014577..6734a77f6 100644 --- a/plugins/PIPEWIRE/recordPIPEWIRE.cpp +++ b/plugins/PIPEWIRE/recordPIPEWIRE.cpp @@ -103,7 +103,7 @@ recordPIPEWIRE :: recordPIPEWIRE(void) //::post("%s:%d@%s", __FILE__, __LINE__, __FUNCTION__); m_image.xsize = 640; m_image.ysize = 480; - m_image.setCsizeByFormat(GEM_RGBA); + m_image.setFormat(GEM_RGBA); recordPIPEWIRE_init(); m_stream_events = { PW_VERSION_STREAM_EVENTS, @@ -154,7 +154,7 @@ bool recordPIPEWIRE :: start(const std::string&filename, gem::Properties&props) m_image.ysize = 480; } if(!m_image.csize) { - m_image.setCsizeByFormat(GEM_RAW_RGBA); + m_image.setFormat(GEM_RAW_RGBA); } m_image.reallocate(); diff --git a/plugins/PIPEWIRE/videoPIPEWIRE.cpp b/plugins/PIPEWIRE/videoPIPEWIRE.cpp index ffba8e8f4..c450e91a4 100644 --- a/plugins/PIPEWIRE/videoPIPEWIRE.cpp +++ b/plugins/PIPEWIRE/videoPIPEWIRE.cpp @@ -76,7 +76,7 @@ videoPIPEWIRE::videoPIPEWIRE(void) { m_pixBlock.image.xsize = 1; m_pixBlock.image.ysize = 1; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); m_pixBlock.image.setBlack(); videoPIPEWIRE_init(); @@ -266,7 +266,7 @@ pixBlock*videoPIPEWIRE::getFrame(void) } return &m_pixBlock; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); const unsigned int count = m_pixBlock.image.xsize * m_pixBlock.image.ysize; unsigned int i=0; @@ -491,16 +491,16 @@ void videoPIPEWIRE::on_param_changed(uint32_t id, const struct spa_pod *param) case(SPA_VIDEO_FORMAT_BGR): case(SPA_VIDEO_FORMAT_BGRA): case(SPA_VIDEO_FORMAT_RGB16): - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); break; case(SPA_VIDEO_FORMAT_YUY2): case(SPA_VIDEO_FORMAT_UYVY): - m_pixBlock.image.setCsizeByFormat(GEM_YUV); + m_pixBlock.image.setFormat(GEM_YUV); break; case(SPA_VIDEO_FORMAT_GRAY8): case(SPA_VIDEO_FORMAT_GRAY16_BE): case(SPA_VIDEO_FORMAT_GRAY16_LE): - m_pixBlock.image.setCsizeByFormat(GEM_GRAY); + m_pixBlock.image.setFormat(GEM_GRAY); break; default: m_pixBlock.image.csize = 0; diff --git a/plugins/PYLON/videoPYLON.cpp b/plugins/PYLON/videoPYLON.cpp index af6e47206..e9fb47fbc 100644 --- a/plugins/PYLON/videoPYLON.cpp +++ b/plugins/PYLON/videoPYLON.cpp @@ -55,7 +55,7 @@ class gem::plugins::videoPYLON::ImageEventHandler : public Pylon::CImageEventHan m_pix.newimage = true; m_pix.image.xsize = ptrGrabResult->GetWidth(); m_pix.image.ysize = ptrGrabResult->GetHeight(); - m_pix.image.setCsizeByFormat(m_color); + m_pix.image.setFormat(m_color); m_pix.image.reallocate(); m_converter.Convert (m_pix.image.data, m_pix.image.xsize*m_pix.image.ysize*m_pix.image.csize, ptrGrabResult); } else { diff --git a/plugins/QT4L/filmQT4L.cpp b/plugins/QT4L/filmQT4L.cpp index 10540b4e0..8162a3f90 100644 --- a/plugins/QT4L/filmQT4L.cpp +++ b/plugins/QT4L/filmQT4L.cpp @@ -116,12 +116,12 @@ bool filmQT4L :: open(const std::string&filename, m_quickfile=0; return false; } - m_image.image.setCsizeByFormat(wantedFormat); + m_image.image.setFormat(wantedFormat); m_image.image.reallocate(); m_qtimage.xsize=m_image.image.xsize; m_qtimage.ysize=m_image.image.ysize; - m_qtimage.setCsizeByFormat(GEM_RGB); + m_qtimage.setFormat(GEM_RGB); m_qtimage.reallocate(); m_newfilm = true; @@ -146,7 +146,7 @@ pixBlock* filmQT4L :: getFrame() return &m_image; } - m_image.image.setCsizeByFormat(m_wantedFormat); + m_image.image.setFormat(m_wantedFormat); m_image.image.reallocate(); pixBlock* pimage = 0; diff --git a/plugins/QuickTime/filmQT.cpp b/plugins/QuickTime/filmQT.cpp index 787eea74e..00a9439ba 100644 --- a/plugins/QuickTime/filmQT.cpp +++ b/plugins/QuickTime/filmQT.cpp @@ -115,7 +115,7 @@ filmQT :: filmQT(void) : if(!filmQT_initQT()) { throw(GemException("unable to initialize QuickTime")); } - m_image.image.setCsizeByFormat(m_wantedFormat); + m_image.image.setFormat(m_wantedFormat); m_bInit = true; } @@ -275,7 +275,7 @@ bool filmQT :: open(const std::string&filename_, pixelformat=k32RGBAPixelFormat; break; } - m_image.image.setCsizeByFormat(); + m_image.image.setFormat(); m_image.image.allocate(); m_rowBytes = m_image.image.xsize * m_image.image.csize; diff --git a/plugins/QuickTime/imageQT.cpp b/plugins/QuickTime/imageQT.cpp index 0eb259456..4041f27a3 100644 --- a/plugins/QuickTime/imageQT.cpp +++ b/plugins/QuickTime/imageQT.cpp @@ -267,14 +267,14 @@ static bool QuickTimeImage2mem(GraphicsImportComponent inImporter, #ifdef k8GrayPixelFormat /* from the docs on "depth": what depth is this data (1-32) or ( 33-40 grayscale ) */ if ((*imageDescH)->depth <= 32) { - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); pixelformat = IMAGEQT_RGBA_PIXELFORMAT; } else { - result.setCsizeByFormat(GEM_GRAY); + result.setFormat(GEM_GRAY); pixelformat = k8GrayPixelFormat; } #else - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); pixelformat = IMAGEQT_RGBA_PIXELFORMAT; #endif diff --git a/plugins/SGI/imageSGI.cpp b/plugins/SGI/imageSGI.cpp index e64017107..7ed885bcf 100644 --- a/plugins/SGI/imageSGI.cpp +++ b/plugins/SGI/imageSGI.cpp @@ -60,9 +60,9 @@ bool imageSGI :: load(std::string filename, imageStruct&result, result.ysize=ysize; if (csize == 4 || csize == 3) { - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); } else if (csize == 1) { - result.setCsizeByFormat(GEM_GRAY); + result.setFormat(GEM_GRAY); } else { fprintf(stderr, "[GEM:imageSGI] unknown color components in SGI file: %s\n", diff --git a/plugins/STB/imageSTB.cpp b/plugins/STB/imageSTB.cpp index 24512e7f8..44ec058af 100644 --- a/plugins/STB/imageSTB.cpp +++ b/plugins/STB/imageSTB.cpp @@ -70,7 +70,7 @@ bool imageSTB :: load(std::string filename, imageStruct&result, result.xsize=xsize; result.ysize=ysize; - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); result.reallocate(); result.fromRGBA(data); diff --git a/plugins/TEST/filmTEST.cpp b/plugins/TEST/filmTEST.cpp index 6712d2b6c..762bd273c 100644 --- a/plugins/TEST/filmTEST.cpp +++ b/plugins/TEST/filmTEST.cpp @@ -40,7 +40,7 @@ filmTEST :: filmTEST(void) : m_fps(20) , m_numFrames(100) { - m_image.image.setCsizeByFormat(GEM_RGBA); + m_image.image.setFormat(GEM_RGBA); m_image.image.xsize=320; m_image.image.ysize=240; m_image.image.reallocate(); diff --git a/plugins/TEST/videoTEST.cpp b/plugins/TEST/videoTEST.cpp index 35d64a6d4..7920cdd3e 100644 --- a/plugins/TEST/videoTEST.cpp +++ b/plugins/TEST/videoTEST.cpp @@ -18,7 +18,7 @@ videoTEST::videoTEST(void) : { m_pixBlock.image.xsize = 64; m_pixBlock.image.ysize = 64; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); } @@ -79,7 +79,7 @@ static void setBlue(unsigned char*data, unsigned int count) pixBlock*videoTEST::getFrame(void) { - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); const unsigned int count = m_pixBlock.image.xsize * m_pixBlock.image.ysize; unsigned int i=0; diff --git a/plugins/TIFF/imageTIFF.cpp b/plugins/TIFF/imageTIFF.cpp index 4c088cd07..fa9b9fdf2 100644 --- a/plugins/TIFF/imageTIFF.cpp +++ b/plugins/TIFF/imageTIFF.cpp @@ -147,17 +147,17 @@ bool imageTIFF :: load(std::string filename, imageStruct&result, bool knownFormat = false; // Is it a gray8 image? if (bits == 8 && samps == 1) { - result.setCsizeByFormat(GEM_GRAY); + result.setFormat(GEM_GRAY); knownFormat = true; } // Is it an RGB image? else if (bits == 8 && samps == 3) { - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); knownFormat = true; } // Is it an RGBA image? else if (bits == 8 && samps == 4) { - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); knownFormat = true; } @@ -243,7 +243,7 @@ bool imageTIFF :: load(std::string filename, imageStruct&result, } TIFFRGBAImageEnd(&img); - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); result.reallocate(); unsigned char *dstLine = result.data; diff --git a/plugins/V4L/recordV4L.cpp b/plugins/V4L/recordV4L.cpp index 8b8ca8176..f7584e5cb 100644 --- a/plugins/V4L/recordV4L.cpp +++ b/plugins/V4L/recordV4L.cpp @@ -54,8 +54,8 @@ recordV4L :: recordV4L(void): { m_image.xsize=720; m_image.ysize=576; - m_image.setCsizeByFormat(GEM_YUV); - m_image.setCsizeByFormat(GEM_RGBA); + m_image.setFormat(GEM_YUV); + m_image.setFormat(GEM_RGBA); m_image.reallocate(); switch(m_image.format) { @@ -190,7 +190,7 @@ bool recordV4L :: write(imageStruct*img) return false; } } - m_image.setCsizeByFormat(); + m_image.setFormat(); m_image.convertFrom(img); // m_image.upsidedown=!m_image.upsidedown; diff --git a/plugins/V4L/videoV4L.cpp b/plugins/V4L/videoV4L.cpp index 787bca3c4..5dba7a051 100644 --- a/plugins/V4L/videoV4L.cpp +++ b/plugins/V4L/videoV4L.cpp @@ -400,7 +400,7 @@ bool videoV4L :: startTransfer() just used RGB, I wonder? */ m_image.image.xsize = vmmap[frame].width; m_image.image.ysize = vmmap[frame].height; - m_image.image.setCsizeByFormat(m_reqFormat); + m_image.image.setFormat(m_reqFormat); m_image.image.reallocate(); switch((m_gotFormat=vmmap[frame].format)) { diff --git a/plugins/V4L2/recordV4L2.cpp b/plugins/V4L2/recordV4L2.cpp index 8296f974f..a4e99fd3c 100644 --- a/plugins/V4L2/recordV4L2.cpp +++ b/plugins/V4L2/recordV4L2.cpp @@ -56,8 +56,8 @@ recordV4L2 :: recordV4L2(void): { m_image.xsize=720; m_image.ysize=576; - m_image.setCsizeByFormat(GEM_YUV); - //m_image.setCsizeByFormat(GEM_RGBA); /* RGBA works with Gem, but not with GStreamer and xawtv */ + m_image.setFormat(GEM_YUV); + //m_image.setFormat(GEM_RGBA); /* RGBA works with Gem, but not with GStreamer and xawtv */ m_image.reallocate(); switch(m_image.format) { @@ -198,7 +198,7 @@ bool recordV4L2 :: write(imageStruct*img) return true; } } - m_image.setCsizeByFormat(); + m_image.setFormat(); m_image.convertFrom(img); // m_image.upsidedown=!m_image.upsidedown; diff --git a/plugins/V4L2/videoV4L2.cpp b/plugins/V4L2/videoV4L2.cpp index 4e25995e4..4e64f2d3d 100644 --- a/plugins/V4L2/videoV4L2.cpp +++ b/plugins/V4L2/videoV4L2.cpp @@ -728,7 +728,7 @@ bool videoV4L2 :: startTransfer() just used RGB, I wonder? */ m_image.image.xsize = fmt.fmt.pix.width; m_image.image.ysize = fmt.fmt.pix.height; - m_image.image.setCsizeByFormat(m_reqFormat); + m_image.image.setFormat(m_reqFormat); m_image.image.reallocate(); debugPost("v4l2: format: %c%c%c%c -> 0x%X", diff --git a/plugins/VFW/videoVFW.cpp b/plugins/VFW/videoVFW.cpp index b4bb52dda..353f60694 100644 --- a/plugins/VFW/videoVFW.cpp +++ b/plugins/VFW/videoVFW.cpp @@ -172,7 +172,7 @@ bool videoVFW :: openDevice(gem::Properties&props) m_image.image.xsize = m_width; m_image.image.ysize = m_height; - m_image.image.setCsizeByFormat(GEM_RGBA); + m_image.image.setFormat(GEM_RGBA); m_image.image.reallocate(); m_image.image.setBlack(); @@ -259,7 +259,7 @@ bool videoVFW :: stopTransfer(void) bool videoVFW :: setColor(int format) { if(format) { - m_image.image.setCsizeByFormat(format); + m_image.image.setFormat(format); } return true; } diff --git a/plugins/VIDS/videoVIDS.cpp b/plugins/VIDS/videoVIDS.cpp index a3bfa1ec5..faa1c5b4f 100644 --- a/plugins/VIDS/videoVIDS.cpp +++ b/plugins/VIDS/videoVIDS.cpp @@ -483,7 +483,7 @@ pixBlock*videoVIDS::getFrame(void) unsigned char*data=m_pixBlock.image.data; m_pixBlock.image.xsize=m_width; m_pixBlock.image.ysize=m_height; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); m_pixBlock.newimage=(data==m_pixBlock.image.data); diff --git a/plugins/VLC/videoVLC.cpp b/plugins/VLC/videoVLC.cpp index 6256a1000..d338a1003 100644 --- a/plugins/VLC/videoVLC.cpp +++ b/plugins/VLC/videoVLC.cpp @@ -403,7 +403,7 @@ void videoVLC::resize(unsigned int width, unsigned int height, m_pixBlock.image.xsize = width; m_pixBlock.image.ysize = height; - m_pixBlock.image.setCsizeByFormat(format); + m_pixBlock.image.setFormat(format); m_pixBlock.image.reallocate(); if(&m_pixBlock.image == m_convertImg) { diff --git a/plugins/VNC/videoVNC.cpp b/plugins/VNC/videoVNC.cpp index 190886ad3..a9ccc4515 100644 --- a/plugins/VNC/videoVNC.cpp +++ b/plugins/VNC/videoVNC.cpp @@ -30,7 +30,7 @@ videoVNC::videoVNC(void) m_mouse.mask=0; m_pixBlock.image.xsize = 64; m_pixBlock.image.ysize = 64; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.reallocate(); } @@ -216,7 +216,7 @@ void videoVNC::frameBufferCallback(rfbClient *client, int x, int y, int w, int bpp=pf->bitsPerPixel/8; int row_stride=client->width*bpp; - m_pixBlock.image.setCsizeByFormat(GEM_RGBA); + m_pixBlock.image.setFormat(GEM_RGBA); m_pixBlock.image.xsize=client->width; m_pixBlock.image.ysize=client->height; m_pixBlock.image.reallocate(); diff --git a/plugins/filmAVF/filmAVF.mm b/plugins/filmAVF/filmAVF.mm index 475b4fc10..74ddfe38b 100644 --- a/plugins/filmAVF/filmAVF.mm +++ b/plugins/filmAVF/filmAVF.mm @@ -41,7 +41,7 @@ { close(); // default values m_wantedFormat = FILMAVF_DEFAULT_PIXELFORMAT; - m_image.image.setCsizeByFormat(m_wantedFormat); + m_image.image.setFormat(m_wantedFormat); } ///////////////////////////////////////////////////////// @@ -297,7 +297,7 @@ } } m_image.image.format = m_wantedFormat; - m_image.image.setCsizeByFormat(); + m_image.image.setFormat(); if(m_image.image.data) { m_image.image.reallocate(); } else { diff --git a/plugins/filmDS/filmDS.cpp b/plugins/filmDS/filmDS.cpp index bc0da737c..72926fa60 100644 --- a/plugins/filmDS/filmDS.cpp +++ b/plugins/filmDS/filmDS.cpp @@ -632,7 +632,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB averageTimePerFrame = infoheader->AvgTimePerFrame / 10000000.0; pix.image.xsize = width; pix.image.ysize = height; - pix.image.setCsizeByFormat(pixelFormat); + pix.image.setFormat(pixelFormat); pix.image.reallocate(); //we need to manually change the output from the renderer window to the null renderer @@ -1036,7 +1036,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB if(pix.image.xsize != getWidth() || pix.image.ysize != getHeight()) { pix.image.xsize = getWidth(); pix.image.ysize = getHeight(); - pix.image.setCsizeByFormat(GEM_RGBA); + pix.image.setFormat(GEM_RGBA); pix.image.reallocate(); pix.newfilm = true; } diff --git a/plugins/filmDSATL/filmDS.cpp b/plugins/filmDSATL/filmDS.cpp index a27c3bfd3..f7675a204 100644 --- a/plugins/filmDSATL/filmDS.cpp +++ b/plugins/filmDSATL/filmDS.cpp @@ -490,7 +490,7 @@ bool filmDS :: open(const std::string&filename, // this is a guess at the fast past for pixels on Windows m_image.image.xsize = m_xsize; m_image.image.ysize = m_ysize; - m_image.image.setCsizeByFormat((m_csize==3)?GEM_RAW_BGR:GEM_RAW_BGRA); + m_image.image.setFormat((m_csize==3)?GEM_RAW_BGR:GEM_RAW_BGRA); m_image.image.upsidedown=false; // Start the video stream diff --git a/plugins/filmDarwin/filmDarwin.cpp b/plugins/filmDarwin/filmDarwin.cpp index b9691afad..bb3979a61 100644 --- a/plugins/filmDarwin/filmDarwin.cpp +++ b/plugins/filmDarwin/filmDarwin.cpp @@ -210,7 +210,7 @@ bool filmDarwin :: open(const std::string&filename, pixelformat=k32ARGBPixelFormat; break; } - m_image.image.setCsizeByFormat(); + m_image.image.setFormat(); m_image.image.data = new unsigned char [m_image.image.xsize*m_image.image.ysize*m_image.image.csize]; diff --git a/plugins/imageIO/imageIO.mm b/plugins/imageIO/imageIO.mm index ec02dc623..04f3c13e8 100644 --- a/plugins/imageIO/imageIO.mm +++ b/plugins/imageIO/imageIO.mm @@ -146,7 +146,7 @@ CFStringRef mime2uti(const std::string&mimetype) size_t h = CGImageGetHeight(myImage); result.xsize = w; result.ysize = h; - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); result.upsidedown = !fixUpDown; result.reallocate(); result.setBlack(); diff --git a/plugins/imageMAGICK/MagickCore.cpp b/plugins/imageMAGICK/MagickCore.cpp index eb0a10187..0693a5b0e 100644 --- a/plugins/imageMAGICK/MagickCore.cpp +++ b/plugins/imageMAGICK/MagickCore.cpp @@ -123,7 +123,7 @@ bool imageMAGICK :: load(std::string filename, imageStruct&result, result.xsize=static_cast(image->columns); result.ysize=static_cast(image->rows); - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); result.reallocate(); result.upsidedown=true; diff --git a/plugins/imageMAGICK/MagickPlusPlus.cpp b/plugins/imageMAGICK/MagickPlusPlus.cpp index cc218c42f..227dfdc2e 100644 --- a/plugins/imageMAGICK/MagickPlusPlus.cpp +++ b/plugins/imageMAGICK/MagickPlusPlus.cpp @@ -48,7 +48,7 @@ bool imageMAGICK :: load(std::string filename, imageStruct&result, result.xsize=static_cast(image.columns()); result.ysize=static_cast(image.rows()); - result.setCsizeByFormat(GEM_RGBA); + result.setFormat(GEM_RGBA); result.reallocate(); result.upsidedown=true; diff --git a/plugins/videoAVF/AVFVideoGrabber.mm b/plugins/videoAVF/AVFVideoGrabber.mm index 8280033b1..f11cab546 100644 --- a/plugins/videoAVF/AVFVideoGrabber.mm +++ b/plugins/videoAVF/AVFVideoGrabber.mm @@ -357,7 +357,7 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput pixes.image.xsize = widthIn; pixes.image.ysize = heightIn; - pixes.image.setCsizeByFormat(glformat); + pixes.image.setFormat(glformat); pixes.image.reallocate(); switch(capformat) { diff --git a/plugins/videoDS/videoDS.cpp b/plugins/videoDS/videoDS.cpp index c7a348255..f573bdda2 100644 --- a/plugins/videoDS/videoDS.cpp +++ b/plugins/videoDS/videoDS.cpp @@ -99,7 +99,7 @@ videoDS :: videoDS(void) for (int i = 0; i <= 2; i++) { m_pixBlockBuf[i].image.xsize=m_width; m_pixBlockBuf[i].image.ysize=m_height; - m_pixBlockBuf[i].image.setCsizeByFormat(GEM_RGBA); + m_pixBlockBuf[i].image.setFormat(GEM_RGBA); m_pixBlockBuf[i].image.reallocate(); m_pixBlockBuf[i].newimage = 0; @@ -111,7 +111,7 @@ videoDS :: videoDS(void) m_image.image.xsize=m_width; m_image.image.ysize=m_height; - m_image.image.setCsizeByFormat(GEM_RGBA); + m_image.image.setFormat(GEM_RGBA); m_image.image.reallocate(); #ifdef USE_RECORDING @@ -517,7 +517,7 @@ void videoDS :: copyBuffer(void) m_pixBlockBuf[m_writeIdx].image.xsize = m_width; m_pixBlockBuf[m_writeIdx].image.ysize = m_height; - m_pixBlockBuf[m_writeIdx].image.setCsizeByFormat(m_format); + m_pixBlockBuf[m_writeIdx].image.setFormat(m_format); m_pixBlockBuf[m_writeIdx].image.reallocate(); m_pixBlockBuf[m_writeIdx].image.reallocate(SampleSize); m_nPixDataSize[m_writeIdx] = SampleSize; @@ -658,7 +658,7 @@ bool videoDS :: setDimen(int x, int y, int leftmargin, int rightmargin, bool videoDS :: setColor(int format) { if(format) { - m_image.image.setCsizeByFormat(format); + m_image.image.setFormat(format); } return true; } diff --git a/plugins/videoDarwin/videoDarwin.cpp b/plugins/videoDarwin/videoDarwin.cpp index 7cddab0be..63d638d8d 100644 --- a/plugins/videoDarwin/videoDarwin.cpp +++ b/plugins/videoDarwin/videoDarwin.cpp @@ -64,7 +64,7 @@ videoDarwin :: videoDarwin() m_img.xsize = 800; m_img.ysize = 600; - m_img.setCsizeByFormat(GEM_RGBA); + m_img.setFormat(GEM_RGBA); m_img.allocate(); //initSeqGrabber(); @@ -296,12 +296,12 @@ bool videoDarwin :: initSeqGrabber() m_img.ysize = m_height; if (m_colorspace==GEM_RGBA) { - m_img.setCsizeByFormat(m_colorspace); + m_img.setFormat(m_colorspace); m_rowBytes = m_width*m_img.csize; pixelFormat=k32ARGBPixelFormat; verbose(1, "[GEM:videoDarwin] using RGB"); } else { - m_img.setCsizeByFormat(GEM_YUV); + m_img.setFormat(GEM_YUV); m_rowBytes = m_width*2; pixelFormat=k422YpCbCr8PixelFormat; verbose(1, "[GEM:videoDarwin] using YUV"); From 12e0900971a21e0a2a4b4241e3ecca00f960cb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 14:59:41 +0100 Subject: [PATCH 014/387] extra: replace imageStruct::setCsizeByFormat() with imageStruct::setFormat() --- extra/pix_artoolkit/pix_artoolkit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extra/pix_artoolkit/pix_artoolkit.cpp b/extra/pix_artoolkit/pix_artoolkit.cpp index 156782024..f23d0ed2b 100644 --- a/extra/pix_artoolkit/pix_artoolkit.cpp +++ b/extra/pix_artoolkit/pix_artoolkit.cpp @@ -74,7 +74,7 @@ pix_artoolkit :: pix_artoolkit() m_object[i].center[0] = 0.0; m_object[i].center[1] = 0.0; } - m_image.setCsizeByFormat(GEM_GRAY); + m_image.setFormat(GEM_GRAY); # if AR_HEADER_VERSION_MAJOR >= 5 m_patterns = arPattCreateHandle(); # endif @@ -288,7 +288,7 @@ void pix_artoolkit :: processRGBAImage(imageStruct &image) m_image.fromGray(image.data); image.data = m_image.data; image.notowned = 0; - image.setCsizeByFormat(m_image.format); + image.setFormat(m_image.format); } ///////////////////////////////////////////////////////// @@ -304,7 +304,7 @@ void pix_artoolkit :: processYUVImage(imageStruct &image) m_image.fromUYVY(image.data); image.data = m_image.data; image.notowned = 0; - image.setCsizeByFormat(m_image.format); + image.setFormat(m_image.format); } ///////////////////////////////////////////////////////// From 70edecafac4bd053288a80ed7f80afa852ab2913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Jan 2024 17:03:54 +0100 Subject: [PATCH 015/387] getting rid of some GetPixel()/GetPixel() calls --- src/Pixes/pix_multiblob.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Pixes/pix_multiblob.cpp b/src/Pixes/pix_multiblob.cpp index aa0ab831a..3edc95542 100644 --- a/src/Pixes/pix_multiblob.cpp +++ b/src/Pixes/pix_multiblob.cpp @@ -132,7 +132,6 @@ pix_multiblob :: pix_multiblob(t_floatarg f) : m_blobNumber = 6; } numBlobsMess(m_blobNumber); - } /*------------------------------------------------------------ @@ -174,8 +173,7 @@ void pix_multiblob :: makeBlob(Blob *pb, int x_ini, int y_ini) assert(cp); pb->area++; - t_float grey=(static_cast(m_image.GetPixel(cp->y, cp->x, - chGray))/255.0); + t_float grey=static_cast(m_image.data[cp->y * m_image.xsize + cp->x])/255.; double x = static_cast(cp->x); double y = static_cast(cp->y); pb->m_xaccum += grey*x; @@ -198,7 +196,7 @@ void pix_multiblob :: makeBlob(Blob *pb, int x_ini, int y_ini) pb->ymax(cp->y); } - m_image.SetPixel(cp->y,cp->x,chGray,0); + m_image.data[m_image.xsize * cp->y + cp->x] = 0; for(int i = -1; i<= 1; i++) { for(int j = -1; j <= 1; j++) { np.x = cp->x + j; @@ -206,7 +204,7 @@ void pix_multiblob :: makeBlob(Blob *pb, int x_ini, int y_ini) if(np.x >= 0 && np.y >= 0 && np.x < m_image.xsize && np.y < m_image.ysize && - m_image.GetPixel(np.y, np.x, chGray) > m_threshold ) { + m_image.data[m_image.xsize * np.y + np.x] > m_threshold ) { ptpush(¤t, &np); } } @@ -258,7 +256,7 @@ void pix_multiblob :: doProcessing(void) // detect blobs and add them to the currentBlobs-array for(int y = 0; y < m_image.ysize; y++) { for(int x = 0; x < m_image.xsize; x++) { - if (m_image.GetPixel(y,x,0) > 0) { + if (m_image.data[y * m_image.xsize + x] > 0) { Blob *blob = new Blob(); if(0 == blob) { continue; From 6e9c31d8d28d508c735b07ca053a6c835c6a00eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 17 Jan 2024 13:48:26 +0100 Subject: [PATCH 016/387] Use [gemglfw3window] as the default window backend (if available) Closes: https://github.com/umlaeute/Gem/issues/406 --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 15004565f..d6ce4eca1 100644 --- a/configure.ac +++ b/configure.ac @@ -717,7 +717,8 @@ AS_CASE(["$with_defaultwindow"], [GEM_DEFAULT_WINDOW=""]) AS_IF([test "x${GEM_DEFAULT_WINDOW}" = "x"], [ - AS_IF([test "x$WINDOWS" = "xyes"], [GEM_DEFAULT_WINDOW="gemw32window"], + AS_IF([test "x${have_glfw3}" = "xyes"], [GEM_DEFAULT_WINDOW="gemglfw3window"], + [test "x$WINDOWS" = "xyes"], [GEM_DEFAULT_WINDOW="gemw32window"], [test "x$DARWIN" = "xyes"], [GEM_DEFAULT_WINDOW="gemcocoawindow"], [test "x$no_glx" != "xyes"], [GEM_DEFAULT_WINDOW="gemglxwindow"], [test "x$no_glut" != "xyes"], [GEM_DEFAULT_WINDOW="gemglutwindow"] From 452a8632cce4ee74be64b14bb5a44da22f58b638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 17 Jan 2024 14:05:11 +0100 Subject: [PATCH 017/387] do not unset m_pimpl->context if m_context exists Closes: https://github.com/umlaeute/Gem/issues/406 --- src/Base/GemWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Base/GemWindow.cpp b/src/Base/GemWindow.cpp index 3a9ccd646..1fecca0ea 100644 --- a/src/Base/GemWindow.cpp +++ b/src/Base/GemWindow.cpp @@ -458,7 +458,11 @@ bool GemWindow::createGemWindow(void) } m_context=m_pimpl->mycontext; } else { - m_pimpl->mycontext = 0; + /* JMZ20240117: this used be 'm_pimpl->mycontext = 0;' which i don't understand... */ + /* as setting mycontext to NULL breaks rendering for backends + * with shared contexts ([gemglxwindow]), we do the obvious thing for now... + */ + m_pimpl->mycontext = m_context; } m_pimpl->dispatch(); From 5d9091ea80d79c9b594d9e5b88934ef8cd34d797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 17 Jan 2024 14:36:12 +0100 Subject: [PATCH 018/387] GemWindow: make sure to output state immediately we rely on a the stack ordering in the [gemwin] patch... --- src/Base/GemWindow.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Base/GemWindow.cpp b/src/Base/GemWindow.cpp index 1fecca0ea..e2119f8ce 100644 --- a/src/Base/GemWindow.cpp +++ b/src/Base/GemWindow.cpp @@ -136,6 +136,10 @@ class GemWindow::PIMPL queue(alist); } + void sendInfoNow(t_float f) { + outlet_float(infoOut, f); + } + void sendInfo(std::vectoralist) { int argc=alist.size(); @@ -198,7 +202,8 @@ class GemWindow::PIMPL switch(output_state) { case TRUE: - parent->info("float", 1); + sendInfoNow(1); + //parent->info("float", 1); break; case NONE: parent->bang(); @@ -215,8 +220,10 @@ class GemWindow::PIMPL return true; fail: - if(TRUE == output_state) - parent->info("float", 0); + if(TRUE == output_state) { + sendInfoNow(0); + //parent->info("float", 0); + } return false; } From e01e82d018944c27c28deb938294d89a18e1c67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 17 Jan 2024 23:21:03 +0100 Subject: [PATCH 019/387] [ci] drop DEBUG_PIXCONVERT --- .git-ci/gitlab-iem.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 9a74a37dc..5d000322d 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -107,7 +107,6 @@ stages: - runner_system_failure variables: CXXFLAGS: "-std=c++11 -g -O2" - CPPFLAGS: "-DGEM_DEBUG_PIXCONVERT=1" fat_binary: "x86_64,arm64" HOMEBREW_NO_ANALYTICS: 1 HOMEBREW_NO_INSTALL_UPGRADE: 1 From 56612c0121472f07cd0d1629939f72dcedab1a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 17 Jan 2024 23:21:36 +0100 Subject: [PATCH 020/387] [ci] add HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 hopefully this will convince brew to keep the installation paths in the Cellar as expected --- .git-ci/gitlab-iem.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 5d000322d..1089a40df 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -111,6 +111,7 @@ stages: HOMEBREW_NO_ANALYTICS: 1 HOMEBREW_NO_INSTALL_UPGRADE: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1 + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 CODESIGNFLAGS: --timestamp --strict --force before_script: - *script_zsh_compat From 0609ccae958ca6f4a1c545d55d1dc61af29eba93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 23 Jan 2024 10:25:48 +0100 Subject: [PATCH 021/387] [github] issue template --- .github/ISSUE_TEMPLATE/bug.yml | 58 ++++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 ++++++ .github/ISSUE_TEMPLATE/general.yml | 9 +++++ 3 files changed, 78 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/general.yml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 000000000..9afa066fd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,58 @@ +name: Bug Report +description: We can only fix problems we know about. +labels: ["bug"] +assignees: + - umlaeute +body: + - type: textarea + id: details + attributes: + label: Detail + description: What went wrong? + placeholder: | + What did you do, what did you expect, what happened? + validations: + required: true + + - type: input + id: gemversion + attributes: + label: Gem Version + description: What is the exact version of Gem you are using (as printed in the Pd-console)? + placeholder: e.g. v0.94-312-g78fe990a0 + validations: + required: true + - type: input + id: pdversion + attributes: + label: Pd Version + description: Which version of Pure Data are you using? + placeholder: e.g. 0.54-1 + - type: dropdown + id: OS + attributes: + label: Operating System + description: Which OS are you using? + multiple: true + options: + - Linux + - macOS + - Windows + - other + - type: input + id: osversion + attributes: + label: OS Version + description: Which version of the Operating System are you using? + placeholder: e.g. Ubuntu/4.10 "Warty" + - type: dropdown + id: arch + attributes: + label: Which CPU are you using? + multiple: true + options: + - amd64/x86_64 ("64bit Intel") + - i386 ("32bit Intel") + - arm64 ("64bit ARM"; e.g. Apple Silicon,...) + - arm ("32bit ARM"; e.g. Raspberry Pi,...) + - other diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..2c079edf8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question + url: https://github.com/umlaeute/Gem/discussions + about: Ask questions and share ideas on our "discussion" page. + - name: Ask on the mailinglist + url: https://lists.puredata.info/listinfo/pd-list + about: The general Pure Data mailinglist is a great place to ask a question with lots of people to answer... + - name: Look for more Documentation + url: https://github.com/umlaeute/Gem/wiki + about: Check our WIKI to see whether your question has already been answered. diff --git a/.github/ISSUE_TEMPLATE/general.yml b/.github/ISSUE_TEMPLATE/general.yml new file mode 100644 index 000000000..c9be27984 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/general.yml @@ -0,0 +1,9 @@ +name: General Ticket +description: Feature requests, improvements, whatever... +body: + - type: textarea + id: details + attributes: + label: Add a description + validations: + required: true From 8faa88d814e9e46ce9373c8be7f7256eef52e010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 5 Feb 2024 16:31:33 +0100 Subject: [PATCH 022/387] [gemhead].pd homour "context_active" from gemwin --- abstractions/gemhead.pd | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/abstractions/gemhead.pd b/abstractions/gemhead.pd index 9df787fc3..2865c2b20 100644 --- a/abstractions/gemhead.pd +++ b/abstractions/gemhead.pd @@ -68,8 +68,8 @@ #X obj 265 214 i; #X obj 212 236 spigot 1; #X obj 130 464 GEMglFlush; -#X obj 130 312 gemlist; -#X obj 130 334 t a a; +#X obj 130 352 gemlist; +#X obj 130 374 t a a; #X obj 411 46 gemargs; #N canvas 735 459 450 300 initbang 0; #X obj 95 95 loadbang; @@ -168,6 +168,18 @@ #X msg 211 310 1; #X msg 239 311 0; #X obj 211 333 t f; +#N canvas 423 496 450 300 activate 0; +#X obj 78 60 inlet gemlist; +#X obj 202 58 inlet gemwin->; +#X obj 78 113 spigot 1; +#X obj 78 156 outlet; +#X obj 202 81 route context_active; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 3 0; +#X connect 4 0 2 1; +#X connect 4 1 3 0; +#X restore 130 308 pd activate; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 2 0 4 0; @@ -193,11 +205,12 @@ #X connect 19 0 17 0; #X connect 20 0 21 0; #X connect 21 0 9 0; -#X connect 22 0 10 0; +#X connect 22 0 27 0; #X connect 22 1 19 0; #X connect 22 2 24 0; -#X connect 23 0 10 0; +#X connect 23 0 27 1; #X connect 23 1 25 0; #X connect 24 0 26 0; #X connect 25 0 26 0; #X connect 26 0 20 1; +#X connect 27 0 10 0; From 2a83d62601bf2d0de87bcfb8df21350ff837361c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 5 Feb 2024 16:41:02 +0100 Subject: [PATCH 023/387] [gemwin] flush openGL after automatic rendering in single-buffer Related: https://github.com/umlaeute/Gem/issues/410 --- abstractions/gemwin.pd | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/abstractions/gemwin.pd b/abstractions/gemwin.pd index 3e8bb6cee..f43101852 100644 --- a/abstractions/gemwin.pd +++ b/abstractions/gemwin.pd @@ -1,4 +1,4 @@ -#N canvas 702 37 937 794 10; +#N canvas 697 37 942 872 10; #X obj 126 74 inlet; #X obj 626 678 outlet; #N canvas 6 61 1083 500 argument 0; @@ -2799,7 +2799,7 @@ #X connect 10 0 8 0; #X connect 10 1 9 0; #X restore 258 606 pd CrystalEyeStereo; -#X obj 131 746 GEMglReportError; +#X obj 131 836 GEMglReportError; #X msg 390 149 1000 \$1; #X obj 390 171 /; #X obj 131 202 metro 20; @@ -3167,6 +3167,23 @@ #X obj 131 268 list split 1; #X obj 131 291 list trim; #X obj 131 245 t a s; +#N canvas 735 459 450 300 flush 0; +#X obj 48 49 inlet; +#X obj 48 72 t a a; +#X obj 48 95 outlet; +#X obj 132 158 GEMglFlush; +#X obj 132 137 spigot; +#X obj 139 71 r \$0-buffer; +#X obj 139 93 t f f; +#X obj 171 115 == 1; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 4 0; +#X connect 4 0 3 0; +#X connect 5 0 6 0; +#X connect 6 1 7 0; +#X connect 7 0 4 1; +#X restore 131 795 pd flush; #X connect 0 0 37 0; #X connect 4 0 48 0; #X connect 4 1 39 0; @@ -3190,7 +3207,7 @@ #X connect 20 0 28 0; #X connect 21 0 17 0; #X connect 22 0 30 0; -#X connect 23 0 16 0; +#X connect 23 0 54 0; #X connect 23 1 13 0; #X connect 24 0 26 0; #X connect 25 0 26 1; @@ -3229,3 +3246,4 @@ #X connect 52 0 4 0; #X connect 53 0 51 0; #X connect 53 1 48 1; +#X connect 54 0 16 0; From b067bd2a8051eda2843e433cacf6b0bd248b99d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 5 Feb 2024 16:48:01 +0100 Subject: [PATCH 024/387] [gemglfw3window] output dimension on window creation Closes: https://github.com/umlaeute/Gem/issues/410 --- src/Output/gemglfw3window.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Output/gemglfw3window.cpp b/src/Output/gemglfw3window.cpp index 42e5f912b..70c69b755 100644 --- a/src/Output/gemglfw3window.cpp +++ b/src/Output/gemglfw3window.cpp @@ -858,6 +858,8 @@ bool gemglfw3window :: create(void) dispatch(); int fb_width=0, fb_height=0; + glfwGetWindowSize(m_window, &fb_width, &fb_height); + dimension(fb_width, fb_height); glfwGetFramebufferSize(m_window, &fb_width, &fb_height); framebuffersize(fb_width, fb_height); From 40450294dd27b374ecf4aa39730750f67af0f5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 5 Feb 2024 16:50:59 +0100 Subject: [PATCH 025/387] gemglfw3window: silence repeated "changing buffer size" warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we only get true single-buffered windows when specifying buffer=1 *before* window creation. however, it seems it works™ anyhow. also, [gemglxwindow] doesn't emit a warning either --- src/Output/gemglfw3window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Output/gemglfw3window.cpp b/src/Output/gemglfw3window.cpp index 70c69b755..6e8ada5e4 100644 --- a/src/Output/gemglfw3window.cpp +++ b/src/Output/gemglfw3window.cpp @@ -647,7 +647,10 @@ void gemglfw3window :: bufferMess(int buf) case 2: m_buffer=buf; if(m_window) { - post("changing buffer type will only effect newly created windows"); + static int warned = 0; + if(!warned) + post("changing buffer type will only effect newly created windows"); + warned = 1; } break; default: From c6eff7f12cfbc5923a75da08f198d8ced66ae534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 5 Feb 2024 21:33:47 +0100 Subject: [PATCH 026/387] [ci] exclude .github/ from nodist check --- .git-ci/nodist | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-ci/nodist b/.git-ci/nodist index 9be0017e2..6122050a5 100644 --- a/.git-ci/nodist +++ b/.git-ci/nodist @@ -21,3 +21,4 @@ doc/notes/keynames.org **/*.vsprops **/* * tests/ +.github/ From 77b21deeecdb9122239ed65976821005a7bd332c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 21 Feb 2024 10:01:13 +0100 Subject: [PATCH 027/387] Add plugin-help for recordPNM --- plugins/PNM/PNM-recordplugin.pd | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/PNM/PNM-recordplugin.pd diff --git a/plugins/PNM/PNM-recordplugin.pd b/plugins/PNM/PNM-recordplugin.pd new file mode 100644 index 000000000..550ea510e --- /dev/null +++ b/plugins/PNM/PNM-recordplugin.pd @@ -0,0 +1,36 @@ +#N canvas 714 348 549 630 10; +#X text 75 381 1- select the backend; +#X obj 232 453 s \$1-ctl; +#X msg 261 422 record 1; +#X text 75 401 2- name the NDI-stream; +#X text 75 421 3- start sending out stream; +#X text 89 47 recordPNM - PPM/PGM image stream output; +#X text 89 57 =======================================; +#X msg 261 382 codec pnm; +#X msg 261 402 filename fifo.ppm; +#X text 80 98 PNM is a family of lowest common denominator image formats \, with an ASCII header containing metadata \, followed by raw uncompressed image data.; +#X msg 237 136 https://netpbm.sourceforge.net/doc/pnm.html; +#N canvas 735 459 450 300 open 0; +#X obj 37 37 inlet; +#X obj 37 60 symbol; +#X msg 37 83 open \$1; +#X obj 37 106 pdcontrol; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X restore 237 159 pd open; +#X text 104 149 Sepcification:; +#X text 76 197 The 'pnm' backend writes a single file containing a concatenated stream of PNM images.; +#X text 78 231 The following codecs are currently supported:; +#X text 103 255 - ppm (rgb888 PPM P6 binary format); +#X text 103 270 - pgm (gray8 PGM P5 binary format); +#X text 28 310 Example cuse case:; +#X text 51 332 I. create a named pipe (in the terminal): 'mkfifo fifo.ppm'; +#X text 49 357 II. record frames into the named pipe using this backend:; +#X text 52 490 III. encode the video with FFMPEG:; +#X text 84 511 'ffmpeg -f image2pipe -i fifo.ppm ...'; +#X text 71 544 note that the [pix_record] may block if data is not read fast enough by the encoder.; +#X connect 2 0 1 0; +#X connect 7 0 1 0; +#X connect 8 0 1 0; +#X connect 10 0 11 0; From 4f88c7ac9edfabc79866f747c0bc90aa2a8384c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 21 Feb 2024 12:18:57 +0100 Subject: [PATCH 028/387] add help-paths to devgem.sh --- devgem.sh.in | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/devgem.sh.in b/devgem.sh.in index 3aec0b4fe..b498a3d6e 100755 --- a/devgem.sh.in +++ b/devgem.sh.in @@ -43,6 +43,26 @@ else fi gempath=${gempath%:} + +# help paths +helppath="" +if [ -d "${srcdir}/help" ]; then + helppath="${helppath}:${srcdir}/help" +fi +for d in $(for pd in "${srcdir}/plugins"/*/*.pd "${builddir}/plugins"/*/*.pd; do + if [ -f "${pd}" ]; then + echo "${pd%/*}" + fi +done | uniq); do + helppath="${helppath}:${d}" +done +helppath=${helppath#:} +helppath=${helppath%:} +if [ -n "${helppath}" ]; then + gempath="${gempath}:${helppath}" + gempath="${gempath#:}" +fi + if [ "x${gempath}" = "x" ]; then gempath=${builddir} fi From 78fc48bd5b8d3b80f5fc6e08103385ec0d2fbbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 21 Feb 2024 18:41:28 +0100 Subject: [PATCH 029/387] Fix yuv420p_to_rgb3() and yuv420p_to_rgb4() Closes: https://github.com/umlaeute/Gem/issues/415 --- src/Gem/PixConvert.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/Gem/PixConvert.cpp b/src/Gem/PixConvert.cpp index b2bcfecde..a7dd665c9 100644 --- a/src/Gem/PixConvert.cpp +++ b/src/Gem/PixConvert.cpp @@ -344,16 +344,17 @@ namespace { static void yuv420p_to_rgb3( const unsigned char*Y, const unsigned char*U, const unsigned char*V, unsigned char*outdata, const size_t width, const size_t height) { - const unsigned char*py1=Y; const unsigned char*py2=Y+width; // plane_1 is luminance (csize==1) const unsigned char*pu=U; const unsigned char*pv=V; unsigned char*pixels1=outdata; unsigned char*pixels2=outdata+width*3; + const size_t rows = height>>1; + const size_t cols = width>>1; - for(int row=0; row<(width>>1); row++) { - for(int col=0; col<(height>>1); col++) { + for(int row=0; row>1; + const size_t cols = width>>1; - for(int row=0; row<(width>>1); row++) { - for(int col=0; col<(height>>1); col++) { + for(int row=0; row> 8); pixels1[outB] = CLAMP((y + uv_b) >> 8); pixels1[outA] = 255; // a - pixels1+=3; + pixels1+=4; // 1st row - 2nd pixel y=YUV2RGB_11*(*py1++ -Y_OFFSET); @@ -431,7 +434,7 @@ namespace { pixels1[outG] = CLAMP((y + uv_g) >> 8); pixels1[outB] = CLAMP((y + uv_b) >> 8); pixels1[outA] = 255; // a - pixels1+=3; + pixels1+=4; // 2nd row - 1st pixel y=YUV2RGB_11*(*py2++ -Y_OFFSET); @@ -439,7 +442,7 @@ namespace { pixels2[outG] = CLAMP((y + uv_g) >> 8); pixels2[outB] = CLAMP((y + uv_b) >> 8); pixels2[outA] = 255; // a - pixels2+=3; + pixels2+=4; // 2nd row - 2nd pixel y=YUV2RGB_11*(*py2++ -Y_OFFSET); @@ -447,11 +450,11 @@ namespace { pixels2[outG] = CLAMP((y + uv_g) >> 8); pixels2[outB] = CLAMP((y + uv_b) >> 8); pixels2[outA] = 255; // a - pixels2+=3; + pixels2+=4; } /* need to skip 1 row, as we keep track of even and odd rows separately */ - pixels1+=width*2; - pixels2+=width*2; + pixels1+=width*4; + pixels2+=width*4; py1+=width*1; py2+=width*1; } From 575a89ebedcc9922465ba02dbdb3b31e8b3daa80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 21 Feb 2024 18:59:22 +0100 Subject: [PATCH 030/387] Prepare [pix_record]-help for backend-querying --- help/pix_record-help.pd | 428 ++++++++++++++++++++++++---------------- 1 file changed, 263 insertions(+), 165 deletions(-) diff --git a/help/pix_record-help.pd b/help/pix_record-help.pd index 0861e733d..88ed13f93 100644 --- a/help/pix_record-help.pd +++ b/help/pix_record-help.pd @@ -1,16 +1,12 @@ -#N canvas 435 61 682 509 10; +#N canvas 475 510 682 509 10; #X declare -lib Gem; #X text 433 9 GEM object; -#X obj 9 375 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; -#X text 18 374 Arguments:; -#X obj 8 56 cnv 15 430 310 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 53 cnv 15 170 410 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 9 415 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 18 414 Arguments:; +#X obj 8 56 cnv 15 430 350 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 53 cnv 15 170 410 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 36 Example:; -#X obj 479 429 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 479 419 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 0 0 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; @@ -29,59 +25,27 @@ #X connect 7 0 4 0; #X connect 7 1 6 0; #X connect 7 1 5 0; -#X restore 484 468 pd gemwin; -#X msg 484 449 create; -#X text 480 428 Create window:; -#X obj 451 194 cnv 15 167 230 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X restore 484 458 pd gemwin; +#X msg 484 439 create; +#X text 480 418 Create window:; +#X obj 451 166 cnv 15 167 230 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 59 gemhead; -#X obj 451 128 pix_film; -#X obj 515 128 t f; -#X obj 464 81 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#N canvas 0 0 450 300 open 0; -#X obj 85 49 inlet; -#X obj 85 237 outlet; -#X obj 85 145 openpanel; -#X msg 85 179 open \$1; -#X msg 259 213 auto 1; -#X obj 268 179 loadbang; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 1 0; -#X connect 4 0 1 0; -#X connect 5 0 4 0; -#X restore 464 100 pd open; -#X text 485 74 open a supported; -#X text 486 85 movie-clip; -#X text 64 385 ; +#X text 64 425 ; #X text 50 12 Synopsis: [pix_record]; #X text 71 31 Class: pix object (output); -#X text 29 57 Description: write a sequence of pixes to a movie file -; -#X obj 451 403 pix_record; -#X obj 451 167 pix_draw; -#X obj 451 148 pix_invert; -#X text 18 104 You can choose the codec you want to use either via -a graphical dialog or by directly sending a "codec" with either the -name or the enumeration number of the codec. Use "codeclist" to query -the available codecs \, their names and their number.; -#X obj 470 343 cnv 15 145 25 empty empty empty 20 12 0 14 -225271 -66577 -0; -#X msg 480 347 bang; -#X msg 552 347 auto \$1; -#X obj 533 348 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 470 199 cnv 15 145 65 empty empty empty 20 12 0 14 -225271 -66577 -0; -#X msg 476 224 codeclist; -#X msg 472 203 dialog; -#X obj 472 244 t a; -#X obj 460 271 cnv 15 155 65 empty empty empty 20 12 0 14 -225271 -66577 -0; -#X msg 463 292 file /tmp/mymovie.mov; -#X obj 464 273 bng 15 250 50 0 empty empty empty 0 -6 0 8 -258699 -1 --1; +#X obj 451 375 pix_record; +#X text 18 114 You can choose the codec you want to use either via a graphical dialog or by directly sending a "codec" with either the name or the enumeration number of the codec. Use "codeclist" to query the available codecs \, their names and their number., f 69; +#X obj 470 315 cnv 15 145 25 empty empty empty 20 12 0 14 #d8fcd8 #404040 0; +#X msg 480 319 bang; +#X msg 552 319 auto \$1; +#X obj 533 320 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 470 171 cnv 15 145 65 empty empty empty 20 12 0 14 #d8fcd8 #404040 0; +#X msg 476 196 codeclist; +#X msg 472 175 dialog; +#X obj 472 216 t a; +#X obj 460 243 cnv 15 155 65 empty empty empty 20 12 0 14 #d8fcd8 #404040 0; +#X msg 463 264 file /tmp/mymovie.mov; +#X obj 464 245 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fc2828 #000000 #000000; #N canvas 0 0 450 300 savepanel 0; #X obj 114 62 inlet; #X obj 114 254 outlet; @@ -93,59 +57,36 @@ the available codecs \, their names and their number.; #X connect 2 1 1 0; #X connect 3 0 4 0; #X connect 4 0 2 0; -#X restore 484 272 pd savepanel; -#X msg 520 315 record \$1; -#X obj 500 317 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 463 315 t a; -#X text 14 73 [pix_write] writes a series of pixes into a movie file. -You can set the file to write to via the "file" message.; -#X text 18 174 When file and codec are specified \, you can open the -writing connection with the message "record 1".; -#X text 18 202 To actually do record a frame into the file \, send -the object a "bang" message. If you want to record a consecutive number -of frames \, use the "auto" message. This allows you to have full control -on which frames are to be recorded.; -#X text 17 269 The recording is finished and the file flushed to disk -\, after a "record 0" message is received. You might not be able to -access the file for reading before recording has finished.; -#X text 526 150 (do something); -#X text 515 168 (monitoring); -#X text 22 339 NOTE: currently only quicktime MOVies can be recorded. -This might change in the future (watch the console!); -#X obj 8 414 cnv 15 430 30 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X restore 484 244 pd savepanel; +#X msg 520 287 record \$1; +#X obj 500 289 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 463 287 t a; +#X text 18 174 When file and codec are specified \, you can open the writing connection with the message "record 1"., f 69; +#X text 18 212 To actually do record a frame into the file \, send the object a "bang" message. If you want to record a consecutive number of frames \, use the "auto" message. This allows you to have full control on which frames are to be recorded., f 69; +#X text 526 90 (do something); +#X text 525 128 (monitoring); +#X obj 8 454 cnv 15 430 30 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #N canvas 6 49 459 361 MESSAGES 0; -#X obj 9 15 cnv 15 430 340 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 15 cnv 15 430 340 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 34 17 Inlets:; #X text 34 293 Outlets:; #X text 12 307 Outlet 1: gemlist; #X text 18 31 Inlet 1: gemlist; -#X text 18 50 Inlet 1: file : specify the file for writing -; -#X text 18 62 Inlet 1: record <0|1>: start recording (no actual grabbing -is done!) or stop recording (flush movie to disk); +#X text 18 50 Inlet 1: file : specify the file for writing; +#X text 18 62 Inlet 1: record <0|1>: start recording (no actual grabbing is done!) or stop recording (flush movie to disk); #X text 18 91 Inlet 1: bang: grab the next incoming pix.; -#X text 18 103 Inlet 1: auto <0|1>: start/stop grabbing all incoming -pixes; +#X text 18 103 Inlet 1: auto <0|1>: start/stop grabbing all incoming pixes; #X text 12 321 Outlet 2: number of frames written; #X text 12 335 Outlet 3: info on available codecs/properties; -#X text 18 148 Inlet 1: codeclist: enumerate a list of available codecs -to the outlet#3; -#X text 18 178 Inlet 1: codec : select codec # from the codec-list -(and enumerate codec-properties to outlet#3); -#X text 18 203 Inlet 1: codec : select codec by short name -(and enumerate codec-properties to outlet#3); -#X text 18 233 Inlet 1: set : set a property named - to the value . properties are persistent across codec-changes. -properties unknown to the currently selected coded are ignored.; -#X text 18 123 Inlet 1: dialog: popup a dialog to select the codec -(if available); -#X restore 83 420 pd MESSAGES; -#X floatatom 527 405 3 0 0 0 - - -; -#X msg 532 244 codec mjpa; -#X msg 552 225 codec 3; +#X text 18 148 Inlet 1: codeclist: enumerate a list of available codecs to the outlet#3; +#X text 18 178 Inlet 1: codec : select codec # from the codec-list (and enumerate codec-properties to outlet#3); +#X text 18 203 Inlet 1: codec : select codec by short name (and enumerate codec-properties to outlet#3); +#X text 18 233 Inlet 1: set : set a property named to the value . properties are persistent across codec-changes. properties unknown to the currently selected coded are ignored.; +#X text 18 123 Inlet 1: dialog: popup a dialog to select the codec (if available); +#X restore 83 460 pd MESSAGES; +#X floatatom 527 377 3 0 0 0 - - - 0; +#X msg 532 216 codec mjpa; +#X msg 552 197 codec 3; #N canvas 129 512 599 344 PROPERTIES 0; #N canvas 607 622 561 319 PropertyLogic 0; #X obj 54 6 inlet; @@ -407,76 +348,233 @@ properties unknown to the currently selected coded are ignored.; #X connect 14 0 15 0; #X connect 15 0 8 1; #X connect 18 0 17 0; -#X restore 68 269 pd PropertyLogic; +#X restore 68 299 pd PropertyLogic; #X msg 68 25 codeclist; #X text 142 25 INIT: query all available codecs; -#X text 86 51 select an available codec (and query available properties) -; -#X msg 96 245 set framerate \$1; -#X floatatom 96 227 3 0 100 0 - - -; -#X obj 82 71 cnv 15 100 60 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 87 80 hradio 15 1 0 1 empty \$0-numcodecs empty 0 -8 0 10 -262144 --1 -1 0; -#X msg 87 100 codec \$1; -#X obj 82 152 cnv 15 200 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 87 160 hradio 15 1 0 1 \$0-selprop \$0-numproperties empty 0 --8 0 10 -262144 -1 -1 0; -#X msg 87 202; -#X floatatom 87 182 0 0 0 0 - #0-propvalue -; -#X obj 297 185 r \$0-makeprop; -#X text 87 138 set a codec-property; -#X text 121 227 override the framerate (default: Gem's framerate); +#X msg 96 275 set framerate \$1; +#X floatatom 96 257 3 0 100 0 - - - 0; +#X obj 82 71 cnv 15 100 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 87 88 hradio 15 1 0 1 empty \$0-numcodecs empty 0 -8 0 10 #fcfcfc #000000 #000000 0; +#X msg 87 108 codec \$1; +#X obj 82 152 cnv 15 200 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 87 181 hradio 15 1 0 1 \$0-selprop \$0-numproperties empty 0 -8 0 10 #fcfcfc #000000 #000000 0; +#X msg 87 217; +#X floatatom 87 197 0 0 0 0 - \$0-propvalue - 0; +#X obj 297 200 r \$0-makeprop; +#X text 121 257 override the framerate (default: Gem's framerate); +#X text 82 149 set a codec-property:; +#X text 86 51 select an available codec (and query available properties):; #X connect 1 0 0 0; -#X connect 4 0 0 0; -#X connect 5 0 4 0; -#X connect 7 0 8 0; -#X connect 8 0 0 0; -#X connect 11 0 0 0; -#X connect 12 0 11 0; -#X connect 13 0 11 0; -#X restore 243 420 pd PROPERTIES; -#X obj 553 386 r \$0-ctl; -#X obj 621 261 s \$0-ctl; -#X obj 620 332 s \$0-ctl; +#X connect 3 0 0 0; +#X connect 4 0 3 0; +#X connect 6 0 7 0; +#X connect 7 0 0 0; +#X connect 10 0 0 0; +#X connect 11 0 10 0; +#X connect 12 0 10 0; +#X restore 243 460 pd PROPERTIES; +#X obj 553 358 r \$0-ctl; +#X obj 621 233 s \$0-ctl; +#X obj 620 304 s \$0-ctl; #N canvas 6 49 515 369 print 0; #X obj 102 176 inlet; #X obj 102 198 s \$0-nfo; #X obj 102 220 r \$0-nfoprint; #X obj 102 242 print INFO; -#X text 62 90 actually you can just hook a [print] to the 3rd outlet. -; -#X text 64 115 here it's a bit more complicated \, as we want to filter -out the messages generated from the [pd PROPERTIES] window.; +#X text 62 90 actually you can just hook a [print] to the 3rd outlet.; +#X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.; #X connect 0 0 1 0; #X connect 2 0 3 0; -#X restore 553 403 pd print; +#X restore 553 375 pd print; #X obj 518 8 declare -lib Gem; +#N canvas 697 49 586 503 backend 0; +#X obj 104 103 bng 15 250 50 0 \$0-backendinfo \$0-backendinfo <--show_info_on_backends 17 8 0 10 #fcfcfc #000000 #000000; +#N canvas 15 49 450 300 \$0-backendinfo 0; +#X text 50 65 Currently you are not using any specific driver...; +#X text 50 50 On this system you have 0 backends available; +#X restore 184 207 pd \$0-backendinfo; +#X obj 184 240 r \$0-backendinfo; +#X msg 223 331 clear; +#X obj 223 351 s pd-\$0-backendinfo; +#X obj 203 424 s \$0-ctl; +#N canvas 4 49 685 300 fake 0; +#X obj 178 5 inlet bang; +#X obj 178 67 outlet; +#X msg 178 25 currentbackend v4l2 \, backends 3 \, backend v4l2 \, backend PNM \, backend ndi \, backend vlc; +#X connect 0 0 2 0; +#X connect 2 0 1 0; +#X restore 379 245 pd fake; +#N canvas 14 49 450 300 content 0; +#N canvas 12 49 638 300 currentdriver 0; +#X obj 119 31 inlet; +#X obj 119 186 outlet; +#X obj 119 82 symbol ; +#X obj 325 33 inlet reset; +#X obj 325 53 symbol ; +#X obj 119 102 select ; +#X obj 119 164 list prepend text 50 65; +#X obj 119 51 route bang; +#X obj 202 54 symbol; +#X msg 224 124 You are currently using the '\$1' driver; +#X msg 119 144 Currently you are not using any specific driver...; +#X connect 0 0 7 0; +#X connect 2 0 5 0; +#X connect 3 0 4 0; +#X connect 4 0 2 1; +#X connect 5 0 10 0; +#X connect 5 1 9 0; +#X connect 6 0 1 0; +#X connect 7 0 2 0; +#X connect 7 1 8 0; +#X connect 8 0 2 1; +#X connect 9 0 6 0; +#X connect 10 0 6 0; +#X restore 303 179 pd currentdriver; +#X obj 190 211 t a; +#X obj 357 124 t b b b; +#X obj 357 58 inlet reset; +#X obj 190 251 s pd-\$0-backendinfo; +#X obj 190 231 list trim; +#X obj 140 25 inlet finalize; +#X obj 123 94 r \$0-nfo; +#X obj 123 124 route backend backends currentbackend; +#N canvas 12 49 456 510 listbackends 0; +#X obj 149 61 inlet; +#X obj 149 276 outlet; +#X obj 241 61 inlet reset; +#X obj 149 81 list split 1; +#X obj 149 101 symbol unknown; +#X obj 241 101 symbol unknown; +#X obj 149 121 t b s; +#X obj 149 141 i; +#X obj 149 161 + 20; +#X obj 149 181 t f f; +#X msg 194 122 100; +#X obj 149 253 list prepend obj 60; +#X msg 291 143 0; +#X obj 291 163 makefilename $%d; +#X obj 149 201 pack 0 s s; +#X obj 241 81 t b b b; +#X msg 149 221 \$1 \$2-recordplugin \$3; +#X connect 0 0 3 0; +#X connect 2 0 15 0; +#X connect 3 0 4 0; +#X connect 4 0 6 0; +#X connect 5 0 4 1; +#X connect 6 0 7 0; +#X connect 6 1 14 1; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 14 0; +#X connect 9 1 7 1; +#X connect 10 0 7 1; +#X connect 11 0 1 0; +#X connect 12 0 13 0; +#X connect 13 0 14 2; +#X connect 14 0 16 0; +#X connect 15 0 5 0; +#X connect 15 1 10 0; +#X connect 15 2 12 0; +#X connect 16 0 11 0; +#X restore 123 149 pd listbackends; +#N canvas 509 196 644 372 numdbackends 0; +#X obj 119 11 inlet; +#X obj 119 316 outlet; +#X obj 119 81 f; +#X obj 277 69 inlet reset; +#X msg 277 89 0; +#X obj 119 298 list prepend text 50; +#X obj 119 101 t f f; +#X obj 146 201 select 0; +#X obj 119 31 route bang float; +#X msg 191 223 90 Click on any of the patches below for information about a specific driver:; +#X msg 119 154 50 On this system you have \$1 backends available; +#X connect 0 0 8 0; +#X connect 2 0 6 0; +#X connect 3 0 4 0; +#X connect 4 0 2 1; +#X connect 5 0 1 0; +#X connect 6 0 10 0; +#X connect 6 1 7 0; +#X connect 7 1 9 0; +#X connect 8 0 2 0; +#X connect 8 1 2 1; +#X connect 9 0 5 0; +#X connect 10 0 5 0; +#X restore 190 179 pd numdbackends; +#X obj 140 48 t a a; +#X connect 0 0 1 0; +#X connect 1 0 5 0; +#X connect 2 0 9 1; +#X connect 2 1 10 1; +#X connect 2 2 0 1; +#X connect 3 0 2 0; +#X connect 5 0 4 0; +#X connect 6 0 11 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 8 1 10 0; +#X connect 8 2 0 0; +#X connect 9 0 1 0; +#X connect 10 0 1 0; +#X connect 11 0 10 0; +#X connect 11 1 0 0; +#X restore 351 305 pd content; +#X obj 203 375 t b; +#X obj 184 280 t b b; +#X obj 223 280 t b b; +#X obj 184 260 t b b b; +#X msg 184 311 loadbang \, vis 1; +#X msg 203 405 backend; +#X obj 379 265 s \$0-nfo; +#X obj 351 219 t b b b, f 10; +#X msg 351 191 FAKE; +#X connect 2 0 11 0; +#X connect 3 0 4 0; +#X connect 6 0 14 0; +#X connect 8 0 13 0; +#X connect 9 0 12 0; +#X connect 9 1 7 0; +#X connect 10 0 3 0; +#X connect 10 1 7 1; +#X connect 11 0 9 0; +#X connect 11 1 8 0; +#X connect 11 2 10 0; +#X connect 12 0 4 0; +#X connect 13 0 5 0; +#X connect 15 0 9 0; +#X connect 15 1 6 0; +#X connect 15 2 10 0; +#X connect 16 0 15 0; +#X coords 0 -1 1 1 170 20 2 100 100; +#X restore 197 366 pd backend specific information; +#X obj 451 87 pix_test; +#X obj 451 120 pix_texture; +#X obj 451 141 square 4; +#X text 29 57 Description: output sequences of pixes; +#X text 13 73 [pix_record] outputs a series of pixes \, e.g. into a movie file. You can set the file to write to via the "file" message., f 70; +#X text 14 331 [pix_record] has a number of output methods \, like movies \, pipes or videodevices. Not all may be available on your system. Check here which backends you can use:, f 70; +#X text 17 273 The recording is finished and the file flushed to disk after a "record 0" message is received. You might not be able to access the file for reading before recording has finished., f 69; #X connect 7 0 8 0; #X connect 8 0 7 0; -#X connect 11 0 12 0; -#X connect 12 0 24 0; -#X connect 12 2 13 0; -#X connect 13 0 12 1; -#X connect 14 0 15 0; -#X connect 15 0 12 0; -#X connect 22 1 50 0; -#X connect 22 2 57 0; -#X connect 23 0 22 0; -#X connect 24 0 23 0; -#X connect 27 0 22 0; -#X connect 28 0 22 0; -#X connect 29 0 28 0; -#X connect 31 0 33 0; -#X connect 32 0 33 0; -#X connect 33 0 55 0; -#X connect 35 0 40 0; -#X connect 36 0 37 0; -#X connect 37 0 35 0; -#X connect 38 0 40 0; -#X connect 39 0 38 0; -#X connect 40 0 56 0; -#X connect 51 0 33 0; -#X connect 52 0 33 0; -#X connect 54 0 22 0; +#X connect 11 0 48 0; +#X connect 15 1 38 0; +#X connect 15 2 45 0; +#X connect 18 0 15 0; +#X connect 19 0 15 0; +#X connect 20 0 19 0; +#X connect 22 0 24 0; +#X connect 23 0 24 0; +#X connect 24 0 43 0; +#X connect 26 0 31 0; +#X connect 27 0 28 0; +#X connect 28 0 26 0; +#X connect 29 0 31 0; +#X connect 30 0 29 0; +#X connect 31 0 44 0; +#X connect 39 0 24 0; +#X connect 40 0 24 0; +#X connect 42 0 15 0; +#X connect 48 0 49 0; +#X connect 49 0 50 0; +#X connect 50 0 15 0; From f8b1baf5e0b7019e67ac4755e25897a24c5ea4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 21 Feb 2024 19:11:24 +0100 Subject: [PATCH 031/387] [pix_video] "driver" -> "backend" --- src/Pixes/pix_video.cpp | 21 +++++++++++++-------- src/Pixes/pix_video.h | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Pixes/pix_video.cpp b/src/Pixes/pix_video.cpp index 007d16733..177fc3e31 100644 --- a/src/Pixes/pix_video.cpp +++ b/src/Pixes/pix_video.cpp @@ -329,13 +329,12 @@ bool pix_video :: driverMess(t_symbol*s, int argc, t_atom*argv) { switch(argc) { case 0: - driverMess(); + enumDrivers(s->s_name); return true; case 1: break; default: - error("'driver' takes a single numeric or symbolic driver ID"); - return false; + goto oops; } switch(argv->a_type) { @@ -345,25 +344,30 @@ bool pix_video :: driverMess(t_symbol*s, int argc, t_atom*argv) return driverMess(atom_getsymbol(argv)->s_name); default: break; } - error("'driver' takes a single numeric or symbolic driver ID"); + oops: + error("'%s' takes a single numeric or symbolic driver ID", s->s_name); return false; } -void pix_video :: driverMess() +void pix_video :: enumDrivers(const char*selector) { // a little bit of info t_atom at; t_atom*ap=&at; + const std::string sel = selector; + const std::string sel0 = std::string("current") + sel; + const std::string sels = sel+"s"; + if(m_videoHandle) { post("current driver: '%s'", m_videoHandle->getName().c_str()); SETSYMBOL(ap+0, gensym(m_videoHandle->getName().c_str())); - outlet_anything(m_infoOut, gensym("currentdriver"), 1, ap); + outlet_anything(m_infoOut, gensym(sel0.c_str()), 1, ap); } if(m_videoHandles.size()>0) { unsigned int i=0; SETFLOAT(ap+0, m_videoHandles.size()); - outlet_anything(m_infoOut, gensym("drivers"), 1, ap); + outlet_anything(m_infoOut, gensym(sels.c_str()), 1, ap); post("available drivers:"); for(i=0; i Date: Wed, 21 Feb 2024 19:18:31 +0100 Subject: [PATCH 032/387] [model]/[multimodel] "loader" -> "backend" --- src/Geos/model.cpp | 6 ++++-- src/Geos/multimodel.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Geos/model.cpp b/src/Geos/model.cpp index 905514634..1700dc99e 100644 --- a/src/Geos/model.cpp +++ b/src/Geos/model.cpp @@ -464,6 +464,7 @@ void model :: backendMess(t_symbol*s, int argc, t_atom*argv) } else { /* no backend requested, just enumerate them */ if(m_loader) { + const std::string sel = s->s_name; std::vectoratoms; gem::any value; gem::Properties props; @@ -475,13 +476,13 @@ void model :: backendMess(t_symbol*s, int argc, t_atom*argv) } atoms.clear(); atoms.push_back(value=(int)(backends.size())); - m_infoOut.send("loaders", atoms); + m_infoOut.send(sel+"s", atoms); if(!backends.empty()) { for(i=0; is_name; std::vectoratoms; gem::any value; gem::Properties props; @@ -237,13 +238,13 @@ void multimodel :: backendMess(t_symbol*s, int argc, t_atom*argv) } atoms.clear(); atoms.push_back(value=(int)(backends.size())); - m_infoOut.send("loaders", atoms); + m_infoOut.send(sel+"s", atoms); if(!backends.empty()) { for(i=0; i Date: Wed, 21 Feb 2024 19:23:20 +0100 Subject: [PATCH 033/387] [pix_film] "loader" -> "backend" --- src/Pixes/pix_film.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Pixes/pix_film.cpp b/src/Pixes/pix_film.cpp index acc4042b0..c18547d2c 100644 --- a/src/Pixes/pix_film.cpp +++ b/src/Pixes/pix_film.cpp @@ -650,6 +650,10 @@ void pix_film :: backendMess(t_symbol*s, int argc, t_atom*argv) } else { /* no backend requested, just enumerate them */ if(m_handle) { + const std::string selector = (s==gensym("backend"))?"backend":"loader"; + t_symbol*sel=gensym(selector.c_str()); + t_symbol*sels=gensym((selector+"s").c_str()); + t_atom at; t_atom*ap=&at; gem::Properties props; @@ -662,13 +666,13 @@ void pix_film :: backendMess(t_symbol*s, int argc, t_atom*argv) props.get("backends", backends); } SETFLOAT(ap+0, backends.size()); - outlet_anything(m_outEnd, gensym("loaders"), 1, ap); + outlet_anything(m_outEnd, sels, 1, ap); if(!backends.empty()) { for(i=0; i Date: Wed, 21 Feb 2024 19:28:04 +0100 Subject: [PATCH 034/387] helpfiles: "loader"/"driver" -> "backend" --- help/model-help.pd | 96 +++++++++++++++--------------------------- help/pix_film-help.pd | 4 +- help/pix_video-help.pd | 44 +++++++++---------- 3 files changed, 57 insertions(+), 87 deletions(-) diff --git a/help/model-help.pd b/help/model-help.pd index 977cbd5a8..407a7c5f7 100644 --- a/help/model-help.pd +++ b/help/model-help.pd @@ -1,10 +1,8 @@ #N canvas 426 119 673 647 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 464 77 cnv 15 200 480 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 466 564 cnv 15 200 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 464 77 cnv 15 200 480 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 466 564 cnv 15 200 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 0 50 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; @@ -27,92 +25,66 @@ #X msg 471 584 create; #X text 468 565 Create window:; #X text 475 59 Example:; -#X obj 7 67 cnv 15 450 210 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 316 cnv 15 450 320 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 67 cnv 15 450 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 316 cnv 15 450 320 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 321 Inlets:; -#X obj 8 282 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 282 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 281 Arguments:; #X text 452 8 GEM object; #X text 27 333 Inlet 1: gemlist; #X text 9 600 Outlets:; #X text 21 613 Outlet 1: gemlist; -#X obj 472 136 cnv 15 180 325 empty empty empty 20 12 0 14 -106458 --66577 0; +#X obj 472 136 cnv 15 180 325 empty empty empty 20 12 0 14 #64fc64 #404040 0; #X text 33 14 Synopsis: [model]; #X text 7 69 Description: Renders an Alias/Wavefront-Model.; -#X text 16 86 The model object renders 3D-models that are saved in -Alias/Wavefront's OBJ-format.; +#X text 16 86 The model object renders 3D-models that are saved in Alias/Wavefront's OBJ-format.; #X text 63 292 optional: name of a OBJ-file to be loaded; -#X obj 470 473 cnv 15 50 30 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 470 473 cnv 15 50 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 583 584 gemhead; #X obj 583 603 world_light; #X obj 473 84 gemhead; #X obj 473 479 model; -#X obj 486 140 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 486 140 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 486 158 openpanel; -#X obj 574 144 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 574 144 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 574 164 rescale \$1; #X msg 490 224 smooth \$1; -#X obj 574 204 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 574 204 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 574 224 revert \$1; #X msg 486 274 material \$1; #X msg 574 274 texture \$1; #X msg 576 326 group \$1; -#X floatatom 490 206 5 0 1 0 - - -; +#X floatatom 490 206 5 0 1 0 - - - 0; #X msg 486 179 open \$1; -#X obj 576 308 hradio 15 1 0 3 empty empty empty 0 -6 0 8 -262144 -1 --1 2; +#X obj 576 308 hradio 15 1 0 3 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0; #X text 27 350 Inlet 1: message: open ; -#X text 27 367 Inlet 1: message: rescale 1|0 :: normalize the model -(must be set PRIOR to opening a model (default:1); -#X text 26 444 Inlet 1: message: material 1|0 :: use material-information -(from the .MTL-file); -#X text 27 512 Inlet 1: message: group :: draw only specified -part of the model (0==all groups); -#X text 16 114 To normalize the size and pivot-point of a loaded model -use the "rescale"-message prior(!) to loading the model.; +#X text 27 367 Inlet 1: message: rescale 1|0 :: normalize the model (must be set PRIOR to opening a model (default:1); +#X text 26 444 Inlet 1: message: material 1|0 :: use material-information (from the .MTL-file); +#X text 27 512 Inlet 1: message: group :: draw only specified part of the model (0==all groups); +#X text 16 114 To normalize the size and pivot-point of a loaded model use the "rescale"-message prior(!) to loading the model.; #X text 27 426 Inlet 1: message: revert 1|0 :: revert faces; -#X text 16 142 The amount of smoothing of the model-facets can be set -via the "smooth"-message.; -#X text 17 168 Some models have material-information stored in a separate -MTL-file. If these materials should be used instead of GEM's [color] -(and friends) use the "material"-message.; -#X text 16 234 Model can consist of several parts \, so-called "groups". -Normally all groups are rendered \, but you can specify specific groups -to be displayed.; +#X text 16 142 The amount of smoothing of the model-facets can be set via the "smooth"-message.; +#X text 17 168 Some models have material-information stored in a separate MTL-file. If these materials should be used instead of GEM's [color] (and friends) use the "material"-message.; +#X text 16 234 Model can consist of several parts \, so-called "groups". Normally all groups are rendered \, but you can specify specific groups to be displayed.; #X obj 473 115 color 1 0 0; -#X obj 486 254 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X text 27 397 Inlet 1: message: smooth :: set smoothing factor -( 0.0==flat. 1.0==smooth. default:0.5); -#X text 27 474 Inlet 1: message: texture 0|1|2 :: 0==linear texturing -\, 1==sphere mapping \, 2==UV-mapping (default); -#X obj 574 254 hradio 15 1 0 3 empty empty empty 0 -6 0 8 -262144 -1 --1 0; -#X text 17 210 Images can be applied either as linear \, spherical -or UV textures.; -#X msg 511 381 loader OBJ; -#X msg 520 401 loader ASSIMP3; -#X text 27 542 Inlet 1: message: loader :: choose which backend -to use first to open the model; +#X obj 486 254 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X text 27 397 Inlet 1: message: smooth :: set smoothing factor ( 0.0==flat. 1.0==smooth. default:0.5); +#X text 27 474 Inlet 1: message: texture 0|1|2 :: 0==linear texturing \, 1==sphere mapping \, 2==UV-mapping (default); +#X obj 574 254 hradio 15 1 0 3 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0; +#X text 17 210 Images can be applied either as linear \, spherical or UV textures.; +#X msg 511 381 backend OBJ; +#X msg 520 401 backend ASSIMP3; +#X text 27 542 Inlet 1: message: backend :: choose which backend to use first to open the model; #X obj 500 524 print info; -#X msg 518 424 loader; +#X msg 518 424 backend; #X obj 473 325 t a; #X obj 558 346 t a; -#X text 559 423 query loaders; +#X text 567 424 query backends; #X obj 490 424 t a; #N canvas 1230 127 534 459 properties 0; #X obj 39 405 outlet; #X msg 39 175 enumProps; -#X text 107 177 print available properties (for reading and/or writing) -; +#X text 107 177 print available properties (for reading and/or writing); #X msg 61 214 get texheight texwidth; #X msg 84 245 set usematerial 1; #X text 209 246 set an (available) named properties; @@ -125,10 +97,8 @@ to use first to open the model; #X text 161 366 clear stored properties; #X text 26 35 ==========================; #X text 26 22 getting/setting properties; -#X text 26 68 depending on the used backend for loading a model \, -different properties might be available., f 61; -#X text 30 104 properties can only be enumerated after a model has -been loaded (and thus the loader-backend has been determined); +#X text 26 68 depending on the used backend for loading a model \, different properties might be available., f 61; +#X text 30 104 properties can only be enumerated after a model has been loaded (and thus the loader-backend has been determined); #X connect 1 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; diff --git a/help/pix_film-help.pd b/help/pix_film-help.pd index c15173258..6344cb500 100644 --- a/help/pix_film-help.pd +++ b/help/pix_film-help.pd @@ -156,8 +156,8 @@ auto-mode \, the film is NOT looped. Instead you can reset the current-frame to zero when the end of the film is reached., f 69; #X text 16 445 Inlet 2: float: changes the frame to be decoded on rendering (starting with 0), f 69; -#X msg 486 212 loader foo; -#X text 17 391 Inlet 1: message : loader : open the film using +#X msg 486 212 backend foo; +#X text 17 391 Inlet 1: message : backend : open the film using only the specified backend(s), f 70; #X obj 578 8 declare -lib Gem; #N canvas 2 93 450 310 :: 0; diff --git a/help/pix_video-help.pd b/help/pix_video-help.pd index de2453461..a4373dee3 100644 --- a/help/pix_video-help.pd +++ b/help/pix_video-help.pd @@ -54,9 +54,9 @@ input device; for the image (does not work on all capture devices); #X text 15 371 Inlet 1: enumerate: list all devices to the console ; -#X text 17 245 Inlet 1: driver : switch between different drivers +#X text 17 245 Inlet 1: backend : switch between different backends \, e.g. v4l \, ieee1394 \, etc.; -#X text 16 276 Inlet 1: driver : switch between different drivers +#X text 16 276 Inlet 1: backend : switch between different backends \, e.g. v4l \, v4l2 \, dv...; #X text 13 66 [pix_video] opens a wide array of cameras \, USB to FireWire to capture cards \, as long as the camera is supported by your operating @@ -68,7 +68,7 @@ system.; #X msg 641 283 dialog; #X msg 604 153 colorspace RGBA; #X msg 609 211 device 0; -#X msg 642 312 driver dv; +#X msg 642 312 backend dv; #N canvas 516 113 572 565 properties 0; #X msg 41 203 enumProps; #X obj 31 21 cnv 15 400 80 empty empty readProperties 20 12 0 14 -233017 @@ -399,20 +399,20 @@ at the same time!; #X obj 657 393 print videoctl; #X obj 647 346 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; -#X msg 665 345 driver \$1; +#X msg 665 345 backend \$1; #X text 686 286 (if available); #X text 16 388 Inlet 1: dialog: open a dialog to configure the input -device (depending on driver / Operating System); +device (depending on backend / Operating System); #X text 18 501 Outlet 2: info (for enumerating devices \, querying properties \, ...); #X text 15 423 Inlet 1: enumProps \, get \, set \, clearProps \, setProps -\, applyProps: interact with driver/device properties; +\, applyProps: interact with backend/device properties; #X obj 657 374 r \$0-ctl; #X text 54 600 you can use [pix_buffer] to distribute the same pix to different parts of your render-chain; #X msg 625 235 device /dev/fw1; #N canvas 697 49 586 667 backend 0; -#X obj 104 122 bng 15 250 50 0 \$0-backendinfo \$0-backendinfo <--show_info_on_drivers +#X obj 104 122 bng 15 250 50 0 \$0-backendinfo \$0-backendinfo <--show_info_on_backends 17 8 0 10 -262144 -1 -1; #N canvas 15 49 450 300 \$0-backendinfo 0; #X restore 184 207 pd \$0-backendinfo; @@ -420,32 +420,32 @@ to different parts of your render-chain; #X msg 223 331 clear; #X obj 223 351 s pd-\$0-backendinfo; #X obj 203 424 s \$0-ctl; -#X msg 203 405 driver; +#X msg 203 405 backend; #N canvas 4 49 685 300 fake 0; #X obj 178 5 inlet bang; -#X msg 178 25 currentdriver v4l2 \, drivers 3 \, driver v4l2 analog -\, driver v4l analog \, driver dc1394 iidc \, driver unicap analog -\, driver vlc; +#X msg 178 25 currentbackend v4l2 \, backends 3 \, backend v4l2 analog +\, backend v4l analog \, backend dc1394 iidc \, backend unicap analog +\, backend vlc; #X obj 178 67 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 265 414 pd fake; #X obj 265 434 s \$0-info; #N canvas 14 49 450 300 content 0; -#X obj 123 124 route driver drivers currentdriver; -#N canvas 509 196 644 372 numdrivers 0; +#X obj 123 124 route backend backends currentbackend; +#N canvas 509 196 644 372 numbackends 0; #X obj 119 11 inlet; #X obj 119 316 outlet; #X obj 119 81 f; #X obj 277 69 inlet reset; #X msg 277 89 0; #X obj 119 298 list prepend text 50; -#X msg 119 154 50 On this system you have \$1 drivers available; +#X msg 119 154 50 On this system you have \$1 backends available; #X obj 119 101 t f f; #X obj 146 201 select 0; #X obj 119 31 route bang float; #X msg 191 223 90 Click on any of the patches below for information -about a specific driver:; +about a specific backend:; #X connect 0 0 9 0; #X connect 2 0 7 0; #X connect 3 0 4 0; @@ -458,8 +458,8 @@ about a specific driver:; #X connect 9 0 2 0; #X connect 9 1 2 1; #X connect 10 0 5 0; -#X restore 190 179 pd numdrivers; -#N canvas 12 49 638 300 currentdriver 0; +#X restore 190 179 pd numbackends; +#N canvas 12 49 638 300 currentbackend 0; #X obj 119 31 inlet; #X obj 119 186 outlet; #X obj 119 82 symbol ; @@ -469,8 +469,8 @@ about a specific driver:; #X obj 119 164 list prepend text 50 65; #X obj 119 51 route bang; #X obj 202 54 symbol; -#X msg 224 124 You are currently using the '\$1' driver; -#X msg 119 144 Currently you are not using any specific driver...; +#X msg 224 124 You are currently using the '\$1' backend; +#X msg 119 144 Currently you are not using any specific backend...; #X connect 0 0 7 0; #X connect 2 0 5 0; #X connect 3 0 4 0; @@ -483,8 +483,8 @@ about a specific driver:; #X connect 8 0 2 1; #X connect 9 0 6 0; #X connect 10 0 6 0; -#X restore 280 179 pd currentdriver; -#N canvas 12 49 456 510 listdrivers 0; +#X restore 280 179 pd currentbackend; +#N canvas 12 49 456 510 listbackends 0; #X obj 149 61 inlet; #X obj 149 276 outlet; #X obj 241 61 inlet reset; @@ -522,7 +522,7 @@ about a specific driver:; #X connect 16 0 5 0; #X connect 16 1 11 0; #X connect 16 2 13 0; -#X restore 123 149 pd listdrivers; +#X restore 123 149 pd listbackends; #X obj 123 94 r \$0-info; #X obj 190 211 t a; #X obj 337 125 t b b b; From c0ab6a114f2ac7cab7be07ffbd009f692f804527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 21 Feb 2024 21:56:07 +0100 Subject: [PATCH 035/387] ship PNM-recordplugin --- plugins/PNM/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/PNM/Makefile.am b/plugins/PNM/Makefile.am index a4ecead01..48b84904c 100644 --- a/plugins/PNM/Makefile.am +++ b/plugins/PNM/Makefile.am @@ -4,8 +4,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/src $(GEM_EXTERNAL_CPPFLAGS) AM_CXXFLAGS = pkglib_LTLIBRARIES= +dist_gemhelp_DATA = pkglib_LTLIBRARIES+= gem_recordPNM.la +dist_gemhelp_DATA += PNM-recordplugin.pd AM_LDFLAGS = -module -avoid-version -shared if WINDOWS From d660fbc325b1cf69d459c6c166ddcca2e28c64a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 22 Feb 2024 10:01:03 +0100 Subject: [PATCH 036/387] Fix buildsystem --- plugins/PNM/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/PNM/Makefile.am b/plugins/PNM/Makefile.am index 48b84904c..4870639b3 100644 --- a/plugins/PNM/Makefile.am +++ b/plugins/PNM/Makefile.am @@ -4,6 +4,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/src $(GEM_EXTERNAL_CPPFLAGS) AM_CXXFLAGS = pkglib_LTLIBRARIES= + +gemhelpdir=$(pkglibdir) dist_gemhelp_DATA = pkglib_LTLIBRARIES+= gem_recordPNM.la From 75ebdbb8ef09c5db94c6d870f1ab7d1bded54755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 10:02:31 +0100 Subject: [PATCH 037/387] use local vars --- src/Geos/model.cpp | 11 ++--------- src/Geos/multimodel.cpp | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/Geos/model.cpp b/src/Geos/model.cpp index 1700dc99e..424874ff8 100644 --- a/src/Geos/model.cpp +++ b/src/Geos/model.cpp @@ -444,16 +444,9 @@ void model :: drawMess(std::string name) ///////////////////////////////////////////////////////// void model :: backendMess(t_symbol*s, int argc, t_atom*argv) { -#if 0 - gem::any value=ids; - m_writeprops.set("backends", value); - applyProperties(); -#endif - int i; - m_backends.clear(); if(argc) { - for(i=0; ia_type) { t_symbol* b=atom_getsymbol(argv+i); m_backends.push_back(b->s_name); @@ -478,7 +471,7 @@ void model :: backendMess(t_symbol*s, int argc, t_atom*argv) atoms.push_back(value=(int)(backends.size())); m_infoOut.send(sel+"s", atoms); if(!backends.empty()) { - for(i=0; ia_type) { t_symbol* b=atom_getsymbol(argv+i); m_backends.push_back(b->s_name); @@ -240,7 +233,7 @@ void multimodel :: backendMess(t_symbol*s, int argc, t_atom*argv) atoms.push_back(value=(int)(backends.size())); m_infoOut.send(sel+"s", atoms); if(!backends.empty()) { - for(i=0; i Date: Mon, 26 Feb 2024 10:03:03 +0100 Subject: [PATCH 038/387] remove commented code --- src/plugins/film.cpp | 1 - src/plugins/modelloader.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/src/plugins/film.cpp b/src/plugins/film.cpp index 491878a4a..f8937a33f 100644 --- a/src/plugins/film.cpp +++ b/src/plugins/film.cpp @@ -240,7 +240,6 @@ class filmMeta : public gem::plugins::film if(requestprops.type("backends")!=gem::Properties::UNSET) { requestprops.get("backends", backends); } - // requestprops.erase("backends"); bool tried=false; if(!backends.empty()) { diff --git a/src/plugins/modelloader.cpp b/src/plugins/modelloader.cpp index a8019ef08..74dab017e 100644 --- a/src/plugins/modelloader.cpp +++ b/src/plugins/modelloader.cpp @@ -146,7 +146,6 @@ class modelloaderMeta : public gem::plugins::modelloader if(requestprops.type("backends")!=gem::Properties::UNSET) { requestprops.get("backends", backends); } - // requestprops.erase("backends"); bool tried=false; if(!backends.empty()) { From 5ae3048e8806a4edd95c67b340f822d99a4485f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 10:03:34 +0100 Subject: [PATCH 039/387] rename backends-property to the private "_backends" --- src/Controls/modelfiler.cpp | 8 ++++---- src/Geos/model.cpp | 8 ++++---- src/Geos/multimodel.cpp | 8 ++++---- src/Pixes/pix_film.cpp | 14 +++++++------- src/plugins/film.cpp | 10 +++++----- src/plugins/modelloader.cpp | 10 +++++----- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Controls/modelfiler.cpp b/src/Controls/modelfiler.cpp index 6c68ea1db..2f4ea2bad 100644 --- a/src/Controls/modelfiler.cpp +++ b/src/Controls/modelfiler.cpp @@ -315,10 +315,10 @@ void modelfiler :: backendMess(t_symbol*s, int argc, t_atom*argv) gem::any value; gem::Properties props; std::vector backends; - props.set("backends", value); + props.set("_backends", value); m_loader->getProperties(props); - if(props.type("backends")!=gem::Properties::UNSET) { - props.get("backends", backends); + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); } atoms.clear(); atoms.push_back(value=(int)(backends.size())); @@ -350,7 +350,7 @@ void modelfiler :: openMess(const std::string&filename) return; } if(!m_backends.empty()) { - wantProps.set("backends", m_backends); + wantProps.set("_backends", m_backends); } char buf[MAXPDSTRING]; diff --git a/src/Geos/model.cpp b/src/Geos/model.cpp index 424874ff8..858bc7f76 100644 --- a/src/Geos/model.cpp +++ b/src/Geos/model.cpp @@ -462,10 +462,10 @@ void model :: backendMess(t_symbol*s, int argc, t_atom*argv) gem::any value; gem::Properties props; std::vector backends; - props.set("backends", value); + props.set("_backends", value); m_loader->getProperties(props); - if(props.type("backends")!=gem::Properties::UNSET) { - props.get("backends", backends); + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); } atoms.clear(); atoms.push_back(value=(int)(backends.size())); @@ -502,7 +502,7 @@ void model :: openMess(const std::string&filename) m_loaded = 0; if(!m_backends.empty()) { - wantProps.set("backends", m_backends); + wantProps.set("_backends", m_backends); } char buf[MAXPDSTRING]; diff --git a/src/Geos/multimodel.cpp b/src/Geos/multimodel.cpp index 9499152c1..ecd1a4da8 100644 --- a/src/Geos/multimodel.cpp +++ b/src/Geos/multimodel.cpp @@ -224,10 +224,10 @@ void multimodel :: backendMess(t_symbol*s, int argc, t_atom*argv) gem::any value; gem::Properties props; std::vector backends; - props.set("backends", value); + props.set("_backends", value); m_loader->getProperties(props); - if(props.type("backends")!=gem::Properties::UNSET) { - props.get("backends", backends); + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); } atoms.clear(); atoms.push_back(value=(int)(backends.size())); @@ -275,7 +275,7 @@ void multimodel :: open(const std::string&filename, int baseModel, } gem::Properties wantProps = m_properties; if(!m_backends.empty()) { - wantProps.set("backends", m_backends); + wantProps.set("_backends", m_backends); } if (!topModel) { error("requires an int for number of models"); diff --git a/src/Pixes/pix_film.cpp b/src/Pixes/pix_film.cpp index c18547d2c..81725bcbd 100644 --- a/src/Pixes/pix_film.cpp +++ b/src/Pixes/pix_film.cpp @@ -222,9 +222,9 @@ pix_film :: pix_film(t_symbol* filename) : gem::Properties props; gem::any value; value=m_ids; - props.set("backends", value); + props.set("_backends", value); m_handle->getProperties(props); - if(props.get("backends", m_ids)) { + if(props.get("_backends", m_ids)) { // } } @@ -343,9 +343,9 @@ void pix_film :: openMess(std::string filename, int format, // FIXXME: check whether using vector works on all platforms std::vectorbackends; backends.push_back(backend); - wantProps.set("backends", backends); + wantProps.set("_backends", backends); } else if (!m_backends.empty()) { - wantProps.set("backends", m_backends); + wantProps.set("_backends", m_backends); } if(!m_handle->open(fname, wantProps)) { @@ -660,10 +660,10 @@ void pix_film :: backendMess(t_symbol*s, int argc, t_atom*argv) gem::any value; std::vector backends; value=m_ids; - props.set("backends", value); + props.set("_backends", value); m_handle->getProperties(props); - if(props.type("backends")!=gem::Properties::UNSET) { - props.get("backends", backends); + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); } SETFLOAT(ap+0, backends.size()); outlet_anything(m_outEnd, sels, 1, ap); diff --git a/src/plugins/film.cpp b/src/plugins/film.cpp index f8937a33f..7355daf8a 100644 --- a/src/plugins/film.cpp +++ b/src/plugins/film.cpp @@ -237,8 +237,8 @@ class filmMeta : public gem::plugins::film } std::vector backends; - if(requestprops.type("backends")!=gem::Properties::UNSET) { - requestprops.get("backends", backends); + if(requestprops.type("_backends")!=gem::Properties::UNSET) { + requestprops.get("_backends", backends); } bool tried=false; @@ -335,13 +335,13 @@ class filmMeta : public gem::plugins::film virtual void getProperties(gem::Properties&props) { std::vector ids; - if(props.type("backends")!=gem::Properties::UNSET) { + if(props.type("_backends")!=gem::Properties::UNSET) { unsigned int i; for(i=0; igetProperties(props); @@ -350,7 +350,7 @@ class filmMeta : public gem::plugins::film } if(!ids.empty()) { - props.set("backends", ids); + props.set("_backends", ids); } } }; diff --git a/src/plugins/modelloader.cpp b/src/plugins/modelloader.cpp index 74dab017e..6422893de 100644 --- a/src/plugins/modelloader.cpp +++ b/src/plugins/modelloader.cpp @@ -143,8 +143,8 @@ class modelloaderMeta : public gem::plugins::modelloader } std::vector backends; - if(requestprops.type("backends")!=gem::Properties::UNSET) { - requestprops.get("backends", backends); + if(requestprops.type("_backends")!=gem::Properties::UNSET) { + requestprops.get("_backends", backends); } bool tried=false; @@ -241,13 +241,13 @@ class modelloaderMeta : public gem::plugins::modelloader virtual void getProperties(gem::Properties&props) { std::vector ids; - if(props.type("backends")!=gem::Properties::UNSET) { + if(props.type("_backends")!=gem::Properties::UNSET) { unsigned int i; for(i=0; igetProperties(props); @@ -256,7 +256,7 @@ class modelloaderMeta : public gem::plugins::modelloader } if(!ids.empty()) { - props.set("backends", ids); + props.set("_backends", ids); } } }; From 87e81fe620310c4eb600198d252378a9a10ce331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 10:14:35 +0100 Subject: [PATCH 040/387] rename m_allHandles to m_handles for symmetry across meta-plugins --- src/plugins/record.cpp | 24 +++++++++--------- src/plugins/video.cpp | 55 +++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/src/plugins/record.cpp b/src/plugins/record.cpp index 8afdfa747..a05bfee2d 100644 --- a/src/plugins/record.cpp +++ b/src/plugins/record.cpp @@ -36,7 +36,7 @@ class recordMeta : public gem::plugins::record { private: static recordMeta*s_instance; - std::vectorm_allHandles, // all available handles + std::vectorm_handles, // all available handles m_selectedHandles; // handles with the currently selected codec gem::plugins::record*m_handle; // currently opened handle (or NULL) std::vectorm_ids; // list of handle names @@ -88,8 +88,8 @@ class recordMeta : public gem::plugins::record #endif #if 0 unsigned int i; - for(i=0; iisThreadable()) { + for(i=0; iisThreadable()) { if(1) { m_canThread=false; break; @@ -145,9 +145,9 @@ class recordMeta : public gem::plugins::record continue; } m_ids.push_back(key); - m_allHandles.push_back(handle); + m_handles.push_back(handle); count++; - verbose(2, "added backend#%d '%s'", (int)(m_allHandles.size()-1), + verbose(2, "added backend#%d '%s'", (int)(m_handles.size()-1), key.c_str()); } } @@ -158,9 +158,9 @@ class recordMeta : public gem::plugins::record virtual ~recordMeta(void) { unsigned int i; - for(i=0; ic=m_allHandles[i]->getCodecs(); + for(i=0; ic=m_handles[i]->getCodecs(); unsigned int j; for(j=0; j0); } diff --git a/src/plugins/video.cpp b/src/plugins/video.cpp index ac59a485f..fc06280f4 100644 --- a/src/plugins/video.cpp +++ b/src/plugins/video.cpp @@ -33,8 +33,7 @@ class videoMeta : public gem::plugins::video { private: static videoMeta*s_instance; - std::vectorm_allHandles, // all available handles - m_selectedHandles; // handles with the currently selected codec + std::vectorm_handles; // all available handles gem::plugins::video*m_handle; // currently opened handle (or NULL) std::vectorm_ids; // list of handle names std::string m_codec; // currently selected codec @@ -98,10 +97,10 @@ class videoMeta : public gem::plugins::video continue; } m_ids.push_back(key); - m_allHandles.push_back(handle); + m_handles.push_back(handle); count++; verbose(2, "Gem::video: added backend#%d '%s'", - (int)(m_allHandles.size()-1), key.c_str()); + (int)(m_handles.size()-1), key.c_str()); } } return (count>0); @@ -126,8 +125,8 @@ class videoMeta : public gem::plugins::video addPlugin(ids, "dv4l"); addPlugin(ids); - for(unsigned int i=0; iisThreadable()) { + for(unsigned int i=0; iisThreadable()) { m_canThread=false; break; } @@ -149,9 +148,9 @@ class videoMeta : public gem::plugins::video { // compat unsigned int i; - for(i=0; ienumerate(void) @@ -162,8 +161,8 @@ class videoMeta : public gem::plugins::video * "devicename:backend" with ':' being some special character unlikely to be found in devicenames */ std::vectorresult; - for(unsigned int i=0; ires=m_allHandles[i]->enumerate(); + for(unsigned int i=0; ires=m_handles[i]->enumerate(); for(unsigned int j=0; jsetDevice(ID)) { + for(unsigned int i=0; isetDevice(ID)) { result=true; } } @@ -185,8 +184,8 @@ class videoMeta : public gem::plugins::video { // compat bool result=false; - for(unsigned int i=0; isetDevice(ID)) { + for(unsigned int i=0; isetDevice(ID)) { result=true; } } @@ -201,9 +200,9 @@ class videoMeta : public gem::plugins::video if(m_handle) { close(); } - for(unsigned int i=0; iopen(props)) { - m_handle=m_allHandles[i]; + for(unsigned int i=0; iopen(props)) { + m_handle=m_handles[i]; return true; } } @@ -256,8 +255,8 @@ class videoMeta : public gem::plugins::video } bool result=false; - for(unsigned int i=0; ireset()) { + for(unsigned int i=0; ireset()) { result=true; } } @@ -308,8 +307,8 @@ class videoMeta : public gem::plugins::video } std::vectorresult; - for(unsigned int i=0; ires=m_allHandles[i]->dialogs(); + for(unsigned int i=0; ires=m_handles[i]->dialogs(); for(unsigned int j=0; jsetColor(color)) { + for(unsigned int i=0; isetColor(color)) { result=false; } } @@ -350,8 +349,8 @@ class videoMeta : public gem::plugins::video virtual bool provides(const std::string&ID) { // OK - for(unsigned int i=0; iprovides(ID)) { + for(unsigned int i=0; iprovides(ID)) { return true; } } @@ -362,8 +361,8 @@ class videoMeta : public gem::plugins::video // OK // LATER: remove dupes std::vectorresult; - for(unsigned int i=0; ires=m_allHandles[i]->provides(); + for(unsigned int i=0; ires=m_handles[i]->provides(); for(unsigned int j=0; j Date: Mon, 26 Feb 2024 10:24:47 +0100 Subject: [PATCH 041/387] make loop variables local --- src/plugins/film.cpp | 26 +++++++++----------------- src/plugins/imageloader.cpp | 15 +++++---------- src/plugins/imagesaver.cpp | 25 ++++++++----------------- src/plugins/modelloader.cpp | 23 ++++++++--------------- src/plugins/record.cpp | 30 ++++++++++-------------------- src/plugins/video.cpp | 9 +++------ src/plugins/videoBase.cpp | 21 +++++++-------------- 7 files changed, 50 insertions(+), 99 deletions(-) diff --git a/src/plugins/film.cpp b/src/plugins/film.cpp index 7355daf8a..cad85c9d3 100644 --- a/src/plugins/film.cpp +++ b/src/plugins/film.cpp @@ -91,8 +91,7 @@ class filmIMAGE : public gem::plugins::film virtual void getProperties(gem::Properties&props) { std::vectorkeys=props.keys(); - unsigned int i=0; - for(i=0; iisThreadable()) { m_canThread=false; break; @@ -211,8 +208,7 @@ class filmMeta : public gem::plugins::film static bool firsttime=true; if(firsttime && ids.size()>0) { startpost("GEM: film loading plugins:"); - unsigned int i; - for(i=0; iopen(name, requestprops)) { @@ -260,8 +254,7 @@ class filmMeta : public gem::plugins::film if(!backends.empty() && !m_handles.empty()) { verbose(2, "no available backend selected, fall back to valid ones"); } - unsigned int i=0; - for(i=0; iopen(name, requestprops)) { m_handle=m_handles[i]; break; @@ -336,8 +329,7 @@ class filmMeta : public gem::plugins::film { std::vector ids; if(props.type("_backends")!=gem::Properties::UNSET) { - unsigned int i; - for(i=0; i0) { startpost("GEM: image loading plugins:"); - unsigned int i; - for(i=0; iisThreadable()) { m_canThread=false; break; @@ -86,8 +84,7 @@ class imageloaderMeta : public gem::plugins::imageloader id=available; } - unsigned int i=0; - for(i=0; iload(filename, result, props)) { return true; } diff --git a/src/plugins/imagesaver.cpp b/src/plugins/imagesaver.cpp index 6362ff94d..f8c867e83 100644 --- a/src/plugins/imagesaver.cpp +++ b/src/plugins/imagesaver.cpp @@ -183,17 +183,14 @@ class imagesaverMeta : public imagesaver static bool firsttime=true; if(firsttime && m_ids.size()>0) { startpost("GEM: image saving plugins:"); - unsigned int i; - for(i=0; iisThreadable()) { m_threadable=false; break; @@ -220,8 +217,7 @@ class imagesaverMeta : public imagesaver id=available; } - unsigned int i=0; - for(i=0; ipriorities; std::multimap::reverse_iterator rit; - unsigned int i; std::string mimetype=(mimetype_c.empty())?imgName2Mime( filename):mimetype_c; - for(i=0; iestimateSave(img, filename, mimetype, props); priorities.insert( std::multimap::value_type(prio, i)); } @@ -295,15 +289,12 @@ class imagesaverMeta : public imagesaver mimetypes.clear(); props.clear(); - unsigned int i; - for(i=0; imimetypes_; gem::Properties props_; m_savers[i]->getWriteCapabilities(mimetypes_, props_); - for(j=0; jkeys=props_.keys(); - for(j=0; jisThreadable()) { m_canThread=false; break; @@ -117,8 +115,7 @@ class modelloaderMeta : public gem::plugins::modelloader static bool firsttime=true; if(firsttime && ids.size()>0) { startpost("GEM: model loading plugins:"); - unsigned int i; - for(i=0; iopen(name, requestprops)) { m_handle=m_handles[i]; @@ -165,8 +160,7 @@ class modelloaderMeta : public gem::plugins::modelloader if(!backends.empty() && !m_handles.empty()) { verbose(2, "no available loader selected, falling back to valid ones"); } - unsigned int i=0; - for(i=0; iopen(name, requestprops)) { m_handle=m_handles[i]; break; @@ -242,8 +236,7 @@ class modelloaderMeta : public gem::plugins::modelloader { std::vector ids; if(props.type("_backends")!=gem::Properties::UNSET) { - unsigned int i; - for(i=0; iisThreadable()) { if(1) { m_canThread=false; @@ -100,8 +99,7 @@ class recordMeta : public gem::plugins::record static bool firsttime=true; if(firsttime && m_ids.size()>0) { startpost("GEM: video record plugins:"); - unsigned int i; - for(i=0; igetCodecs(void) { clearCodecHandle(); - unsigned int i; - for(i=0; ic=m_handles[i]->getCodecs(); - unsigned int j; - for(j=0; jsetCodec(codec)) { @@ -234,9 +227,8 @@ class recordMeta : public gem::plugins::record } checkSelectedHandles(); - unsigned int i; gem::plugins::record*handle=NULL; - for(i=0; idialog()) { break; @@ -261,8 +253,7 @@ class recordMeta : public gem::plugins::record return false; } - unsigned int i; - for(i=0; ienumProperties(props)) { return true; @@ -284,8 +275,7 @@ class recordMeta : public gem::plugins::record return false; // no selected codec available } - unsigned int i; - for(i=0; istart(filename, props)) { m_handle=m_selectedHandles[i]; return true; diff --git a/src/plugins/video.cpp b/src/plugins/video.cpp index fc06280f4..0bd683683 100644 --- a/src/plugins/video.cpp +++ b/src/plugins/video.cpp @@ -79,8 +79,7 @@ class videoMeta : public gem::plugins::video id=available; } - unsigned int i=0; - for(i=0; i0) { startpost("GEM: video capture plugins:"); - unsigned int i; - for(i=0; i0) { numlocks=locks_; locks=new pthread_mutex_t*[numlocks]; - unsigned int i=0; - for(i=0; im_providers.size(); i++) + for(unsigned int i=0; im_providers.size(); i++) if(name == m_pimpl->m_providers[i]) { return true; } @@ -581,8 +577,7 @@ std::vectorvideoBase :: provides() { std::vectorresult; if(m_pimpl) { - unsigned int i; - for(i=0; im_providers.size(); i++) { + for(unsigned int i=0; im_providers.size(); i++) { result.push_back(m_pimpl->m_providers[i]); } } @@ -615,8 +610,7 @@ void videoBase :: setProperties(gem::Properties&props) // nada std::vector keys=props.keys(); - unsigned int i=0; - for(i=0; ikeys=props.keys(); - unsigned int i=0; - for(i=0; i Date: Mon, 26 Feb 2024 10:41:34 +0100 Subject: [PATCH 042/387] video/record: allow selecting backend through "_backend" --- src/plugins/record.cpp | 37 ++++++++++++++++++++++++++----- src/plugins/video.cpp | 50 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 75 insertions(+), 12 deletions(-) diff --git a/src/plugins/record.cpp b/src/plugins/record.cpp index ba3f68f57..863ba60b2 100644 --- a/src/plugins/record.cpp +++ b/src/plugins/record.cpp @@ -271,18 +271,43 @@ class recordMeta : public gem::plugins::record virtual bool start(const std::string&filename, gem::Properties&props) { stop(); + if(!checkSelectedHandles()) { return false; // no selected codec available } - for(unsigned int i=0; istart(filename, props)) { - m_handle=m_selectedHandles[i]; - return true; + /* if the user requested some backends, prioritize these */ + std::vector backends; + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); + } + + bool tried=false; + if(!backends.empty()) { + for(unsigned int j=0; !m_handle && jstart(filename, props)) { + m_handle=m_selectedHandles[i]; + break; + } + } } } - m_handle=NULL; - return false; + if(!tried) { + if(!backends.empty() && !m_selectedHandles.empty()) { + verbose(2, "no available backend selected, fall back to valid ones"); + } + for(unsigned int i=0; istart(filename, props)) { + m_handle=m_selectedHandles[i]; + break; + } + } + } + return (NULL != m_handle); } ////////// diff --git a/src/plugins/video.cpp b/src/plugins/video.cpp index 0bd683683..504c0ea22 100644 --- a/src/plugins/video.cpp +++ b/src/plugins/video.cpp @@ -197,13 +197,38 @@ class videoMeta : public gem::plugins::video if(m_handle) { close(); } - for(unsigned int i=0; iopen(props)) { - m_handle=m_handles[i]; - return true; + + std::vector backends; + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); + } + + bool tried=false; + if(!backends.empty()) { + for(unsigned int j=0; !m_handle && jopen(props)) { + m_handle=m_handles[i]; + break; + } + } } } - return false; + if(!tried) { + if(!backends.empty() && !m_handles.empty()) { + verbose(2, "no available backend selected, fall back to valid ones"); + } + for(unsigned int i=0; iopen(props)) { + m_handle=m_handles[i]; + break; + } + } + } + return (NULL != m_handle); } virtual bool start(void) { @@ -277,9 +302,22 @@ class videoMeta : public gem::plugins::video } virtual void getProperties(gem::Properties&props) { - // OK + std::vector ids; + if(props.type("_backends")!=gem::Properties::UNSET) { + for(unsigned int i=0; igetProperties(props); + } else { + props.clear(); + } + + if(!ids.empty()) { + props.set("_backends", ids); } } virtual bool dialog(std::vectornames) From 23ec25de5630219e2de860f0f349d99418ff3ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 10:56:06 +0100 Subject: [PATCH 043/387] drop unused code --- src/Pixes/pix_record.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/Pixes/pix_record.cpp b/src/Pixes/pix_record.cpp index 1bb8c9d74..0c14515e8 100644 --- a/src/Pixes/pix_record.cpp +++ b/src/Pixes/pix_record.cpp @@ -21,31 +21,6 @@ class pix_record :: PIMPL PIMPL(void) {}; ~PIMPL(void) {}; - struct codechandle { - codechandle(gem::plugins::record*h, const std::string&c):handle(h), - codec(c) {} - - gem::plugins::record*handle; - std::string codec; - }; - std::map >m_codechandle; - std::vectorm_codecs; - - void addCodecHandle(gem::plugins::record*handle, const std::string&codec) - { -#ifdef __GNUC__ -# warning better handling of duplicate codecs -#endif - /* FIXME: we should generate a unique codec-ID, e.g. ":" */ - m_codechandle[codec].push_back(codechandle(handle, codec)); - m_codecs.push_back(codec); - } - void clearCodecHandle(void) - { - m_codecs.clear(); - m_codechandle.clear(); - } - static gem::any atom2any(t_atom*ap) { gem::any result; From b8ae73cc8fe7fd80563243ef8b8d3380657095b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 11:16:29 +0100 Subject: [PATCH 044/387] [pix_record] switch to gem::RTE::Outlet --- src/Pixes/pix_record.cpp | 59 ++++++++++++++++++---------------------- src/Pixes/pix_record.h | 5 ++-- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/src/Pixes/pix_record.cpp b/src/Pixes/pix_record.cpp index 0c14515e8..c563c7e2d 100644 --- a/src/Pixes/pix_record.cpp +++ b/src/Pixes/pix_record.cpp @@ -80,9 +80,9 @@ class pix_record :: PIMPL // Constructor // ///////////////////////////////////////////////////////// -pix_record :: pix_record(int argc, t_atom *argv): +pix_record :: pix_record(int argc, t_atom *argv) : m_banged(false), m_automatic(true), - m_outNumFrames(NULL), m_outInfo(NULL), + m_framesOut(gem::RTE::Outlet(this)), m_infoOut(gem::RTE::Outlet(this)), m_currentFrame(-1), m_maxFrames(0), m_recording(false), @@ -92,9 +92,6 @@ pix_record :: pix_record(int argc, t_atom *argv): if (argc != 0) { error("ignoring arguments"); } - m_outNumFrames = outlet_new(this->x_obj, 0); - m_outInfo = outlet_new(this->x_obj, 0); - m_handle=gem::plugins::record::getInstance(); getCodecList(); @@ -109,9 +106,6 @@ pix_record :: ~pix_record() if(m_handle) { delete m_handle; } - outlet_free(m_outNumFrames); - outlet_free(m_outInfo); - if(m_pimpl) { delete m_pimpl; } @@ -214,7 +208,7 @@ void pix_record :: stopRecording() if(m_recording) { m_handle->stop(); m_currentFrame = 0; - outlet_float(m_outNumFrames,m_currentFrame); + m_framesOut.send(m_currentFrame); verbose(1, "movie written"); } @@ -250,7 +244,7 @@ void pix_record :: render(GemState *state) if(success) { m_currentFrame++; - outlet_float(m_outNumFrames,m_currentFrame); + m_framesOut.send(m_currentFrame); } else { stopRecording(); } @@ -272,45 +266,45 @@ void pix_record :: enumPropertiesMess() return; } - t_atom ap[3]; + std::vectordata; + gem::any value; std::vectorkeys=props.keys(); + data.clear(); + data.push_back(value=(int)keys.size()); + m_infoOut.send("numprops", data); - SETFLOAT(ap+0, keys.size()); - outlet_anything(m_outInfo, gensym("numprops"), 1, ap); - unsigned int i=0; - for(i=0; icodecs=m_handle->getCodecs(); - unsigned int i; - for(i=0; igetCodecDescription(codecname); + std::vectordata; + gem::any value; t_atom ap[3]; verbose(2, "codec%d: '%s': %s", i, codecname.c_str(), (descr.empty()?"":descr.c_str())); - SETFLOAT (ap+0, static_cast(i)); - SETSYMBOL(ap+1, gensym(codecname.c_str())); - SETSYMBOL(ap+2, gensym(descr.c_str())); - outlet_anything(m_outInfo, gensym("codec"), 3, ap); + data.push_back(value=i); + data.push_back(value=codecname); + data.push_back(value=descr); + m_infoOut.send("codec", data); } } @@ -452,12 +447,12 @@ void pix_record :: obj_setupCallback(t_class *classPtr) CPPEXTERN_MSG1(classPtr, "auto", autoMess, bool); CPPEXTERN_MSG0(classPtr, "bang", bangMess); CPPEXTERN_MSG1(classPtr, "record", recordMess, bool); - CPPEXTERN_MSG0(classPtr, "dialog", dialogMess); CPPEXTERN_MSG0(classPtr, "codeclist", getCodecList); class_addmethod(classPtr, reinterpret_cast(&pix_record::codecMessCallback), gensym("codec"), A_GIMME, A_NULL); + CPPEXTERN_MSG0(classPtr, "dialog", dialogMess); CPPEXTERN_MSG0(classPtr, "proplist", enumPropertiesMess); CPPEXTERN_MSG0(classPtr, "enumProps", enumPropertiesMess); CPPEXTERN_MSG (classPtr, "set", setPropertiesMess); diff --git a/src/Pixes/pix_record.h b/src/Pixes/pix_record.h index f35a9bea6..ab8fea02d 100644 --- a/src/Pixes/pix_record.h +++ b/src/Pixes/pix_record.h @@ -21,6 +21,7 @@ #include "Base/GemBase.h" #include "Gem/Image.h" +#include "RTE/Outlet.h" #include "plugins/record.h" @@ -95,9 +96,9 @@ class GEM_EXTERN pix_record : public GemBase ////////// // a outlet for information like #frames - t_outlet *m_outNumFrames; + gem::RTE::Outlet m_framesOut; // another outlet for extra information (like list of codecs...) - t_outlet *m_outInfo; + gem::RTE::Outlet m_infoOut; int m_currentFrame; //keep track of the number of frames From f9eaa47fd7a329c2cb3269a1c3d41edc299eddf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 11:23:51 +0100 Subject: [PATCH 045/387] [pix_record] remove more unused code --- src/Pixes/pix_record.cpp | 56 ---------------------------------------- src/Pixes/pix_record.h | 9 +++---- 2 files changed, 4 insertions(+), 61 deletions(-) diff --git a/src/Pixes/pix_record.cpp b/src/Pixes/pix_record.cpp index c563c7e2d..d9c94cb33 100644 --- a/src/Pixes/pix_record.cpp +++ b/src/Pixes/pix_record.cpp @@ -111,62 +111,6 @@ pix_record :: ~pix_record() } } - -///////////////////////////////////////////////////////// -// add backends -// -///////////////////////////////////////////////////////// -bool pix_record :: addHandle( std::vectoravailable, - std::string ID) -{ - unsigned int i=0; - int count=0; - - std::vectorid; - if(!ID.empty()) { - // if requested 'cid' is in 'available' add it to the list of 'id's - if(std::find(available.begin(), available.end(), ID)!=available.end()) { - id.push_back(ID); - } else { - // request for an unavailable ID - verbose(2, "backend '%s' unavailable", ID.c_str()); - return false; - } - } else { - // no 'ID' given: add all available IDs - id=available; - } - - for(i=0; i::getInstance(key); - } catch (GemException&ex) { - startpost("(%s) ", ex.what()); - handle=NULL; - } - if(NULL==handle) { - post("<--- DISABLED"); - break; - } - endpost(); - - m_ids.push_back(key); - m_allhandles.push_back(handle); - count++; - verbose(2, "added backend#%d '%s' @ %p", m_allhandles.size()-1, - key.c_str(), handle); - } - } - - return (count>0); -} - // // stops recording into the movie // diff --git a/src/Pixes/pix_record.h b/src/Pixes/pix_record.h index ab8fea02d..babbba742 100644 --- a/src/Pixes/pix_record.h +++ b/src/Pixes/pix_record.h @@ -74,6 +74,10 @@ class GEM_EXTERN pix_record : public GemBase std::string m_filename; virtual void fileMess(t_symbol*s,int argc, t_atom *argv); + ////////// + // Set backend to use + virtual void backendMess(t_symbol*s, int argc, t_atom*argv); + ////////// // turn recording on/off virtual void recordMess(bool on); @@ -114,11 +118,6 @@ class GEM_EXTERN pix_record : public GemBase private: bool m_recording; gem::plugins::record *m_handle; - std::vectorm_ids; - std::vectorm_handles; - std::vectorm_allhandles; - virtual bool addHandle(std::vectoravailable_ids, - std::string id=std::string("")); ////////// // static member functions void autoMess(bool on); From 93d31fa479467aab9f9d2ac6ebd19eba67255fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 11:29:27 +0100 Subject: [PATCH 046/387] pix_record: make owner known to PIMPL --- src/Pixes/pix_record.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Pixes/pix_record.cpp b/src/Pixes/pix_record.cpp index d9c94cb33..1080de63e 100644 --- a/src/Pixes/pix_record.cpp +++ b/src/Pixes/pix_record.cpp @@ -15,10 +15,12 @@ CPPEXTERN_NEW_WITH_GIMME(pix_record); -class pix_record :: PIMPL +struct pix_record :: PIMPL { -public: - PIMPL(void) {}; + CPPExtern*parent; + PIMPL(CPPExtern*_parent) + :parent(_parent) + {}; ~PIMPL(void) {}; static gem::any atom2any(t_atom*ap) @@ -38,14 +40,14 @@ class pix_record :: PIMPL } return result; } - static void addProperties(CPPExtern*obj, gem::Properties&props, int argc, t_atom*argv) + void addProperties(gem::Properties&props, int argc, t_atom*argv) { if(!argc) { return; } if(argv->a_type != A_SYMBOL) { - pd_error(obj, "no key given..."); + pd_error(parent, "no key given..."); return; } std::string key=std::string(atom_getsymbol(argv)->s_name); @@ -87,7 +89,7 @@ pix_record :: pix_record(int argc, t_atom *argv) : m_maxFrames(0), m_recording(false), m_handle(NULL), - m_pimpl(new PIMPL()) + m_pimpl(new PIMPL(this)) { if (argc != 0) { error("ignoring arguments"); @@ -253,7 +255,7 @@ void pix_record :: enumPropertiesMess() } void pix_record :: setPropertiesMess(t_symbol*s, int argc, t_atom*argv) { - PIMPL::addProperties(this, m_props, argc, argv); + m_pimpl->addProperties(m_props, argc, argv); } void pix_record :: clearPropertiesMess() From 07783b693a7d52ff84dededeee1264a7163a344f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:13:49 +0100 Subject: [PATCH 047/387] plugins/record*: implement getProperties() with a stub --- plugins/DECKLINK/recordDECKLINK.h | 6 ++---- plugins/NDI/recordNDI.h | 6 ++---- plugins/PIPEWIRE/recordPIPEWIRE.h | 6 ++---- plugins/PNM/recordPNM.h | 6 ++---- plugins/QT4L/recordQT4L.h | 6 ++---- plugins/QuickTime/recordQT.h | 1 + plugins/V4L/recordV4L.h | 6 ++---- plugins/V4L2/recordV4L2.h | 6 ++---- 8 files changed, 15 insertions(+), 28 deletions(-) diff --git a/plugins/DECKLINK/recordDECKLINK.h b/plugins/DECKLINK/recordDECKLINK.h index fd97cab87..b7ee31c0f 100644 --- a/plugins/DECKLINK/recordDECKLINK.h +++ b/plugins/DECKLINK/recordDECKLINK.h @@ -82,10 +82,8 @@ class GEM_EXPORT recordDECKLINK : public record virtual const std::string getCodecDescription(const std::string&); virtual bool enumProperties(gem::Properties&); - virtual bool dialog(void) - { - return false; - } + virtual void getProperties(gem::Properties&props) {;}; + virtual bool dialog(void) { return false; } private: diff --git a/plugins/NDI/recordNDI.h b/plugins/NDI/recordNDI.h index 258e69940..3f75c4b66 100644 --- a/plugins/NDI/recordNDI.h +++ b/plugins/NDI/recordNDI.h @@ -90,10 +90,8 @@ class GEM_EXPORT recordNDI : public record virtual const std::string getCodecDescription(const std::string&); virtual bool enumProperties(gem::Properties&); - virtual bool dialog(void) - { - return false; - } + virtual void getProperties(gem::Properties&props) {;}; + virtual bool dialog(void) { return false; } private: diff --git a/plugins/PIPEWIRE/recordPIPEWIRE.h b/plugins/PIPEWIRE/recordPIPEWIRE.h index c5e71fb29..b3cb69a41 100644 --- a/plugins/PIPEWIRE/recordPIPEWIRE.h +++ b/plugins/PIPEWIRE/recordPIPEWIRE.h @@ -78,10 +78,8 @@ class GEM_EXPORT recordPIPEWIRE : public record // properties virtual bool enumProperties(gem::Properties&props); - virtual bool dialog(void) - { - return false; - } + virtual void getProperties(gem::Properties&props) {;}; + virtual bool dialog(void) { return false; } void on_process(void); void on_param_changed(uint32_t id, const struct spa_pod *param); private: diff --git a/plugins/PNM/recordPNM.h b/plugins/PNM/recordPNM.h index e6f9f5d5a..48408c5d2 100644 --- a/plugins/PNM/recordPNM.h +++ b/plugins/PNM/recordPNM.h @@ -80,10 +80,8 @@ class GEM_EXPORT recordPNM : public record // properties virtual bool enumProperties(gem::Properties&props); - virtual bool dialog(void) - { - return false; - } + virtual void getProperties(gem::Properties&props) {;}; + virtual bool dialog(void) { return false; } private: diff --git a/plugins/QT4L/recordQT4L.h b/plugins/QT4L/recordQT4L.h index 8faa5a2a0..d7f9ac8b7 100644 --- a/plugins/QT4L/recordQT4L.h +++ b/plugins/QT4L/recordQT4L.h @@ -119,10 +119,8 @@ class GEM_EXPORT recordQT4L : public record */ virtual bool enumProperties(gem::Properties&props); - virtual bool dialog(void) - { - return false; - } + virtual void getProperties(gem::Properties&props) {;}; + virtual bool dialog(void) { return false; } private: quicktime_t *m_qtfile; diff --git a/plugins/QuickTime/recordQT.h b/plugins/QuickTime/recordQT.h index 14c3b7941..20a1acc3d 100644 --- a/plugins/QuickTime/recordQT.h +++ b/plugins/QuickTime/recordQT.h @@ -92,6 +92,7 @@ class GEM_EXPORT recordQT : public record virtual std::vectorgetCodecs(void); virtual const std::string getCodecDescription(const std::string&codecname); virtual bool enumProperties(gem::Properties&props); + virtual void getProperties(gem::Properties&props) {;}; private: diff --git a/plugins/V4L/recordV4L.h b/plugins/V4L/recordV4L.h index b821e66a0..cac719aaf 100644 --- a/plugins/V4L/recordV4L.h +++ b/plugins/V4L/recordV4L.h @@ -103,10 +103,8 @@ class GEM_EXPORT recordV4L : public record virtual const std::string getCodecDescription(const std::string&); virtual bool enumProperties(gem::Properties&); - virtual bool dialog(void) - { - return false; - } + virtual void getProperties(gem::Properties&props) {;}; + virtual bool dialog(void) { return false; } private: int m_fd; diff --git a/plugins/V4L2/recordV4L2.h b/plugins/V4L2/recordV4L2.h index 5e5d2d628..cceb26caa 100644 --- a/plugins/V4L2/recordV4L2.h +++ b/plugins/V4L2/recordV4L2.h @@ -97,10 +97,8 @@ class GEM_EXPORT recordV4L2 : public record virtual const std::string getCodecDescription(const std::string&); virtual bool enumProperties(gem::Properties&); - virtual bool dialog(void) - { - return false; - } + virtual void getProperties(gem::Properties&props) {;}; + virtual bool dialog(void) { return false; } private: From 7d47d36c7f1526cf7581c016cc91e390b8ef8230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:17:19 +0100 Subject: [PATCH 048/387] plugins/record: add getProperties() and implement _backend prop for recordMETA --- src/plugins/record.cpp | 22 ++++++++++++++++++++++ src/plugins/record.h | 6 +++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/plugins/record.cpp b/src/plugins/record.cpp index 863ba60b2..f2d166234 100644 --- a/src/plugins/record.cpp +++ b/src/plugins/record.cpp @@ -263,6 +263,28 @@ class recordMeta : public gem::plugins::record return false; } + virtual void getProperties(gem::Properties&props) + { + std::vector ids; + if(props.type("_backends")!=gem::Properties::UNSET) { + for(unsigned int i=0; igetProperties(props); + } else { + props.clear(); + } + + if(!ids.empty()) { + props.set("_backends", ids); + } + } + + ////////// // start recording // diff --git a/src/plugins/record.h b/src/plugins/record.h index 08e408f06..014d4865c 100644 --- a/src/plugins/record.h +++ b/src/plugins/record.h @@ -70,8 +70,12 @@ class GEM_EXTERN record */ virtual bool enumProperties(gem::Properties&props) = 0; + /** get the given properties from the currently selected codec + */ + virtual void getProperties(gem::Properties&props) = 0; + ////////// - // popup a dialog to set the codec interactively (interesting on os-x and w32) + // popup a dialog to set the codec interactively (interesting on OSX and w32) // just return FALSE if you don't support dialogs virtual bool dialog(void) = 0; From 97191714d2e8df1179a303422a41e4f8d105b15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:17:40 +0100 Subject: [PATCH 049/387] [pix_record] backend selection/querying --- src/Pixes/pix_record.cpp | 65 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/src/Pixes/pix_record.cpp b/src/Pixes/pix_record.cpp index 1080de63e..ec3ebf1cd 100644 --- a/src/Pixes/pix_record.cpp +++ b/src/Pixes/pix_record.cpp @@ -18,11 +18,14 @@ CPPEXTERN_NEW_WITH_GIMME(pix_record); struct pix_record :: PIMPL { CPPExtern*parent; + PIMPL(CPPExtern*_parent) - :parent(_parent) + : parent(_parent) {}; ~PIMPL(void) {}; + std::vector backends; + static gem::any atom2any(t_atom*ap) { gem::any result; @@ -95,7 +98,7 @@ pix_record :: pix_record(int argc, t_atom *argv) : error("ignoring arguments"); } - m_handle=gem::plugins::record::getInstance(); + m_handle = gem::plugins::record::getInstance(); getCodecList(); } @@ -128,12 +131,17 @@ void pix_record :: startRecording() } // find a handle for the current settings (filename, codec, props) - /* const std::string codec=m_codec; */ stopRecording(); - m_currentFrame = 0; + // do not re-set the codec, if there is no need... /* m_handle->setCodec(codec); */ + + m_props.erase("_backends"); + if(!m_pimpl->backends.empty()) { + m_props.set("_backends", m_pimpl->backends); + } + if(m_handle->start(m_filename, m_props)) { m_filename=std::string(""); m_recording=true; @@ -382,6 +390,52 @@ void pix_record :: fileMess(t_symbol*s, int argc, t_atom *argv) } } +///////////////////////////////////////////////////////// +// backendMess +// +///////////////////////////////////////////////////////// +void pix_record :: backendMess(t_symbol*s, int argc, t_atom*argv) +{ + m_pimpl->backends.clear(); + if(argc) { + for(int i=0; ia_type) { + t_symbol* b=atom_getsymbol(argv+i); + m_pimpl->backends.push_back(b->s_name); + } else { + error("%s must be symbolic", s->s_name); + } + } + } else { + /* no backend requested, just enumerate them */ + if(m_handle) { + const std::string sel = s->s_name; + std::vectoratoms; + gem::any value; + gem::Properties props; + std::vector backends; + props.set("_backends", value); + m_handle->getProperties(props); + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); + } + atoms.clear(); + atoms.push_back(value=(int)(backends.size())); + m_infoOut.send(sel+"s", atoms); + if(!backends.empty()) { + for(int i=0; i(&pix_record::codecMessCallback), From a67f31afd9ef54d9661ff2c8fdeef08938084b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:37:21 +0100 Subject: [PATCH 050/387] _backendinfo: helper for showing backends in help-patches --- help/_backendinfo.pd | 172 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 help/_backendinfo.pd diff --git a/help/_backendinfo.pd b/help/_backendinfo.pd new file mode 100644 index 000000000..6d6b8812e --- /dev/null +++ b/help/_backendinfo.pd @@ -0,0 +1,172 @@ +#N canvas 651 26 695 516 12; +#X obj 104 102 bng 15 250 50 0 \$0-backendinfo \$0-backendinfo <--show_info_on_backends 17 8 0 10 #fcfcfc #000000 #000000; +#N canvas 15 49 489 343 \$0-backendinfo 0; +#X restore 184 207 pd \$0-backendinfo; +#X obj 184 240 r \$0-backendinfo; +#X msg 323 341 clear; +#X obj 323 365 s pd-\$0-backendinfo; +#X msg 207 415 backend; +#N canvas 4 49 685 300 fake 0; +#X obj 178 5 inlet bang; +#X msg 178 25 currentbackend v4l2 \, backends 3 \, backend v4l2 analog \, backend v4l analog \, backend dc1394 iidc \, backend unicap analog \, backend vlc; +#X obj 178 67 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X restore 445 224 pd fake; +#N canvas 147 535 627 326 content 0; +#X obj 123 134 route backend backends currentbackend; +#N canvas 509 196 644 372 numbackends 0; +#X obj 119 11 inlet; +#X obj 119 316 outlet; +#X obj 119 81 f; +#X obj 277 69 inlet reset; +#X msg 277 89 0; +#X obj 119 298 list prepend text 50; +#X msg 119 154 50 On this system you have \$1 backends available; +#X obj 119 101 t f f; +#X obj 146 201 select 0; +#X obj 119 31 route bang float; +#X msg 191 223 90 Click on any of the patches below for information about a specific backend:; +#X connect 0 0 9 0; +#X connect 2 0 7 0; +#X connect 3 0 4 0; +#X connect 4 0 2 1; +#X connect 5 0 1 0; +#X connect 6 0 5 0; +#X connect 7 0 6 0; +#X connect 7 1 8 0; +#X connect 8 1 10 0; +#X connect 9 0 2 0; +#X connect 9 1 2 1; +#X connect 10 0 5 0; +#X restore 196 189 pd numbackends; +#N canvas 12 49 638 300 currentbackend 0; +#X obj 119 31 inlet; +#X obj 119 186 outlet; +#X obj 119 82 symbol ; +#X obj 325 33 inlet reset; +#X obj 325 53 symbol ; +#X obj 119 102 select ; +#X obj 119 164 list prepend text 50 65; +#X obj 119 51 route bang; +#X obj 202 54 symbol; +#X msg 224 124 You are currently using the '\$1' backend; +#X msg 119 144 Currently you are not using any specific backend...; +#X connect 0 0 7 0; +#X connect 2 0 5 0; +#X connect 3 0 4 0; +#X connect 4 0 2 1; +#X connect 5 0 10 0; +#X connect 5 1 9 0; +#X connect 6 0 1 0; +#X connect 7 0 2 0; +#X connect 7 1 8 0; +#X connect 8 0 2 1; +#X connect 9 0 6 0; +#X connect 10 0 6 0; +#X restore 330 189 pd currentbackend; +#N canvas 443 146 538 511 listbackends 0; +#X obj 149 61 inlet; +#X obj 149 297 outlet; +#X obj 261 61 inlet reset; +#X obj 149 84 list split 1; +#X obj 149 107 symbol unknown; +#X obj 261 107 symbol unknown; +#X obj 149 130 t b s; +#X obj 149 153 i; +#X obj 149 199 t f f; +#X obj 149 274 list prepend obj 60; +#X obj 311 163 makefilename $%d; +#X obj 149 176 + 25; +#X msg 194 131 120; +#X msg 311 140 1; +#X obj 149 222 pack 0 s s s; +#X obj 438 163 symbol \$2; +#X obj 261 84 t b b b b; +#X msg 149 245 \$1 \$2-\$4plugin \$3; +#X connect 0 0 3 0; +#X connect 2 0 16 0; +#X connect 3 0 4 0; +#X connect 4 0 6 0; +#X connect 5 0 4 1; +#X connect 6 0 7 0; +#X connect 6 1 14 1; +#X connect 7 0 11 0; +#X connect 8 0 14 0; +#X connect 8 1 7 1; +#X connect 9 0 1 0; +#X connect 10 0 14 2; +#X connect 11 0 8 0; +#X connect 12 0 7 1; +#X connect 13 0 10 0; +#X connect 14 0 17 0; +#X connect 15 0 14 3; +#X connect 16 0 5 0; +#X connect 16 1 12 0; +#X connect 16 2 13 0; +#X connect 16 3 15 0; +#X connect 17 0 9 0; +#X restore 123 159 pd listbackends; +#X obj 196 221 t a; +#X obj 400 134 t b b b; +#X obj 400 47 inlet reset; +#X obj 196 261 s pd-\$0-backendinfo; +#X obj 196 241 list trim; +#X obj 146 25 inlet finalize; +#X obj 146 49 t b b b; +#X obj 123 109 spigot; +#X msg 195 83 0; +#X obj 400 69 t b b; +#X msg 427 91 1; +#X obj 123 84 r \$1-info; +#X connect 0 0 3 0; +#X connect 0 1 1 0; +#X connect 0 2 2 0; +#X connect 1 0 4 0; +#X connect 2 0 4 0; +#X connect 3 0 4 0; +#X connect 4 0 8 0; +#X connect 5 0 3 1; +#X connect 5 1 1 1; +#X connect 5 2 2 1; +#X connect 6 0 13 0; +#X connect 8 0 7 0; +#X connect 9 0 10 0; +#X connect 10 0 1 0; +#X connect 10 1 2 0; +#X connect 10 2 12 0; +#X connect 11 0 0 0; +#X connect 12 0 11 1; +#X connect 13 0 5 0; +#X connect 13 1 14 0; +#X connect 14 0 11 1; +#X connect 15 0 11 0; +#X restore 351 315 pd content; +#X obj 207 385 t b; +#X msg 422 168 bang; +#X obj 184 290 t b b; +#X obj 323 290 t b b, f 14; +#X obj 184 260 t b b b; +#X msg 184 321 loadbang \, vis 1; +#X obj 207 446 s \$1-ctl; +#X obj 445 247 s \$1-info; +#X obj 422 196 t b b b; +#X text 79 45 this is a helper-abstraction for use in Gem's helppatches; +#X connect 2 0 12 0; +#X connect 3 0 4 0; +#X connect 5 0 14 0; +#X connect 6 0 15 0; +#X connect 8 0 5 0; +#X connect 9 0 16 0; +#X connect 10 0 13 0; +#X connect 10 1 7 0; +#X connect 11 0 3 0; +#X connect 11 1 7 1; +#X connect 12 0 10 0; +#X connect 12 1 8 0; +#X connect 12 2 11 0; +#X connect 13 0 4 0; +#X connect 16 0 10 0; +#X connect 16 1 6 0; +#X connect 16 2 11 0; +#X coords 0 -1 1 1 170 20 2 100 100; From 5acc06a8ea7e68af297a863312cb1436fd388ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:43:11 +0100 Subject: [PATCH 051/387] Use _backendinfo in help-patches --- help/pix_record-help.pd | 178 ++------------------------- help/pix_video-help.pd | 266 ++++++---------------------------------- 2 files changed, 46 insertions(+), 398 deletions(-) diff --git a/help/pix_record-help.pd b/help/pix_record-help.pd index 88ed13f93..da96238b9 100644 --- a/help/pix_record-help.pd +++ b/help/pix_record-help.pd @@ -90,7 +90,7 @@ #N canvas 129 512 599 344 PROPERTIES 0; #N canvas 607 622 561 319 PropertyLogic 0; #X obj 54 6 inlet; -#X obj 293 70 r \$0-nfo; +#X obj 293 70 r \$0-info; #X obj 54 45 route codeclist codec; #X obj 126 67 f; #N canvas 82 113 577 363 codecs 0; @@ -305,7 +305,7 @@ #X obj 100 181 t f; #X msg 126 117 0; #X obj 126 139 t f; -#X obj 293 156 s \$0-nfoprint; +#X obj 293 156 s \$0-infoprint; #N canvas 4 49 450 300 reset 0; #X obj 99 217 s \$0-numcodecs; #X obj 99 195 t a a; @@ -360,7 +360,7 @@ #X obj 87 181 hradio 15 1 0 1 \$0-selprop \$0-numproperties empty 0 -8 0 10 #fcfcfc #000000 #000000 0; #X msg 87 217; #X floatatom 87 197 0 0 0 0 - \$0-propvalue - 0; -#X obj 297 200 r \$0-makeprop; +#X obj 297 199 r \$0-makeprop; #X text 121 257 override the framerate (default: Gem's framerate); #X text 82 149 set a codec-property:; #X text 86 51 select an available codec (and query available properties):; @@ -378,8 +378,8 @@ #X obj 620 304 s \$0-ctl; #N canvas 6 49 515 369 print 0; #X obj 102 176 inlet; -#X obj 102 198 s \$0-nfo; -#X obj 102 220 r \$0-nfoprint; +#X obj 102 198 s \$0-info; +#X obj 102 220 r \$0-infoprint; #X obj 102 242 print INFO; #X text 62 90 actually you can just hook a [print] to the 3rd outlet.; #X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.; @@ -387,167 +387,6 @@ #X connect 2 0 3 0; #X restore 553 375 pd print; #X obj 518 8 declare -lib Gem; -#N canvas 697 49 586 503 backend 0; -#X obj 104 103 bng 15 250 50 0 \$0-backendinfo \$0-backendinfo <--show_info_on_backends 17 8 0 10 #fcfcfc #000000 #000000; -#N canvas 15 49 450 300 \$0-backendinfo 0; -#X text 50 65 Currently you are not using any specific driver...; -#X text 50 50 On this system you have 0 backends available; -#X restore 184 207 pd \$0-backendinfo; -#X obj 184 240 r \$0-backendinfo; -#X msg 223 331 clear; -#X obj 223 351 s pd-\$0-backendinfo; -#X obj 203 424 s \$0-ctl; -#N canvas 4 49 685 300 fake 0; -#X obj 178 5 inlet bang; -#X obj 178 67 outlet; -#X msg 178 25 currentbackend v4l2 \, backends 3 \, backend v4l2 \, backend PNM \, backend ndi \, backend vlc; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X restore 379 245 pd fake; -#N canvas 14 49 450 300 content 0; -#N canvas 12 49 638 300 currentdriver 0; -#X obj 119 31 inlet; -#X obj 119 186 outlet; -#X obj 119 82 symbol ; -#X obj 325 33 inlet reset; -#X obj 325 53 symbol ; -#X obj 119 102 select ; -#X obj 119 164 list prepend text 50 65; -#X obj 119 51 route bang; -#X obj 202 54 symbol; -#X msg 224 124 You are currently using the '\$1' driver; -#X msg 119 144 Currently you are not using any specific driver...; -#X connect 0 0 7 0; -#X connect 2 0 5 0; -#X connect 3 0 4 0; -#X connect 4 0 2 1; -#X connect 5 0 10 0; -#X connect 5 1 9 0; -#X connect 6 0 1 0; -#X connect 7 0 2 0; -#X connect 7 1 8 0; -#X connect 8 0 2 1; -#X connect 9 0 6 0; -#X connect 10 0 6 0; -#X restore 303 179 pd currentdriver; -#X obj 190 211 t a; -#X obj 357 124 t b b b; -#X obj 357 58 inlet reset; -#X obj 190 251 s pd-\$0-backendinfo; -#X obj 190 231 list trim; -#X obj 140 25 inlet finalize; -#X obj 123 94 r \$0-nfo; -#X obj 123 124 route backend backends currentbackend; -#N canvas 12 49 456 510 listbackends 0; -#X obj 149 61 inlet; -#X obj 149 276 outlet; -#X obj 241 61 inlet reset; -#X obj 149 81 list split 1; -#X obj 149 101 symbol unknown; -#X obj 241 101 symbol unknown; -#X obj 149 121 t b s; -#X obj 149 141 i; -#X obj 149 161 + 20; -#X obj 149 181 t f f; -#X msg 194 122 100; -#X obj 149 253 list prepend obj 60; -#X msg 291 143 0; -#X obj 291 163 makefilename $%d; -#X obj 149 201 pack 0 s s; -#X obj 241 81 t b b b; -#X msg 149 221 \$1 \$2-recordplugin \$3; -#X connect 0 0 3 0; -#X connect 2 0 15 0; -#X connect 3 0 4 0; -#X connect 4 0 6 0; -#X connect 5 0 4 1; -#X connect 6 0 7 0; -#X connect 6 1 14 1; -#X connect 7 0 8 0; -#X connect 8 0 9 0; -#X connect 9 0 14 0; -#X connect 9 1 7 1; -#X connect 10 0 7 1; -#X connect 11 0 1 0; -#X connect 12 0 13 0; -#X connect 13 0 14 2; -#X connect 14 0 16 0; -#X connect 15 0 5 0; -#X connect 15 1 10 0; -#X connect 15 2 12 0; -#X connect 16 0 11 0; -#X restore 123 149 pd listbackends; -#N canvas 509 196 644 372 numdbackends 0; -#X obj 119 11 inlet; -#X obj 119 316 outlet; -#X obj 119 81 f; -#X obj 277 69 inlet reset; -#X msg 277 89 0; -#X obj 119 298 list prepend text 50; -#X obj 119 101 t f f; -#X obj 146 201 select 0; -#X obj 119 31 route bang float; -#X msg 191 223 90 Click on any of the patches below for information about a specific driver:; -#X msg 119 154 50 On this system you have \$1 backends available; -#X connect 0 0 8 0; -#X connect 2 0 6 0; -#X connect 3 0 4 0; -#X connect 4 0 2 1; -#X connect 5 0 1 0; -#X connect 6 0 10 0; -#X connect 6 1 7 0; -#X connect 7 1 9 0; -#X connect 8 0 2 0; -#X connect 8 1 2 1; -#X connect 9 0 5 0; -#X connect 10 0 5 0; -#X restore 190 179 pd numdbackends; -#X obj 140 48 t a a; -#X connect 0 0 1 0; -#X connect 1 0 5 0; -#X connect 2 0 9 1; -#X connect 2 1 10 1; -#X connect 2 2 0 1; -#X connect 3 0 2 0; -#X connect 5 0 4 0; -#X connect 6 0 11 0; -#X connect 7 0 8 0; -#X connect 8 0 9 0; -#X connect 8 1 10 0; -#X connect 8 2 0 0; -#X connect 9 0 1 0; -#X connect 10 0 1 0; -#X connect 11 0 10 0; -#X connect 11 1 0 0; -#X restore 351 305 pd content; -#X obj 203 375 t b; -#X obj 184 280 t b b; -#X obj 223 280 t b b; -#X obj 184 260 t b b b; -#X msg 184 311 loadbang \, vis 1; -#X msg 203 405 backend; -#X obj 379 265 s \$0-nfo; -#X obj 351 219 t b b b, f 10; -#X msg 351 191 FAKE; -#X connect 2 0 11 0; -#X connect 3 0 4 0; -#X connect 6 0 14 0; -#X connect 8 0 13 0; -#X connect 9 0 12 0; -#X connect 9 1 7 0; -#X connect 10 0 3 0; -#X connect 10 1 7 1; -#X connect 11 0 9 0; -#X connect 11 1 8 0; -#X connect 11 2 10 0; -#X connect 12 0 4 0; -#X connect 13 0 5 0; -#X connect 15 0 9 0; -#X connect 15 1 6 0; -#X connect 15 2 10 0; -#X connect 16 0 15 0; -#X coords 0 -1 1 1 170 20 2 100 100; -#X restore 197 366 pd backend specific information; #X obj 451 87 pix_test; #X obj 451 120 pix_texture; #X obj 451 141 square 4; @@ -555,9 +394,10 @@ #X text 13 73 [pix_record] outputs a series of pixes \, e.g. into a movie file. You can set the file to write to via the "file" message., f 70; #X text 14 331 [pix_record] has a number of output methods \, like movies \, pipes or videodevices. Not all may be available on your system. Check here which backends you can use:, f 70; #X text 17 273 The recording is finished and the file flushed to disk after a "record 0" message is received. You might not be able to access the file for reading before recording has finished., f 69; +#X obj 197 366 _backendinfo \$0 record; #X connect 7 0 8 0; #X connect 8 0 7 0; -#X connect 11 0 48 0; +#X connect 11 0 47 0; #X connect 15 1 38 0; #X connect 15 2 45 0; #X connect 18 0 15 0; @@ -575,6 +415,6 @@ #X connect 39 0 24 0; #X connect 40 0 24 0; #X connect 42 0 15 0; +#X connect 47 0 48 0; #X connect 48 0 49 0; -#X connect 49 0 50 0; -#X connect 50 0 15 0; +#X connect 49 0 15 0; diff --git a/help/pix_video-help.pd b/help/pix_video-help.pd index a4373dee3..98220de2c 100644 --- a/help/pix_video-help.pd +++ b/help/pix_video-help.pd @@ -1,28 +1,22 @@ -#N canvas 235 64 871 639 10; +#N canvas 235 64 871 645 10; #X declare -lib Gem; #X text 671 9 GEM object; -#X obj 8 46 cnv 15 540 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 559 47 cnv 15 280 500 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 46 cnv 15 540 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 559 47 cnv 15 280 500 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 71 21 Class: pix object (pix source); #X text 561 33 Example:; #X text 50 2 Synopsis: [pix_video]; #X text 29 47 Description: open a camera and get input; -#X obj 9 182 cnv 15 540 365 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 9 149 cnv 15 540 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 182 cnv 15 540 365 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 9 149 cnv 15 540 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 148 Arguments:; #X text 17 486 Outlet 1: gemlist; #X text 17 198 Inlet 1: gemlist; -#X text 16 308 Inlet 1: colorspace "RGBA|YUV|Grey": decodes the current -film into the specified colorspace \, if supported by the backend., f 62; +#X text 16 308 Inlet 1: colorspace "RGBA|YUV|Grey": decodes the current film into the specified colorspace \, if supported by the backend., f 62; #X text 64 159 none; #X text 33 184 Inlet:; #X text 33 472 Outlet:; -#X obj 717 460 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 717 460 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 0 22 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; @@ -44,23 +38,15 @@ film into the specified colorspace \, if supported by the backend., f 62; #X restore 722 499 pd gemwin; #X msg 722 477 create; #X text 718 456 Create window:; -#X obj 563 86 cnv 15 230 280 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 563 86 cnv 15 230 280 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 567 526 rectangle 4 3; #X obj 567 502 pix_texture; -#X text 17 216 Inlet 1: device : the number or file path to the -input device; -#X text 16 339 Inlet 1: dimen : set various dimensions -for the image (does not work on all capture devices); -#X text 15 371 Inlet 1: enumerate: list all devices to the console -; -#X text 17 245 Inlet 1: backend : switch between different backends -\, e.g. v4l \, ieee1394 \, etc.; -#X text 16 276 Inlet 1: backend : switch between different backends -\, e.g. v4l \, v4l2 \, dv...; -#X text 13 66 [pix_video] opens a wide array of cameras \, USB to FireWire -to capture cards \, as long as the camera is supported by your operating -system.; +#X text 17 216 Inlet 1: device : the number or file path to the input device; +#X text 16 339 Inlet 1: dimen : set various dimensions for the image (does not work on all capture devices); +#X text 15 371 Inlet 1: enumerate: list all devices to the console; +#X text 17 245 Inlet 1: backend : switch between different backends \, e.g. v4l \, ieee1394 \, etc.; +#X text 16 276 Inlet 1: backend : switch between different backends \, e.g. v4l \, v4l2 \, dv...; +#X text 13 66 [pix_video] opens a wide array of cameras \, USB to FireWire to capture cards \, as long as the camera is supported by your operating system.; #X obj 567 58 gemhead; #X msg 596 124 dimen 64 64; #X msg 586 99 dimen 256 128; @@ -71,12 +57,9 @@ system.; #X msg 642 312 backend dv; #N canvas 516 113 572 565 properties 0; #X msg 41 203 enumProps; -#X obj 31 21 cnv 15 400 80 empty empty readProperties 20 12 0 14 -233017 --66577 0; -#X obj 39 47 hradio 15 1 0 1 \$0-propreadId \$0-propreadId empty 0 --8 0 10 -262144 -1 -1 0; -#X obj 40 70 cnv 15 260 20 empty \$0-propreadName 10 9 0 14 --203904 -66577 0; +#X obj 31 21 cnv 15 400 80 empty empty readProperties 20 12 0 14 #e0e0e0 #404040 0; +#X obj 39 47 hradio 15 1 0 1 \$0-propreadId \$0-propreadId empty 0 -8 0 10 #fcfcfc #000000 #000000 0; +#X obj 40 70 cnv 15 260 20 empty \$0-propreadName 10 9 0 14 #c4c4fc #404040 0; #N canvas 186 49 450 537 PropertyLogic 0; #N canvas 586 84 774 460 id2property 0; #X obj 353 106 r \$0-info; @@ -304,30 +287,21 @@ system.; #X connect 13 0 8 0; #X connect 16 0 17 0; #X restore 41 526 pd PropertyLogic; -#X obj 310 70 cnv 15 100 20 empty \$0-propreadValue -- 10 9 0 14 -261234 --66577 0; -#X obj 31 111 cnv 15 400 80 empty empty writeProperties 20 12 0 14 --233017 -66577 0; -#X obj 39 137 hradio 15 1 0 1 \$0-propwriteId \$0-propwriteId empty -0 -8 0 10 -262144 -1 -1 0; -#X obj 40 160 cnv 15 260 20 empty \$0-propwriteName 10 9 0 14 --203904 -66577 0; -#X obj 311 160 nbx 5 20 -1e+37 1e+37 0 0 \$0-propwriteValue \$0-propwriteValue -empty 0 -8 0 14 -204786 -1 -1 0 256; +#X obj 310 70 cnv 15 100 20 empty \$0-propreadValue -- 10 9 0 14 #fcc4c4 #404040 0; +#X obj 31 111 cnv 15 400 80 empty empty writeProperties 20 12 0 14 #e0e0e0 #404040 0; +#X obj 39 137 hradio 15 1 0 1 \$0-propwriteId \$0-propwriteId empty 0 -8 0 10 #fcfcfc #000000 #000000 0; +#X obj 40 160 cnv 15 260 20 empty \$0-propwriteName 10 9 0 14 #c4c4fc #404040 0; +#X obj 311 160 nbx 5 20 -1e+37 1e+37 0 0 \$0-propwriteValue \$0-propwriteValue empty 0 -8 0 14 #c4fcc4 #000000 #000000 0 256; #X msg 66 315 get bus_info; #X msg 83 392 set quality 5; #X obj 66 294 r \$0-propget; #X obj 83 372 r \$0-propset; #X msg 87 340 get Hue Saturation; #X text 208 340 you can query several properties at once; -#X text 146 295 query a (readable) property via a message "get " -; -#X text 161 372 set a (writable) property via a message "set -"; -#X text 70 224 this will return 2 lists of readable and writable properties -through the "info" outlet of [pix_video].; -#X text 72 257 NOTE that propertynames are always single symbols that -might contain spaces (and other weird characters); +#X text 146 295 query a (readable) property via a message "get "; +#X text 161 372 set a (writable) property via a message "set "; +#X text 70 224 this will return 2 lists of readable and writable properties through the "info" outlet of [pix_video].; +#X text 72 257 NOTE that propertynames are always single symbols that might contain spaces (and other weird characters); #X text 103 203 INIT: query names of all available properties; #X text 83 423 ATOMIC setting of multiple properties; #X msg 99 441 clearProps; @@ -354,10 +328,8 @@ might contain spaces (and other weird characters); #X obj 655 459 s \$0-info; #X obj 586 376 t a a; #N canvas 166 121 570 420 device 0; -#X obj 204 60 cnv 20 20 20 empty \$0-open-canvas 0 4 10 0 16 -233017 --1 0; -#X obj 60 61 hradio 18 1 0 8 empty empty empty 0 -6 0 8 -225271 -1 --1 0; +#X obj 204 60 cnv 20 20 20 empty \$0-open-canvas 0 4 10 0 16 #e0e0e0 #000000 0; +#X obj 60 61 hradio 18 1 0 8 empty empty empty 0 -6 0 8 #d8fcd8 #000000 #000000 0; #X obj 60 13 inlet; #X msg 160 254 label \$1; #X obj 160 232 makefilename %d; @@ -389,186 +361,22 @@ might contain spaces (and other weird characters); #X connect 15 0 8 0; #X coords 0 -1 1 1 165 20 1 60 60; #X restore 609 187 pd device; -#X obj 36 565 cnv 15 400 30 empty empty empty 20 12 0 14 -260097 -66577 -0; -#X text 48 565 NOTE: usually you cannot use a camera more than once -at the same time!; -#X obj 563 413 cnv 15 80 30 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 36 565 cnv 15 400 30 empty empty empty 20 12 0 14 #fc8000 #404040 0; +#X text 48 565 NOTE: usually you cannot use a camera more than once at the same time!; +#X obj 563 413 cnv 15 80 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 567 418 pix_video; #X obj 657 393 print videoctl; -#X obj 647 346 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 647 346 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 665 345 backend \$1; #X text 686 286 (if available); -#X text 16 388 Inlet 1: dialog: open a dialog to configure the input -device (depending on backend / Operating System); -#X text 18 501 Outlet 2: info (for enumerating devices \, querying -properties \, ...); -#X text 15 423 Inlet 1: enumProps \, get \, set \, clearProps \, setProps -\, applyProps: interact with backend/device properties; +#X text 16 388 Inlet 1: dialog: open a dialog to configure the input device (depending on backend / Operating System); +#X text 18 501 Outlet 2: info (for enumerating devices \, querying properties \, ...); +#X text 15 423 Inlet 1: enumProps \, get \, set \, clearProps \, setProps \, applyProps: interact with backend/device properties; #X obj 657 374 r \$0-ctl; -#X text 54 600 you can use [pix_buffer] to distribute the same pix -to different parts of your render-chain; +#X text 54 600 you can use [pix_buffer] to distribute the same pix to different parts of your render-chain; #X msg 625 235 device /dev/fw1; -#N canvas 697 49 586 667 backend 0; -#X obj 104 122 bng 15 250 50 0 \$0-backendinfo \$0-backendinfo <--show_info_on_backends -17 8 0 10 -262144 -1 -1; -#N canvas 15 49 450 300 \$0-backendinfo 0; -#X restore 184 207 pd \$0-backendinfo; -#X obj 184 240 r \$0-backendinfo; -#X msg 223 331 clear; -#X obj 223 351 s pd-\$0-backendinfo; -#X obj 203 424 s \$0-ctl; -#X msg 203 405 backend; -#N canvas 4 49 685 300 fake 0; -#X obj 178 5 inlet bang; -#X msg 178 25 currentbackend v4l2 \, backends 3 \, backend v4l2 analog -\, backend v4l analog \, backend dc1394 iidc \, backend unicap analog -\, backend vlc; -#X obj 178 67 outlet; -#X connect 0 0 1 0; -#X connect 1 0 2 0; -#X restore 265 414 pd fake; -#X obj 265 434 s \$0-info; -#N canvas 14 49 450 300 content 0; -#X obj 123 124 route backend backends currentbackend; -#N canvas 509 196 644 372 numbackends 0; -#X obj 119 11 inlet; -#X obj 119 316 outlet; -#X obj 119 81 f; -#X obj 277 69 inlet reset; -#X msg 277 89 0; -#X obj 119 298 list prepend text 50; -#X msg 119 154 50 On this system you have \$1 backends available; -#X obj 119 101 t f f; -#X obj 146 201 select 0; -#X obj 119 31 route bang float; -#X msg 191 223 90 Click on any of the patches below for information -about a specific backend:; -#X connect 0 0 9 0; -#X connect 2 0 7 0; -#X connect 3 0 4 0; -#X connect 4 0 2 1; -#X connect 5 0 1 0; -#X connect 6 0 5 0; -#X connect 7 0 6 0; -#X connect 7 1 8 0; -#X connect 8 1 10 0; -#X connect 9 0 2 0; -#X connect 9 1 2 1; -#X connect 10 0 5 0; -#X restore 190 179 pd numbackends; -#N canvas 12 49 638 300 currentbackend 0; -#X obj 119 31 inlet; -#X obj 119 186 outlet; -#X obj 119 82 symbol ; -#X obj 325 33 inlet reset; -#X obj 325 53 symbol ; -#X obj 119 102 select ; -#X obj 119 164 list prepend text 50 65; -#X obj 119 51 route bang; -#X obj 202 54 symbol; -#X msg 224 124 You are currently using the '\$1' backend; -#X msg 119 144 Currently you are not using any specific backend...; -#X connect 0 0 7 0; -#X connect 2 0 5 0; -#X connect 3 0 4 0; -#X connect 4 0 2 1; -#X connect 5 0 10 0; -#X connect 5 1 9 0; -#X connect 6 0 1 0; -#X connect 7 0 2 0; -#X connect 7 1 8 0; -#X connect 8 0 2 1; -#X connect 9 0 6 0; -#X connect 10 0 6 0; -#X restore 280 179 pd currentbackend; -#N canvas 12 49 456 510 listbackends 0; -#X obj 149 61 inlet; -#X obj 149 276 outlet; -#X obj 241 61 inlet reset; -#X obj 149 81 list split 1; -#X obj 149 101 symbol unknown; -#X obj 241 101 symbol unknown; -#X obj 149 121 t b s; -#X obj 149 141 i; -#X obj 149 161 + 20; -#X obj 149 181 t f f; -#X msg 149 221 \$1 \$2-videoplugin \$3; -#X msg 194 122 100; -#X obj 149 253 list prepend obj 60; -#X msg 291 143 0; -#X obj 291 163 makefilename $%d; -#X obj 149 201 pack 0 s s; -#X obj 241 81 t b b b; -#X connect 0 0 3 0; -#X connect 2 0 16 0; -#X connect 3 0 4 0; -#X connect 4 0 6 0; -#X connect 5 0 4 1; -#X connect 6 0 7 0; -#X connect 6 1 15 1; -#X connect 7 0 8 0; -#X connect 8 0 9 0; -#X connect 9 0 15 0; -#X connect 9 1 7 1; -#X connect 10 0 12 0; -#X connect 11 0 7 1; -#X connect 12 0 1 0; -#X connect 13 0 14 0; -#X connect 14 0 15 2; -#X connect 15 0 10 0; -#X connect 16 0 5 0; -#X connect 16 1 11 0; -#X connect 16 2 13 0; -#X restore 123 149 pd listbackends; -#X obj 123 94 r \$0-info; -#X obj 190 211 t a; -#X obj 337 125 t b b b; -#X obj 337 59 inlet reset; -#X obj 190 251 s pd-\$0-backendinfo; -#X obj 190 231 list trim; -#X obj 140 25 inlet finalize; -#X connect 0 0 3 0; -#X connect 0 1 1 0; -#X connect 0 2 2 0; -#X connect 1 0 5 0; -#X connect 2 0 5 0; -#X connect 3 0 5 0; -#X connect 4 0 0 0; -#X connect 5 0 9 0; -#X connect 6 0 3 1; -#X connect 6 1 1 1; -#X connect 6 2 2 1; -#X connect 7 0 6 0; -#X connect 9 0 8 0; -#X connect 10 0 2 0; -#X connect 10 0 1 0; -#X restore 351 305 pd content; -#X obj 203 375 t b; -#X msg 265 388 bang; -#X obj 184 280 t b b; -#X obj 223 280 t b b; -#X obj 184 260 t b b b; -#X msg 184 311 loadbang \, vis 1; -#X connect 2 0 14 0; -#X connect 3 0 4 0; -#X connect 6 0 5 0; -#X connect 7 0 8 0; -#X connect 10 0 6 0; -#X connect 11 0 7 0; -#X connect 12 0 15 0; -#X connect 12 1 9 0; -#X connect 13 0 3 0; -#X connect 13 1 9 1; -#X connect 14 0 12 0; -#X connect 14 1 10 0; -#X connect 14 2 13 0; -#X connect 15 0 4 0; -#X coords 0 -1 1 1 170 40 1 100 100; -#X restore 156 103 pd backend specific information; #X obj 738 8 declare -lib Gem; +#X obj 156 103 _backendinfo \$0 video; #X connect 17 0 18 0; #X connect 18 0 17 0; #X connect 22 0 21 0; From 5242e47ea5a76f2f12576a7477519978392d1225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:51:27 +0100 Subject: [PATCH 052/387] mode-help: backend info --- help/model-help.pd | 62 +++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/help/model-help.pd b/help/model-help.pd index 407a7c5f7..5aaad4b51 100644 --- a/help/model-help.pd +++ b/help/model-help.pd @@ -1,4 +1,4 @@ -#N canvas 426 119 673 647 10; +#N canvas 426 119 673 690 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; #X obj 464 77 cnv 15 200 480 empty empty empty 20 12 0 14 #dce4fc #404040 0; @@ -75,14 +75,26 @@ #X msg 511 381 backend OBJ; #X msg 520 401 backend ASSIMP3; #X text 27 542 Inlet 1: message: backend :: choose which backend to use first to open the model; -#X obj 500 524 print info; #X msg 518 424 backend; #X obj 473 325 t a; #X obj 558 346 t a; #X text 567 424 query backends; #X obj 490 424 t a; +#X obj 558 8 declare -lib Gem; +#X obj 494 451 r \$0-ctl; +#N canvas 6 49 515 369 print 0; +#X obj 102 176 inlet; +#X obj 102 198 s \$0-info; +#X obj 102 220 r \$0-infoprint; +#X obj 102 242 print INFO; +#X text 62 90 actually you can just hook a [print] to the 3rd outlet.; +#X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.; +#X connect 0 0 1 0; +#X connect 2 0 3 0; +#X restore 500 524 pd print; +#X obj 8 644 cnv 15 450 30 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 41 647 _backendinfo \$0 model; #N canvas 1230 127 534 459 properties 0; -#X obj 39 405 outlet; #X msg 39 175 enumProps; #X text 107 177 print available properties (for reading and/or writing); #X msg 61 214 get texheight texwidth; @@ -99,39 +111,39 @@ #X text 26 22 getting/setting properties; #X text 26 68 depending on the used backend for loading a model \, different properties might be available., f 61; #X text 30 104 properties can only be enumerated after a model has been loaded (and thus the loader-backend has been determined); -#X connect 1 0 0 0; -#X connect 3 0 0 0; -#X connect 4 0 0 0; -#X connect 7 0 0 0; -#X connect 9 0 0 0; -#X connect 11 0 0 0; -#X restore 533 478 pd properties; -#X obj 558 8 declare -lib Gem; +#X obj 39 405 s \$0-ctl; +#X connect 0 0 16 0; +#X connect 2 0 16 0; +#X connect 3 0 16 0; +#X connect 6 0 16 0; +#X connect 8 0 16 0; +#X connect 10 0 16 0; +#X restore 353 648 pd properties; #X connect 3 0 4 0; #X connect 4 0 3 0; #X connect 22 0 23 0; #X connect 24 0 48 0; -#X connect 25 1 57 0; +#X connect 25 1 64 0; #X connect 26 0 27 0; #X connect 27 0 37 0; #X connect 28 0 29 0; -#X connect 29 0 60 0; -#X connect 30 0 59 0; +#X connect 29 0 59 0; +#X connect 30 0 58 0; #X connect 31 0 32 0; -#X connect 32 0 60 0; -#X connect 33 0 59 0; -#X connect 34 0 60 0; -#X connect 35 0 60 0; +#X connect 32 0 59 0; +#X connect 33 0 58 0; +#X connect 34 0 59 0; +#X connect 35 0 59 0; #X connect 36 0 30 0; -#X connect 37 0 59 0; +#X connect 37 0 58 0; #X connect 38 0 35 0; -#X connect 48 0 59 0; +#X connect 48 0 58 0; #X connect 49 0 33 0; #X connect 52 0 34 0; -#X connect 54 0 62 0; -#X connect 55 0 62 0; -#X connect 58 0 62 0; +#X connect 54 0 61 0; +#X connect 55 0 61 0; +#X connect 57 0 61 0; +#X connect 58 0 25 0; #X connect 59 0 25 0; -#X connect 60 0 25 0; -#X connect 62 0 25 0; +#X connect 61 0 25 0; #X connect 63 0 25 0; From c064a382580f763554996422c0e25a6c784b44dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:51:38 +0100 Subject: [PATCH 053/387] de-deprecate "backend" message for [pix_film] --- src/Pixes/pix_film.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pixes/pix_film.cpp b/src/Pixes/pix_film.cpp index 81725bcbd..941fba5b8 100644 --- a/src/Pixes/pix_film.cpp +++ b/src/Pixes/pix_film.cpp @@ -627,8 +627,8 @@ void pix_film :: autoMess(double speed) void pix_film :: backendMess(t_symbol*s, int argc, t_atom*argv) { int i; - if(gensym("loader") != s) { - error("'%s' is deprecated; please use '%s' instead", s->s_name, "loader"); + if(gensym("backend") != s) { + error("'%s' is deprecated; please use '%s' instead", s->s_name, "backend"); } m_backends.clear(); if(argc) { From 903b0e5a80e9db0b53bcb50b633158315f2d5846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 12:56:55 +0100 Subject: [PATCH 054/387] pix_film-help: show backendinfo --- help/pix_film-help.pd | 211 ++++++++++++++++-------------------------- 1 file changed, 82 insertions(+), 129 deletions(-) diff --git a/help/pix_film-help.pd b/help/pix_film-help.pd index 6344cb500..56032ff1f 100644 --- a/help/pix_film-help.pd +++ b/help/pix_film-help.pd @@ -1,20 +1,15 @@ #N canvas 163 143 704 623 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 272 cnv 15 430 340 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 272 cnv 15 430 340 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 274 Inlets:; #X text 39 487 Outlets:; -#X obj 9 239 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 239 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 238 Arguments:; -#X obj 8 56 cnv 15 430 180 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 57 cnv 15 250 450 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 57 cnv 15 250 450 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 40 Example:; -#X obj 594 440 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 594 440 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 0 50 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; @@ -36,88 +31,55 @@ #X restore 599 479 pd gemwin; #X msg 599 460 create; #X text 595 439 Create window:; -#X obj 451 88 cnv 15 215 300 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 451 88 cnv 15 215 300 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 63 gemhead; #X text 17 503 Outlet 1: gemlist; #X text 18 288 Inlet 1: gemlist, f 68; #X obj 451 410 pix_texture; -#X obj 463 90 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 463 90 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 505 57 open a supported; #X text 506 68 movie-clip; -#X floatatom 466 342 5 0 0 3 length - -; -#X floatatom 514 342 5 0 0 3 width - -; -#X floatatom 565 342 5 0 0 3 height - -; -#X obj 514 281 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 --1 -1; -#X floatatom 504 263 5 0 10000 1 frameNum - -; +#X floatatom 466 352 5 0 0 3 length - - 0; +#X floatatom 514 352 5 0 0 3 width - - 0; +#X floatatom 565 352 5 0 0 3 height - - 0; +#X floatatom 504 263 5 0 10000 1 frameNum - - 0; #X text 71 31 Class: pix object (pix source); #X text 29 57 Description: load in a movie-file; #X obj 463 117 openpanel; #X obj 451 432 rectangle 4 3; #X text 50 12 Synopsis: [pix_film]; -#X text 15 78 [pix_film] loads in a preproduced digital-video to be -used as a texture \, bitblit or something else., f 69; +#X text 15 78 [pix_film] loads in a preproduced digital-video to be used as a texture \, bitblit or something else., f 69; #X text 64 249 symbol: file to load initially; -#X text 18 303 Inlet 1: message: open [RGBA|YUV|Grey]: opens -the movie \, decodes it into the specified color-space if supported. -, f 69; -#X text 18 336 Inlet 1: message: colorspace "RGBA|YUV|Grey": decodes -the current film into the specified colorspace \, if supported., f 69; -#X text 18 365 Inlet 1: message : auto 1|0 : starts/stops automatic -playback. (default:0), f 69; -#X text 17 576 Outlet 3: bang: indicates that the last frame has been -reached. (or: an illegal frame would have been decoded), f 69; +#X text 18 303 Inlet 1: message: open [RGBA|YUV|Grey]: opens the movie \, decodes it into the specified color-space if supported., f 69; +#X text 18 336 Inlet 1: message: colorspace "RGBA|YUV|Grey": decodes the current film into the specified colorspace \, if supported., f 69; +#X text 18 365 Inlet 1: message : auto 1|0 : starts/stops automatic playback. (default:0), f 69; +#X text 17 576 Outlet 3: bang: indicates that the last frame has been reached. (or: an illegal frame would have been decoded), f 69; #X msg 469 174 auto \$1; -#X obj 469 156 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 469 156 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 480 193 colorspace Grey; -#X text 17 520 Outlet 2: list: : gets -the dimensions (in frames and pixels) of a film when it gets loaded. -if length is not available (video-streams) -1 is returned., f 69; +#X text 17 520 Outlet 2: list: : gets the dimensions (in frames and pixels) of a film when it gets loaded. if length is not available (video-streams) -1 is returned., f 69; #N canvas 18 93 928 614 :: 0; -#X text 24 16 the format [pix_film] is able to decode depends on the -system you are running Gem.; -#X text 33 52 basically Gem's decoding capabilities are handled by -plugins. You should see \, which plugins are loaded \, when instantiating -the first [pix_film] object: a line "[pix_film]: foo support" means -\, that the 'foo' plugin has been loaded.; -#X text 453 50 you can add a plugin to your system by simply copying -the plugin-binary called "gem_filmNAME.dll" (or gem_filmNAME.so if -you are on a unix-like system) into your Gem-directory (where you find -the Gem-binary \, e.g. Gem.dll); -#X text 456 103 if you want to remove a plugin (e.g. because you are -not satisfied with the decoding quality of because it is unstable) -\, you can simply remove the corresponding gem_filmNAME.dll file from -your Gem-directory.; -#X text 35 123 which media can be decoded \, depends on the installed -plugins and on the codecs you have installed on your system.; -#X obj 45 248 cnv 15 200 15 empty empty empty 20 12 0 14 -203904 -66577 -0; -#X obj 45 303 cnv 15 200 15 empty empty empty 20 12 0 14 -203904 -66577 -0; -#X obj 445 248 cnv 15 200 15 empty empty empty 20 12 0 14 -203904 -66577 -0; +#X text 24 16 the format [pix_film] is able to decode depends on the system you are running Gem.; +#X text 33 52 basically Gem's decoding capabilities are handled by plugins. You should see \, which plugins are loaded \, when instantiating the first [pix_film] object: a line "[pix_film]: foo support" means \, that the 'foo' plugin has been loaded.; +#X text 453 50 you can add a plugin to your system by simply copying the plugin-binary called "gem_filmNAME.dll" (or gem_filmNAME.so if you are on a unix-like system) into your Gem-directory (where you find the Gem-binary \, e.g. Gem.dll); +#X text 456 103 if you want to remove a plugin (e.g. because you are not satisfied with the decoding quality of because it is unstable) \, you can simply remove the corresponding gem_filmNAME.dll file from your Gem-directory.; +#X text 35 123 which media can be decoded \, depends on the installed plugins and on the codecs you have installed on your system.; +#X obj 45 248 cnv 15 200 15 empty empty empty 20 12 0 14 #c4c4fc #404040 0; +#X obj 45 303 cnv 15 200 15 empty empty empty 20 12 0 14 #c4c4fc #404040 0; +#X obj 445 248 cnv 15 200 15 empty empty empty 20 12 0 14 #c4c4fc #404040 0; #X text 449 249 Gmerlin (gem_filmGMERLIN); #X text 49 249 QuickTime (gem_filmQT); -#X text 73 262 available on OS-X (PPC and i386 \, but not 64bit!) and -W32; -#X text 73 277 should be able to decode any QuickTime MOV \, and probably -a lot more; +#X text 73 262 available on OS-X (PPC and i386 \, but not 64bit!) and W32; +#X text 73 277 should be able to decode any QuickTime MOV \, and probably a lot more; #X text 49 304 DirectShow (gem_filmDS); #X text 73 317 available on W32; -#X text 73 331 should be able to decode anything for which you have -a DirectShow filter installed; +#X text 73 331 should be able to decode anything for which you have a DirectShow filter installed; #X text 50 365 AVI (gem_filmAVI); #X text 73 380 available on W32; -#X text 73 394 this uses the old (pre-XP) W32-API for decoding movies. -Support for newer codecs is probably limited; +#X text 73 394 this uses the old (pre-XP) W32-API for decoding movies. Support for newer codecs is probably limited; #X text 50 424 AVIPLAY (gem_filmAVIPLAY); #X text 73 439 available on linux; -#X text 74 452 uses the meta-framework "avifile" to decode movies \, -which itself has a plugin system to use ffmpeg \, vorbis \, w32-dlls -\, ... to decode videos; +#X text 74 452 uses the meta-framework "avifile" to decode movies \, which itself has a plugin system to use ffmpeg \, vorbis \, w32-dlls \, ... to decode videos; #X text 73 507 available on linux; #X text 50 494 quicktime4linux (gem_filmQT4L); #X text 73 522 uses libquicktime/lqt for decoding; @@ -125,80 +87,71 @@ which itself has a plugin system to use ffmpeg \, vorbis \, w32-dlls #X text 473 277 uses Gmerlin-avdecoder to decode lots of formats; #X text 449 304 MPEG3 (gem_filmMPEG3); #X text 473 317 available on linux; -#X text 473 331 should be able to decode various MPEG-formats (e.g. -MPEG-2-Video and MPEG-2-transportstreams); +#X text 473 331 should be able to decode various MPEG-formats (e.g. MPEG-2-Video and MPEG-2-transportstreams); #X text 473 380 available on linux; -#X text 473 394 uses an old \, buggy (and no longer developed) library -to decode MPEG-streams; +#X text 473 394 uses an old \, buggy (and no longer developed) library to decode MPEG-streams; #X text 450 365 MPEG (gem_filmMPEG1); #X text 450 424 Darwin (gem_filmDarwin); #X text 473 439 available on OS-X; #X text 450 484 test (gem_TEST); #X text 473 497 available on ALL platforms; -#X text 473 512 outputs test images rather than decoding real media -files; +#X text 473 512 outputs test images rather than decoding real media files; #X text 270 194 available film decoding plugins; #X text 260 210 (recommended plugins are highlighted); -#X text 474 452 an alternative implementation of the QuickTime plugin -for OS-X only; +#X text 474 452 an alternative implementation of the QuickTime plugin for OS-X only; #X restore 455 484 pd :: FORMATS; -#X obj 473 305 unpack 0 0 0 0; -#X floatatom 581 306 5 0 0 3 fps - -; +#X obj 473 325 unpack 0 0 0 0; +#X floatatom 581 326 5 0 0 1 fps - - 0; #X obj 451 281 pix_film; -#X msg 489 237 bang; -#X text 17 418 Inlet 1: message : bang: (re)send the l/w/h/fps info -to the 2nd outlet, f 69; -#X text 14 144 Normally \, you will only get one specified (via the -second inlet) frame of the film. To play back a complete film \, you -have to change the frame accordingly \, OR use the "auto" message \, -to automatically proceed to the next frame each rendering-cycle. In -auto-mode \, the film is NOT looped. Instead you can reset the current-frame -to zero when the end of the film is reached., f 69; -#X text 16 445 Inlet 2: float: changes the frame to be decoded -on rendering (starting with 0), f 69; -#X msg 486 212 backend foo; -#X text 17 391 Inlet 1: message : backend : open the film using -only the specified backend(s), f 70; +#X msg 489 217 bang; +#X text 17 418 Inlet 1: message : bang: (re)send the l/w/h/fps info to the 2nd outlet, f 69; +#X text 14 144 Normally \, you will only get one specified (via the second inlet) frame of the film. To play back a complete film \, you have to change the frame accordingly \, OR use the "auto" message \, to automatically proceed to the next frame each rendering-cycle. In auto-mode \, the film is NOT looped. Instead you can reset the current-frame to zero when the end of the film is reached., f 69; +#X text 16 445 Inlet 2: float: changes the frame to be decoded on rendering (starting with 0), f 69; +#X text 17 391 Inlet 1: message : backend : open the film using only the specified backend(s), f 70; #X obj 578 8 declare -lib Gem; #N canvas 2 93 450 310 :: 0; -#X text 35 220 If a specific colorspace is required \, it is strongly -recommended to convert using [pix_rgba] \, [pix_yuv] \, [pix_grey] -etc. This is the only way to guarantee a colorspace., f 60; -#X text 35 33 Note that the default colorspace may vary on different -operating systems \, even for the same patch and same video file. For -instance \, [pix_film] may output YUV images in macOS \, while the -same patch and same video file may obtain RGB images in Linux. While -most downstream [pix] objects can adapt automatically to the incoming -format \, there are some (e.g. [pix_chroma_key]) which take a user-specified -color as an input. Such objects are sensitive to the image's colorspace -\, and patches using them may exhibit variable behavior on different -OSes.; -#X text 35 172 Note also that codecs may choose to disregard the colorspace -passed to pix_film -- you may or may not get the requested colorspace. -; +#X text 35 220 If a specific colorspace is required \, it is strongly recommended to convert using [pix_rgba] \, [pix_yuv] \, [pix_grey] etc. This is the only way to guarantee a colorspace., f 60; +#X text 35 33 Note that the default colorspace may vary on different operating systems \, even for the same patch and same video file. For instance \, [pix_film] may output YUV images in macOS \, while the same patch and same video file may obtain RGB images in Linux. While most downstream [pix] objects can adapt automatically to the incoming format \, there are some (e.g. [pix_chroma_key]) which take a user-specified color as an input. Such objects are sensitive to the image's colorspace \, and patches using them may exhibit variable behavior on different OSes.; +#X text 35 172 Note also that codecs may choose to disregard the colorspace passed to pix_film -- you may or may not get the requested colorspace.; #X restore 211 130 pd :: COLORSPACES; -#X text 13 104 You can open a specified film via the "open" message -\, which takes an optional argument for the colorspace \, to which -the movie should be decoded (RGBA \, YUV or Grey). See, f 70; +#X text 13 104 You can open a specified film via the "open" message \, which takes an optional argument for the colorspace \, to which the movie should be decoded (RGBA \, YUV or Grey). See, f 70; #X msg 463 136 open \$1 RGBA; #X text 546 129 Recommended to specify colorspace!, f 20; +#X obj 457 584 _backendinfo \$0 film; +#X obj 489 241 r \$0-ctl; +#X obj 463 241 t a; +#X obj 509 282 route bang; +#X obj 509 302 bng 18 250 50 0 \$0-end \$0-end end_reached 20 9 0 10 #fcfcfc #000000 #000000; +#N canvas 6 49 515 369 print 0; +#X obj 102 176 inlet; +#X obj 102 198 s \$0-info; +#X obj 102 220 r \$0-infoprint; +#X obj 102 242 print INFO; +#X text 62 90 actually you can just hook a [print] to the 3rd outlet.; +#X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.; +#X connect 0 0 1 0; +#X connect 2 0 3 0; +#X restore 583 282 pd print; #X connect 10 0 11 0; #X connect 11 0 10 0; -#X connect 14 0 44 0; -#X connect 17 0 29 0; -#X connect 18 0 28 0; -#X connect 25 0 44 1; -#X connect 28 0 54 0; -#X connect 37 0 44 0; -#X connect 38 0 37 0; -#X connect 39 0 44 0; -#X connect 42 0 21 0; -#X connect 42 1 22 0; -#X connect 42 2 23 0; -#X connect 42 3 43 0; -#X connect 44 0 17 0; -#X connect 44 1 42 0; -#X connect 44 2 24 0; -#X connect 45 0 44 0; -#X connect 49 0 44 0; -#X connect 54 0 44 0; +#X connect 14 0 43 0; +#X connect 17 0 28 0; +#X connect 18 0 27 0; +#X connect 24 0 43 1; +#X connect 27 0 52 0; +#X connect 36 0 56 0; +#X connect 37 0 36 0; +#X connect 38 0 56 0; +#X connect 41 0 21 0; +#X connect 41 1 22 0; +#X connect 41 2 23 0; +#X connect 41 3 42 0; +#X connect 43 0 17 0; +#X connect 43 1 41 0; +#X connect 43 2 57 0; +#X connect 44 0 56 0; +#X connect 52 0 56 0; +#X connect 55 0 56 0; +#X connect 56 0 43 0; +#X connect 57 0 58 0; +#X connect 57 1 59 0; From 71c897a8dd9cefe5ba3e2b8d38136d3b6e9cfc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 14:12:30 +0100 Subject: [PATCH 055/387] make loop-vars local --- plugins/ASSIMP2/modelASSIMP2.cpp | 20 ++++++-------- plugins/ASSIMP3/modelASSIMP3.cpp | 16 +++++------- plugins/AVI/filmAVI.cpp | 3 +-- plugins/AVIPLAY/filmAVIPLAY.cpp | 3 +-- plugins/AVT/videoAVT.cpp | 22 ++++++---------- plugins/DC1394/videoDC1394.cpp | 25 +++++++----------- plugins/DECKLINK/recordDECKLINK.cpp | 3 +-- plugins/DECKLINK/videoDECKLINK.cpp | 6 ++--- plugins/DV4L/videoDV4L.cpp | 12 +++------ plugins/FFMPEG/filmFFMPEG.cpp | 3 +-- plugins/GMERLIN/filmGMERLIN.cpp | 8 +++--- plugins/HALCON/videoHALCON.cpp | 39 ++++++++++------------------ plugins/MPEG1/filmMPEG1.cpp | 6 +---- plugins/OBJ/modelOBJ.cpp | 6 ++--- plugins/OptiTrack/videoOptiTrack.cpp | 6 ++--- plugins/QT4L/filmQT4L.cpp | 3 +-- plugins/QT4L/recordQT4L.cpp | 17 +++++------- plugins/QuickTime/filmQT.cpp | 3 +-- plugins/QuickTime/imageQT.cpp | 3 ++- plugins/QuickTime/recordQT.cpp | 11 +++----- plugins/TEST/videoTEST.cpp | 15 ++++------- plugins/UNICAP/videoUNICAP.cpp | 19 +++++--------- plugins/V4L/videoV4L.cpp | 31 +++++++++------------- plugins/V4L2/videoV4L2.cpp | 10 +++---- plugins/VLC/videoVLC.cpp | 6 ++--- plugins/VNC/videoVNC.cpp | 3 +-- plugins/filmDSATL/filmDS.cpp | 6 ++--- plugins/filmDarwin/filmDarwin.cpp | 3 +-- plugins/imageMAGICK/imageMAGICK.cpp | 6 ++--- plugins/videoDS/videoDS.cpp | 3 +-- plugins/videoDarwin/videoDarwin.cpp | 14 ++++------ 31 files changed, 119 insertions(+), 212 deletions(-) diff --git a/plugins/ASSIMP2/modelASSIMP2.cpp b/plugins/ASSIMP2/modelASSIMP2.cpp index 93237bcaf..db147ade0 100644 --- a/plugins/ASSIMP2/modelASSIMP2.cpp +++ b/plugins/ASSIMP2/modelASSIMP2.cpp @@ -43,14 +43,13 @@ static void get_bounding_box_for_node (const struct aiScene*scene, ) { struct aiMatrix4x4 prev; - unsigned int n = 0, t; prev = *trafo; aiMultiplyMatrix4(trafo,&nd->mTransformation); - for (; n < nd->mNumMeshes; ++n) { + for (unsigned int n=0; n < nd->mNumMeshes; ++n) { const struct aiMesh* mesh = scene->mMeshes[nd->mMeshes[n]]; - for (t = 0; t < mesh->mNumVertices; ++t) { + for (unsigned int t = 0; t < mesh->mNumVertices; ++t) { struct aiVector3D tmp = mesh->mVertices[t]; aiTransformVecByMatrix4(&tmp,trafo); @@ -65,7 +64,7 @@ static void get_bounding_box_for_node (const struct aiScene*scene, } } - for (n = 0; n < nd->mNumChildren; ++n) { + for (unsigned int n = 0; n < nd->mNumChildren; ++n) { get_bounding_box_for_node(scene, nd->mChildren[n],min,max,trafo); } *trafo = prev; @@ -197,15 +196,13 @@ static void recursive_render (const struct aiScene*scene, std::vector >& colors, aiMatrix4x4* trafo) { - int i; - unsigned int n = 0, t; aiMatrix4x4 prev = *trafo; // update transform aiMultiplyMatrix4(trafo,&nd->mTransformation); // draw all meshes assigned to this node - for (; n < nd->mNumMeshes; ++n) { + for (unsigned int =0; n < nd->mNumMeshes; ++n) { const struct aiMesh* mesh = scene->mMeshes[nd->mMeshes[n]]; if(use_material) { apply_material(sc->mMaterials[mesh->mMaterialIndex]); @@ -226,7 +223,7 @@ static void recursive_render (const struct aiScene*scene, glDisable(GL_COLOR_MATERIAL); } #endif - for (t = 0; t < mesh->mNumFaces; ++t) { + for (unsigned int t = 0; t < mesh->mNumFaces; ++t) { const struct aiFace* face = &mesh->mFaces[t]; GLenum face_mode; @@ -248,7 +245,7 @@ static void recursive_render (const struct aiScene*scene, float* pt; std::vector vec; - for(i = 0; i < face->mNumIndices; i++) { + for(int i = 0; i < face->mNumIndices; i++) { int index = face->mIndices[i]; if(use_material && mesh->mColors[0] != NULL) { @@ -281,7 +278,7 @@ static void recursive_render (const struct aiScene*scene, } // draw all children - for (n = 0; n < nd->mNumChildren; ++n) { + for (unsigned int n = 0; n < nd->mNumChildren; ++n) { recursive_render(scene, sc, nd->mChildren[n], use_material, vertices, normals, texcoords, colors, trafo); } @@ -403,8 +400,7 @@ void modelASSIMP2 :: setProperties(gem::Properties&props) #if 0 std::vectorkeys=props.keys(); - unsigned int i; - for(i=0; imTransformation); - for (; n < nd->mNumMeshes; ++n) { + for (unsigned int n=0; n < nd->mNumMeshes; ++n) { const struct aiMesh* mesh = scene->mMeshes[nd->mMeshes[n]]; - for (t = 0; t < mesh->mNumVertices; ++t) { + for (unsigned int t = 0; t < mesh->mNumVertices; ++t) { aiVector3D tmp = mesh->mVertices[t]; aiTransformVecByMatrix4(&tmp,trafo); @@ -63,7 +62,7 @@ static void get_bounding_box_for_node (const struct aiScene*scene, } } - for (n = 0; n < nd->mNumChildren; ++n) { + for (unsigned int n = 0; n < nd->mNumChildren; ++n) { get_bounding_box_for_node(scene, nd->mChildren[n],min,max,trafo); } *trafo = prev; @@ -180,8 +179,6 @@ static void recursive_render( , aiMatrix4x4* trafo ) { - int i; - unsigned int t; aiMatrix4x4 prev = *trafo; // update transform aiMultiplyMatrix4(trafo,&nd->mTransformation); @@ -202,9 +199,9 @@ static void recursive_render( apply_material(outmesh.mesh.material, sc->mMaterials[mesh->mMaterialIndex]); - for (t = 0; t < mesh->mNumFaces; ++t) { + for (unsigned int t = 0; t < mesh->mNumFaces; ++t) { const struct aiFace* face = &mesh->mFaces[t]; - for(i = 0; i < face->mNumIndices; i++) { + for(int i = 0; i < face->mNumIndices; i++) { int index = face->mIndices[i]; numVertices++; @@ -427,9 +424,8 @@ void modelASSIMP3 :: setProperties(gem::Properties&props) void modelASSIMP3 :: getProperties(gem::Properties&props) { std::vectorkeys=props.keys(); - unsigned int i; props.clear(); - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; i videoAVT::enumerate() tPvCameraInfo*cameraList=new tPvCameraInfo[cameraNum]; cameraNum = PvCameraList(cameraList,cameraNum,NULL); - unsigned long i = 0; - for (i = 0; i < cameraNum; i++) { + for (unsigned long i = 0; i < cameraNum; i++) { result.push_back(cameraList[i].DisplayName); } @@ -461,9 +457,8 @@ bool videoAVT::enumProperties(gem::Properties&readable, } void videoAVT::setProperties(gem::Properties&props) { - int i; std::vectorkeys=props.keys(); - for(i=0; ikeys=props.keys(); - for(i=0; i=0) { devicenum=m_devicenum; } else if (!m_devicename.empty()) { - int i=0; - for(i=0; inum; i++) { + for(int i=0; inum; i++) { // find camera based on its GUID std::string name=guid2string(list->ids[i].guid); if(guid2string(list->ids[i].guid)==m_devicename) { @@ -230,8 +229,7 @@ bool videoDC1394 :: openDevice(gem::Properties&props) } } - int i; - for (i=video_modes.num-1; i>=0; i--) { + for (int i=video_modes.num-1; i>=0; i--) { unsigned int w=0, h=0; if(DC1394_SUCCESS==dc1394_get_image_size_from_video_mode(m_dccamera, video_modes.modes[i], &w, &h)) { @@ -261,6 +259,7 @@ bool videoDC1394 :: openDevice(gem::Properties&props) if(mode<0) { // select highest res mode: + int i = -1; for (i=video_modes.num-1; i>=0; i--) { if (!dc1394_is_video_mode_scalable(video_modes.modes[i])) { dc1394_get_color_coding_from_video_mode(m_dccamera,video_modes.modes[i], @@ -430,8 +429,7 @@ std::vectorvideoDC1394 :: enumerate() return result; } - int i=0; - for(i=0; inum; i++) { + for(int i=0; inum; i++) { // verbose(1, "[GEM:videoDC1394] IIDC#%02d: %"PRIx64"\t%x\t%s", i, list->ids[i].guid, list->ids[i].unit, buf); result.push_back(guid2string(list->ids[i].guid, list->ids[i].unit)); } @@ -533,7 +531,7 @@ bool videoDC1394::enumProperties(gem::Properties&readable, return false; } - for ( int i = 0 ; i < DC1394_FEATURE_NUM ; i++ ) { + for (int i = 0 ; i < DC1394_FEATURE_NUM ; i++ ) { if ( feature_set.feature[i].available ) { // TODO remove space in feature name (eg. "Trigger Delay") key = dc1394_feature_get_string(feature_set.feature[i].id); @@ -572,8 +570,7 @@ void videoDC1394::getProperties(gem::Properties&props) double value; std::string svalue; - int i=0; - for(i=0; i0) { - int s; - for(s=DC1394_ISO_SPEED_MIN; s=(100*(1<keys=props.keys(); - int i; - for(i=0; ikeys=props.keys(); - int i=0; - for(i=0; ikeys=props.keys(); - unsigned int i; - for(i=0; i videoDV4L::enumerate() struct raw1394_portinfo*pinf=new struct raw1394_portinfo[num_pinf]; int ports = raw1394_get_port_info(handle, pinf, num_pinf); - int i=0; - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; i %s", i, bgav_redirector_get_name(m_file, i), bgav_redirector_get_url(m_file, i)); } - for(i = 0; i < num_urls; i++) { + for(int i = 0; i < num_urls; i++) { filename=(char*)bgav_redirector_get_url(m_file, i); close(); if (open(filename, wantProps)) { @@ -468,8 +467,7 @@ void filmGMERLIN::getProperties(gem::Properties&props) std::vector keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; igetBackends(void) +GemDylib::getDefaultExtension(); std::vectorlisting=gem::files::getFilenameListing(pattern); - int i=0; - for(i=0; i0) { - int i=0; - - for(i=0; i videoHALCON::enumerate() backends.push_back(m_backendname); } - int i=0; - - for(i=0; i videoHALCON::enumerate() continue; } - int j=0; - for(j=0; j videoHALCON::enumerate() bool videoHALCON::enumProperties(gem::Properties&readable, gem::Properties&writeable) { - int i=0; gem::any typeval; (void*)0; @@ -537,7 +527,7 @@ bool videoHALCON::enumProperties(gem::Properties&readable, &Information, &ValueList); if(ValueList.Num()>0) { - for(i=0; i< ValueList.Num(); i++) { + for(int i=0; i< ValueList.Num(); i++) { Halcon::HCtrlVal v=ValueList[i]; if(v.ValType() == Halcon::StringVal) { readable.set(v.S(), typeval); @@ -560,7 +550,7 @@ bool videoHALCON::enumProperties(gem::Properties&readable, &Information, &ValueList); if(ValueList.Num()>0) { - for(i=0; i< ValueList.Num(); i++) { + for(int i=0; i< ValueList.Num(); i++) { Halcon::HCtrlVal v=ValueList[i]; if(v.ValType() == Halcon::StringVal) { readable.set(v.S(), typeval); @@ -585,7 +575,7 @@ bool videoHALCON::enumProperties(gem::Properties&readable, &Information, &ValueList); if(ValueList.Num()>0) { - for(i=0; i< ValueList.Num(); i++) { + for(int i=0; i< ValueList.Num(); i++) { Halcon::HCtrlVal v=ValueList[i]; if(v.ValType() == Halcon::StringVal) { writeable.set(v.S(), typeval); @@ -611,8 +601,7 @@ void videoHALCON::setProperties(gem::Properties&props) return; } std::vectorkeys=props.keys(); - int i=0; - for(i=0; ikeys=props.keys(); - int i=0; - for(i=0; iGetFramegrabberParam(key.c_str()); gem::any nonetype; - int j=0; - for(j=0; j< hresult.Num(); j++) { + for(int j=0; j< hresult.Num(); j++) { Halcon::HCtrlVal v=hresult[j]; switch(v.ValType()) { case Halcon::LongVal: diff --git a/plugins/MPEG1/filmMPEG1.cpp b/plugins/MPEG1/filmMPEG1.cpp index ec0ae2cf0..16a198aad 100644 --- a/plugins/MPEG1/filmMPEG1.cpp +++ b/plugins/MPEG1/filmMPEG1.cpp @@ -222,8 +222,7 @@ void filmMPEG1::getProperties(gem::Properties&props) std::vector keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; ikeys=requestprops.keys(); - unsigned int i; - for(i=0; ikeys=props.keys(); - unsigned int i; props.clear(); - for(i=0; ivideoOptiTrack::enumerate(void) } CameraList list; - int i; - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; ikeys=props.keys(); std::mapproptypes; - int i=0; - for(i=0; inum_encoding_parameters; i++) { + for(int i=0; inum_encoding_parameters; i++) { proptypes[codec->encoding_parameters[i].name]= codec->encoding_parameters[i].type; } - for(i=0; i::iterator it = proptypes.find( key); @@ -240,8 +238,7 @@ static int try_colormodel(quicktime_t * file, int track, std::vector colormodel) { - int i=0; - for(i=0; inum_encoding_parameters; lqt_parameter_info_t*params=m_codec->encoding_parameters; - int i=0; - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; i(rowBytes) ); } diff --git a/plugins/QuickTime/recordQT.cpp b/plugins/QuickTime/recordQT.cpp index a1f9481f4..8c213cb25 100644 --- a/plugins/QuickTime/recordQT.cpp +++ b/plugins/QuickTime/recordQT.cpp @@ -115,14 +115,13 @@ recordQT :: recordQT(void) //get list of codecs installed -- useful later CodecNameSpecListPtr codecList; CodecNameSpec codecName; - int i; int count; GetCodecNameList(&codecList,1); count=codecList->count; codecContainer.clear(); verbose(0, "[GEM:recordQT] %i codecs installed",codecList->count); - for (i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { codecName = codecList->list[i]; std::string typeName = std::string((char*)codecName.typeName + 1, ((char*)codecName.typeName)[0]); codecListStorage cod = {i, codecName.cType, typeName, codecName.codec}; @@ -135,7 +134,7 @@ recordQT :: recordQT(void) nResID = movieInDataForkResID; m_codecType = kJPEGCodecType; - for(i = 0; i < count; i++) { + for(int i = 0; i < count; i++) { if (codecContainer[i].ctype == kJPEGCodecType) { m_codec = codecContainer[i].codec; verbose(1, "[GEM:recordQT] found pjpeg codec %i %lu %p ctype", @@ -650,8 +649,7 @@ const char*recordQT :: getCodecName(int i) std::vectorrecordQT::getCodecs(void) { std::vectorresult; - int i; - for(i=0; ikeys=props.keys(); - unsigned int i; - for(i=0; i videoUNICAP::enumerate(void) std::vector result; int devcount=0; unicap_status_t status = 0; - int i=0; m_providers.clear(); m_providers.push_back(s_name); @@ -581,7 +579,7 @@ std::vector videoUNICAP::enumerate(void) m_name2devices.clear(); - for(i=0; i keys=props.keys(); bool getwidth=false, getheight=false; - int i=0; - for(i=0; i keys=props.keys(); - int i=0; - for(i=0; i vcap.minheight) ? m_height : vcap.minheight; height =(height > vcap.maxheight) ? vcap.maxheight : height; - for (i = 0; i < V4L_NBUF; i++) { + for (int i = 0; i < V4L_NBUF; i++) { switch(m_reqFormat) { case GEM_RAW_GRAY: vmmap[i].format = VIDEO_PALETTE_GREY; @@ -385,7 +382,7 @@ bool videoV4L :: startTransfer() } if (v4l1_ioctl(tvfd, VIDIOCMCAPTURE, &vmmap[frame]) < 0) { - for (i = 0; i < V4L_NBUF; i++) { + for (int i = 0; i < V4L_NBUF; i++) { vmmap[i].format = vpicture.palette; } if (v4l1_ioctl(tvfd, VIDIOCMCAPTURE, &vmmap[frame]) < 0) { @@ -462,18 +459,17 @@ std::vector videoV4L::enumerate() { std::vector result; std::vector glob, allglob; - int i=0; glob=gem::files::getFilenameListing("/dev/video*"); - for(i=0; i videoV4L::enumerate() bool videoV4L::enumProperties(gem::Properties&readable, gem::Properties&writeable) { - int i=0; std::vectorkeys; gem::any type; @@ -521,7 +516,7 @@ bool videoV4L::enumProperties(gem::Properties&readable, keys.push_back("frequency"); type=0; - for(i=0; ikeys=props.keys(); bool restart=false; bool do_s_chan=false, do_s_pict=false; - int i=0; double d; std::string s; @@ -554,7 +548,7 @@ void videoV4L::setProperties(gem::Properties&props) perror("[GEM:videoV4L] VDIOCGCHAN"); } - for(i=0; i alldev = enumerate(); - int i; + int i=0; for(i=0; ikeys=props.keys(); - unsigned int i; - for(i=0; ikeys=props.keys(); double d; - int i; - for(i=0; ikeys=props.keys(); - unsigned int i; - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; i keys=props.keys(); gem::any value; double d; - unsigned int i=0; - for(i=0; idlg) if(dlg.empty()) { SetupCaptureDevice(m_pCG, m_pCDbase); } else { - int i; - for(i=0; i=0) { m_inputDevice=m_devicenum; } else if (!m_devicename.empty()) { - int i; const int maxcount=(deviceCountkeys=props.keys(); - int i=0; - for(i=0; i videoDarwin::enumerate() short inputIndex; verbose(1, "[GEM:videoDarwin] SG channel Device List count %d index %d", deviceCount,deviceIndex); - int i; m_devices.clear(); - for (i = 0; i < deviceCount; i++) { + for (int i = 0; i < deviceCount; i++) { m_devices.push_back(pascal2str((*devices)->entry[i].name)); verbose(1, "[GEM:videoDarwin] SG channel Device List[%d] %s", i, m_devices[i].c_str()); @@ -723,7 +719,7 @@ std::vector videoDarwin::enumerate() //we should have device names in big ass undocumented structs //walk through the list - for (i = 0; i < inputIndex; i++) { + for (int i = 0; i < inputIndex; i++) { std::string input=pascal2str((*theSGInputList)->entry[i].name); verbose(1, "[GEM:videoDarwin] SG channel Input Device List %d %s", i, input.c_str()); From cd86b98d60adb4973c84f49ef68d0485958fa4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 14:20:38 +0100 Subject: [PATCH 056/387] [pix_buffer]: rename m_handle to m_saver it's only half of the (possible) handles --- src/Pixes/pix_buffer.cpp | 18 +++++++++--------- src/Pixes/pix_buffer.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Pixes/pix_buffer.cpp b/src/Pixes/pix_buffer.cpp index 79207388a..5282e54ae 100644 --- a/src/Pixes/pix_buffer.cpp +++ b/src/Pixes/pix_buffer.cpp @@ -93,7 +93,7 @@ pix_buffer :: pix_buffer(t_symbol* s,t_float f=100.0) : m_buffer(NULL), m_numframes(0), m_bindname(NULL), - m_handle(NULL), + m_saver(NULL), m_outlet(new gem::RTE::Outlet(this)) { if (s==&s_) { @@ -113,7 +113,7 @@ pix_buffer :: pix_buffer(t_symbol* s,t_float f=100.0) m_numframes = (unsigned int)f; m_buffer = new imageStruct[m_numframes]; - m_handle = gem::plugins::imagesaver::getInstance(); + m_saver = gem::plugins::imagesaver::getInstance(); pd_bind(&this->x_obj->ob_pd, m_bindname); outlet_new(this->x_obj, &s_float); @@ -130,10 +130,10 @@ pix_buffer :: ~pix_buffer( void ) delete [] m_buffer; } m_buffer=NULL; - if(m_handle) { - delete m_handle; + if(m_saver) { + delete m_saver; } - m_handle=NULL; + m_saver=NULL; delete m_outlet; } ///////////////////////////////////////////////////////// @@ -307,8 +307,8 @@ void pix_buffer :: saveMess(std::string filename, int pos) if(img && img->data) { std::string fullname=gem::files::getFullpath(filename); - if(m_handle) { - m_handle->save(*img, fullname, std::string(), m_writeprops); + if(m_saver) { + m_saver->save(*img, fullname, std::string(), m_writeprops); } else { mem2image(img, fullname.c_str(), 0); } @@ -343,8 +343,8 @@ void pix_buffer :: enumProperties(void) gem::Properties props; props.set("quality", 100); - if(m_handle) { - m_handle->getWriteCapabilities(mimetypes, props); + if(m_saver) { + m_saver->getWriteCapabilities(mimetypes, props); } std::vectordata; diff --git a/src/Pixes/pix_buffer.h b/src/Pixes/pix_buffer.h index 9bcd89c54..60ff56c60 100644 --- a/src/Pixes/pix_buffer.h +++ b/src/Pixes/pix_buffer.h @@ -88,7 +88,7 @@ class GEM_EXTERN pix_buffer : public CPPExtern gem::Properties m_writeprops; - gem::plugins::imagesaver*m_handle; + gem::plugins::imagesaver*m_saver; gem::RTE::Outlet*m_outlet; }; From dbbba2a1a5b8ce416ccb1e1d401f7b7b9dc865dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 14:26:10 +0100 Subject: [PATCH 057/387] extendible notation of constructor-args --- src/Pixes/pix_buffer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Pixes/pix_buffer.cpp b/src/Pixes/pix_buffer.cpp index 5282e54ae..e91f2ade4 100644 --- a/src/Pixes/pix_buffer.cpp +++ b/src/Pixes/pix_buffer.cpp @@ -90,11 +90,11 @@ CPPEXTERN_NEW_WITH_TWO_ARGS(pix_buffer, t_symbol*,A_DEFSYMBOL,t_float, // ///////////////////////////////////////////////////////// pix_buffer :: pix_buffer(t_symbol* s,t_float f=100.0) - : m_buffer(NULL), - m_numframes(0), - m_bindname(NULL), - m_saver(NULL), - m_outlet(new gem::RTE::Outlet(this)) + : m_buffer(NULL) + , m_numframes(0) + , m_bindname(NULL) + , m_saver(NULL) + , m_outlet(new gem::RTE::Outlet(this)) { if (s==&s_) { static int buffercounter=0; From c01560a209843fc58923aafc9984329af86629b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 14:27:18 +0100 Subject: [PATCH 058/387] pix_buffer: PIMPL for utils --- src/Pixes/pix_buffer.cpp | 99 ++++++++++++++++++++++------------------ src/Pixes/pix_buffer.h | 4 ++ 2 files changed, 59 insertions(+), 44 deletions(-) diff --git a/src/Pixes/pix_buffer.cpp b/src/Pixes/pix_buffer.cpp index e91f2ade4..c415ad429 100644 --- a/src/Pixes/pix_buffer.cpp +++ b/src/Pixes/pix_buffer.cpp @@ -27,54 +27,64 @@ #include "RTE/Outlet.h" /* utilities */ -static gem::any atom2any(t_atom*ap) +struct pix_buffer :: PIMPL { - gem::any result; - if(ap) { - switch(ap->a_type) { - case A_FLOAT: - result=atom_getfloat(ap); - break; - case A_SYMBOL: - result=std::string(atom_getsymbol(ap)->s_name); - break; - default: - result=ap->a_w.w_gpointer; + CPPExtern*parent; + + PIMPL(CPPExtern*_parent) + : parent(_parent) + {}; + ~PIMPL(void) {}; + + static gem::any atom2any(t_atom*ap) + { + gem::any result; + if(ap) { + switch(ap->a_type) { + case A_FLOAT: + result=atom_getfloat(ap); + break; + case A_SYMBOL: + result=std::string(atom_getsymbol(ap)->s_name); + break; + default: + result=ap->a_w.w_gpointer; + } } + return result; } - return result; -} -static void addProperties(CPPExtern*obj, gem::Properties&props, int argc, t_atom*argv) -{ - if(!argc) { - return; - } + void addProperties(gem::Properties&props, int argc, t_atom*argv) + { + if(!argc) { + return; + } - if(argv->a_type != A_SYMBOL) { - pd_error(obj, "no key given..."); - return; - } - std::string key=std::string(atom_getsymbol(argv)->s_name); - std::vector values; - argc--; - argv++; - while(argc-->0) { - values.push_back(atom2any(argv++)); - } - switch(values.size()) { - default: - props.set(key, values); - break; - case 1: - props.set(key, values[0]); - break; - case 0: { - gem::any dummy; - props.set(key, dummy); - } - break; + if(argv->a_type != A_SYMBOL) { + pd_error(parent, "no key given..."); + return; + } + std::string key=std::string(atom_getsymbol(argv)->s_name); + std::vector values; + argc--; + argv++; + while(argc-->0) { + values.push_back(atom2any(argv++)); + } + switch(values.size()) { + default: + props.set(key, values); + break; + case 1: + props.set(key, values[0]); + break; + case 0: { + gem::any dummy; + props.set(key, dummy); + } + break; + } } -} +}; ///////////////////////////////////////////////////////// // @@ -95,6 +105,7 @@ pix_buffer :: pix_buffer(t_symbol* s,t_float f=100.0) , m_bindname(NULL) , m_saver(NULL) , m_outlet(new gem::RTE::Outlet(this)) + , m_pimpl(new PIMPL(this)) { if (s==&s_) { static int buffercounter=0; @@ -411,7 +422,7 @@ void pix_buffer :: clearProperties(void) } void pix_buffer :: setProperties(t_symbol*s, int argc, t_atom*argv) { - addProperties(this, m_writeprops, argc, argv); + m_pimpl->addProperties(m_writeprops, argc, argv); } ///////////////////////////////////////////////////////// diff --git a/src/Pixes/pix_buffer.h b/src/Pixes/pix_buffer.h index 60ff56c60..a7a314354 100644 --- a/src/Pixes/pix_buffer.h +++ b/src/Pixes/pix_buffer.h @@ -90,6 +90,10 @@ class GEM_EXTERN pix_buffer : public CPPExtern gem::plugins::imagesaver*m_saver; gem::RTE::Outlet*m_outlet; + + private: + class PIMPL; + PIMPL*m_pimpl; }; #endif // for header file From 554414ea56f43c0bc7eb73b797a59dc59e4d6cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 14:52:30 +0100 Subject: [PATCH 059/387] pix_buffer: move stuff to PIMPL --- src/Pixes/pix_buffer.cpp | 42 ++++++++++++++++++++++------------------ src/Pixes/pix_buffer.h | 3 --- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/Pixes/pix_buffer.cpp b/src/Pixes/pix_buffer.cpp index c415ad429..2ef406380 100644 --- a/src/Pixes/pix_buffer.cpp +++ b/src/Pixes/pix_buffer.cpp @@ -30,11 +30,21 @@ struct pix_buffer :: PIMPL { CPPExtern*parent; + gem::RTE::Outlet outlet; + + gem::plugins::imagesaver*saver; PIMPL(CPPExtern*_parent) : parent(_parent) + , outlet(_parent) + , saver(gem::plugins::imagesaver::getInstance()) {}; - ~PIMPL(void) {}; + ~PIMPL(void) { + if(saver) { + delete saver; + } + saver=NULL; + }; static gem::any atom2any(t_atom*ap) { @@ -103,8 +113,6 @@ pix_buffer :: pix_buffer(t_symbol* s,t_float f=100.0) : m_buffer(NULL) , m_numframes(0) , m_bindname(NULL) - , m_saver(NULL) - , m_outlet(new gem::RTE::Outlet(this)) , m_pimpl(new PIMPL(this)) { if (s==&s_) { @@ -124,10 +132,7 @@ pix_buffer :: pix_buffer(t_symbol* s,t_float f=100.0) m_numframes = (unsigned int)f; m_buffer = new imageStruct[m_numframes]; - m_saver = gem::plugins::imagesaver::getInstance(); - pd_bind(&this->x_obj->ob_pd, m_bindname); - outlet_new(this->x_obj, &s_float); } ///////////////////////////////////////////////////////// // Destructor @@ -141,11 +146,10 @@ pix_buffer :: ~pix_buffer( void ) delete [] m_buffer; } m_buffer=NULL; - if(m_saver) { - delete m_saver; + if(m_pimpl) { + delete m_pimpl; } - m_saver=NULL; - delete m_outlet; + m_pimpl=NULL; } ///////////////////////////////////////////////////////// // allocateMess @@ -228,7 +232,7 @@ void pix_buffer :: resizeMess(int newsize) ///////////////////////////////////////////////////////// void pix_buffer :: bangMess( void ) { - m_outlet->send(m_numframes); + m_pimpl->outlet.send(m_numframes); } unsigned int pix_buffer :: numFrames( void ) { @@ -318,8 +322,8 @@ void pix_buffer :: saveMess(std::string filename, int pos) if(img && img->data) { std::string fullname=gem::files::getFullpath(filename); - if(m_saver) { - m_saver->save(*img, fullname, std::string(), m_writeprops); + if(m_pimpl->saver) { + m_pimpl->saver->save(*img, fullname, std::string(), m_writeprops); } else { mem2image(img, fullname.c_str(), 0); } @@ -354,8 +358,8 @@ void pix_buffer :: enumProperties(void) gem::Properties props; props.set("quality", 100); - if(m_saver) { - m_saver->getWriteCapabilities(mimetypes, props); + if(m_pimpl->saver) { + m_pimpl->saver->getWriteCapabilities(mimetypes, props); } std::vectordata; @@ -366,20 +370,20 @@ void pix_buffer :: enumProperties(void) /* mimetypes */ data.push_back(std::string("numwrite")); data.push_back(mimetypes.size()); - m_outlet->send("mimelist", data); + m_pimpl->outlet.send("mimelist", data); for(i=0; isend("mimelist", data); + m_pimpl->outlet.send("mimelist", data); } /* write properties */ data.clear(); data.push_back(std::string("numwrite")); data.push_back(keys.size()); - m_outlet->send("proplist", data); + m_pimpl->outlet.send("proplist", data); for(i=0; isend("proplist", data); + m_pimpl->outlet.send("proplist", data); } } void pix_buffer :: clearProperties(void) diff --git a/src/Pixes/pix_buffer.h b/src/Pixes/pix_buffer.h index a7a314354..a9e05bd09 100644 --- a/src/Pixes/pix_buffer.h +++ b/src/Pixes/pix_buffer.h @@ -88,9 +88,6 @@ class GEM_EXTERN pix_buffer : public CPPExtern gem::Properties m_writeprops; - gem::plugins::imagesaver*m_saver; - gem::RTE::Outlet*m_outlet; - private: class PIMPL; PIMPL*m_pimpl; From 000094103f585f938bff4133b4d0a6360d3aa256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 15:12:58 +0100 Subject: [PATCH 060/387] imagesaver: support "_backends" property --- src/plugins/imagesaver.cpp | 48 +++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/src/plugins/imagesaver.cpp b/src/plugins/imagesaver.cpp index f8c867e83..a89ab3400 100644 --- a/src/plugins/imagesaver.cpp +++ b/src/plugins/imagesaver.cpp @@ -260,17 +260,37 @@ class imagesaverMeta : public imagesaver std::string mimetype=(mimetype_c.empty())?imgName2Mime( filename):mimetype_c; - for(unsigned int i=0; iestimateSave(img, filename, mimetype, props); - priorities.insert( std::multimap::value_type(prio, i)); + std::vector backends; + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); } + if(!backends.empty()) { + /* if the user requested some backends, prioritize these */ + for(unsigned int j=0; jsave(img, filename, mimetype, props)) { + return true; + } + } + } + } else { + /* otherwise get the best saver (based on their own estimate */ + for(unsigned int i=0; iestimateSave(img, filename, mimetype, props); + priorities.insert( std::multimap::value_type(prio, i)); + } - for(rit=priorities.rbegin(); rit != priorities.rend(); ++rit) { - float prio=rit->first; - int index=rit->second; - verbose(2, "trying saver[%d]=%s / %f", index, m_ids[index].c_str(), prio); - if(m_savers[index]->save(img, filename, mimetype, props)) { - return true; + for(rit=priorities.rbegin(); rit != priorities.rend(); ++rit) { + float prio=rit->first; + int index=rit->second; + verbose(2, "trying saver[%d]=%s / %f", index, m_ids[index].c_str(), prio); + if(m_savers[index]->save(img, filename, mimetype, props)) { + return true; + } } } @@ -286,6 +306,12 @@ class imagesaverMeta : public imagesaver virtual void getWriteCapabilities(std::vector&mimetypes, gem::Properties&props) { + std::vector ids; + if(props.type("_backends")!=gem::Properties::UNSET) { + for(unsigned int i=0; i Date: Mon, 26 Feb 2024 15:55:32 +0100 Subject: [PATCH 061/387] imageloaderMeta: drop "private" specifiers they are of no use inside the implementation --- src/plugins/imageloader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/imageloader.cpp b/src/plugins/imageloader.cpp index de29035c5..0dc462a5e 100644 --- a/src/plugins/imageloader.cpp +++ b/src/plugins/imageloader.cpp @@ -29,14 +29,14 @@ namespace gem { namespace plugins { -class imageloaderMeta : public gem::plugins::imageloader +struct imageloaderMeta : public gem::plugins::imageloader { -private: +public: static imageloaderMeta*s_instance; std::vectorm_loaders; std::vectorm_ids; bool m_canThread; -public: + imageloaderMeta(void) : m_canThread(true) { gem::PluginFactory::loadPlugins("image"); @@ -57,6 +57,7 @@ class imageloaderMeta : public gem::plugins::imageloader firsttime=false; m_canThread=true; + for(unsigned int i=0; iisThreadable()) { m_canThread=false; @@ -110,7 +111,6 @@ class imageloaderMeta : public gem::plugins::imageloader return (count>0); } -public: virtual ~imageloaderMeta(void) { for(unsigned int i=0; i Date: Mon, 26 Feb 2024 15:56:05 +0100 Subject: [PATCH 062/387] imageloader: properties to controll the imageloaderMeta backends --- src/plugins/imageloader.cpp | 48 ++++++++++++++++++++++++++++++++++--- src/plugins/imageloader.h | 6 +++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/plugins/imageloader.cpp b/src/plugins/imageloader.cpp index 0dc462a5e..fab1da29e 100644 --- a/src/plugins/imageloader.cpp +++ b/src/plugins/imageloader.cpp @@ -122,9 +122,27 @@ struct imageloaderMeta : public gem::plugins::imageloader virtual bool load(std::string filename, imageStruct&result, gem::Properties&props) { - for(unsigned int i=0; iload(filename, result, props)) { - return true; + std::vector backends; + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); + } + if(!backends.empty()) { + /* if the user requested some backends, use these */ + for(unsigned int j=0; jload(filename, result, props)) { + return true; + } + } + } + } else { + for(unsigned int i=0; iload(filename, result, props)) { + return true; + } } } return false; @@ -134,6 +152,21 @@ struct imageloaderMeta : public gem::plugins::imageloader { return m_canThread; } + + void getProperties(gem::Properties&props) { + std::vector ids; + if(props.type("_backends")!=gem::Properties::UNSET) { + for(unsigned int i=0; i(loader); + if (meta != nullptr) { + meta->getProperties(props); + } else { + pd_error(0, "Unable to get properties from generic gem::plugins::imageloader (only meta-loader is supported)"); + } +} diff --git a/src/plugins/imageloader.h b/src/plugins/imageloader.h index 22bc5a7d8..5f91ee8b9 100644 --- a/src/plugins/imageloader.h +++ b/src/plugins/imageloader.h @@ -61,6 +61,12 @@ class GEM_EXTERN imageloader /* returns TRUE if this object can be used from within a thread */ virtual bool isThreadable(void) = 0; + + /** + * get the current value of the given properties from the loader + * not really used, except for controlling the meta-loader + */ + static void getProperties(imageloader*loader, gem::Properties&props); }; }; From 6f2674f57c315bd514145152e809fb8b8c89da2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 16:02:38 +0100 Subject: [PATCH 063/387] [pix_buffer] "backend" support --- src/Pixes/pix_buffer.cpp | 111 +++++++++++++++++++++++++++++++++++++-- src/Pixes/pix_buffer.h | 4 ++ 2 files changed, 110 insertions(+), 5 deletions(-) diff --git a/src/Pixes/pix_buffer.cpp b/src/Pixes/pix_buffer.cpp index 2ef406380..acfdea516 100644 --- a/src/Pixes/pix_buffer.cpp +++ b/src/Pixes/pix_buffer.cpp @@ -24,6 +24,7 @@ #include "Gem/Files.h" #include "plugins/imagesaver.h" +#include "plugins/imageloader.h" #include "RTE/Outlet.h" /* utilities */ @@ -33,19 +34,28 @@ struct pix_buffer :: PIMPL gem::RTE::Outlet outlet; gem::plugins::imagesaver*saver; + gem::plugins::imageloader*loader; PIMPL(CPPExtern*_parent) : parent(_parent) , outlet(_parent) , saver(gem::plugins::imagesaver::getInstance()) + , loader(gem::plugins::imageloader::getInstance()) {}; ~PIMPL(void) { if(saver) { delete saver; } saver=NULL; + if(loader) { + delete loader; + } + loader=NULL; }; + std::vector savebackends; + std::vector loadbackends; + static gem::any atom2any(t_atom*ap) { gem::any result; @@ -285,6 +295,7 @@ void pix_buffer :: loadMess(std::string filename, int pos) // load an image into mem imageStruct *image = NULL; + imageStruct img; // some checks if (pos<0 || pos>=m_numframes) { @@ -293,16 +304,32 @@ void pix_buffer :: loadMess(std::string filename, int pos) } std::string file=findFile(filename); - image = image2mem(file.c_str()); - if(!image) { - error("'%s' is no valid image!", file.c_str()); - return; + if(m_pimpl->loader) { + gem::Properties m_loadprops; /* empty for now */ + m_loadprops.erase("_backends"); + if(!m_pimpl->loadbackends.empty()) { + m_loadprops.set("_backends", m_pimpl->loadbackends); + } + if(m_pimpl->loader->load(file, img, m_loadprops)) { + image = &img; + } + + if(!image) { + error("unable to load image'%s'!", file.c_str()); + } + } else { + image = image2mem(file.c_str()); + if(!image) { + error("'%s' is no valid image!", file.c_str()); + return; + } } putMess(image,pos); // destroy the image-data - delete image; + if(image != &img) + delete image; } ///////////////////////////////////////////////////////// @@ -323,6 +350,10 @@ void pix_buffer :: saveMess(std::string filename, int pos) if(img && img->data) { std::string fullname=gem::files::getFullpath(filename); if(m_pimpl->saver) { + m_writeprops.erase("_backends"); + if(!m_pimpl->savebackends.empty()) { + m_writeprops.set("_backends", m_pimpl->savebackends); + } m_pimpl->saver->save(*img, fullname, std::string(), m_writeprops); } else { mem2image(img, fullname.c_str(), 0); @@ -428,6 +459,72 @@ void pix_buffer :: setProperties(t_symbol*s, int argc, t_atom*argv) { m_pimpl->addProperties(m_writeprops, argc, argv); } +///////////////////////////////////////////////////////// +// backendMess +// +///////////////////////////////////////////////////////// +void pix_buffer :: backendMess(t_symbol*s, int argc, t_atom*argv) +{ + const std::string sel = s->s_name; + bool saver; + if(sel == "loadbackend") + saver = false; + else if (sel == "savebackend") + saver = true; + else { + error("Use 'loadbackend' to set/get image-loading backends, and 'savebackend' to set/get image-saving backends"); + return; + } + + if(argc) { + std::vector&backends = saver?m_pimpl->savebackends:m_pimpl->loadbackends; + backends.clear(); + for(int i=0; ia_type) { + t_symbol* b=atom_getsymbol(argv+i); + backends.push_back(b->s_name); + } else { + error("%s must be symbolic", s->s_name); + } + } + } else { + /* no backend requested, just enumerate them */ + + if((saver && m_pimpl->saver) || (!saver && m_pimpl->loader)) { + std::vectoratoms; + gem::any value; + gem::Properties props; + std::vector backends; + props.set("_backends", value); + if(saver) { + std::vector mimetypes; + m_pimpl->saver->getWriteCapabilities(mimetypes, props); + } else { + gem::plugins::imageloader::getProperties(m_pimpl->loader, props); + } + if(props.type("_backends")!=gem::Properties::UNSET) { + props.get("_backends", backends); + } + atoms.clear(); + atoms.push_back(value=(int)(backends.size())); + m_pimpl->outlet.send(sel+"s", atoms); + if(!backends.empty()) { + for(int i=0; ioutlet.send(sel, atoms); + } + } else { + if(saver) { + post("no image saving backends found!"); + } else { + post("no image loading backends found!"); + } + } + } + } +} + ///////////////////////////////////////////////////////// // static member function @@ -451,6 +548,10 @@ void pix_buffer :: obj_setupCallback(t_class *classPtr) CPPEXTERN_MSG0(classPtr, "clearProps", clearProperties); CPPEXTERN_MSG (classPtr, "setProp", setProperties); CPPEXTERN_MSG (classPtr, "setProps", setProperties); + + CPPEXTERN_MSG (classPtr, "backend", backendMess); + CPPEXTERN_MSG (classPtr, "loadbackend", backendMess); + CPPEXTERN_MSG (classPtr, "savebackend", backendMess); } void pix_buffer :: allocateMess(t_symbol*s, int argc, t_atom*argv) { diff --git a/src/Pixes/pix_buffer.h b/src/Pixes/pix_buffer.h index a9e05bd09..2e76c0370 100644 --- a/src/Pixes/pix_buffer.h +++ b/src/Pixes/pix_buffer.h @@ -81,6 +81,10 @@ class GEM_EXTERN pix_buffer : public CPPExtern virtual void clearProperties( void ); virtual void setProperties( t_symbol*, int, t_atom*); + ////////// + // Set backend to use + virtual void backendMess(t_symbol*s, int argc, t_atom*argv); + protected: imageStruct *m_buffer; unsigned int m_numframes; From 68a46cf6e7fc305e985e581e89f04e0028e4f3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 16:22:16 +0100 Subject: [PATCH 064/387] [pix_buffer] backend info in help-patch --- help/pix_buffer-help.pd | 139 ++++++++++++++++++++++++++++------------ 1 file changed, 98 insertions(+), 41 deletions(-) diff --git a/help/pix_buffer-help.pd b/help/pix_buffer-help.pd index 8071b743e..9905a9794 100644 --- a/help/pix_buffer-help.pd +++ b/help/pix_buffer-help.pd @@ -1,44 +1,31 @@ -#N canvas 350 148 668 535 10; +#N canvas 350 148 668 577 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 263 cnv 15 430 250 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 263 cnv 15 430 250 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 265 Inlets:; -#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 226 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 452 75 cnv 15 200 170 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 452 75 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 461 54 Example:; -#X obj 457 120 cnv 15 190 150 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 457 120 cnv 15 190 150 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 71 31 Class: pix object; #X text 29 57 Description: a storage place for a number of images; -#X text 11 79 [pix_buffer] is a named storage place for images. It -is quite similar to Pd's [table] object (but you cannot open it and -have a look at it's contents).; +#X text 11 79 [pix_buffer] is a named storage place for images. It is quite similar to Pd's [table] object (but you cannot open it and have a look at it's contents).; #X text 50 11 Synopsis: [pix_buffer]; -#X text 23 281 Inlet 1: bang: get the size of the buffer in frames -; -#X text 12 123 The images stored in the [pix_buffer] can have different -dimensions and colourspaces. Memory is reserved on demand \, but you -can preallocate memory with the [allocate( message.; +#X text 23 281 Inlet 1: bang: get the size of the buffer in frames; +#X text 12 123 The images stored in the [pix_buffer] can have different dimensions and colourspaces. Memory is reserved on demand \, but you can preallocate memory with the [allocate( message.; #X text 23 481 Outlet 1: int: size of the buffer; #X msg 464 128 bang; -#X floatatom 464 253 5 0 0 0 - - -; +#X floatatom 464 303 5 0 0 0 - - - 0; #X msg 505 154 allocate 256 256 4; -#X text 462 296 see also:; -#X obj 475 348 pix_buffer_read; -#X obj 474 323 pix_buffer_write; +#X text 462 426 see also:; +#X obj 475 478 pix_buffer_read; +#X obj 474 453 pix_buffer_write; #X text 64 237 list: ; -#X obj 464 230 pix_buffer depot 10; -#X text 10 170 To write data to the [pix_buffer] or get images from -it \, you can use separate objects [pix_buffer_write] and [pix_buffer_read] -or the [open( message.; -#X obj 505 80 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 240 pix_buffer depot 10; +#X text 10 170 To write data to the [pix_buffer] or get images from it \, you can use separate objects [pix_buffer_write] and [pix_buffer_read] or the [open( message.; +#X obj 505 80 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 openpanel 0; #X obj 114 62 inlet; #X obj 121 254 outlet; @@ -51,28 +38,98 @@ or the [open( message.; #X connect 3 1 1 0; #X connect 4 0 3 0; #X restore 505 97 pd openpanel; -#X text 23 300 Inlet 1: message: open : put an image -into the pix_buffer at the given index; +#X text 23 300 Inlet 1: message: open : put an image into the pix_buffer at the given index; #X msg 505 132 open somefile.jpg 0; #X msg 506 174 resize 15; -#X text 23 384 Inlet 1: message: resize : re-allocate slots in -the buffer (slots will survive this); -#X text 23 333 Inlet 1: message: allocate : -assume that all images in the pix_buffer will have the given dimension -and preallocate memory for them (pixes will be set to black); +#X text 23 384 Inlet 1: message: resize : re-allocate slots in the buffer (slots will survive this); +#X text 23 333 Inlet 1: message: allocate : assume that all images in the pix_buffer will have the given dimension and preallocate memory for them (pixes will be set to black); #X msg 506 193 copy 0 2; #X msg 506 212 save /tmp/out.jpg 2; -#X text 23 414 Inlet 1: message: copy : copy a pix from -slot to slot ; -#X text 23 444 Inlet 1: message: save : save image -in given slot to harddisk.; +#X text 23 414 Inlet 1: message: copy : copy a pix from slot to slot ; +#X text 23 444 Inlet 1: message: save : save image in given slot to harddisk.; #X obj 548 8 declare -lib Gem; +#X obj 464 277 route float; +#X obj 587 240 r \$0-ctl; +#N canvas 6 49 515 369 print 0; +#X obj 102 176 inlet; +#X obj 102 198 s \$0-info; +#X obj 102 220 r \$0-infoprint; +#X obj 102 242 print INFO; +#X text 62 90 actually you can just hook a [print] to the 3rd outlet.; +#X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.; +#N canvas 664 456 450 465 logic 0; +#X obj 223 19 r \$0load-ctl; +#X obj 242 184 s \$0-ctl; +#X obj 83 119 r \$0-info; +#X obj 353 19 r \$0save-ctl; +#X obj 353 42 t b a b; +#X obj 83 142 list prepend 0; +#X obj 83 188 s \$0-infoprint; +#X obj 122 380 s \$0load-info; +#X obj 147 400 s \$0save-info; +#X msg 223 64 0; +#X msg 262 64 1; +#X msg 392 66 2; +#X msg 353 65 0; +#X obj 353 88 t f; +#X obj 223 42 t b b b; +#X msg 242 151 loadbackend; +#X msg 372 156 savebackend; +#X obj 223 105 t a; +#X obj 156 261 fudiformat -u; +#X obj 188 305 fudiparse; +#X obj 83 165 route 0; +#X obj 122 209 list split 1; +#X obj 122 328 list append; +#X obj 122 351 route 1 2; +#X obj 156 284 list split 4; +#X obj 156 235 list trim; +#X connect 0 0 14 0; +#X connect 2 0 5 0; +#X connect 3 0 4 0; +#X connect 4 0 12 0; +#X connect 4 1 16 0; +#X connect 4 2 11 0; +#X connect 5 0 20 0; +#X connect 9 0 17 0; +#X connect 10 0 17 0; +#X connect 11 0 13 0; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 9 0; +#X connect 14 1 15 0; +#X connect 14 2 10 0; +#X connect 15 0 1 0; +#X connect 16 0 1 0; +#X connect 17 0 5 1; +#X connect 18 0 24 0; +#X connect 19 0 22 1; +#X connect 20 0 6 0; +#X connect 20 1 21 0; +#X connect 21 0 22 0; +#X connect 21 1 25 0; +#X connect 22 0 23 0; +#X connect 23 0 7 0; +#X connect 23 1 8 0; +#X connect 24 1 19 0; +#X connect 25 0 18 0; +#X restore 347 257 pd logic; +#X connect 0 0 1 0; +#X connect 2 0 3 0; +#X restore 543 277 pd print; +#X obj 67 549 _backendinfo \$0save imagesaver; +#X obj 67 523 _backendinfo \$0load imageloader; +#X text 244 524 loading images; +#X text 244 554 saving images; #X connect 16 0 23 0; #X connect 18 0 23 0; -#X connect 23 0 17 0; +#X connect 23 0 37 0; #X connect 25 0 26 0; #X connect 26 0 28 0; #X connect 28 0 23 0; #X connect 29 0 23 0; #X connect 32 0 23 0; #X connect 33 0 23 0; +#X connect 37 0 17 0; +#X connect 37 1 39 0; +#X connect 38 0 23 0; From 6acaae5c2b1044d665f3cf60d6321f3833583dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 16:44:44 +0100 Subject: [PATCH 065/387] backend help for modelloader plugins --- plugins/ASSIMP2/ASSIMP2-modelplugin.pd | 3 +++ plugins/ASSIMP2/Makefile.am | 3 +++ plugins/ASSIMP3/ASSIMP3-modelplugin.pd | 20 ++++++++++++++++++++ plugins/ASSIMP3/Makefile.am | 3 +++ plugins/OBJ/Makefile.am | 4 ++++ plugins/OBJ/OBJ-modelplugin.pd | 14 ++++++++++++++ 6 files changed, 47 insertions(+) create mode 100644 plugins/ASSIMP2/ASSIMP2-modelplugin.pd create mode 100644 plugins/ASSIMP3/ASSIMP3-modelplugin.pd create mode 100644 plugins/OBJ/OBJ-modelplugin.pd diff --git a/plugins/ASSIMP2/ASSIMP2-modelplugin.pd b/plugins/ASSIMP2/ASSIMP2-modelplugin.pd new file mode 100644 index 000000000..baa78c941 --- /dev/null +++ b/plugins/ASSIMP2/ASSIMP2-modelplugin.pd @@ -0,0 +1,3 @@ +#N canvas 242 133 479 182 12; +#X text 26 29 With the ASSIMP backend \, you can load a multitude of different model formats.; +#X text 24 79 This is the backend for the old ASSIMP2 library \, which is no longer maintained.; diff --git a/plugins/ASSIMP2/Makefile.am b/plugins/ASSIMP2/Makefile.am index 7678bd677..23cd4c1c9 100644 --- a/plugins/ASSIMP2/Makefile.am +++ b/plugins/ASSIMP2/Makefile.am @@ -9,9 +9,12 @@ EXTRA_DIST += win-vs2008/modelASSIMP2.sln win-vs2008/modelASSIMP2.vcproj EXTRA_DIST += win-vs2008/ASSIMP2.vsprops pkglib_LTLIBRARIES= +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = if HAVE_ASSIMP2 pkglib_LTLIBRARIES += gem_modelASSIMP2.la +dist_gemhelp_DATA += ASSIMP2-modelplugin.pd endif gem_modelASSIMP2_la_CXXFLAGS = diff --git a/plugins/ASSIMP3/ASSIMP3-modelplugin.pd b/plugins/ASSIMP3/ASSIMP3-modelplugin.pd new file mode 100644 index 000000000..81b9e6b51 --- /dev/null +++ b/plugins/ASSIMP3/ASSIMP3-modelplugin.pd @@ -0,0 +1,20 @@ +#N canvas 242 133 450 499 12; +#X obj 95 416 s \$1-ctl; +#X text 169 312 smoothing (0..1); +#X msg 95 313 smooth \$1; +#X obj 98 287 hsl 170 20 0 1 0 0 empty empty empty -2 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X text 26 104 It depends on the AssImp (Asset Importer) library \, which must be present on your system in order to be used.; +#X text 26 29 With the ASSIMP backend \, you can load a multitude of different model formats (a tthe time of writing its about 40 different formats \, from simple OBJ files to Collada and Blender meshes).; +#X msg 80 163 https://assimp.org; +#N canvas 614 438 450 300 URL 0; +#X obj 37 37 inlet; +#X obj 37 62 symbol; +#X obj 37 112 pdcontrol; +#X msg 37 87 browse \$1; +#X connect 0 0 1 0; +#X connect 1 0 3 0; +#X connect 3 0 2 0; +#X restore 80 188 pd URL; +#X connect 2 0 0 0; +#X connect 3 0 2 0; +#X connect 6 0 7 0; diff --git a/plugins/ASSIMP3/Makefile.am b/plugins/ASSIMP3/Makefile.am index d440fee5f..cd8c40d68 100644 --- a/plugins/ASSIMP3/Makefile.am +++ b/plugins/ASSIMP3/Makefile.am @@ -6,9 +6,12 @@ EXTRA_DIST = EXTRA_DIST += README.txt pkglib_LTLIBRARIES= +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = if HAVE_ASSIMP3 pkglib_LTLIBRARIES += gem_modelASSIMP3.la +dist_gemhelp_DATA += ASSIMP3-modelplugin.pd endif gem_modelASSIMP3_la_CXXFLAGS = diff --git a/plugins/OBJ/Makefile.am b/plugins/OBJ/Makefile.am index 4dab23070..9e4e3c3a2 100644 --- a/plugins/OBJ/Makefile.am +++ b/plugins/OBJ/Makefile.am @@ -8,6 +8,10 @@ EXTRA_DIST += win-vs2008/modelOBJ.sln win-vs2008/modelOBJ.vcproj pkglib_LTLIBRARIES= gem_modelOBJ.la +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = +dist_gemhelp_DATA += OBJ-modelplugin.pd + gem_modelOBJ_la_CXXFLAGS = gem_modelOBJ_la_LDFLAGS = -module -avoid-version -shared if WINDOWS diff --git a/plugins/OBJ/OBJ-modelplugin.pd b/plugins/OBJ/OBJ-modelplugin.pd new file mode 100644 index 000000000..976bcd611 --- /dev/null +++ b/plugins/OBJ/OBJ-modelplugin.pd @@ -0,0 +1,14 @@ +#N canvas 242 133 450 499 12; +#X text 26 30 With the OBJ backend \, you can load Alias Wavefront OBJ files.; +#X text 21 74 This is a simple text-based format \, and the loader does not require any additional dependencies (so should be available on all installations of Gem).; +#X obj 95 416 s \$1-ctl; +#X text 178 232 smoothing (0..1); +#X msg 112 302 reverse \$1; +#X obj 112 278 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X msg 104 233 smooth \$1; +#X obj 107 207 hsl 170 20 0 1 0 0 empty empty empty -2 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X text 143 281 reverse winding; +#X connect 4 0 2 0; +#X connect 5 0 4 0; +#X connect 6 0 2 0; +#X connect 7 0 6 0; From 9ea1551794a33602ccc32e867b80b4552dbcf241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 17:04:06 +0100 Subject: [PATCH 066/387] recordPIPEWIRE: lowercase plugin name when registering --- plugins/PIPEWIRE/recordPIPEWIRE.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PIPEWIRE/recordPIPEWIRE.cpp b/plugins/PIPEWIRE/recordPIPEWIRE.cpp index 6734a77f6..7117a56b3 100644 --- a/plugins/PIPEWIRE/recordPIPEWIRE.cpp +++ b/plugins/PIPEWIRE/recordPIPEWIRE.cpp @@ -32,7 +32,7 @@ using namespace gem::plugins; #include -REGISTER_RECORDFACTORY("PIPEWIRE", recordPIPEWIRE); +REGISTER_RECORDFACTORY("pipewire", recordPIPEWIRE); namespace { From 39364b18b4974e363eea82931967f3322d420c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 17:29:07 +0100 Subject: [PATCH 067/387] normalize registered plugin names make sure to use the same name for record and film plugins --- plugins/QT4L/recordQT4L.cpp | 2 +- plugins/QuickTime/imageQT.cpp | 4 ++-- plugins/QuickTime/recordQT.cpp | 2 +- plugins/SGI/imageSGI.cpp | 4 ++-- plugins/STB/imageSTB.cpp | 4 ++-- plugins/V4L/recordV4L.cpp | 2 +- plugins/V4L2/recordV4L2.cpp | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/QT4L/recordQT4L.cpp b/plugins/QT4L/recordQT4L.cpp index 2e484871b..1984cc76b 100644 --- a/plugins/QT4L/recordQT4L.cpp +++ b/plugins/QT4L/recordQT4L.cpp @@ -33,7 +33,7 @@ using namespace gem::plugins; #ifdef GEM_USE_RECORDQT4L #include -REGISTER_RECORDFACTORY("QT4L", recordQT4L); +REGISTER_RECORDFACTORY("quicktime4linux", recordQT4L); #endif ///////////////////////////////////////////////////////// // diff --git a/plugins/QuickTime/imageQT.cpp b/plugins/QuickTime/imageQT.cpp index df8aebc95..6456e68c8 100644 --- a/plugins/QuickTime/imageQT.cpp +++ b/plugins/QuickTime/imageQT.cpp @@ -55,8 +55,8 @@ using namespace gem::plugins; -REGISTER_IMAGELOADERFACTORY("QT", imageQT); -REGISTER_IMAGESAVERFACTORY("QT", imageQT); +REGISTER_IMAGELOADERFACTORY("QuickTime", imageQT); +REGISTER_IMAGESAVERFACTORY("QuickTime", imageQT); #if defined __APPLE__ static OSStatus diff --git a/plugins/QuickTime/recordQT.cpp b/plugins/QuickTime/recordQT.cpp index 8c213cb25..812bca769 100644 --- a/plugins/QuickTime/recordQT.cpp +++ b/plugins/QuickTime/recordQT.cpp @@ -69,7 +69,7 @@ static bool touch(const std::string&filename) return false; } -REGISTER_RECORDFACTORY("QT", recordQT); +REGISTER_RECORDFACTORY("QuickTime", recordQT); ///////////////////////////////////////////////////////// // // recordQT diff --git a/plugins/SGI/imageSGI.cpp b/plugins/SGI/imageSGI.cpp index 7ed885bcf..569c73982 100644 --- a/plugins/SGI/imageSGI.cpp +++ b/plugins/SGI/imageSGI.cpp @@ -26,8 +26,8 @@ using namespace gem::plugins; -REGISTER_IMAGELOADERFACTORY("SGI", imageSGI); -REGISTER_IMAGESAVERFACTORY ("SGI", imageSGI); +REGISTER_IMAGELOADERFACTORY("sgi", imageSGI); +REGISTER_IMAGESAVERFACTORY ("sgi", imageSGI); ///////////////////////////////////////////////////////// // diff --git a/plugins/STB/imageSTB.cpp b/plugins/STB/imageSTB.cpp index 44ec058af..29e81c53c 100644 --- a/plugins/STB/imageSTB.cpp +++ b/plugins/STB/imageSTB.cpp @@ -36,8 +36,8 @@ using namespace gem::plugins; -REGISTER_IMAGELOADERFACTORY("STB", imageSTB); -REGISTER_IMAGESAVERFACTORY ("STB", imageSTB); +REGISTER_IMAGELOADERFACTORY("stb", imageSTB); +REGISTER_IMAGESAVERFACTORY ("stb", imageSTB); ///////////////////////////////////////////////////////// // diff --git a/plugins/V4L/recordV4L.cpp b/plugins/V4L/recordV4L.cpp index f7584e5cb..1de697cbd 100644 --- a/plugins/V4L/recordV4L.cpp +++ b/plugins/V4L/recordV4L.cpp @@ -37,7 +37,7 @@ using namespace gem::plugins; #include #include -REGISTER_RECORDFACTORY("V4L", recordV4L); +REGISTER_RECORDFACTORY("v4l", recordV4L); ///////////////////////////////////////////////////////// // // recordV4L diff --git a/plugins/V4L2/recordV4L2.cpp b/plugins/V4L2/recordV4L2.cpp index a4e99fd3c..01ae1f990 100644 --- a/plugins/V4L2/recordV4L2.cpp +++ b/plugins/V4L2/recordV4L2.cpp @@ -39,7 +39,7 @@ using namespace gem::plugins; #include #include -REGISTER_RECORDFACTORY("V4L2", recordV4L2); +REGISTER_RECORDFACTORY("v4l2", recordV4L2); ///////////////////////////////////////////////////////// // // recordV4L2 From 147be6038f8b5e8ba2c330eb02e2fec7ab3bb2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 17:49:44 +0100 Subject: [PATCH 068/387] Add some image backend helppatches --- plugins/JPEG/Makefile.am | 5 +++++ plugins/JPEG/jpeg-imageloaderplugin.pd | 4 ++++ plugins/JPEG/jpeg-imagesaverplugin.pd | 5 +++++ plugins/SGI/Makefile.am | 4 ++++ plugins/SGI/sgi-imageloaderplugin.pd | 5 +++++ plugins/SGI/sgi-imagesaverplugin.pd | 6 ++++++ plugins/STB/Makefile.am | 4 ++++ plugins/STB/stb-imageloaderplugin.pd | 12 ++++++++++++ plugins/STB/stb-imagesaverplugin.pd | 8 ++++++++ plugins/TIFF/Makefile.am | 4 ++++ plugins/TIFF/tiff-imageloaderplugin.pd | 5 +++++ plugins/TIFF/tiff-imagesaverplugin.pd | 10 ++++++++++ 12 files changed, 72 insertions(+) create mode 100644 plugins/JPEG/jpeg-imageloaderplugin.pd create mode 100644 plugins/JPEG/jpeg-imagesaverplugin.pd create mode 100644 plugins/SGI/sgi-imageloaderplugin.pd create mode 100644 plugins/SGI/sgi-imagesaverplugin.pd create mode 100644 plugins/STB/stb-imageloaderplugin.pd create mode 100644 plugins/STB/stb-imagesaverplugin.pd create mode 100644 plugins/TIFF/tiff-imageloaderplugin.pd create mode 100644 plugins/TIFF/tiff-imagesaverplugin.pd diff --git a/plugins/JPEG/Makefile.am b/plugins/JPEG/Makefile.am index 7c5b456a4..1ee798399 100644 --- a/plugins/JPEG/Makefile.am +++ b/plugins/JPEG/Makefile.am @@ -7,9 +7,14 @@ EXTRA_DIST += win-vs2003/imageJPEG.sln win-vs2003/imageJPEG.vcproj EXTRA_DIST += win-vs2008/imageJPEG.sln win-vs2008/imageJPEG.vcproj EXTRA_DIST += win-vs2008/JPEG.vsprops + +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = pkglib_LTLIBRARIES= + if HAVE_LIB_JPEG pkglib_LTLIBRARIES+= gem_imageJPEG.la +dist_gemhelp_DATA += jpeg-imageloaderplugin.pd jpeg-imagesaverplugin.pd endif gem_imageJPEG_la_CXXFLAGS = diff --git a/plugins/JPEG/jpeg-imageloaderplugin.pd b/plugins/JPEG/jpeg-imageloaderplugin.pd new file mode 100644 index 000000000..738f2b794 --- /dev/null +++ b/plugins/JPEG/jpeg-imageloaderplugin.pd @@ -0,0 +1,4 @@ +#N canvas 977 251 588 226 12; +#X text 21 44 The JPEG plugin can load JPEG images.; +#X text 29 78 Note that any orientation metadata embedded into the image (like an upside-down flag) will be *ignored*.; +#X text 34 143 This plugins requires libJPEG.; diff --git a/plugins/JPEG/jpeg-imagesaverplugin.pd b/plugins/JPEG/jpeg-imagesaverplugin.pd new file mode 100644 index 000000000..0144b5a53 --- /dev/null +++ b/plugins/JPEG/jpeg-imagesaverplugin.pd @@ -0,0 +1,5 @@ +#N canvas 1042 282 588 226 12; +#X text 31 173 This plugins requires libJPEG.; +#X text 21 44 The JPEG plugin can write JPEG images.; +#X text 29 78 All images will be converted to RGB before saving.; +#X text 29 101 You can set the 'quality' property to adjust the compression level.; diff --git a/plugins/SGI/Makefile.am b/plugins/SGI/Makefile.am index 4d95ae6b2..be982972c 100644 --- a/plugins/SGI/Makefile.am +++ b/plugins/SGI/Makefile.am @@ -9,6 +9,10 @@ EXTRA_DIST += win-vs2008/imageSGI.sln win-vs2008/imageSGI.vcproj pkglib_LTLIBRARIES= gem_imageSGI.la +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = +dist_gemhelp_DATA += sgi-imageloaderplugin.pd sgi-imagesaverplugin.pd + gem_imageSGI_la_CXXFLAGS = gem_imageSGI_la_LDFLAGS = -module -avoid-version -shared if WINDOWS diff --git a/plugins/SGI/sgi-imageloaderplugin.pd b/plugins/SGI/sgi-imageloaderplugin.pd new file mode 100644 index 000000000..b4e792325 --- /dev/null +++ b/plugins/SGI/sgi-imageloaderplugin.pd @@ -0,0 +1,5 @@ +#N canvas 242 133 450 309 12; +#X text 21 74 The SGI plugin loads SGI images \, typically with extensions: .sgi \, .rgba \, .rgb \, .bw; +#X text 23 119 SGI images were popular in the 90ies on the SGI workstations.; +#X text 22 162 These days they are rather seldom.; +#X text 20 187 However \, the SGI plugin is the oldest image reader in Gem that does not require any external libraries \, so it should be available on all platforms supported by Gem (These days there's also the STB plugin \, which can read more common formats).; diff --git a/plugins/SGI/sgi-imagesaverplugin.pd b/plugins/SGI/sgi-imagesaverplugin.pd new file mode 100644 index 000000000..47b894b95 --- /dev/null +++ b/plugins/SGI/sgi-imagesaverplugin.pd @@ -0,0 +1,6 @@ +#N canvas 242 133 489 314 12; +#X text 43 79 SGI images were popular in the 90ies on the SGI workstations.; +#X text 42 122 These days they are rather seldom.; +#X text 22 42 The SGI plugin writes SGI images.; +#X text 47 174 All images are converted to RGBA before saving.; +#X text 49 205 You can pass the 'imagename' property to set the metadata in the image.; diff --git a/plugins/STB/Makefile.am b/plugins/STB/Makefile.am index bca600073..26c052802 100644 --- a/plugins/STB/Makefile.am +++ b/plugins/STB/Makefile.am @@ -12,6 +12,10 @@ EXTRA_DIST+= \ pkglib_LTLIBRARIES= gem_imageSTB.la +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = +dist_gemhelp_DATA += stb-imageloaderplugin.pd stb-imagesaverplugin.pd + gem_imageSTB_la_CXXFLAGS = gem_imageSTB_la_LDFLAGS = -module -avoid-version -shared if WINDOWS diff --git a/plugins/STB/stb-imageloaderplugin.pd b/plugins/STB/stb-imageloaderplugin.pd new file mode 100644 index 000000000..2799a6d32 --- /dev/null +++ b/plugins/STB/stb-imageloaderplugin.pd @@ -0,0 +1,12 @@ +#N canvas 678 202 588 374 12; +#X text 37 110 - TGA (unknown subset); +#X text 37 130 - PSD (composited view only \, no extra channels \, 8/16 bpc); +#X text 37 170 - PIC (Softimage PIC); +#X text 37 190 - PNM (PPM and PGM binary only); +#X text 37 150 - GIF (unknown subset); +#X text 21 44 The STB plugin can load the following formats:; +#X text 29 280 Not all variants of the given formats might be supported!; +#X text 30 307 However \, STB does not require any additional dependencies \, so it should be available (with the same capabilities) on all platforms supported by Gem., f 77; +#X text 39 91 - PNG¹ ( 1/2/4/8/16-bpc); +#X text 39 71 - JPEG¹ (baseline & progressive. 12 bpc/arithmethic NOT supported), f 66; +#X text 30 227 ¹ Note that (at least) JPEG and PNG images that have the upside-down flag set will not be automatically corrected., f 77; diff --git a/plugins/STB/stb-imagesaverplugin.pd b/plugins/STB/stb-imagesaverplugin.pd new file mode 100644 index 000000000..fe7623524 --- /dev/null +++ b/plugins/STB/stb-imagesaverplugin.pd @@ -0,0 +1,8 @@ +#N canvas 702 134 529 313 12; +#X text 21 74 The STB plugin can write the following formats:; +#X text 37 120 - PNG; +#X text 37 100 - JPEG, f 69; +#X text 37 140 - TGA; +#X text 37 160 - BMP; +#X text 32 249 All images are converted to RGBA before saving.; +#X text 29 200 Typically only some baseline subset is supported for each format. JPEG saving takes a 'quality' property (1..100).; diff --git a/plugins/TIFF/Makefile.am b/plugins/TIFF/Makefile.am index 64bf457fb..81ddfb66e 100644 --- a/plugins/TIFF/Makefile.am +++ b/plugins/TIFF/Makefile.am @@ -7,9 +7,13 @@ EXTRA_DIST += win-vs2003/imageTIFF.sln win-vs2003/imageTIFF.vcproj EXTRA_DIST += win-vs2008/imageTIFF.sln win-vs2008/imageTIFF.vcproj EXTRA_DIST += win-vs2008/TIFF.vsprops +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = pkglib_LTLIBRARIES= + if HAVE_LIB_TIFF pkglib_LTLIBRARIES+= gem_imageTIFF.la +dist_gemhelp_DATA += tiff-imageloaderplugin.pd tiff-imagesaverplugin.pd endif diff --git a/plugins/TIFF/tiff-imageloaderplugin.pd b/plugins/TIFF/tiff-imageloaderplugin.pd new file mode 100644 index 000000000..e42a8016c --- /dev/null +++ b/plugins/TIFF/tiff-imageloaderplugin.pd @@ -0,0 +1,5 @@ +#N canvas 500 228 588 226 12; +#X text 34 163 This plugins requires libTIFF.; +#X text 19 78 Upside-down images should be automatically corrected and displayed correctly.; +#X text 19 110 If present \, metadata like x/yresolution \, resolutionuntits \, creatoing artist and software will be extracted.; +#X text 21 44 The TIFF plugin can load TIFF images.; diff --git a/plugins/TIFF/tiff-imagesaverplugin.pd b/plugins/TIFF/tiff-imagesaverplugin.pd new file mode 100644 index 000000000..93926579d --- /dev/null +++ b/plugins/TIFF/tiff-imagesaverplugin.pd @@ -0,0 +1,10 @@ +#N canvas 811 273 589 325 12; +#X text 31 233 This plugins requires libTIFF.; +#X text 21 44 The TIFF plugin can write TIFF images.; +#X text 35 79 The following properties can be set when saving the image:; +#X text 49 204 - 'hostcomputer'; +#X text 49 104 - 'xresolution' (default: 72.); +#X text 49 124 - 'yresolution' (default: 72); +#X text 49 144 - 'resolutionunit' (default: 'inch'); +#X text 49 184 - 'artist'; +#X text 49 164 - 'software' (default: 'PD/GEM'); From 5350e37d721c03c2a7ca38514f0b885696cad3af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 22 Feb 2024 12:01:01 +0100 Subject: [PATCH 069/387] [modelfiler] "loader" -> "backend" --- src/Controls/modelfiler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Controls/modelfiler.cpp b/src/Controls/modelfiler.cpp index 2f4ea2bad..a8d235b08 100644 --- a/src/Controls/modelfiler.cpp +++ b/src/Controls/modelfiler.cpp @@ -311,6 +311,7 @@ void modelfiler :: backendMess(t_symbol*s, int argc, t_atom*argv) } else { /* no backend requested, just enumerate them */ if(m_loader) { + const std::string sel = s->s_name; std::vectoratoms; gem::any value; gem::Properties props; @@ -322,13 +323,13 @@ void modelfiler :: backendMess(t_symbol*s, int argc, t_atom*argv) } atoms.clear(); atoms.push_back(value=(int)(backends.size())); - m_infoOut.send("loaders", atoms); + m_infoOut.send(sel + "s", atoms); if(!backends.empty()) { for(int i=0; i Date: Thu, 22 Feb 2024 12:20:22 +0100 Subject: [PATCH 070/387] Outlet: print an error if we cannot convert gem::any to t_atom --- src/RTE/Outlet.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/RTE/Outlet.cpp b/src/RTE/Outlet.cpp index 84988233e..46136c871 100644 --- a/src/RTE/Outlet.cpp +++ b/src/RTE/Outlet.cpp @@ -39,7 +39,7 @@ class gem::RTE::Outlet::PIMPL parent_=NULL; } } - static bool any2atom(const gem::any value, t_atom&atom) + bool any2atom(const gem::any value, t_atom&atom) { double d=0; std::string s=std::string(); @@ -104,6 +104,13 @@ class gem::RTE::Outlet::PIMPL } else if(ISTYPE(void*)) { atype=A_POINTER; p=any_cast(value); + } else { + if(parent_) + parent_->error("cannot convert gem::any of unknown type '%s' to t_atom", + value.get_type().name()); + else + pd_error(0, "cannot convert gem::any of unknown type '%s' to t_atom", + value.get_type().name()); } switch(atype) { From 4f2ee85d16edfb3e5505d765399e64f0edb6cf20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 22 Feb 2024 12:20:51 +0100 Subject: [PATCH 071/387] enable long/unsigned_long to t_float conversion, despite the precision loss --- src/RTE/Outlet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RTE/Outlet.cpp b/src/RTE/Outlet.cpp index 46136c871..49e1cac78 100644 --- a/src/RTE/Outlet.cpp +++ b/src/RTE/Outlet.cpp @@ -73,7 +73,7 @@ class gem::RTE::Outlet::PIMPL } else if(ISTYPE(unsigned int)) { atype=A_FLOAT; d=any_cast(value); -#if 0 +#if 1 /* "long"s cannot be stored in "double"s without losing precision... */ } else if(ISTYPE(long)) { atype=A_FLOAT; From d856997a344248ffed2368a4309c5d3b3540ed68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 26 Feb 2024 23:25:51 +0100 Subject: [PATCH 072/387] add _backendinfo.pd to installed-files --- help/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/help/Makefile.am b/help/Makefile.am index caf4824c4..667cdc947 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -237,4 +237,9 @@ dist_gemhelp_DATA += \ triangle-help.pd \ tube-help.pd \ vertex_program-help.pd \ - world_light-help.pd + world_light-help.pd \ + $(empty) + +dist_gemhelp_DATA += \ + _backendinfo.pd \ + $(empty) From 6fcca64664e1b110f113a94f37a9b265fd259b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 27 Feb 2024 08:47:50 +0100 Subject: [PATCH 073/387] more backend helppatches for imageplugins --- plugins/QuickTime/Makefile.am | 4 ++++ .../QuickTime/QuickTime-imageloaderplugin.pd | 3 +++ .../QuickTime/QuickTime-imagesaverplugin.pd | 4 ++++ plugins/imageIO/Makefile.am | 6 +++++- plugins/imageIO/imageIO-imageloaderplugin.pd | 5 +++++ plugins/imageIO/imageIO-imagesaverplugin.pd | 4 ++++ plugins/imageMAGICK/Makefile.am | 5 +++++ .../imageMAGICK/magick-imageloaderplugin.pd | 18 ++++++++++++++++++ plugins/imageMAGICK/magick-imagesaverplugin.pd | 17 +++++++++++++++++ 9 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 plugins/QuickTime/QuickTime-imageloaderplugin.pd create mode 100644 plugins/QuickTime/QuickTime-imagesaverplugin.pd create mode 100644 plugins/imageIO/imageIO-imageloaderplugin.pd create mode 100644 plugins/imageIO/imageIO-imagesaverplugin.pd create mode 100644 plugins/imageMAGICK/magick-imageloaderplugin.pd create mode 100644 plugins/imageMAGICK/magick-imagesaverplugin.pd diff --git a/plugins/QuickTime/Makefile.am b/plugins/QuickTime/Makefile.am index 40b713126..712172c5a 100644 --- a/plugins/QuickTime/Makefile.am +++ b/plugins/QuickTime/Makefile.am @@ -8,9 +8,13 @@ EXTRA_DIST += win-vs2003/filmQT.sln win-vs2003/filmQT.vcproj EXTRA_DIST += win-vs2008/filmQT.sln win-vs2008/filmQT.vcproj pkglib_LTLIBRARIES= +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = + if HAVE_FRAMEWORK_QUICKTIME pkglib_LTLIBRARIES+= gem_filmQT.la pkglib_LTLIBRARIES+= gem_imageQT.la +dist_gemhelp_DATA += QuickTime-imageloaderplugin.pd QuickTime-imagesaverplugin.pd pkglib_LTLIBRARIES+= gem_recordQT.la endif diff --git a/plugins/QuickTime/QuickTime-imageloaderplugin.pd b/plugins/QuickTime/QuickTime-imageloaderplugin.pd new file mode 100644 index 000000000..ed6b950ab --- /dev/null +++ b/plugins/QuickTime/QuickTime-imageloaderplugin.pd @@ -0,0 +1,3 @@ +#N canvas 678 202 524 220 12; +#X text 22 136 This plugin uses Apple's deprecated QuickTime framework and is only available on 32bit OSX and Windows., f 55; +#X text 21 74 The QuickTime plugin can load many different image formats.; diff --git a/plugins/QuickTime/QuickTime-imagesaverplugin.pd b/plugins/QuickTime/QuickTime-imagesaverplugin.pd new file mode 100644 index 000000000..7a2c1acf3 --- /dev/null +++ b/plugins/QuickTime/QuickTime-imagesaverplugin.pd @@ -0,0 +1,4 @@ +#N canvas 673 187 529 313 12; +#X text 21 74 The imageIO plugin can write the following formats:; +#X text 22 176 This plugin uses Apple's deprecated QuickTime framework and is only available on 32bit OSX and Windows., f 55; +#X text 37 100 - JPEG \, JPEG2000 \, TIFF \, GIF \, PNG \, BMP \, TARGA \, SGI \, PhotoShop \, QuickTime images \, MacPaint images, f 69; diff --git a/plugins/imageIO/Makefile.am b/plugins/imageIO/Makefile.am index c06ea00b0..0397caab0 100644 --- a/plugins/imageIO/Makefile.am +++ b/plugins/imageIO/Makefile.am @@ -5,8 +5,12 @@ AM_CPPFLAGS = -I$(top_srcdir)/src $(GEM_EXTERNAL_CPPFLAGS) EXTRA_DIST = pkglib_LTLIBRARIES= +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = + if HAVE_FRAMEWORK_IMAGEIO -pkglib_LTLIBRARIES += gem_imageIO.la +pkglib_LTLIBRARIES+= gem_imageIO.la +dist_gemhelp_DATA += imageIO-imageloaderplugin.pd imageIO-imagesaverplugin.pd endif gem_imageIO_la_OBJCFLAGS = $(GEM_EXTERNAL_CFLAGS) -fobjc-arc diff --git a/plugins/imageIO/imageIO-imageloaderplugin.pd b/plugins/imageIO/imageIO-imageloaderplugin.pd new file mode 100644 index 000000000..6175d2a55 --- /dev/null +++ b/plugins/imageIO/imageIO-imageloaderplugin.pd @@ -0,0 +1,5 @@ +#N canvas 678 202 532 328 12; +#X text 22 246 This plugin uses Apple's Image I/O framework (and is therefore only available on macOS)., f 46; +#X text 21 74 The imageIO plugin can load "most image formats" (at least that's what the manufacturer of the underlying library claims).; +#X text 34 164 - JPEG \, JPEG2000 \, TIFF \, GIF \, PNG \, BMP \, icns \, ico \, QuickTime images, f 69; +#X text 23 141 among them are:; diff --git a/plugins/imageIO/imageIO-imagesaverplugin.pd b/plugins/imageIO/imageIO-imagesaverplugin.pd new file mode 100644 index 000000000..475ddb2b5 --- /dev/null +++ b/plugins/imageIO/imageIO-imagesaverplugin.pd @@ -0,0 +1,4 @@ +#N canvas 673 187 529 313 12; +#X text 21 74 The imageIO plugin can write the following formats:; +#X text 37 100 - JPEG \, JPEG2000 \, TIFF \, GIF \, PNG \, BMP \, icns \, ico \, QuickTime images, f 69; +#X text 22 176 This plugin uses Apple's Image I/O framework (and is therefore only available on macOS)., f 47; diff --git a/plugins/imageMAGICK/Makefile.am b/plugins/imageMAGICK/Makefile.am index eee608a97..0b6103fe7 100644 --- a/plugins/imageMAGICK/Makefile.am +++ b/plugins/imageMAGICK/Makefile.am @@ -8,11 +8,16 @@ EXTRA_DIST += win-vs2008/imageMAGICK.sln win-vs2008/imageMAGICK.vcproj EXTRA_DIST += win-vs2008/ImageMagick_Release.vsprops win-vs2008/ImageMagick.vsprops pkglib_LTLIBRARIES= +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = + if HAVE_LIB_IMAGEMAGICK__ pkglib_LTLIBRARIES+= gem_imageMAGICK.la +dist_gemhelp_DATA += magick-imageloaderplugin.pd magick-imagesaverplugin.pd else if HAVE_LIB_MAGICKCORE pkglib_LTLIBRARIES+= gem_imageMAGICK.la +dist_gemhelp_DATA += magick-imageloaderplugin.pd magick-imagesaverplugin.pd endif endif diff --git a/plugins/imageMAGICK/magick-imageloaderplugin.pd b/plugins/imageMAGICK/magick-imageloaderplugin.pd new file mode 100644 index 000000000..08e2f4866 --- /dev/null +++ b/plugins/imageMAGICK/magick-imageloaderplugin.pd @@ -0,0 +1,18 @@ +#N canvas 678 202 532 328 12; +#X text 23 91 among them are:; +#X text 12 50 The ImageMagick plugin can load a wide variety of image formats (over 100).; +#X text 22 296 This plugin uses the ImageMagick library.; +#X text 33 114 - JPEG \, JPEG2000 \, TIFF \, GIF \, PNG \, BMP \, ..., f 69; +#X text 28 194 NOTE: this plugin can also open video files (and expose the first frame) \, if FFMPEG is available. Doing so might decode the entire video file to a temporary place \, which might both take a long time and fill your disk. We would like to git rid of this behaviour \, so do not rely on it.; +#X msg 306 144 https://imagemagick.org; +#N canvas 735 459 450 300 URL 0; +#X obj 37 37 inlet; +#X obj 37 62 symbol; +#X msg 37 87 browse \$1; +#X obj 37 112 pdcontrol; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X restore 306 169 pd URL; +#X text 58 143 for a more complete list \, visit:; +#X connect 5 0 6 0; diff --git a/plugins/imageMAGICK/magick-imagesaverplugin.pd b/plugins/imageMAGICK/magick-imagesaverplugin.pd new file mode 100644 index 000000000..042102e4d --- /dev/null +++ b/plugins/imageMAGICK/magick-imagesaverplugin.pd @@ -0,0 +1,17 @@ +#N canvas 859 250 591 292 12; +#X text 23 91 among them are:; +#X text 22 236 This plugin uses the ImageMagick library.; +#X text 33 114 - JPEG \, JPEG2000 \, TIFF \, GIF \, PNG \, BMP \, ..., f 69; +#X msg 306 144 https://imagemagick.org; +#N canvas 735 459 450 300 URL 0; +#X obj 37 37 inlet; +#X obj 37 62 symbol; +#X msg 37 87 browse \$1; +#X obj 37 112 pdcontrol; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X restore 306 169 pd URL; +#X text 58 143 for a more complete list \, visit:; +#X text 12 50 The ImageMagick plugin can save a wide variety of image formats (over 100).; +#X connect 3 0 4 0; From b73c0f3ccc446f56bba4fb865f05098632b2bfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 27 Feb 2024 08:48:10 +0100 Subject: [PATCH 074/387] alignment --- help/pix_buffer-help.pd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/help/pix_buffer-help.pd b/help/pix_buffer-help.pd index 9905a9794..615f7b00a 100644 --- a/help/pix_buffer-help.pd +++ b/help/pix_buffer-help.pd @@ -120,7 +120,7 @@ #X obj 67 549 _backendinfo \$0save imagesaver; #X obj 67 523 _backendinfo \$0load imageloader; #X text 244 524 loading images; -#X text 244 554 saving images; +#X text 244 551 saving images; #X connect 16 0 23 0; #X connect 18 0 23 0; #X connect 23 0 37 0; From b11b75d5537524b9336bf3830090079ba008965b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 27 Feb 2024 08:53:52 +0100 Subject: [PATCH 075/387] renamed NDI backend help patches the plugin claims its name is 'NDI', not 'ndi' --- plugins/NDI/Makefile.am | 2 +- plugins/NDI/{ndi-recordplugin.pd => NDI-recordplugin.pd} | 0 plugins/NDI/{ndi-videoplugin.pd => NDI-videoplugin.pd} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename plugins/NDI/{ndi-recordplugin.pd => NDI-recordplugin.pd} (100%) rename plugins/NDI/{ndi-videoplugin.pd => NDI-videoplugin.pd} (100%) diff --git a/plugins/NDI/Makefile.am b/plugins/NDI/Makefile.am index 22a8072b4..41d4c99f1 100644 --- a/plugins/NDI/Makefile.am +++ b/plugins/NDI/Makefile.am @@ -26,7 +26,7 @@ EXTRA_DIST += \ if HAVE_NDI pkglib_LTLIBRARIES+= gem_videoNDI.la gem_recordNDI.la -dist_gemhelp_DATA += ndi-videoplugin.pd ndi-recordplugin.pd +dist_gemhelp_DATA += NDI-videoplugin.pd NDI-recordplugin.pd endif # videoNDI diff --git a/plugins/NDI/ndi-recordplugin.pd b/plugins/NDI/NDI-recordplugin.pd similarity index 100% rename from plugins/NDI/ndi-recordplugin.pd rename to plugins/NDI/NDI-recordplugin.pd diff --git a/plugins/NDI/ndi-videoplugin.pd b/plugins/NDI/NDI-videoplugin.pd similarity index 100% rename from plugins/NDI/ndi-videoplugin.pd rename to plugins/NDI/NDI-videoplugin.pd From 56d1f978f05f127da2df4ab69f77efab212c8a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 27 Feb 2024 08:55:03 +0100 Subject: [PATCH 076/387] fixed typos --- plugins/ASSIMP3/ASSIMP3-modelplugin.pd | 2 +- plugins/NDI/NDI-videoplugin.pd | 2 +- plugins/PNM/PNM-recordplugin.pd | 6 +++--- plugins/STB/stb-imageloaderplugin.pd | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/ASSIMP3/ASSIMP3-modelplugin.pd b/plugins/ASSIMP3/ASSIMP3-modelplugin.pd index 81b9e6b51..cfc08e23c 100644 --- a/plugins/ASSIMP3/ASSIMP3-modelplugin.pd +++ b/plugins/ASSIMP3/ASSIMP3-modelplugin.pd @@ -4,7 +4,7 @@ #X msg 95 313 smooth \$1; #X obj 98 287 hsl 170 20 0 1 0 0 empty empty empty -2 -10 0 12 #fcfcfc #000000 #000000 0 1; #X text 26 104 It depends on the AssImp (Asset Importer) library \, which must be present on your system in order to be used.; -#X text 26 29 With the ASSIMP backend \, you can load a multitude of different model formats (a tthe time of writing its about 40 different formats \, from simple OBJ files to Collada and Blender meshes).; +#X text 26 29 With the ASSIMP backend \, you can load a multitude of different model formats (at the time of writing its about 40 different formats \, from simple OBJ files to Collada and Blender meshes).; #X msg 80 163 https://assimp.org; #N canvas 614 438 450 300 URL 0; #X obj 37 37 inlet; diff --git a/plugins/NDI/NDI-videoplugin.pd b/plugins/NDI/NDI-videoplugin.pd index 1606a3d1e..16c51cdc3 100644 --- a/plugins/NDI/NDI-videoplugin.pd +++ b/plugins/NDI/NDI-videoplugin.pd @@ -8,7 +8,7 @@ #X text 53 342 if you want to wait for future (not-yet-existing) streams \, you can do do by setting the "future" property to "1" *immediately* before you try to 'open' the stream.; #X text 57 389 Once the NDI-stream appears \, [pix_video] will start outputting it:; #X obj 232 253 s \$1-ctl; -#X text 457 151 NDI-stream names contain spaces and parantheses.; +#X text 457 151 NDI-stream names contain spaces and parentheses.; #X text 456 166 You must escape the spaces with backspace.; #X obj 232 503 s \$1-ctl; #X text 89 57 ====================================; diff --git a/plugins/PNM/PNM-recordplugin.pd b/plugins/PNM/PNM-recordplugin.pd index 550ea510e..cfe88391e 100644 --- a/plugins/PNM/PNM-recordplugin.pd +++ b/plugins/PNM/PNM-recordplugin.pd @@ -19,12 +19,12 @@ #X connect 1 0 2 0; #X connect 2 0 3 0; #X restore 237 159 pd open; -#X text 104 149 Sepcification:; -#X text 76 197 The 'pnm' backend writes a single file containing a concatenated stream of PNM images.; +#X text 104 149 Specification:; +#X text 76 197 The 'PNM' backend writes a single file containing a concatenated stream of PNM images.; #X text 78 231 The following codecs are currently supported:; #X text 103 255 - ppm (rgb888 PPM P6 binary format); #X text 103 270 - pgm (gray8 PGM P5 binary format); -#X text 28 310 Example cuse case:; +#X text 28 310 Example use case:; #X text 51 332 I. create a named pipe (in the terminal): 'mkfifo fifo.ppm'; #X text 49 357 II. record frames into the named pipe using this backend:; #X text 52 490 III. encode the video with FFMPEG:; diff --git a/plugins/STB/stb-imageloaderplugin.pd b/plugins/STB/stb-imageloaderplugin.pd index 2799a6d32..3962e761a 100644 --- a/plugins/STB/stb-imageloaderplugin.pd +++ b/plugins/STB/stb-imageloaderplugin.pd @@ -8,5 +8,5 @@ #X text 29 280 Not all variants of the given formats might be supported!; #X text 30 307 However \, STB does not require any additional dependencies \, so it should be available (with the same capabilities) on all platforms supported by Gem., f 77; #X text 39 91 - PNG¹ ( 1/2/4/8/16-bpc); -#X text 39 71 - JPEG¹ (baseline & progressive. 12 bpc/arithmethic NOT supported), f 66; +#X text 39 71 - JPEG¹ (baseline & progressive. 12 bpc/arithmetic NOT supported), f 66; #X text 30 227 ¹ Note that (at least) JPEG and PNG images that have the upside-down flag set will not be automatically corrected., f 77; From f8d172cfb12b4e5f8cdf7b765a3471a986260404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 27 Feb 2024 09:02:11 +0100 Subject: [PATCH 077/387] recordPNM: note that the created file cannot be played back directly --- plugins/PNM/PNM-recordplugin.pd | 69 ++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/plugins/PNM/PNM-recordplugin.pd b/plugins/PNM/PNM-recordplugin.pd index cfe88391e..c18baae6e 100644 --- a/plugins/PNM/PNM-recordplugin.pd +++ b/plugins/PNM/PNM-recordplugin.pd @@ -1,36 +1,43 @@ -#N canvas 714 348 549 630 10; -#X text 75 381 1- select the backend; -#X obj 232 453 s \$1-ctl; -#X msg 261 422 record 1; -#X text 75 401 2- name the NDI-stream; -#X text 75 421 3- start sending out stream; -#X text 89 47 recordPNM - PPM/PGM image stream output; -#X text 89 57 =======================================; -#X msg 261 382 codec pnm; -#X msg 261 402 filename fifo.ppm; -#X text 80 98 PNM is a family of lowest common denominator image formats \, with an ASCII header containing metadata \, followed by raw uncompressed image data.; -#X msg 237 136 https://netpbm.sourceforge.net/doc/pnm.html; -#N canvas 735 459 450 300 open 0; +#N canvas 714 348 549 449 10; +#X text 69 27 recordPNM - PPM/PGM image stream output; +#X text 69 37 =======================================; +#X text 60 78 PNM is a family of lowest common denominator image formats \, with an ASCII header containing metadata \, followed by raw uncompressed image data.; +#X msg 217 116 https://netpbm.sourceforge.net/doc/pnm.html; +#X text 84 129 Specification:; +#X text 76 167 The 'PNM' backend writes a single file containing a concatenated stream of PNM images.; +#X text 78 201 The following codecs are currently supported:; +#X text 103 217 - ppm (rgb888 PPM P6 binary format); +#X text 103 232 - pgm (gray8 PGM P5 binary format); +#X obj 32 260 cnv 18 420 60 empty empty empty 20 12 0 10 #ffe3c6 #404040 0; +#X text 36 277 NOTE:; +#N canvas 735 459 450 300 URL 0; #X obj 37 37 inlet; #X obj 37 60 symbol; -#X msg 37 83 open \$1; #X obj 37 106 pdcontrol; +#X msg 37 83 browse \$1; #X connect 0 0 1 0; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X restore 237 159 pd open; -#X text 104 149 Specification:; -#X text 76 197 The 'PNM' backend writes a single file containing a concatenated stream of PNM images.; -#X text 78 231 The following codecs are currently supported:; -#X text 103 255 - ppm (rgb888 PPM P6 binary format); -#X text 103 270 - pgm (gray8 PGM P5 binary format); -#X text 28 310 Example use case:; -#X text 51 332 I. create a named pipe (in the terminal): 'mkfifo fifo.ppm'; -#X text 49 357 II. record frames into the named pipe using this backend:; -#X text 52 490 III. encode the video with FFMPEG:; -#X text 84 511 'ffmpeg -f image2pipe -i fifo.ppm ...'; -#X text 71 544 note that the [pix_record] may block if data is not read fast enough by the encoder.; +#X connect 1 0 3 0; +#X connect 3 0 2 0; +#X restore 217 139 pd URL; +#X text 75 289 You need special software (such as FFMPEG) in order to correctly decode it., f 62; +#N canvas 735 459 450 300 example 0; +#X text 75 91 1- select the backend; +#X obj 232 163 s \$1-ctl; +#X msg 261 132 record 1; +#X text 75 111 2- name the NDI-stream; +#X text 75 131 3- start sending out stream; +#X text 28 20 Example use case:; +#X text 51 42 I. create a named pipe (in the terminal): 'mkfifo fifo.ppm'; +#X text 49 67 II. record frames into the named pipe using this backend:; +#X text 52 200 III. encode the video with FFMPEG:; +#X text 84 221 'ffmpeg -f image2pipe -i fifo.ppm ...'; +#X text 71 254 note that the [pix_record] may block if data is not read fast enough by the encoder.; +#X msg 261 92 codec ppm; +#X msg 261 112 file /tmp/fifo.ppm; #X connect 2 0 1 0; -#X connect 7 0 1 0; -#X connect 8 0 1 0; -#X connect 10 0 11 0; +#X connect 11 0 1 0; +#X connect 12 0 1 0; +#X restore 200 330 pd example; +#X text 45 397 This plugin does not require any external libraries \, and should therefore be available on all platforms., f 52; +#X text 75 261 The file created by this backend is not a valid video file and CANNOT be played directly., f 62; +#X connect 3 0 11 0; From e69166e05f215fa59d3f94acfb7b46766265725f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 10:23:35 +0100 Subject: [PATCH 078/387] use 'size' parameter --- src/Gem/PixConvert.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gem/PixConvert.cpp b/src/Gem/PixConvert.cpp index a7dd665c9..3a46a5283 100644 --- a/src/Gem/PixConvert.cpp +++ b/src/Gem/PixConvert.cpp @@ -146,7 +146,7 @@ namespace { if(inR == outR && inG == outG && inB == outB && inA == outA) { if(indata != outdata) - memcpy(outdata, indata, width*height*4); + memcpy(outdata, indata, size*4); return; } From 5773a70aaabffdfe7f9a1c7b606d5a437931700f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 10:23:50 +0100 Subject: [PATCH 079/387] PixConvert: document the various macros --- src/Gem/PixConvert.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Gem/PixConvert.cpp b/src/Gem/PixConvert.cpp index 3a46a5283..f6b3aa7ab 100644 --- a/src/Gem/PixConvert.cpp +++ b/src/Gem/PixConvert.cpp @@ -798,7 +798,16 @@ namespace { } } -/* the actual converter instances */ +/* the actual converter instances. + * these macros create to() functions (e.g. RGBAtoUYYV), + * instantiating the named template. + * all converters use PACKED formats (except where stated otherwise + */ + +/* generic converter: CONVERT(ARGB, UYVY, rgb4_to_yuv4, unsigned char); + * converts from (ushort*)ARGB to (uchar*)UYVY using rgb4_to_yuv4 + * the type 'T' must be 'unsigned char' (it's only there for symmetry) + */ #define CONVERT(SRC, DST, templ, T) \ void SRC##to##DST( \ const T*indata, unsigned char*outdata, \ @@ -806,6 +815,10 @@ namespace { CONVERTER_MARK(); \ templ(indata, outdata, width, height); \ } +/* same as CONVERTER, but inputdata T can be non-(uchar*) + * at the expense that 'templ' can only convert from 'SRC'. + * the 'shift' parameter is 8*(sizeof(T)-sizeof(unsigned char*)) + */ #define CONVERT0(SRC, DST, templ, T, shift) \ void SRC##to##DST( \ const T*indata, unsigned char*outdata, \ @@ -813,6 +826,9 @@ namespace { CONVERTER_MARK(); \ templ(indata, outdata, width, height); \ } +/* greyscale converter: CONVERTy(ARGB, rgb4_to_y, unsigned char); + * converts from (uchar*)ARGB to (uchar*)Y using rgb4_to_y + */ #define CONVERTy(SRC, templ, T) \ void SRC##toY( \ const T*indata, unsigned char*outdata, \ @@ -820,6 +836,9 @@ namespace { CONVERTER_MARK(); \ templ(indata, outdata, width, height); \ } +/* planar->packed converter: CONVERTp(I420, UYVY, yuv420p_to_yuv4, unsigned char); + * converts from (uchar*)I420 (3planes) to (uchar*)UYVY (1plane) using yuv420p_to_yuv4 + */ #define CONVERTp(SRC, DST, templ, T) \ void SRC##to##DST( \ const T*Y, const T*U, const T*V, unsigned char*outdata, \ From d7b357583d1ba35b80c8a8196a46823fd08c318d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 10:30:37 +0100 Subject: [PATCH 080/387] PixConvert: cannot use four_to_four to convert between downsampled YUV formats --- src/Gem/PixConvert.cpp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/Gem/PixConvert.cpp b/src/Gem/PixConvert.cpp index f6b3aa7ab..5460d75ae 100644 --- a/src/Gem/PixConvert.cpp +++ b/src/Gem/PixConvert.cpp @@ -179,6 +179,13 @@ namespace { } } + template + static void four_to_four_2( + const unsigned char*indata, unsigned char*outdata, size_t width, size_t height) { + four_to_four(indata, outdata, width>>1, height); + } + /* Y -> ... */ template */ CONVERTy(UYVY, yuv4_to_y, unsigned char); -CONVERT(UYVY, UYVY, four_to_four, unsigned char); -CONVERT(UYVY, VYUY, four_to_four, unsigned char); -CONVERT(UYVY, YVYU, four_to_four, unsigned char); -CONVERT(UYVY, YUYV, four_to_four, unsigned char); +CONVERT(UYVY, UYVY, four_to_four_2, unsigned char); +CONVERT(UYVY, VYUY, four_to_four_2, unsigned char); +CONVERT(UYVY, YVYU, four_to_four_2, unsigned char); +CONVERT(UYVY, YUYV, four_to_four_2, unsigned char); CONVERT(UYVY, RGB , yuv4_to_rgb3, unsigned char); CONVERT(UYVY, BGR , yuv4_to_rgb3, unsigned char); CONVERT(UYVY, RGBA, yuv4_to_rgb4, unsigned char); @@ -937,10 +944,10 @@ CONVERT(UYVY, ABGR, yuv4_to_rgb4, unsigned char); CONVERT(UYVY, ARGB, yuv4_to_rgb4, unsigned char); CONVERTy(VYUY, yuv4_to_y, unsigned char); -CONVERT(VYUY, UYVY, four_to_four, unsigned char); -CONVERT(VYUY, VYUY, four_to_four, unsigned char); -CONVERT(VYUY, YVYU, four_to_four, unsigned char); -CONVERT(VYUY, YUYV, four_to_four, unsigned char); +CONVERT(VYUY, UYVY, four_to_four_2, unsigned char); +CONVERT(VYUY, VYUY, four_to_four_2, unsigned char); +CONVERT(VYUY, YVYU, four_to_four_2, unsigned char); +CONVERT(VYUY, YUYV, four_to_four_2, unsigned char); CONVERT(VYUY, RGB , yuv4_to_rgb3, unsigned char); CONVERT(VYUY, BGR , yuv4_to_rgb3, unsigned char); CONVERT(VYUY, RGBA, yuv4_to_rgb4, unsigned char); @@ -949,10 +956,10 @@ CONVERT(VYUY, ABGR, yuv4_to_rgb4, unsigned char); CONVERT(VYUY, ARGB, yuv4_to_rgb4, unsigned char); CONVERTy(YUYV, yuv4_to_y, unsigned char); -CONVERT(YUYV, UYVY, four_to_four, unsigned char); -CONVERT(YUYV, VYUY, four_to_four, unsigned char); -CONVERT(YUYV, YVYU, four_to_four, unsigned char); -CONVERT(YUYV, YUYV, four_to_four, unsigned char); +CONVERT(YUYV, UYVY, four_to_four_2, unsigned char); +CONVERT(YUYV, VYUY, four_to_four_2, unsigned char); +CONVERT(YUYV, YVYU, four_to_four_2, unsigned char); +CONVERT(YUYV, YUYV, four_to_four_2, unsigned char); CONVERT(YUYV, RGB , yuv4_to_rgb3, unsigned char); CONVERT(YUYV, BGR , yuv4_to_rgb3, unsigned char); CONVERT(YUYV, RGBA, yuv4_to_rgb4, unsigned char); @@ -961,10 +968,10 @@ CONVERT(YUYV, ABGR, yuv4_to_rgb4, unsigned char); CONVERT(YUYV, ARGB, yuv4_to_rgb4, unsigned char); CONVERTy(YVYU, yuv4_to_y, unsigned char); -CONVERT(YVYU, UYVY, four_to_four, unsigned char); -CONVERT(YVYU, VYUY, four_to_four, unsigned char); -CONVERT(YVYU, YVYU, four_to_four, unsigned char); -CONVERT(YVYU, YUYV, four_to_four, unsigned char); +CONVERT(YVYU, UYVY, four_to_four_2, unsigned char); +CONVERT(YVYU, VYUY, four_to_four_2, unsigned char); +CONVERT(YVYU, YVYU, four_to_four_2, unsigned char); +CONVERT(YVYU, YUYV, four_to_four_2, unsigned char); CONVERT(YVYU, RGB , yuv4_to_rgb3, unsigned char); CONVERT(YVYU, BGR , yuv4_to_rgb3, unsigned char); CONVERT(YVYU, RGBA, yuv4_to_rgb4, unsigned char); From 3bf6da27f75a6a1cc6e4fc8e08d4e9ce99444f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 10:31:14 +0100 Subject: [PATCH 081/387] DECKLINK: nicer MARK --- plugins/DECKLINK/decklink_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DECKLINK/decklink_common.h b/plugins/DECKLINK/decklink_common.h index f144f6ce7..f32f5984f 100644 --- a/plugins/DECKLINK/decklink_common.h +++ b/plugins/DECKLINK/decklink_common.h @@ -20,7 +20,7 @@ #include #include -#define MARK() printf("%s:%d\t%s\n", __FILE__, __LINE__, __FUNCTION__) +#define MARK() printf("%s:%d\t[%s]\n", __FILE__, __LINE__, __FUNCTION__) #ifdef _WIN32 # include From 1a514672ef83e482ee1537ccfebf8e3abea5da3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 10:46:08 +0100 Subject: [PATCH 082/387] PixConvert: get rid of CONVERTy macro and use CONVERT() instead. this requires us, not '#define Y 0', so we cannot use Y anywhere as a variable --- src/Gem/PixConvert.cpp | 88 +++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 48 deletions(-) diff --git a/src/Gem/PixConvert.cpp b/src/Gem/PixConvert.cpp index 5460d75ae..ce9de8cbc 100644 --- a/src/Gem/PixConvert.cpp +++ b/src/Gem/PixConvert.cpp @@ -47,6 +47,8 @@ YVYU */ +#define Y 0 + #define RGB 0,1,2 #define BGR 2,1,0 #define RGBA 0,1,2,3 @@ -230,7 +232,7 @@ namespace { } /* YUV4 -> ... */ - template + template static void yuv4_to_y( const unsigned char*indata, unsigned char*outdata, size_t width, size_t height) { size_t size = (width*height)>>1; @@ -310,12 +312,12 @@ namespace { template static void yuv420p_to_yuv4( - const unsigned char*Y, const unsigned char*U, const unsigned char*V, + const unsigned char*Y_, const unsigned char*U, const unsigned char*V, unsigned char*outdata, size_t width, size_t height) { unsigned char *pixels1=outdata; unsigned char *pixels2=pixels1+width*2; - const unsigned char*py1=Y; - const unsigned char*py2=Y+width; // plane_1 is luminance (csize==1) + const unsigned char*py1=Y_; + const unsigned char*py2=Y_+width; // plane_1 is luminance (csize==1) const unsigned char*pu=U; const unsigned char*pv=V; int row=height>>1; @@ -349,10 +351,10 @@ namespace { template static void yuv420p_to_rgb3( - const unsigned char*Y, const unsigned char*U, const unsigned char*V, + const unsigned char*Y_, const unsigned char*U, const unsigned char*V, unsigned char*outdata, const size_t width, const size_t height) { - const unsigned char*py1=Y; - const unsigned char*py2=Y+width; // plane_1 is luminance (csize==1) + const unsigned char*py1=Y_; + const unsigned char*py2=Y_+width; // plane_1 is luminance (csize==1) const unsigned char*pu=U; const unsigned char*pv=V; unsigned char*pixels1=outdata; @@ -407,10 +409,10 @@ namespace { template static void yuv420p_to_rgb4( - const unsigned char*Y, const unsigned char*U, const unsigned char*V, + const unsigned char*Y_, const unsigned char*U, const unsigned char*V, unsigned char*outdata, size_t width, size_t height) { - const unsigned char*py1=Y; - const unsigned char*py2=Y+width; // plane_1 is luminance (csize==1) + const unsigned char*py1=Y_; + const unsigned char*py2=Y_+width; // plane_1 is luminance (csize==1) const unsigned char*pu=U; const unsigned char*pv=V; unsigned char*pixels1=outdata; @@ -470,7 +472,7 @@ namespace { /* RGB3 -> ... */ - template + template static void rgb3_to_y(const unsigned char*indata, unsigned char*outdata, size_t width, size_t height) { size_t size = width*height; @@ -542,7 +544,7 @@ namespace { /* RGB4 -> ... */ - template + template static void rgb4_to_y(const unsigned char*indata, unsigned char*outdata, size_t width, size_t height) { size_t size = width*height; @@ -584,13 +586,13 @@ namespace { namespace { template static void i420ps16_to_rgb3( - const short*Y, const short*U, const short*V, + const short*Y_, const short*U, const short*V, unsigned char*outdata, const size_t width, const size_t height) { unsigned char *pixels1=outdata; unsigned char *pixels2=outdata+width*3; - const short*py1=Y; - const short*py2=Y+width; // plane_1 is luminance (csize==1) + const short*py1=Y_; + const short*py2=Y_+width; // plane_1 is luminance (csize==1) const short*pv=V;//(format==GL_BGR)?V:U; const short*pu=U;//(format==GL_RGB)?V:U; @@ -646,13 +648,13 @@ namespace { } template static void i420ps16_to_rgb4( - const short*Y, const short*U, const short*V, + const short*Y_, const short*U, const short*V, unsigned char*outdata, const size_t width, const size_t height) { unsigned char *pixels1=outdata; unsigned char *pixels2=outdata+width*4; - const short*py1=Y; // odd row - const short*py2=Y+width;// even row + const short*py1=Y_; // odd row + const short*py2=Y_+width;// even row const short*pv=V; const short*pu=U; @@ -709,12 +711,12 @@ namespace { } template static void i420ps16_to_yuv4( - const short*Y, const short*U, const short*V, + const short*Y_, const short*U, const short*V, unsigned char*outdata, size_t width, size_t height) { unsigned char *pixels1=outdata; unsigned char *pixels2=pixels1+width*2; - const short*py1=Y; - const short*py2=Y+width; // plane_1 is luminance (csize==1) + const short*py1=Y_; + const short*py2=Y_+width; // plane_1 is luminance (csize==1) const short*pu=U; const short*pv=V; int row=height>>1; @@ -833,25 +835,15 @@ namespace { CONVERTER_MARK(); \ templ(indata, outdata, width, height); \ } -/* greyscale converter: CONVERTy(ARGB, rgb4_to_y, unsigned char); - * converts from (uchar*)ARGB to (uchar*)Y using rgb4_to_y - */ -#define CONVERTy(SRC, templ, T) \ - void SRC##toY( \ - const T*indata, unsigned char*outdata, \ - size_t width, size_t height) { \ - CONVERTER_MARK(); \ - templ(indata, outdata, width, height); \ - } /* planar->packed converter: CONVERTp(I420, UYVY, yuv420p_to_yuv4, unsigned char); * converts from (uchar*)I420 (3planes) to (uchar*)UYVY (1plane) using yuv420p_to_yuv4 */ #define CONVERTp(SRC, DST, templ, T) \ void SRC##to##DST( \ - const T*Y, const T*U, const T*V, unsigned char*outdata, \ + const T*Y_, const T*U, const T*V, unsigned char*outdata, \ size_t width, size_t height) { \ CONVERTER_MARK(); \ - templ(Y, U, V, outdata, width, height); \ + templ(Y_, U, V, outdata, width, height); \ } /* GRAY -> */ @@ -893,11 +885,11 @@ CONVERT0(Yu16, ARGB, y_to_rgb4, unsigned short, 8); /* YUV420planar -> */ -void I420toY(const unsigned char*Y, const unsigned char*U, const unsigned char*V, +void I420toY(const unsigned char*Y_, const unsigned char*U, const unsigned char*V, unsigned char*outdata, size_t width, size_t height) { CONVERTER_MARK(); - if(Y != outdata) - memcpy(outdata, Y, width*height); + if(Y_ != outdata) + memcpy(outdata, Y_, width*height); } CONVERTp(I420, UYVY, yuv420p_to_yuv4, unsigned char); @@ -911,12 +903,12 @@ CONVERTp(I420, BGRA, yuv420p_to_rgb4, unsigned char); CONVERTp(I420, ABGR, yuv420p_to_rgb4, unsigned char); CONVERTp(I420, ARGB, yuv420p_to_rgb4, unsigned char); -void I420S16toY(const short*Y, const short*U, const short*V, +void I420S16toY(const short*Y_, const short*U, const short*V, unsigned char*outdata, size_t width, size_t height) { CONVERTER_MARK(); size_t size = width*height; while(size--) { - *outdata++ = ((*Y++)>>8) + Y_OFFSET; + *outdata++ = ((*Y_++)>>8) + Y_OFFSET; } } CONVERTp(I420S16, UYVY, i420ps16_to_yuv4, short); @@ -931,7 +923,7 @@ CONVERTp(I420S16, ARGB, i420ps16_to_rgb4, short); CONVERTp(I420S16, ABGR, i420ps16_to_rgb4, short); /* UYVY -> */ -CONVERTy(UYVY, yuv4_to_y, unsigned char); +CONVERT(UYVY, Y, yuv4_to_y, unsigned char); CONVERT(UYVY, UYVY, four_to_four_2, unsigned char); CONVERT(UYVY, VYUY, four_to_four_2, unsigned char); CONVERT(UYVY, YVYU, four_to_four_2, unsigned char); @@ -943,7 +935,7 @@ CONVERT(UYVY, BGRA, yuv4_to_rgb4, unsigned char); CONVERT(UYVY, ABGR, yuv4_to_rgb4, unsigned char); CONVERT(UYVY, ARGB, yuv4_to_rgb4, unsigned char); -CONVERTy(VYUY, yuv4_to_y, unsigned char); +CONVERT(VYUY, Y, yuv4_to_y, unsigned char); CONVERT(VYUY, UYVY, four_to_four_2, unsigned char); CONVERT(VYUY, VYUY, four_to_four_2, unsigned char); CONVERT(VYUY, YVYU, four_to_four_2, unsigned char); @@ -955,7 +947,7 @@ CONVERT(VYUY, BGRA, yuv4_to_rgb4, unsigned char); CONVERT(VYUY, ABGR, yuv4_to_rgb4, unsigned char); CONVERT(VYUY, ARGB, yuv4_to_rgb4, unsigned char); -CONVERTy(YUYV, yuv4_to_y, unsigned char); +CONVERT(YUYV, Y, yuv4_to_y, unsigned char); CONVERT(YUYV, UYVY, four_to_four_2, unsigned char); CONVERT(YUYV, VYUY, four_to_four_2, unsigned char); CONVERT(YUYV, YVYU, four_to_four_2, unsigned char); @@ -967,7 +959,7 @@ CONVERT(YUYV, BGRA, yuv4_to_rgb4, unsigned char); CONVERT(YUYV, ABGR, yuv4_to_rgb4, unsigned char); CONVERT(YUYV, ARGB, yuv4_to_rgb4, unsigned char); -CONVERTy(YVYU, yuv4_to_y, unsigned char); +CONVERT(YVYU, Y, yuv4_to_y, unsigned char); CONVERT(YVYU, UYVY, four_to_four_2, unsigned char); CONVERT(YVYU, VYUY, four_to_four_2, unsigned char); CONVERT(YVYU, YVYU, four_to_four_2, unsigned char); @@ -1005,7 +997,7 @@ CONVERT0(RGB16, BGRA, RGB16_to_rgb4, unsigned char, 0); CONVERT0(RGB16, ABGR, RGB16_to_rgb4, unsigned char, 0); CONVERT0(RGB16, ARGB, RGB16_to_rgb4, unsigned char, 0); -CONVERTy(RGB, rgb3_to_y, unsigned char); +CONVERT(RGB, Y, rgb3_to_y, unsigned char); CONVERT(RGB, UYVY, rgb3_to_yuv4, unsigned char); CONVERT(RGB, VYUY, rgb3_to_yuv4, unsigned char); CONVERT(RGB, YVYU, rgb3_to_yuv4, unsigned char); @@ -1017,7 +1009,7 @@ CONVERT(RGB, ABGR, rgb3_to_rgb4, unsigned char); CONVERT(RGB, BGRA, rgb3_to_rgb4, unsigned char); CONVERT(RGB, ARGB, rgb3_to_rgb4, unsigned char); -CONVERTy(BGR, rgb3_to_y, unsigned char); +CONVERT(BGR, Y, rgb3_to_y, unsigned char); CONVERT(BGR, UYVY, rgb3_to_yuv4, unsigned char); CONVERT(BGR, VYUY, rgb3_to_yuv4, unsigned char); CONVERT(BGR, YVYU, rgb3_to_yuv4, unsigned char); @@ -1030,7 +1022,7 @@ CONVERT(BGR, BGRA, rgb3_to_rgb4, unsigned char); CONVERT(BGR, ARGB, rgb3_to_rgb4, unsigned char); /* RGBA -> */ -CONVERTy(RGBA, rgb4_to_y, unsigned char); +CONVERT(RGBA, Y, rgb4_to_y, unsigned char); CONVERT(RGBA, UYVY, rgb4_to_yuv4, unsigned char); CONVERT(RGBA, VYUY, rgb4_to_yuv4, unsigned char); CONVERT(RGBA, YVYU, rgb4_to_yuv4, unsigned char); @@ -1042,7 +1034,7 @@ CONVERT(RGBA, ABGR, four_to_four, unsigned char); CONVERT(RGBA, BGRA, four_to_four, unsigned char); CONVERT(RGBA, ARGB, four_to_four, unsigned char); -CONVERTy(BGRA, rgb4_to_y, unsigned char); +CONVERT(BGRA, Y, rgb4_to_y, unsigned char); CONVERT(BGRA, UYVY, rgb4_to_yuv4, unsigned char); CONVERT(BGRA, VYUY, rgb4_to_yuv4, unsigned char); CONVERT(BGRA, YVYU, rgb4_to_yuv4, unsigned char); @@ -1054,7 +1046,7 @@ CONVERT(BGRA, ABGR, four_to_four, unsigned char); CONVERT(BGRA, BGRA, four_to_four, unsigned char); CONVERT(BGRA, ARGB, four_to_four, unsigned char); -CONVERTy(ABGR, rgb4_to_y, unsigned char); +CONVERT(ABGR, Y, rgb4_to_y, unsigned char); CONVERT(ABGR, UYVY, rgb4_to_yuv4, unsigned char); CONVERT(ABGR, VYUY, rgb4_to_yuv4, unsigned char); CONVERT(ABGR, YVYU, rgb4_to_yuv4, unsigned char); @@ -1066,7 +1058,7 @@ CONVERT(ABGR, ABGR, four_to_four, unsigned char); CONVERT(ABGR, BGRA, four_to_four, unsigned char); CONVERT(ABGR, ARGB, four_to_four, unsigned char); -CONVERTy(ARGB, rgb4_to_y, unsigned char); +CONVERT(ARGB, Y, rgb4_to_y, unsigned char); CONVERT(ARGB, UYVY, rgb4_to_yuv4, unsigned char); CONVERT(ARGB, VYUY, rgb4_to_yuv4, unsigned char); CONVERT(ARGB, YVYU, rgb4_to_yuv4, unsigned char); From e148aa4ca3d0ae3e182c20d42486a8018f3501d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 13:01:09 +0100 Subject: [PATCH 083/387] Add help-patch for recordDECKLINK --- plugins/DECKLINK/Makefile.am | 6 ++- plugins/DECKLINK/decklink-recordplugin.pd | 56 +++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 plugins/DECKLINK/decklink-recordplugin.pd diff --git a/plugins/DECKLINK/Makefile.am b/plugins/DECKLINK/Makefile.am index 27ed9f508..d58a93ff5 100644 --- a/plugins/DECKLINK/Makefile.am +++ b/plugins/DECKLINK/Makefile.am @@ -35,11 +35,13 @@ EXTRA_DIST += \ if HAVE_LIB_DECKLINK pkglib_LTLIBRARIES+= gem_videoDECKLINK.la gem_recordDECKLINK.la -dist_gemhelp_DATA += decklink-videoplugin.pd +dist_gemhelp_DATA += decklink-videoplugin.pd +dist_gemhelp_DATA += decklink-recordplugin.pd else if GEM_DECKLINK_LOCAL pkglib_LTLIBRARIES+= gem_videoDECKLINK.la gem_recordDECKLINK.la -dist_gemhelp_DATA += decklink-videoplugin.pd +dist_gemhelp_DATA += decklink-videoplugin.pd +dist_gemhelp_DATA += decklink-recordplugin.pd endif endif diff --git a/plugins/DECKLINK/decklink-recordplugin.pd b/plugins/DECKLINK/decklink-recordplugin.pd new file mode 100644 index 000000000..8c4ffdcb1 --- /dev/null +++ b/plugins/DECKLINK/decklink-recordplugin.pd @@ -0,0 +1,56 @@ +#N canvas 35 250 641 863 10; +#X text 120 445 SDI; +#X text 120 460 HDMI; +#X text 120 475 OpticalSDI; +#X text 120 490 Component; +#X text 120 505 SVideo; +#X text 89 426 connection; +#X text 95 536 format; +#X text 63 401 known parameters-values:; +#X text 89 47 DeckLink record backend; +#X text 61 94 this allows you to output video via cards manufactured by Blackmagic \, using their proprietary API.; +#X msg 126 268 codec decklink; +#X text 59 147 Since the recording plugins are targetted towards file recording \, there is no way to list available output devices., f 63; +#X msg 126 294 file DeckLink\ SDI\ 4K; +#X text 271 291 2 Use the full name of your device (escape spaces with backspace); +#X text 270 269 1 codec is required!; +#X obj 95 362 s \$1-ctl; +#X text 89 59 =======================; +#X text 67 183 You therefore must set the codec to 'decklink' and the output file to the name of your device \, e.g. "DeckLink SDI 4K"., f 61; +#X text 69 217 You will also want to set the output format to something that matches your pixel data (otherwise it might use some low denominator like NTSC)., f 61; +#X text 274 326 3 pick a suitable format (that is supported by your device); +#X msg 126 321 set format ntsc; +#X text 260 570 1080p23.98; +#X text 260 590 1080p24; +#X text 260 610 1080p25; +#X text 260 630 1080p29.97; +#X text 260 650 1080p30; +#X text 260 670 1080p50; +#X text 260 690 1080p59.94; +#X text 260 710 1080p60; +#X text 260 730 1080i50; +#X text 260 750 1080i59.94; +#X text 260 770 1080i60; +#X text 370 570 720p50; +#X text 370 590 720p59.94; +#X text 370 610 720p60; +#X text 370 660 2160p23.98; +#X text 370 680 2160p24; +#X text 370 700 2160p25; +#X text 370 720 2160p29.97; +#X text 370 740 2160p30; +#X text 120 570 525i59.94 NTSC; +#X text 120 590 625i50 PAL; +#X text 470 570 2Kp23.98 DCI; +#X text 470 590 2Kp24 DCI; +#X text 470 610 2Kp25 DCI; +#X text 470 650 4Kp23.98 DCI; +#X text 470 670 4Kp24 DCI; +#X text 470 690 4Kp25 DCI; +#X msg 230 400 set connection SDI; +#X msg 244 371 set format 1080p2398; +#X connect 10 0 15 0; +#X connect 12 0 15 0; +#X connect 20 0 15 0; +#X connect 48 0 15 0; +#X connect 49 0 15 0; From bfdec5ef13a0c2079d4dca1b081149adb6b32d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 13:02:33 +0100 Subject: [PATCH 084/387] recordDECKLINK: understand more mode-aliases --- plugins/DECKLINK/recordDECKLINK.cpp | 267 ++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) diff --git a/plugins/DECKLINK/recordDECKLINK.cpp b/plugins/DECKLINK/recordDECKLINK.cpp index 55b2eb0fc..cbc0ab314 100644 --- a/plugins/DECKLINK/recordDECKLINK.cpp +++ b/plugins/DECKLINK/recordDECKLINK.cpp @@ -32,12 +32,276 @@ namespace { + static std::map s_name2mode; + static bool name2mode(const std::string&name, BMDDisplayMode&mode) + { + static bool done=false; + if(!done) { + done = true; + /* fourcc-like codes from DeckLink API */ + s_name2mode["ntsc"] = bmdModeNTSC; + s_name2mode["nt23"] = bmdModeNTSC2398; + s_name2mode["pal "] = bmdModePAL; + s_name2mode["ntsp"] = bmdModeNTSCp; + s_name2mode["palp"] = bmdModePALp; + s_name2mode["23ps"] = bmdModeHD1080p2398; + s_name2mode["24ps"] = bmdModeHD1080p24; + s_name2mode["Hp25"] = bmdModeHD1080p25; + s_name2mode["Hp29"] = bmdModeHD1080p2997; + s_name2mode["Hp30"] = bmdModeHD1080p30; + s_name2mode["Hp47"] = bmdModeHD1080p4795; + s_name2mode["Hp48"] = bmdModeHD1080p48; + s_name2mode["Hp50"] = bmdModeHD1080p50; + s_name2mode["Hp59"] = bmdModeHD1080p5994; + s_name2mode["Hp60"] = bmdModeHD1080p6000; + s_name2mode["Hp95"] = bmdModeHD1080p9590; + s_name2mode["Hp96"] = bmdModeHD1080p96; + s_name2mode["Hp10"] = bmdModeHD1080p100; + s_name2mode["Hp11"] = bmdModeHD1080p11988; + s_name2mode["Hp12"] = bmdModeHD1080p120; + s_name2mode["Hi50"] = bmdModeHD1080i50; + s_name2mode["Hi59"] = bmdModeHD1080i5994; + s_name2mode["Hi60"] = bmdModeHD1080i6000; + s_name2mode["hp50"] = bmdModeHD720p50; + s_name2mode["hp59"] = bmdModeHD720p5994; + s_name2mode["hp60"] = bmdModeHD720p60; + s_name2mode["2k23"] = bmdMode2k2398; + s_name2mode["2k24"] = bmdMode2k24; + s_name2mode["2k25"] = bmdMode2k25; + s_name2mode["2d23"] = bmdMode2kDCI2398; + s_name2mode["2d24"] = bmdMode2kDCI24; + s_name2mode["2d25"] = bmdMode2kDCI25; + s_name2mode["2d29"] = bmdMode2kDCI2997; + s_name2mode["2d30"] = bmdMode2kDCI30; + s_name2mode["2d47"] = bmdMode2kDCI4795; + s_name2mode["2d48"] = bmdMode2kDCI48; + s_name2mode["2d50"] = bmdMode2kDCI50; + s_name2mode["2d59"] = bmdMode2kDCI5994; + s_name2mode["2d60"] = bmdMode2kDCI60; + s_name2mode["2d95"] = bmdMode2kDCI9590; + s_name2mode["2d96"] = bmdMode2kDCI96; + s_name2mode["2d10"] = bmdMode2kDCI100; + s_name2mode["2d11"] = bmdMode2kDCI11988; + s_name2mode["2d12"] = bmdMode2kDCI120; + s_name2mode["4k23"] = bmdMode4K2160p2398; + s_name2mode["4k24"] = bmdMode4K2160p24; + s_name2mode["4k25"] = bmdMode4K2160p25; + s_name2mode["4k29"] = bmdMode4K2160p2997; + s_name2mode["4k30"] = bmdMode4K2160p30; + s_name2mode["4k47"] = bmdMode4K2160p4795; + s_name2mode["4k48"] = bmdMode4K2160p48; + s_name2mode["4k50"] = bmdMode4K2160p50; + s_name2mode["4k59"] = bmdMode4K2160p5994; + s_name2mode["4k60"] = bmdMode4K2160p60; + s_name2mode["4k95"] = bmdMode4K2160p9590; + s_name2mode["4k96"] = bmdMode4K2160p96; + s_name2mode["4k10"] = bmdMode4K2160p100; + s_name2mode["4k11"] = bmdMode4K2160p11988; + s_name2mode["4k12"] = bmdMode4K2160p120; + s_name2mode["4d23"] = bmdMode4kDCI2398; + s_name2mode["4d24"] = bmdMode4kDCI24; + s_name2mode["4d25"] = bmdMode4kDCI25; + s_name2mode["4d29"] = bmdMode4kDCI2997; + s_name2mode["4d30"] = bmdMode4kDCI30; + s_name2mode["4d47"] = bmdMode4kDCI4795; + s_name2mode["4d48"] = bmdMode4kDCI48; + s_name2mode["4d50"] = bmdMode4kDCI50; + s_name2mode["4d59"] = bmdMode4kDCI5994; + s_name2mode["4d60"] = bmdMode4kDCI60; + s_name2mode["4d95"] = bmdMode4kDCI9590; + s_name2mode["4d96"] = bmdMode4kDCI96; + s_name2mode["4d10"] = bmdMode4kDCI100; + s_name2mode["4d11"] = bmdMode4kDCI11988; + s_name2mode["4d12"] = bmdMode4kDCI120; + s_name2mode["8k23"] = bmdMode8K4320p2398; + s_name2mode["8k24"] = bmdMode8K4320p24; + s_name2mode["8k25"] = bmdMode8K4320p25; + s_name2mode["8k29"] = bmdMode8K4320p2997; + s_name2mode["8k30"] = bmdMode8K4320p30; + s_name2mode["8k47"] = bmdMode8K4320p4795; + s_name2mode["8k48"] = bmdMode8K4320p48; + s_name2mode["8k50"] = bmdMode8K4320p50; + s_name2mode["8k59"] = bmdMode8K4320p5994; + s_name2mode["8k60"] = bmdMode8K4320p60; + s_name2mode["8d23"] = bmdMode8kDCI2398; + s_name2mode["8d24"] = bmdMode8kDCI24; + s_name2mode["8d25"] = bmdMode8kDCI25; + s_name2mode["8d29"] = bmdMode8kDCI2997; + s_name2mode["8d30"] = bmdMode8kDCI30; + s_name2mode["8d47"] = bmdMode8kDCI4795; + s_name2mode["8d48"] = bmdMode8kDCI48; + s_name2mode["8d50"] = bmdMode8kDCI50; + s_name2mode["8d59"] = bmdMode8kDCI5994; + s_name2mode["8d60"] = bmdMode8kDCI60; + s_name2mode["vga6"] = bmdMode640x480p60; + s_name2mode["svg6"] = bmdMode800x600p60; + s_name2mode["wxg5"] = bmdMode1440x900p50; + s_name2mode["wxg6"] = bmdMode1440x900p60; + s_name2mode["sxg5"] = bmdMode1440x1080p50; + s_name2mode["sxg6"] = bmdMode1440x1080p60; + s_name2mode["uxg5"] = bmdMode1600x1200p50; + s_name2mode["uxg6"] = bmdMode1600x1200p60; + s_name2mode["wux5"] = bmdMode1920x1200p50; + s_name2mode["wux6"] = bmdMode1920x1200p60; + s_name2mode["1945"] = bmdMode1920x1440p50; + s_name2mode["1946"] = bmdMode1920x1440p60; + s_name2mode["wqh5"] = bmdMode2560x1440p50; + s_name2mode["wqh6"] = bmdMode2560x1440p60; + s_name2mode["wqx5"] = bmdMode2560x1600p50; + s_name2mode["wqx6"] = bmdMode2560x1600p60; + s_name2mode["rwci"] = bmdModeCintelRAW; + s_name2mode["rwcc"] = bmdModeCintelCompressedRAW; + s_name2mode["iunk"] = bmdModeUnknown; + + /* GStreamer short names */ + s_name2mode["ntsc2398"] = bmdModeNTSC2398; + s_name2mode["pal"] = bmdModePAL; + s_name2mode["ntsc-p"] = bmdModeNTSCp; + s_name2mode["pal-p"] = bmdModePALp; + s_name2mode["1080p2398"] = bmdModeHD1080p2398; + s_name2mode["1080p24"] = bmdModeHD1080p24; + s_name2mode["1080p25"] = bmdModeHD1080p25; + s_name2mode["1080p2997"] = bmdModeHD1080p2997; + s_name2mode["1080p30"] = bmdModeHD1080p30; + s_name2mode["1080i50"] = bmdModeHD1080i50; + s_name2mode["1080i5994"] = bmdModeHD1080i5994; + s_name2mode["1080i60"] = bmdModeHD1080i6000; + s_name2mode["1080p50"] = bmdModeHD1080p50; + s_name2mode["1080p5994"] = bmdModeHD1080p5994; + s_name2mode["1080p60"] = bmdModeHD1080p6000; + s_name2mode["720p50"] = bmdModeHD720p50; + s_name2mode["720p5994"] = bmdModeHD720p5994; + s_name2mode["720p60"] = bmdModeHD720p60; + s_name2mode["1556p2398"] = bmdMode2k2398; + s_name2mode["1556p24"] = bmdMode2k24; + s_name2mode["1556p25"] = bmdMode2k25; + s_name2mode["2kdcip2398"] = bmdMode2kDCI2398; + s_name2mode["2kdcip24"] = bmdMode2kDCI24; + s_name2mode["2kdcip25"] = bmdMode2kDCI25; + s_name2mode["2kdcip2997"] = bmdMode2kDCI2997; + s_name2mode["2kdcip30"] = bmdMode2kDCI30; + s_name2mode["2kdcip50"] = bmdMode2kDCI50; + s_name2mode["2kdcip5994"] = bmdMode2kDCI5994; + s_name2mode["2kdcip60"] = bmdMode2kDCI60; + s_name2mode["2160p2398"] = bmdMode4K2160p2398; + s_name2mode["2160p24"] = bmdMode4K2160p24; + s_name2mode["2160p25"] = bmdMode4K2160p25; + s_name2mode["2160p2997"] = bmdMode4K2160p2997; + s_name2mode["2160p30"] = bmdMode4K2160p30; + s_name2mode["2160p50"] = bmdMode4K2160p50; + s_name2mode["2160p5994"] = bmdMode4K2160p5994; + s_name2mode["2160p60"] = bmdMode4K2160p60; + s_name2mode["4kdcip2398"] = bmdMode4kDCI2398; + s_name2mode["8kdcip2398"] = bmdMode8kDCI2398; + s_name2mode["4kdcip24"] = bmdMode4kDCI24; + s_name2mode["8kdcip24"] = bmdMode8kDCI24; + s_name2mode["4kdcip25"] = bmdMode4kDCI25; + s_name2mode["8kdcip25"] = bmdMode8kDCI25; + s_name2mode["4kdcip2997"] = bmdMode4kDCI2997; + s_name2mode["8kdcip2997"] = bmdMode8kDCI2997; + s_name2mode["4kdcip30"] = bmdMode4kDCI30; + s_name2mode["8kdcip30"] = bmdMode8kDCI30; + s_name2mode["4kdcip50"] = bmdMode4kDCI50; + s_name2mode["8kdcip50"] = bmdMode8kDCI50; + s_name2mode["4kdcip5994"] = bmdMode4kDCI5994; + s_name2mode["8kdcip5994"] = bmdMode8kDCI5994; + s_name2mode["4kdcip60"] = bmdMode4kDCI60; + s_name2mode["8kdcip60"] = bmdMode8kDCI60; + s_name2mode["8kp2398"] = bmdMode8K4320p2398; + s_name2mode["8kp24"] = bmdMode8K4320p24; + s_name2mode["8kp25"] = bmdMode8K4320p25; + s_name2mode["8kp2997"] = bmdMode8K4320p2997; + s_name2mode["8kp30"] = bmdMode8K4320p30; + s_name2mode["8kp50"] = bmdMode8K4320p50; + s_name2mode["8kp5994"] = bmdMode8K4320p5994; + s_name2mode["8kp60"] = bmdMode8K4320p60; + + /* GStreamer long names */ + s_name2mode["NTSC SD 60i"] = bmdModeNTSC; + s_name2mode["NTSC SD 60i (24 fps)"] = bmdModeNTSC2398; + s_name2mode["PAL SD 50i"] = bmdModePAL; + s_name2mode["NTSC SD 60p"] = bmdModeNTSCp; + s_name2mode["PAL SD 50p"] = bmdModePALp; + s_name2mode["HD1080 23.98p"] = bmdModeHD1080p2398; + s_name2mode["HD1080 24p"] = bmdModeHD1080p24; + s_name2mode["HD1080 25p"] = bmdModeHD1080p25; + s_name2mode["HD1080 29.97p"] = bmdModeHD1080p2997; + s_name2mode["HD1080 30p"] = bmdModeHD1080p30; + s_name2mode["HD1080 50i"] = bmdModeHD1080i50; + s_name2mode["HD1080 59.94i"] = bmdModeHD1080i5994; + s_name2mode["HD1080 60i"] = bmdModeHD1080i6000; + s_name2mode["HD1080 50p"] = bmdModeHD1080p50; + s_name2mode["HD1080 59.94p"] = bmdModeHD1080p5994; + s_name2mode["HD1080 60p"] = bmdModeHD1080p6000; + s_name2mode["HD720 50p"] = bmdModeHD720p50; + s_name2mode["HD720 59.94p"] = bmdModeHD720p5994; + s_name2mode["HD720 60p"] = bmdModeHD720p60; + s_name2mode["2k 23.98p"] = bmdMode2k2398; + s_name2mode["2k 24p"] = bmdMode2k24; + s_name2mode["2k 25p"] = bmdMode2k25; + s_name2mode["2k dci 23.98p"] = bmdMode2kDCI2398; + s_name2mode["2k dci 24p"] = bmdMode2kDCI24; + s_name2mode["2k dci 25p"] = bmdMode2kDCI25; + s_name2mode["2k dci 29.97p"] = bmdMode2kDCI2997; + s_name2mode["2k dci 30p"] = bmdMode2kDCI30; + s_name2mode["2k dci 50p"] = bmdMode2kDCI50; + s_name2mode["2k dci 59.94p"] = bmdMode2kDCI5994; + s_name2mode["2k dci 60p"] = bmdMode2kDCI60; + s_name2mode["4k 23.98p"] = bmdMode4K2160p2398; + s_name2mode["4k 24p"] = bmdMode4K2160p24; + s_name2mode["4k 25p"] = bmdMode4K2160p25; + s_name2mode["4k 29.97p"] = bmdMode4K2160p2997; + s_name2mode["4k 30p"] = bmdMode4K2160p30; + s_name2mode["4k 50p"] = bmdMode4K2160p50; + s_name2mode["4k 59.94p"] = bmdMode4K2160p5994; + s_name2mode["4k 60p"] = bmdMode4K2160p60; + s_name2mode["4k dci 23.98p"] = bmdMode4kDCI2398; + s_name2mode["8k dci 23.98p"] = bmdMode8kDCI2398; + s_name2mode["4k dci 24p"] = bmdMode4kDCI24; + s_name2mode["8k dci 24p"] = bmdMode8kDCI24; + s_name2mode["4k dci 25p"] = bmdMode4kDCI25; + s_name2mode["8k dci 25p"] = bmdMode8kDCI25; + s_name2mode["4k dci 29.97p"] = bmdMode4kDCI2997; + s_name2mode["8k dci 29.97p"] = bmdMode8kDCI2997; + s_name2mode["4k dci 30p"] = bmdMode4kDCI30; + s_name2mode["8k dci 30p"] = bmdMode8kDCI30; + s_name2mode["4k dci 50p"] = bmdMode4kDCI50; + s_name2mode["8k dci 50p"] = bmdMode8kDCI50; + s_name2mode["4k dci 59.94p"] = bmdMode4kDCI5994; + s_name2mode["8k dci 59.94p"] = bmdMode8kDCI5994; + s_name2mode["4k dci 60p"] = bmdMode4kDCI60; + s_name2mode["8k dci 60p"] = bmdMode8kDCI60; + s_name2mode["8k 23.98p"] = bmdMode8K4320p2398; + s_name2mode["8k 24p"] = bmdMode8K4320p24; + s_name2mode["8k 25p"] = bmdMode8K4320p25; + s_name2mode["8k 29.97p"] = bmdMode8K4320p2997; + s_name2mode["8k 30p"] = bmdMode8K4320p30; + s_name2mode["8k 50p"] = bmdMode8K4320p50; + s_name2mode["8k 59.94p"] = bmdMode8K4320p5994; + s_name2mode["8k 60p"] = bmdMode8K4320p60; + + + } + std::map::iterator it = s_name2mode.find(name); + if(s_name2mode.end() != it) { + mode=it->second; + return true; + } + return false; + } + + + + IDeckLinkDisplayMode*getDisplayMode(IDeckLinkOutput*dlo, const std::string&formatname, int formatnum) { IDeckLinkDisplayModeIterator*dmi = NULL; IDeckLinkDisplayMode*displayMode = NULL; int count=formatnum; + BMDDisplayMode mode = bmdModeUnknown; + bool have_mode = name2mode(formatname, mode); + if(S_OK == dlo->GetDisplayModeIterator(&dmi)) { while(S_OK == dmi->Next(&displayMode)) { if (formatnum<0 && formatname.empty()) { @@ -56,6 +320,9 @@ IDeckLinkDisplayMode*getDisplayMode(IDeckLinkOutput*dlo, if(found) { break; } + if(have_mode && displayMode->GetDisplayMode() == mode) { + break; + } } } // else check the format index From 5b3ff4cab5e8a877ca999bd7d6eca0e865a1ab61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 13:03:14 +0100 Subject: [PATCH 085/387] pix_record-help: hires test signal --- help/pix_record-help.pd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/help/pix_record-help.pd b/help/pix_record-help.pd index da96238b9..90c413d5a 100644 --- a/help/pix_record-help.pd +++ b/help/pix_record-help.pd @@ -63,7 +63,7 @@ #X obj 463 287 t a; #X text 18 174 When file and codec are specified \, you can open the writing connection with the message "record 1"., f 69; #X text 18 212 To actually do record a frame into the file \, send the object a "bang" message. If you want to record a consecutive number of frames \, use the "auto" message. This allows you to have full control on which frames are to be recorded., f 69; -#X text 526 90 (do something); +#X text 554 80 (do something), f 10; #X text 525 128 (monitoring); #X obj 8 454 cnv 15 430 30 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #N canvas 6 49 459 361 MESSAGES 0; @@ -387,7 +387,6 @@ #X connect 2 0 3 0; #X restore 553 375 pd print; #X obj 518 8 declare -lib Gem; -#X obj 451 87 pix_test; #X obj 451 120 pix_texture; #X obj 451 141 square 4; #X text 29 57 Description: output sequences of pixes; @@ -395,9 +394,10 @@ #X text 14 331 [pix_record] has a number of output methods \, like movies \, pipes or videodevices. Not all may be available on your system. Check here which backends you can use:, f 70; #X text 17 273 The recording is finished and the file flushed to disk after a "record 0" message is received. You might not be able to access the file for reading before recording has finished., f 69; #X obj 197 366 _backendinfo \$0 record; +#X obj 451 87 pix_test 720 468; #X connect 7 0 8 0; #X connect 8 0 7 0; -#X connect 11 0 47 0; +#X connect 11 0 54 0; #X connect 15 1 38 0; #X connect 15 2 45 0; #X connect 18 0 15 0; @@ -416,5 +416,5 @@ #X connect 40 0 24 0; #X connect 42 0 15 0; #X connect 47 0 48 0; -#X connect 48 0 49 0; -#X connect 49 0 15 0; +#X connect 48 0 15 0; +#X connect 54 0 47 0; From 2845e9ebdfbe28d5539ae86dfc361530abbc3a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 14:00:30 +0100 Subject: [PATCH 086/387] recordDECKLINK: handle RGBA images --- plugins/DECKLINK/decklink_common.h | 18 ++++++++++++++---- plugins/DECKLINK/recordDECKLINK.cpp | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/plugins/DECKLINK/decklink_common.h b/plugins/DECKLINK/decklink_common.h index f32f5984f..c6d9e4489 100644 --- a/plugins/DECKLINK/decklink_common.h +++ b/plugins/DECKLINK/decklink_common.h @@ -105,6 +105,11 @@ void free_deckstring(deckstring_t s) static std::map s_connectionstrings; namespace { + enum _gem_BMDPixelFormat { + /* GEM specific */ + gemBmdFormat8BitRGBA = /* 'RGBA' */ 0x52474241, + }; + BMDVideoConnection string2connection(std::string Name) { static bool done = false; @@ -205,6 +210,7 @@ BMDPixelFormat string2pixformat(std::string Name) s_pixformatstrings["yuv"] = bmdFormat8BitYUV; s_pixformatstrings["argb"] = bmdFormat8BitARGB; s_pixformatstrings["bgra"] = bmdFormat8BitBGRA; + s_pixformatstrings["rgba8"] = gemBmdFormat8BitRGBA; #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) #else verbose(0, "[GEM:videoDECKLINK] lacking C++11 support requires pixformats to be lower-case"); @@ -259,10 +265,13 @@ class ImageStructWrapper : public IDeckLinkVideoFrame } virtual BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat() { - switch(m_img->csize) { - case 4: - return bmdFormat8BitARGB; - case 2: + bool reverse = false; + switch(m_img->format) { + case GEM_RAW_RGBA: + return gemBmdFormat8BitRGBA; + case GEM_RAW_BGRA: + return bmdFormat8BitBGRA; + case GEM_RAW_UYVY: return bmdFormat8BitYUV; default: break; @@ -333,6 +342,7 @@ int GetRowBytes(BMDPixelFormat pixelFormat, int frameWidth) case bmdFormat8BitARGB: case bmdFormat8BitBGRA: + case gemBmdFormat8BitRGBA: default: bytesPerRow = frameWidth * 4; break; diff --git a/plugins/DECKLINK/recordDECKLINK.cpp b/plugins/DECKLINK/recordDECKLINK.cpp index cbc0ab314..132705520 100644 --- a/plugins/DECKLINK/recordDECKLINK.cpp +++ b/plugins/DECKLINK/recordDECKLINK.cpp @@ -444,10 +444,13 @@ class VideoOutputter : public IDeckLinkVideoOutputCallback #endif if (m_videoFrame->GetPixelFormat() != srcformat) { - if(srcformat != bmdFormatUnspecified) { + result = E_NOTIMPL; + switch(srcformat) { + case bmdFormatUnspecified: + case gemBmdFormat8BitRGBA: + break; + default: result = m_frameConverter?m_frameConverter->ConvertFrame(isw, m_videoFrame):E_NOTIMPL; - } else { - result = E_NOTIMPL; } if (result != S_OK) { @@ -464,6 +467,12 @@ class VideoOutputter : public IDeckLinkVideoOutputCallback } } +#if 0 + post("schedule image %p[%dx%d@%s]" + , isw, (int)isw->GetWidth(), (int)isw->GetHeight(), pixformat2string(isw->GetPixelFormat()).c_str() + ); +#endif + result = m_deckLinkOutput->ScheduleVideoFrame(isw, (m_totalFramesScheduled * m_frameDuration), m_frameDuration, m_frameTimescale); if (result != S_OK) { fprintf(stderr, "Failed to schedule frame: 0x%X\n", (unsigned int)result); From 0b10d7d47dd83ddc5e9ddff3bdd8955964401cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 14:07:13 +0100 Subject: [PATCH 087/387] recordDECKLINK: use 1080p25 in the docs --- plugins/DECKLINK/decklink-recordplugin.pd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DECKLINK/decklink-recordplugin.pd b/plugins/DECKLINK/decklink-recordplugin.pd index 8c4ffdcb1..21bff99c8 100644 --- a/plugins/DECKLINK/decklink-recordplugin.pd +++ b/plugins/DECKLINK/decklink-recordplugin.pd @@ -48,7 +48,7 @@ #X text 470 670 4Kp24 DCI; #X text 470 690 4Kp25 DCI; #X msg 230 400 set connection SDI; -#X msg 244 371 set format 1080p2398; +#X msg 244 371 set format 1080p25; #X connect 10 0 15 0; #X connect 12 0 15 0; #X connect 20 0 15 0; From c250d7241ddab4c53aafadd53bc13fc57485c11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 14:12:39 +0100 Subject: [PATCH 088/387] finalize recordDECKLINK help --- plugins/DECKLINK/decklink-recordplugin.pd | 117 +++++++++++----------- 1 file changed, 61 insertions(+), 56 deletions(-) diff --git a/plugins/DECKLINK/decklink-recordplugin.pd b/plugins/DECKLINK/decklink-recordplugin.pd index 21bff99c8..3d9d6fc0e 100644 --- a/plugins/DECKLINK/decklink-recordplugin.pd +++ b/plugins/DECKLINK/decklink-recordplugin.pd @@ -1,56 +1,61 @@ -#N canvas 35 250 641 863 10; -#X text 120 445 SDI; -#X text 120 460 HDMI; -#X text 120 475 OpticalSDI; -#X text 120 490 Component; -#X text 120 505 SVideo; -#X text 89 426 connection; -#X text 95 536 format; -#X text 63 401 known parameters-values:; -#X text 89 47 DeckLink record backend; -#X text 61 94 this allows you to output video via cards manufactured by Blackmagic \, using their proprietary API.; -#X msg 126 268 codec decklink; -#X text 59 147 Since the recording plugins are targetted towards file recording \, there is no way to list available output devices., f 63; -#X msg 126 294 file DeckLink\ SDI\ 4K; -#X text 271 291 2 Use the full name of your device (escape spaces with backspace); -#X text 270 269 1 codec is required!; -#X obj 95 362 s \$1-ctl; -#X text 89 59 =======================; -#X text 67 183 You therefore must set the codec to 'decklink' and the output file to the name of your device \, e.g. "DeckLink SDI 4K"., f 61; -#X text 69 217 You will also want to set the output format to something that matches your pixel data (otherwise it might use some low denominator like NTSC)., f 61; -#X text 274 326 3 pick a suitable format (that is supported by your device); -#X msg 126 321 set format ntsc; -#X text 260 570 1080p23.98; -#X text 260 590 1080p24; -#X text 260 610 1080p25; -#X text 260 630 1080p29.97; -#X text 260 650 1080p30; -#X text 260 670 1080p50; -#X text 260 690 1080p59.94; -#X text 260 710 1080p60; -#X text 260 730 1080i50; -#X text 260 750 1080i59.94; -#X text 260 770 1080i60; -#X text 370 570 720p50; -#X text 370 590 720p59.94; -#X text 370 610 720p60; -#X text 370 660 2160p23.98; -#X text 370 680 2160p24; -#X text 370 700 2160p25; -#X text 370 720 2160p29.97; -#X text 370 740 2160p30; -#X text 120 570 525i59.94 NTSC; -#X text 120 590 625i50 PAL; -#X text 470 570 2Kp23.98 DCI; -#X text 470 590 2Kp24 DCI; -#X text 470 610 2Kp25 DCI; -#X text 470 650 4Kp23.98 DCI; -#X text 470 670 4Kp24 DCI; -#X text 470 690 4Kp25 DCI; -#X msg 230 400 set connection SDI; -#X msg 244 371 set format 1080p25; -#X connect 10 0 15 0; -#X connect 12 0 15 0; -#X connect 20 0 15 0; -#X connect 48 0 15 0; -#X connect 49 0 15 0; +#N canvas 44 91 641 863 10; +#X text 120 495 SDI; +#X text 120 510 HDMI; +#X text 120 525 OpticalSDI; +#X text 120 540 Component; +#X text 120 555 SVideo; +#X text 89 476 connection; +#X text 95 586 format; +#X text 33 451 known parameters-values:; +#X text 89 17 DeckLink record backend; +#X text 61 64 this allows you to output video via cards manufactured by Blackmagic \, using their proprietary API.; +#X msg 126 248 codec decklink; +#X text 59 107 Since the recording plugins are targetted towards file recording \, there is no way to list available output devices., f 63; +#X text 274 249 1 codec is required!; +#X text 89 29 =======================; +#X text 67 143 You therefore must set the codec to 'decklink' and the output file to the name of your device \, e.g. "DeckLink SDI 4K"., f 61; +#X text 69 177 You will also want to set the output format to something that matches your pixel data (otherwise it might use some low denominator like NTSC)., f 61; +#X text 274 304 3 pick a suitable format (that is supported by your device); +#X msg 126 301 set format ntsc; +#X text 260 620 1080p23.98; +#X text 260 640 1080p24; +#X text 260 660 1080p25; +#X text 260 680 1080p29.97; +#X text 260 700 1080p30; +#X text 260 720 1080p50; +#X text 260 740 1080p59.94; +#X text 260 760 1080p60; +#X text 260 780 1080i50; +#X text 260 800 1080i59.94; +#X text 260 820 1080i60; +#X text 370 620 720p50; +#X text 370 640 720p59.94; +#X text 370 660 720p60; +#X text 370 710 2160p23.98; +#X text 370 730 2160p24; +#X text 370 750 2160p25; +#X text 370 770 2160p29.97; +#X text 370 790 2160p30; +#X text 120 620 525i59.94 NTSC; +#X text 120 640 625i50 PAL; +#X text 470 620 2Kp23.98 DCI; +#X text 470 640 2Kp24 DCI; +#X text 470 660 2Kp25 DCI; +#X text 470 700 4Kp23.98 DCI; +#X text 470 720 4Kp24 DCI; +#X text 470 740 4Kp25 DCI; +#X msg 126 274 set connection SDI; +#X msg 184 319 set format 1080p25; +#X text 274 276 2 (optional) set output connector; +#X msg 124 360 symbol DeckLink\ SDI\ 4K; +#X msg 124 383 record 0 \, file \$1 \, record 1; +#X text 301 355 4 Use the full name of your device as the filename (escape spaces with backspace)., f 39; +#X obj 95 422 s \$1-ctl; +#X obj 95 337 t a; +#X connect 10 0 52 0; +#X connect 17 0 52 0; +#X connect 45 0 52 0; +#X connect 46 0 52 0; +#X connect 48 0 49 0; +#X connect 49 0 51 0; +#X connect 52 0 51 0; From fbd562df55f7221dfa3ac6fcfef817c678517df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 16:54:48 +0100 Subject: [PATCH 089/387] Better wording --- plugins/NDI/NDI-recordplugin.pd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/NDI/NDI-recordplugin.pd b/plugins/NDI/NDI-recordplugin.pd index 854239f31..d91afebb5 100644 --- a/plugins/NDI/NDI-recordplugin.pd +++ b/plugins/NDI/NDI-recordplugin.pd @@ -10,8 +10,7 @@ #X text 75 161 2- name the NDI-stream; #X text 75 211 3- start sending out stream; #X msg 260 362 filename Waiting\ Man; -#X text 74 332 Your streamname can contain spaces which must escape -with backspace., f 71; +#X text 74 332 If your streamname should contain spaces \, escape them with backspace., f 74; #X connect 5 0 1 0; #X connect 6 0 1 0; #X connect 7 0 1 0; From 0da67171cdb2c80e8da2a5d2cfb210df36f80bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 17:01:00 +0100 Subject: [PATCH 090/387] document recordV4L2 --- plugins/V4L2/Makefile.am | 1 + plugins/V4L2/v4l2-recordplugin.pd | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 plugins/V4L2/v4l2-recordplugin.pd diff --git a/plugins/V4L2/Makefile.am b/plugins/V4L2/Makefile.am index effa343f1..6950a8f01 100644 --- a/plugins/V4L2/Makefile.am +++ b/plugins/V4L2/Makefile.am @@ -13,6 +13,7 @@ if HAVE_V4L2 pkglib_LTLIBRARIES+= gem_videoV4L2.la pkglib_LTLIBRARIES+= gem_recordV4L2.la dist_gemhelp_DATA += v4l2-videoplugin.pd +dist_gemhelp_DATA += v4l2-recordplugin.pd endif if WINDOWS diff --git a/plugins/V4L2/v4l2-recordplugin.pd b/plugins/V4L2/v4l2-recordplugin.pd new file mode 100644 index 000000000..0a6c8ea88 --- /dev/null +++ b/plugins/V4L2/v4l2-recordplugin.pd @@ -0,0 +1,26 @@ +#N canvas 712 348 578 574 10; +#X text 75 101 1- select the backend; +#X obj 232 253 s \$1-ctl; +#X msg 261 212 record 1; +#X text 75 211 3- start sending out stream; +#X text 89 47 recordV4L2 - output pixes with the video4linux2 framework; +#X text 89 57 =========================================================; +#X msg 261 102 codec v4l2; +#X msg 261 162 filename /dev/video1; +#X text 75 161 2- select a V4L2 output device; +#X msg 135 369 https://github.com/umlaeute/v4l2loopback; +#N canvas 0 0 204 175 URL 0; +#X obj 37 37 inlet; +#X obj 37 60 symbol; +#X msg 37 83 browse \$1; +#X obj 37 106 pdcontrol; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X restore 135 392 pd URL; +#X text 86 315 This is mostly useful for sharing pix-streams between applications using "virtual cameras" \, e.g. via the v4l2loopback kernel module:; +#X text 83 443 While writing to a v4l2 OUTPUT device \, you can read the video-frames from the corresponding CAPTURE device with a different application (e.g. a video-encoder \, or your favourite teleconferencing software); +#X connect 2 0 1 0; +#X connect 6 0 1 0; +#X connect 7 0 1 0; +#X connect 9 0 10 0; From b9ba7d8a5ac203a8d3fae544ce683c9062cbb51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 17:03:49 +0100 Subject: [PATCH 091/387] document recordV4L and improve docs for videoV4L --- plugins/V4L/Makefile.am | 1 + plugins/V4L/v4l-recordplugin.pd | 3 +++ plugins/V4L/v4l-videoplugin.pd | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 plugins/V4L/v4l-recordplugin.pd diff --git a/plugins/V4L/Makefile.am b/plugins/V4L/Makefile.am index 9a0940a7f..8896e5306 100644 --- a/plugins/V4L/Makefile.am +++ b/plugins/V4L/Makefile.am @@ -12,6 +12,7 @@ if HAVE_V4L pkglib_LTLIBRARIES+=gem_videoV4L.la pkglib_LTLIBRARIES+=gem_recordV4L.la dist_gemhelp_DATA +=v4l-videoplugin.pd +dist_gemhelp_DATA +=v4l-recordplugin.pd endif if WINDOWS diff --git a/plugins/V4L/v4l-recordplugin.pd b/plugins/V4L/v4l-recordplugin.pd new file mode 100644 index 000000000..ad51be662 --- /dev/null +++ b/plugins/V4L/v4l-recordplugin.pd @@ -0,0 +1,3 @@ +#N canvas 8 49 528 177 10; +#X text 89 76 Note however \, that V4L(1) has been deprecated in the linux-kernel for many years now \, and you should probably use the V4L2 backend instead.; +#X text 89 47 This backend allows you to write to V4L(1) output devices.; diff --git a/plugins/V4L/v4l-videoplugin.pd b/plugins/V4L/v4l-videoplugin.pd index 1c88a7de2..8fcf011a2 100644 --- a/plugins/V4L/v4l-videoplugin.pd +++ b/plugins/V4L/v4l-videoplugin.pd @@ -1,2 +1,3 @@ -#N canvas 8 49 505 112 10; +#N canvas 8 49 528 177 10; #X text 89 47 Nothing special about this backend...; +#X text 89 76 Note however \, that V4L(1) has been deprecated in the linux-kernel for many years now \, and you should probably use the V4L2 backend instead.; From 739f66e6551b8e864c6e14725ffd3e752aaaf91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 17:08:16 +0100 Subject: [PATCH 092/387] stub documentation for film/record with QuickTime --- plugins/QuickTime/Makefile.am | 1 + plugins/QuickTime/QuickTime-filmplugin.pd | 3 +++ plugins/QuickTime/QuickTime-recordplugin.pd | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 plugins/QuickTime/QuickTime-filmplugin.pd create mode 100644 plugins/QuickTime/QuickTime-recordplugin.pd diff --git a/plugins/QuickTime/Makefile.am b/plugins/QuickTime/Makefile.am index 712172c5a..c8917ba13 100644 --- a/plugins/QuickTime/Makefile.am +++ b/plugins/QuickTime/Makefile.am @@ -15,6 +15,7 @@ if HAVE_FRAMEWORK_QUICKTIME pkglib_LTLIBRARIES+= gem_filmQT.la pkglib_LTLIBRARIES+= gem_imageQT.la dist_gemhelp_DATA += QuickTime-imageloaderplugin.pd QuickTime-imagesaverplugin.pd +dist_gemhelp_DATA += QuickTime-filmplugin.pd QuickTime-recordplugin.pd pkglib_LTLIBRARIES+= gem_recordQT.la endif diff --git a/plugins/QuickTime/QuickTime-filmplugin.pd b/plugins/QuickTime/QuickTime-filmplugin.pd new file mode 100644 index 000000000..00605fb1d --- /dev/null +++ b/plugins/QuickTime/QuickTime-filmplugin.pd @@ -0,0 +1,3 @@ +#N canvas 678 202 524 220 12; +#X text 22 136 This plugin uses Apple's deprecated QuickTime framework and is only available on 32bit OSX and Windows., f 55; +#X text 21 74 The QuickTime plugin can load many different film formats.; diff --git a/plugins/QuickTime/QuickTime-recordplugin.pd b/plugins/QuickTime/QuickTime-recordplugin.pd new file mode 100644 index 000000000..bc1352b66 --- /dev/null +++ b/plugins/QuickTime/QuickTime-recordplugin.pd @@ -0,0 +1,3 @@ +#N canvas 675 202 527 229 12; +#X text 27 129 This plugin uses Apple's deprecated QuickTime framework and is only available on 32bit OSX and Windows., f 55; +#X text 34 62 TODO: describe this plugin.; From e848647941e3afd4f8c913611b2503c23fd82890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 17:13:12 +0100 Subject: [PATCH 093/387] gemglxwindow: Fix error string generation --- src/Output/gemglxwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index 048713a0c..36e70ac61 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -544,10 +544,10 @@ struct gemglxwindow::PIMPL { errstr+="???"; break; case 1: - errstr+"single"; + errstr+="single"; break; case 2: - errstr+"double"; + errstr+="double"; break; } errstr+=" buffer window"; From 2b8e9cc37d0217646ec1831e673c3d8849f84bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 28 Feb 2024 17:41:42 +0100 Subject: [PATCH 094/387] recordPIPEWIRE: use the filename as the PW stream name --- plugins/PIPEWIRE/recordPIPEWIRE.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/PIPEWIRE/recordPIPEWIRE.cpp b/plugins/PIPEWIRE/recordPIPEWIRE.cpp index 7117a56b3..c6b7e43fc 100644 --- a/plugins/PIPEWIRE/recordPIPEWIRE.cpp +++ b/plugins/PIPEWIRE/recordPIPEWIRE.cpp @@ -147,6 +147,8 @@ bool recordPIPEWIRE :: start(const std::string&filename, gem::Properties&props) stop(); //::post("%s:%d@%s", __FILE__, __LINE__, __FUNCTION__); m_filename = filename; + if (m_filename.empty()) + m_filename = "gem-output"; if(!m_image.xsize) { m_image.xsize = 640; } @@ -166,7 +168,7 @@ bool recordPIPEWIRE :: start(const std::string&filename, gem::Properties&props) pw_thread_loop_lock(s_loop); m_stream = pw_stream_new_simple( pw_thread_loop_get_loop(s_loop), - "gem-output", + m_filename.c_str(), pw_properties_new( PW_KEY_MEDIA_CLASS, "Video/Source", PW_KEY_MEDIA_TYPE, "Video", From 0b85f0a554c5dced905066a46f7210e778b1ae6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 08:32:59 +0100 Subject: [PATCH 095/387] DECKLINK: wild casts so we can inject our own pseudo BMDPixelFormat otherwise the MinGW/g++-13 builds fail... --- plugins/DECKLINK/decklink_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/DECKLINK/decklink_common.h b/plugins/DECKLINK/decklink_common.h index c6d9e4489..654a70e7e 100644 --- a/plugins/DECKLINK/decklink_common.h +++ b/plugins/DECKLINK/decklink_common.h @@ -210,7 +210,7 @@ BMDPixelFormat string2pixformat(std::string Name) s_pixformatstrings["yuv"] = bmdFormat8BitYUV; s_pixformatstrings["argb"] = bmdFormat8BitARGB; s_pixformatstrings["bgra"] = bmdFormat8BitBGRA; - s_pixformatstrings["rgba8"] = gemBmdFormat8BitRGBA; + s_pixformatstrings["rgba8"] = (BMDPixelFormat)((int)bmdFormat8BitYUV); #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) #else verbose(0, "[GEM:videoDECKLINK] lacking C++11 support requires pixformats to be lower-case"); @@ -268,11 +268,11 @@ class ImageStructWrapper : public IDeckLinkVideoFrame bool reverse = false; switch(m_img->format) { case GEM_RAW_RGBA: - return gemBmdFormat8BitRGBA; + return (BMDPixelFormat)((int)bmdFormat8BitYUV); case GEM_RAW_BGRA: return bmdFormat8BitBGRA; case GEM_RAW_UYVY: - return bmdFormat8BitYUV; + return (BMDPixelFormat)((int)bmdFormat8BitYUV); default: break; } From e691202f8db2a6ab30480d8fdf41c98f57b6273d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 08:40:59 +0100 Subject: [PATCH 096/387] pix_record-help: update record-toggle according to state --- help/pix_record-help.pd | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/help/pix_record-help.pd b/help/pix_record-help.pd index 90c413d5a..bd745470c 100644 --- a/help/pix_record-help.pd +++ b/help/pix_record-help.pd @@ -59,7 +59,7 @@ #X connect 4 0 2 0; #X restore 484 244 pd savepanel; #X msg 520 287 record \$1; -#X obj 500 289 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 500 289 tgl 15 0 empty \$0-record empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 463 287 t a; #X text 18 174 When file and codec are specified \, you can open the writing connection with the message "record 1"., f 69; #X text 18 212 To actually do record a frame into the file \, send the object a "bang" message. If you want to record a consecutive number of frames \, use the "auto" message. This allows you to have full control on which frames are to be recorded., f 69; @@ -383,8 +383,17 @@ #X obj 102 242 print INFO; #X text 62 90 actually you can just hook a [print] to the 3rd outlet.; #X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.; +#X obj 272 179 r \$0-ctl; +#X obj 272 202 route record; +#X obj 272 225 route float; +#X msg 272 248 set \$1; +#X obj 272 271 s \$0-record; #X connect 0 0 1 0; #X connect 2 0 3 0; +#X connect 6 0 7 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; #X restore 553 375 pd print; #X obj 518 8 declare -lib Gem; #X obj 451 120 pix_texture; From 1b6ea7ce1523c97351c84112b2d39d154ca39482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 08:59:39 +0100 Subject: [PATCH 097/387] recordQT4L: when the framesize changes, use new track otherwise lqt crashes. --- plugins/QT4L/recordQT4L.cpp | 16 ++++++++++------ plugins/QT4L/recordQT4L.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/QT4L/recordQT4L.cpp b/plugins/QT4L/recordQT4L.cpp index 1984cc76b..5e431a53d 100644 --- a/plugins/QT4L/recordQT4L.cpp +++ b/plugins/QT4L/recordQT4L.cpp @@ -141,6 +141,7 @@ bool recordQT4L :: start(const std::string&filename, gem::Properties&props) lqt_file_type_t type = guess_qtformat(filename); + m_curTrack = -1; m_qtfile = lqt_open_write(filename.c_str(), type); if(m_qtfile==NULL) { pd_error(0, "[GEM:recordQT4L] starting to record to %s failed", @@ -253,8 +254,6 @@ bool recordQT4L :: init(const imageStruct*img, double fps) int rowspan=0, rowspan_uv=0; lqt_codec_info_t*codec=NULL; int err=0; - int track=0; - if(!m_qtfile || !img || fps < 0.) { return false; @@ -292,8 +291,9 @@ bool recordQT4L :: init(const imageStruct*img, double fps) if(err!=0) { return false; } + m_curTrack++; - applyProperties(m_qtfile, track, m_codec, m_props); + applyProperties(m_qtfile, m_curTrack, m_codec, m_props); /* set the colormodel */ std::vectortrycolormodels; @@ -301,7 +301,7 @@ bool recordQT4L :: init(const imageStruct*img, double fps) trycolormodels.push_back(BC_RGB888); trycolormodels.push_back(BC_YUV422); - m_colormodel=try_colormodel(m_qtfile, track, trycolormodels); + m_colormodel=try_colormodel(m_qtfile, m_curTrack, trycolormodels); if(!m_colormodel) { return false; } @@ -318,7 +318,6 @@ bool recordQT4L :: init(const imageStruct*img, double fps) return true; } - ///////////////////////////////////////////////////////// // do the actual encoding and writing to file // @@ -346,6 +345,11 @@ bool recordQT4L :: write(imageStruct*img) m_restart=false; } + if(m_curTrack<0) { + pd_error(0, "[GEM:recordQt4L] detected invalid track %d", m_curTrack); + return false; + } + double timestamp_d=(m_useTimeStamp ?(clock_gettimesince(m_startTime)*TIMEBASE/1000.) :m_curFrame*m_timeTick); @@ -382,7 +386,7 @@ bool recordQT4L :: write(imageStruct*img) } } - lqt_encode_video(m_qtfile, rowpointers, 0, timestamp); + lqt_encode_video(m_qtfile, rowpointers, m_curTrack, timestamp); delete[]rowpointers; return true; } diff --git a/plugins/QT4L/recordQT4L.h b/plugins/QT4L/recordQT4L.h index d7f9ac8b7..2ace699d3 100644 --- a/plugins/QT4L/recordQT4L.h +++ b/plugins/QT4L/recordQT4L.h @@ -155,6 +155,7 @@ class GEM_EXPORT recordQT4L : public record double m_timeTick; size_t m_curFrame; + int m_curTrack; #endif /* QT */ }; }; From c98fdd6c79b8fa10c12f946b4c5322eb746650b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 09:03:56 +0100 Subject: [PATCH 098/387] recordQT4L: add documentation patch --- plugins/QT4L/Makefile.am | 4 ++++ plugins/QT4L/quicktime4linux-recordplugin.pd | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 plugins/QT4L/quicktime4linux-recordplugin.pd diff --git a/plugins/QT4L/Makefile.am b/plugins/QT4L/Makefile.am index 9f586d2a6..6c0f8f055 100644 --- a/plugins/QT4L/Makefile.am +++ b/plugins/QT4L/Makefile.am @@ -4,14 +4,18 @@ AM_CPPFLAGS = -I$(top_srcdir)/src $(GEM_EXTERNAL_CPPFLAGS) AM_CXXFLAGS = pkglib_LTLIBRARIES= +gemhelpdir=$(pkglibdir) +dist_gemhelp_DATA = if HAVE_LIB_LIBQUICKTIME pkglib_LTLIBRARIES+= gem_filmQT4L.la pkglib_LTLIBRARIES+= gem_recordQT4L.la +dist_gemhelp_DATA += quicktime4linux-recordplugin.pd endif if HAVE_LIB_LQT pkglib_LTLIBRARIES+= gem_filmQT4L.la pkglib_LTLIBRARIES+= gem_recordQT4L.la +dist_gemhelp_DATA += quicktime4linux-recordplugin.pd endif AM_LDFLAGS = -module -avoid-version -shared diff --git a/plugins/QT4L/quicktime4linux-recordplugin.pd b/plugins/QT4L/quicktime4linux-recordplugin.pd new file mode 100644 index 000000000..ce0683e41 --- /dev/null +++ b/plugins/QT4L/quicktime4linux-recordplugin.pd @@ -0,0 +1,18 @@ +#N canvas 43 91 666 401 10; +#X obj 95 292 s \$1-ctl; +#X obj 95 257 t a; +#X text 89 17 QT4L record backend; +#X text 89 29 ===================; +#X msg 95 138 codec mjpa; +#X text 274 139 1 pick a suitable codec; +#X msg 118 179 file /tmp/test.mov; +#X msg 124 224 record 1; +#X text 272 228 3 start recording, f 39; +#X text 95 342 If the framesize changes while recording \, a new track will be started.; +#X text 62 62 An ordinary backend to write movies.; +#X text 54 95 Supported containers: MOV \, AVI \, MP4 \, M4A; +#X text 271 178 2 set the output file (the container format is guessed from the file-extension); +#X connect 1 0 0 0; +#X connect 4 0 1 0; +#X connect 6 0 1 0; +#X connect 7 0 1 0; From fe9e9a16cdc51381a384f0dc34bf13b29835f48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 11:02:44 +0100 Subject: [PATCH 099/387] prevent double installation of quicktime4linux-recordplugin.pd --- plugins/QT4L/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/QT4L/Makefile.am b/plugins/QT4L/Makefile.am index 6c0f8f055..b8b04fdee 100644 --- a/plugins/QT4L/Makefile.am +++ b/plugins/QT4L/Makefile.am @@ -11,12 +11,13 @@ if HAVE_LIB_LIBQUICKTIME pkglib_LTLIBRARIES+= gem_filmQT4L.la pkglib_LTLIBRARIES+= gem_recordQT4L.la dist_gemhelp_DATA += quicktime4linux-recordplugin.pd -endif +else if HAVE_LIB_LQT pkglib_LTLIBRARIES+= gem_filmQT4L.la pkglib_LTLIBRARIES+= gem_recordQT4L.la dist_gemhelp_DATA += quicktime4linux-recordplugin.pd endif +endif AM_LDFLAGS = -module -avoid-version -shared if WINDOWS From 73979302511a74bfa1afe2b32af148bb7ba33bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 13:24:09 +0100 Subject: [PATCH 100/387] pix_test: "noise"-flag to enable/disable the snow --- src/Pixes/pix_test.cpp | 48 ++++++++++++++++++++++++------------------ src/Pixes/pix_test.h | 3 +++ 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/Pixes/pix_test.cpp b/src/Pixes/pix_test.cpp index 0a826db33..2e5490671 100644 --- a/src/Pixes/pix_test.cpp +++ b/src/Pixes/pix_test.cpp @@ -51,14 +51,14 @@ static volatile unsigned char getRandom(void) } static void makeSMPTE_RGBA(unsigned int cols, unsigned int rows, - unsigned char*DATA, float scale) + unsigned char*DATA, float scale, bool noise) { unsigned char*data=DATA; unsigned int r,c; unsigned int row0, row1; row0=0; - row1=rows*2/3; + row1=noise?(rows*2/3):(rows*3/4); for(r=row0; rset(GemState::_PIX, &m_pix); } -///////////////////////////////////////////////////////// -// static member function -// -///////////////////////////////////////////////////////// -void pix_test :: obj_setupCallback(t_class *classPtr) -{ - CPPEXTERN_MSG2(classPtr, "dimen", dimenMess, unsigned int, unsigned int); - CPPEXTERN_MSG1(classPtr, "colorspace", csMess, std::string); -} + void pix_test :: csMess(std::string cs) { std::string color; @@ -392,3 +386,17 @@ void pix_test :: dimenMess(unsigned int w, unsigned int h) m_pix.image.reallocate(); m_pix.newfilm=true; } +void pix_test :: noiseMess(bool noise) { + m_noise = noise; +} + +///////////////////////////////////////////////////////// +// static member function +// +///////////////////////////////////////////////////////// +void pix_test :: obj_setupCallback(t_class *classPtr) +{ + CPPEXTERN_MSG2(classPtr, "dimen", dimenMess, unsigned int, unsigned int); + CPPEXTERN_MSG1(classPtr, "colorspace", csMess, std::string); + CPPEXTERN_MSG1(classPtr, "noise", noiseMess, bool); +} diff --git a/src/Pixes/pix_test.h b/src/Pixes/pix_test.h index 5fd45b5a5..376d618e7 100644 --- a/src/Pixes/pix_test.h +++ b/src/Pixes/pix_test.h @@ -61,6 +61,9 @@ class GEM_EXTERN pix_test : public GemPixObj void dimenMess(unsigned int, unsigned int); void csMess(std::string); + void noiseMess(bool); + + bool m_noise; }; #endif // for header file From 369de73aede5632a4ea0bb2a9785a3f4d8ec0ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 13:57:40 +0100 Subject: [PATCH 101/387] help-patch for [pix_test] --- help/Makefile.am | 1 + help/pix_test-help.pd | 84 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 help/pix_test-help.pd diff --git a/help/Makefile.am b/help/Makefile.am index 667cdc947..5dd0eb34c 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -186,6 +186,7 @@ dist_gemhelp_DATA += \ pix_snap-help.pd \ pix_subtract-help.pd \ pix_takealpha-help.pd \ + pix_test-help.pd \ pix_texture-help.pd \ pix_threshold_bernsen-help.pd \ pix_threshold-help.pd \ diff --git a/help/pix_test-help.pd b/help/pix_test-help.pd new file mode 100644 index 000000000..eb8737e15 --- /dev/null +++ b/help/pix_test-help.pd @@ -0,0 +1,84 @@ +#N canvas 728 323 650 585 10; +#X declare -lib Gem; +#X text 452 8 GEM object; +#X obj 9 326 cnv 15 430 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 39 328 Inlets:; +#X text 38 432 Outlets:; +#X obj 8 286 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 17 285 Arguments:; +#X obj 7 56 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 380 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X text 453 60 Example:; +#X obj 514 484 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#N canvas 1 98 450 300 gemwin 0; +#X obj 132 136 gemwin; +#X obj 67 89 outlet; +#X obj 67 10 inlet; +#X obj 67 41 route create; +#X msg 67 70 set destroy; +#X msg 142 68 set create; +#X msg 198 112 destroy \, reset; +#X msg 132 94 create \, 1 \, color 0.5 0.5 0.5; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 3 0 7 0; +#X connect 3 1 5 0; +#X connect 3 1 6 0; +#X connect 4 0 1 0; +#X connect 5 0 1 0; +#X connect 6 0 0 0; +#X connect 7 0 0 0; +#X restore 519 523 pd gemwin; +#X msg 519 504 create; +#X text 515 483 Create window:; +#X text 71 31 Class: pix object; +#X text 46 445 Outlet 1: gemlist; +#X text 53 342 Inlet 1: gemlist; +#X text 63 296 ; +#X obj 518 8 declare -lib Gem; +#X text 50 12 Synopsis: [pix_test]; +#X text 29 56 Description: create test pixes; +#X text 22 79 [pix_test] creates a test image \, of the specified dimensions and colorspace.; +#X text 24 118 The test-image consists of the SMPTE colorbars (7 colors with decreasing luminance: white \, yellow \, cyan \, green magenta \, red \, blue) \, followed by a black-white gradient and a white-black gradient.; +#X text 24 176 The bottom of the image is filled with grey noise (but this can be turned off with the 'noise' message); +#X text 53 364 Inlet 1: colorspace RGBA|RGB|YUV/GREY : set format of input-data; +#X text 53 390 Inlet 1: dimen : set dimensions.; +#X text 53 405 Inlet 1: noise <1|0> : with noise (default) or without; +#X obj 450 114 cnv 15 160 230 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 451 84 gemhead; +#X obj 451 403 pix_texture; +#X obj 451 425 square 3.5; +#X obj 451 355 pix_info, f 25; +#X floatatom 471 379 5 0 0 0 - - - 0; +#X floatatom 505 379 5 0 0 0 - - - 0; +#X floatatom 549 379 5 0 0 0 - - - 0; +#X msg 476 136 dimen 1920 1080; +#X obj 476 263 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X msg 476 286 noise \$1; +#X msg 476 167 colorspace RGBA; +#X obj 451 159 t a; +#X msg 476 187 colorspace RGB; +#X msg 476 207 colorspace YUV; +#X msg 476 227 colorspace grey; +#X obj 451 251 t a; +#X obj 451 316 pix_test; +#X msg 476 116 dimen 64 64; +#X connect 10 0 11 0; +#X connect 11 0 10 0; +#X connect 27 0 38 0; +#X connect 28 0 29 0; +#X connect 30 0 28 0; +#X connect 30 1 31 0; +#X connect 30 2 32 0; +#X connect 30 3 33 0; +#X connect 34 0 38 0; +#X connect 35 0 36 0; +#X connect 36 0 43 0; +#X connect 37 0 42 0; +#X connect 38 0 42 0; +#X connect 39 0 42 0; +#X connect 40 0 42 0; +#X connect 41 0 42 0; +#X connect 42 0 43 0; +#X connect 43 0 30 0; +#X connect 44 0 38 0; From e446c0e7e13140afabd006029517d00ed8fdf5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 16:12:23 +0100 Subject: [PATCH 102/387] recordQT: prefer avi_odml over avi --- plugins/QT4L/recordQT4L.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/QT4L/recordQT4L.cpp b/plugins/QT4L/recordQT4L.cpp index 5e431a53d..9946f0815 100644 --- a/plugins/QT4L/recordQT4L.cpp +++ b/plugins/QT4L/recordQT4L.cpp @@ -106,10 +106,10 @@ static struct { } qtformats[] = { { "qt", LQT_FILE_QT, "mov", "Quicktime (QT7 compatible)", "yuv2" }, /* ffmpeg_mpg4 */ { "qtold", LQT_FILE_QT_OLD, "mov", "Quicktime (qt4l and old lqt)", "yuv2" }, /* mjpa */ - { "avi", LQT_FILE_AVI, "avi", "AVI (< 2G)", "yuv2" }, /* ffmpeg_msmpeg4v3 */ { "avi_odml", LQT_FILE_AVI_ODML, "avi", "AVI (> 2G)", "yuv2" }, /* ffmpeg_msmpeg4v3 */ + { "avi", LQT_FILE_AVI, "avi", "AVI (< 2G)", "yuv2" }, /* ffmpeg_msmpeg4v3 */ { "mp4", LQT_FILE_MP4, "mp4", "ISO MPEG-4", "yuv2" }, /* ffmpeg_mpg4 */ - { "m4a", LQT_FILE_M4A, "m4a", "m4a (iTunes compatible)", "yuv2" }, /* ffmpeg_mpg4 */ + { "m4a", LQT_FILE_M4A, "m4a", "m4a (iTunes compatible)", "yuv2" }, /* ffmpeg_mpg4 */ }; /* guess the file-format by inspecting the extension */ static lqt_file_type_t guess_qtformat(const std::string&filename) From 0c77892ff48b155cb70fe9416c9324b4eb9a5bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 16:12:55 +0100 Subject: [PATCH 103/387] recordQT: add 'qtformat' property to force a given container --- plugins/QT4L/recordQT4L.cpp | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/plugins/QT4L/recordQT4L.cpp b/plugins/QT4L/recordQT4L.cpp index 9946f0815..608cf8b05 100644 --- a/plugins/QT4L/recordQT4L.cpp +++ b/plugins/QT4L/recordQT4L.cpp @@ -111,21 +111,35 @@ static struct { { "mp4", LQT_FILE_MP4, "mp4", "ISO MPEG-4", "yuv2" }, /* ffmpeg_mpg4 */ { "m4a", LQT_FILE_M4A, "m4a", "m4a (iTunes compatible)", "yuv2" }, /* ffmpeg_mpg4 */ }; +/* get the filetype from the short name */ +static lqt_file_type_t get_qtformat(const char*name) +{ + for(unsigned int i = 0; i < sizeof(qtformats)/sizeof(*qtformats); i++) { + if(!strcasecmp(name, qtformats[i].name)) { + verbose(1, "[GEM:recordQT4L] using format '%s'", qtformats[i].description); + return qtformats[i].type; + } + } + + verbose(0, + "[GEM:recordQT4L] unknown extension: encoding will be QuickTime"); + return LQT_FILE_QT; /* should be save for now */ +} /* guess the file-format by inspecting the extension */ static lqt_file_type_t guess_qtformat(const std::string&filename) { const char * extension = strrchr(filename.c_str(), '.'); if(!extension) { - verbose(0, - "[GEM:recordQT4L] no extension given: encoding will be QuickTime"); + verbose(0, "[GEM:recordQT4L] no extension given: encoding will be QuickTime"); return LQT_FILE_QT; } extension++; - for(unsigned int i = 0; i < sizeof(qtformats)/sizeof(qtformats[0]); i++) { + for(unsigned int i = 0; i < sizeof(qtformats)/sizeof(*qtformats); i++) { if(!strcasecmp(extension, qtformats[i].extension)) { + verbose(1, "[GEM:recordQT4L] detected format '%s'", qtformats[i].description); return qtformats[i].type; } } @@ -139,10 +153,18 @@ bool recordQT4L :: start(const std::string&filename, gem::Properties&props) { stop(); - lqt_file_type_t type = guess_qtformat(filename); + lqt_file_type_t format = LQT_FILE_NONE; + std::string s; + if (props.get("qtformat", s)) { + format = get_qtformat(s.c_str()); + } + + if (LQT_FILE_NONE == format) { + format = guess_qtformat(filename); + } m_curTrack = -1; - m_qtfile = lqt_open_write(filename.c_str(), type); + m_qtfile = lqt_open_write(filename.c_str(), format); if(m_qtfile==NULL) { pd_error(0, "[GEM:recordQT4L] starting to record to %s failed", filename.c_str()); @@ -493,6 +515,10 @@ bool recordQT4L :: enumProperties(gem::Properties&props) props.set(params[i].name, typ); } + if(gem::Properties::UNSET == props.type("qtformat")) { + props.set("qtformat", std::string("auto")); + } + return true; } From 205f1dc6f541137f7cf4f027a5b19b524d63b715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 16:13:12 +0100 Subject: [PATCH 104/387] recordQT: update documentation --- plugins/QT4L/quicktime4linux-recordplugin.pd | 21 +++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/plugins/QT4L/quicktime4linux-recordplugin.pd b/plugins/QT4L/quicktime4linux-recordplugin.pd index ce0683e41..3ff34c589 100644 --- a/plugins/QT4L/quicktime4linux-recordplugin.pd +++ b/plugins/QT4L/quicktime4linux-recordplugin.pd @@ -1,9 +1,8 @@ -#N canvas 43 91 666 401 10; +#N canvas 602 85 487 610 10; #X obj 95 292 s \$1-ctl; #X obj 95 257 t a; #X text 89 17 QT4L record backend; #X text 89 29 ===================; -#X msg 95 138 codec mjpa; #X text 274 139 1 pick a suitable codec; #X msg 118 179 file /tmp/test.mov; #X msg 124 224 record 1; @@ -11,8 +10,20 @@ #X text 95 342 If the framesize changes while recording \, a new track will be started.; #X text 62 62 An ordinary backend to write movies.; #X text 54 95 Supported containers: MOV \, AVI \, MP4 \, M4A; -#X text 271 178 2 set the output file (the container format is guessed from the file-extension); +#X text 102 393 Normally \, the container is guessed from the file extension \, but you can force it with the 'qtformat' property:; +#X text 148 436 qt - QuickTime (QT7 compatible); +#X text 148 456 qtold - QuickTime (qt4l and old lqt); +#X text 148 476 avi_odml - AVI (> 2GB); +#X text 148 496 avi - AVI (< 2GB); +#X text 148 516 mp4 - ISO MPEG-4; +#X text 148 536 m4a - m4a (iTunes compatible); +#X text 384 436 <- "*.mov"; +#X text 384 476 <- "*.avi"; +#X text 384 516 <- "*.mp4"; +#X text 384 536 <- "*.m4a"; +#X text 271 178 2 set the output file; +#X msg 95 138 codec x264; #X connect 1 0 0 0; -#X connect 4 0 1 0; +#X connect 5 0 1 0; #X connect 6 0 1 0; -#X connect 7 0 1 0; +#X connect 23 0 1 0; From 21169f719cc7392a35883c077df847f4c16b753f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 16:13:39 +0100 Subject: [PATCH 105/387] pix_test: fix no-noise for RGB/YUV/Grey images --- src/Pixes/pix_test.cpp | 119 ++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 56 deletions(-) diff --git a/src/Pixes/pix_test.cpp b/src/Pixes/pix_test.cpp index 2e5490671..14cb42dc6 100644 --- a/src/Pixes/pix_test.cpp +++ b/src/Pixes/pix_test.cpp @@ -50,17 +50,35 @@ static volatile unsigned char getRandom(void) return (random_nextseed % 0xFF); } +static unsigned int getLastRow(int rows, int stage, bool noise) { + if(noise) { + switch(stage) { + case 0: return rows*2/3; /* SMPTE */ + case 1: return rows*3/4; /* black-white */ + case 2: return rows*5/6; /* white-black */ + default: break; + } + } else { + switch(stage) { + case 0: return rows*3/4; /* SMPTE */ + case 1: return rows*7/8; /* black-white */ + case 2: return rows; /* white-black */ + default: break; + } + } + return rows; +} + static void makeSMPTE_RGBA(unsigned int cols, unsigned int rows, unsigned char*DATA, float scale, bool noise) { unsigned char*data=DATA; - unsigned int r,c; + unsigned int r=0; unsigned int row0, row1; - row0=0; - row1=noise?(rows*2/3):(rows*3/4); - for(r=row0; r>1; - row0=0; - row1=rows*2/3; - for(r=row0; r Date: Thu, 29 Feb 2024 16:42:34 +0100 Subject: [PATCH 106/387] recordQT: add more general metadata props, renamed 'qtformat' to 'lqtformat' and documented everything --- plugins/QT4L/quicktime4linux-recordplugin.pd | 45 ++++++++++++++------ plugins/QT4L/recordQT4L.cpp | 35 ++++++++++++--- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/plugins/QT4L/quicktime4linux-recordplugin.pd b/plugins/QT4L/quicktime4linux-recordplugin.pd index 3ff34c589..63fe2a765 100644 --- a/plugins/QT4L/quicktime4linux-recordplugin.pd +++ b/plugins/QT4L/quicktime4linux-recordplugin.pd @@ -1,4 +1,4 @@ -#N canvas 602 85 487 610 10; +#N canvas 594 85 799 696 10; #X obj 95 292 s \$1-ctl; #X obj 95 257 t a; #X text 89 17 QT4L record backend; @@ -10,20 +10,41 @@ #X text 95 342 If the framesize changes while recording \, a new track will be started.; #X text 62 62 An ordinary backend to write movies.; #X text 54 95 Supported containers: MOV \, AVI \, MP4 \, M4A; -#X text 102 393 Normally \, the container is guessed from the file extension \, but you can force it with the 'qtformat' property:; -#X text 148 436 qt - QuickTime (QT7 compatible); -#X text 148 456 qtold - QuickTime (qt4l and old lqt); -#X text 148 476 avi_odml - AVI (> 2GB); -#X text 148 496 avi - AVI (< 2GB); -#X text 148 516 mp4 - ISO MPEG-4; -#X text 148 536 m4a - m4a (iTunes compatible); -#X text 384 436 <- "*.mov"; -#X text 384 476 <- "*.avi"; -#X text 384 516 <- "*.mp4"; -#X text 384 536 <- "*.m4a"; +#X text 38 413 Normally \, the container is guessed from the file extension \, but you can force it with the 'qtformat' property:; +#X text 64 456 qt - QuickTime (QT7 compatible); +#X text 64 476 qtold - QuickTime (qt4l and old lqt); +#X text 64 496 avi_odml - AVI (> 2GB); +#X text 64 516 avi - AVI (< 2GB); +#X text 64 536 mp4 - ISO MPEG-4; +#X text 64 556 m4a - m4a (iTunes compatible); +#X text 300 456 <- "*.mov"; +#X text 300 496 <- "*.avi"; +#X text 300 536 <- "*.mp4"; +#X text 300 556 <- "*.m4a"; #X text 271 178 2 set the output file; #X msg 95 138 codec x264; +#X msg 49 612 set lqtformat avi_odml; +#X obj 49 635 s \$1-ctl; +#X text 502 414 While there are a number of codec-specific properties \, you can also set some generic metadata:; +#X msg 519 468 set name my\ first\ video; +#X msg 519 528 set copyright public-domain; +#X msg 519 488 set info just\ a\ test; +#X msg 519 548 set album first\ things\ first; +#X msg 519 568 set genre experimental; +#X msg 519 608 set comment nothing\ to\ say\ (and\ saying\ it); +#X msg 519 508 set author N.N.; +#X obj 519 631 s \$1-ctl; +#X msg 519 588 set track #9; #X connect 1 0 0 0; #X connect 5 0 1 0; #X connect 6 0 1 0; #X connect 23 0 1 0; +#X connect 24 0 25 0; +#X connect 27 0 34 0; +#X connect 28 0 34 0; +#X connect 29 0 34 0; +#X connect 30 0 34 0; +#X connect 31 0 34 0; +#X connect 32 0 34 0; +#X connect 33 0 34 0; +#X connect 35 0 34 0; diff --git a/plugins/QT4L/recordQT4L.cpp b/plugins/QT4L/recordQT4L.cpp index 608cf8b05..f4f43d130 100644 --- a/plugins/QT4L/recordQT4L.cpp +++ b/plugins/QT4L/recordQT4L.cpp @@ -155,7 +155,7 @@ bool recordQT4L :: start(const std::string&filename, gem::Properties&props) lqt_file_type_t format = LQT_FILE_NONE; std::string s; - if (props.get("qtformat", s)) { + if (props.get("lqtformat", s)) { format = get_qtformat(s.c_str()); } @@ -171,6 +171,22 @@ bool recordQT4L :: start(const std::string&filename, gem::Properties&props) return false; } +#define prop2quicktime(qtfile, propname) \ + if (props.get(#propname, s)) { quicktime_set_##propname(qtfile, (char*)s.c_str()); } +#define prop2lqt(qtfile, propname) \ + if (props.get(#propname, s)) { lqt_set_##propname(qtfile, (char*)s.c_str()); } + + prop2quicktime(m_qtfile, name); + prop2quicktime(m_qtfile, copyright); + prop2quicktime(m_qtfile, info); + + prop2lqt(m_qtfile, album); + prop2lqt(m_qtfile, artist); + prop2lqt(m_qtfile, genre); + prop2lqt(m_qtfile, track); + prop2lqt(m_qtfile, comment); + prop2lqt(m_qtfile, author); + m_props=props; m_restart=true; @@ -492,6 +508,19 @@ bool recordQT4L :: enumProperties(gem::Properties&props) return false; } + props.set("lqtformat", std::string("auto")); + + props.set("name", std::string("")); + props.set("copyright", std::string("")); + props.set("info", std::string("")); + + props.set("album", std::string("")); + props.set("artist", std::string("")); + props.set("genre", std::string("")); + props.set("track", std::string("")); + props.set("comment", std::string("")); + props.set("author", std::string("")); + props.set("framerate", 0.f); const int paramcount=m_codec->num_encoding_parameters; @@ -515,10 +544,6 @@ bool recordQT4L :: enumProperties(gem::Properties&props) props.set(params[i].name, typ); } - if(gem::Properties::UNSET == props.type("qtformat")) { - props.set("qtformat", std::string("auto")); - } - return true; } From d0f7b421b1feb6a6f6d7019637cab8f50bc6a07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 16:58:36 +0100 Subject: [PATCH 107/387] TEST: help for filmTEST and videoTEST --- plugins/TEST/Makefile.am | 3 +-- plugins/TEST/test-filmplugin.pd | 6 ++++++ plugins/TEST/test-videoplugin.pd | 20 ++++++++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 plugins/TEST/test-filmplugin.pd diff --git a/plugins/TEST/Makefile.am b/plugins/TEST/Makefile.am index dc6da82a4..052de2658 100644 --- a/plugins/TEST/Makefile.am +++ b/plugins/TEST/Makefile.am @@ -8,11 +8,10 @@ AM_LDFLAGS = -module -avoid-version -shared gemhelpdir=$(pkglibdir) dist_gemhelp_DATA = - - pkglib_LTLIBRARIES = pkglib_LTLIBRARIES+=gem_filmTEST.la +dist_gemhelp_DATA +=test-filmplugin.pd pkglib_LTLIBRARIES+=gem_videoTEST.la dist_gemhelp_DATA +=test-videoplugin.pd diff --git a/plugins/TEST/test-filmplugin.pd b/plugins/TEST/test-filmplugin.pd new file mode 100644 index 000000000..c15a0c8c5 --- /dev/null +++ b/plugins/TEST/test-filmplugin.pd @@ -0,0 +1,6 @@ +#N canvas 856 26 505 263 10; +#X obj 143 227 s \$1-ctl; +#X msg 143 184 backend test \, open test; +#X text 51 50 a test backend for [pix_film]; +#X text 55 111 This pretends to open a 'test' video file that contains a simple test-pattern.; +#X connect 1 0 0 0; diff --git a/plugins/TEST/test-videoplugin.pd b/plugins/TEST/test-videoplugin.pd index 1c88a7de2..df214036c 100644 --- a/plugins/TEST/test-videoplugin.pd +++ b/plugins/TEST/test-videoplugin.pd @@ -1,2 +1,18 @@ -#N canvas 8 49 505 112 10; -#X text 89 47 Nothing special about this backend...; +#N canvas 856 26 505 389 10; +#X obj 142 347 s \$1-ctl; +#X msg 143 144 backend test \, device test; +#X msg 179 185 dimen 720 480; +#X obj 180 299 t a; +#X text 51 50 a test backend for [pix_video]; +#X text 55 111 This backend creates simple test patterns:; +#X msg 210 236 set type noise; +#X msg 210 256 set type red; +#X msg 210 276 set type green; +#X msg 210 296 set type blue; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 6 0 3 0; +#X connect 7 0 3 0; +#X connect 8 0 3 0; +#X connect 9 0 3 0; From cae1651cac8ef29760f85533b3995a46290fb6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 17:20:24 +0100 Subject: [PATCH 108/387] Add '_gemwin' help-abstraction --- help/Makefile.am | 1 + help/_gemwin.pd | 75 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 help/_gemwin.pd diff --git a/help/Makefile.am b/help/Makefile.am index 5dd0eb34c..3506453a1 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -243,4 +243,5 @@ dist_gemhelp_DATA += \ dist_gemhelp_DATA += \ _backendinfo.pd \ + _gemwin.pd \ $(empty) diff --git a/help/_gemwin.pd b/help/_gemwin.pd new file mode 100644 index 000000000..e88afa11b --- /dev/null +++ b/help/_gemwin.pd @@ -0,0 +1,75 @@ +#N canvas 735 459 904 450 12; +#X obj 160 337 gemwin; +#X obj 102 121 cnv 25 25 25 empty empty empty 20 12 0 12 #000000 #404040 0; +#X obj 104 123 tgl 21 0 \$0-tgl \$0-tgl create 25 10 0 12 #fcfcfc #000000 #000000 0 1; +#N canvas 735 459 784 307 tgl 0; +#X obj 70 51 r \$0-tgl; +#X obj 70 101 t f f; +#X obj 70 126 select 0 1; +#X msg 70 151 0 \, destroy; +#X msg 152 151 create \, 1; +#X obj 230 126 select 0 1; +#X msg 230 151 create; +#X msg 282 151 destroy; +#X obj 230 176 symbol; +#X msg 230 201 label \$1; +#X obj 230 226 s \$0-tgl; +#X obj 207 20 loadbang; +#X obj 70 176 s \$0-gemwin; +#X obj 70 76 route float; +#X obj 460 61 inlet; +#X msg 460 117 set \$1; +#X obj 460 142 s \$0-tgl; +#X obj 279 65 t b; +#X obj 249 65 t b; +#X obj 460 92 route float destroy create; +#X connect 0 0 13 0; +#X connect 1 0 2 0; +#X connect 1 1 5 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 12 0; +#X connect 4 0 12 0; +#X connect 5 0 6 0; +#X connect 5 1 7 0; +#X connect 6 0 8 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 11 0 18 0; +#X connect 13 0 1 0; +#X connect 14 0 19 0; +#X connect 15 0 16 0; +#X connect 17 0 7 0; +#X connect 18 0 6 0; +#X connect 19 0 15 0; +#X connect 19 1 18 0; +#X connect 19 2 17 0; +#X restore 364 149 pd tgl; +#X obj 160 310 r \$0-gemwin; +#X obj 264 99 inlet; +#X obj 264 124 t a a; +#X obj 264 149 s \$0-gemwin; +#X obj 537 59 loadbang; +#X obj 537 124 gemargs; +#X msg 482 59 bang; +#X obj 537 149 route float; +#X obj 538 174 t a a; +#X obj 538 199 s \$0-gemwin; +#X obj 160 362 outlet; +#X obj 537 84 t b b; +#X msg 664 108 reset; +#X connect 0 0 14 0; +#X connect 4 0 0 0; +#X connect 5 0 6 0; +#X connect 6 0 7 0; +#X connect 6 1 3 0; +#X connect 8 0 15 0; +#X connect 9 0 11 0; +#X connect 10 0 15 0; +#X connect 11 1 12 0; +#X connect 12 0 13 0; +#X connect 15 0 9 0; +#X connect 15 1 16 0; +#X connect 16 0 13 0; +#X coords 0 -1 1 1 85 46 1 100 100; From be3d90641624872c120234f10bff69bf5202b291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 29 Feb 2024 17:38:01 +0100 Subject: [PATCH 109/387] start using [_gemwin] helper --- help/accumrotate-help.pd | 68 +++------- help/alpha-help.pd | 98 +++++--------- help/ambient-help.pd | 61 +++------ help/ambientRGB-help.pd | 73 +++-------- help/camera-help.pd | 86 +++++-------- help/circle-help.pd | 56 ++------ help/color-help.pd | 52 ++------ help/colorRGB-help.pd | 66 +++------- help/colorSquare-help.pd | 81 ++++-------- help/cone-help.pd | 63 +++------ help/cube-help.pd | 57 ++------- help/cuboid-help.pd | 65 +++------- help/curve-help.pd | 118 ++++++----------- help/curve3d-help.pd | 189 +++++++++++---------------- help/cylinder-help.pd | 64 +++------- help/depth-help.pd | 88 ++++--------- help/diffuse-help.pd | 61 +++------ help/diffuseRGB-help.pd | 69 +++------- help/disk-help.pd | 69 +++------- help/emission-help.pd | 56 ++------ help/emissionRGB-help.pd | 65 +++------- help/fragment_program-help.pd | 74 +++-------- help/gemcubeframebuffer-help.pd | 219 ++++++++++++-------------------- help/tube-help.pd | 121 +++++++----------- 24 files changed, 597 insertions(+), 1422 deletions(-) diff --git a/help/accumrotate-help.pd b/help/accumrotate-help.pd index 3adcade7d..128a4cf94 100644 --- a/help/accumrotate-help.pd +++ b/help/accumrotate-help.pd @@ -2,59 +2,26 @@ #X declare -lib Gem; #X text 452 8 GEM object; #X text 50 12 Synopsis: [accumrotate]; -#X obj 8 197 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 197 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 63 225 Inlet 1: message: reset; -#X text 64 254 Inlet 3: float: delta-rotation around Y-axis (in deg) -; -#X text 64 242 Inlet 2: float: delta-rotation around X-axis (in deg) -; -#X text 64 266 Inlet 4: float: delta-rotation around Z-axis (in deg) -; +#X text 64 254 Inlet 3: float: delta-rotation around Y-axis (in deg); +#X text 64 242 Inlet 2: float: delta-rotation around X-axis (in deg); +#X text 64 266 Inlet 4: float: delta-rotation around Z-axis (in deg); #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 282 Outlets:; #X text 57 295 Outlet 1: gemlist; -#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; #X text 63 166 initial rotations around X \, Y \, Z-axes; -#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X text 42 95 [accumrotate] accepts a gemList and changes the current -transformation matrix by the specified delta-rotation; -#X text 41 130 the delta-values add to the current rotation-matrix. -; +#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 42 95 [accumrotate] accepts a gemList and changes the current transformation matrix by the specified delta-rotation; +#X text 41 130 the delta-values add to the current rotation-matrix.; #X text 29 77 Description: accumulated rotation; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 233 square; #X msg 478 108 reset; @@ -67,11 +34,10 @@ transformation matrix by the specified delta-rotation; #X obj 143 337 rotateXYZ; #X obj 95 337 rotate; #X obj 520 8 declare -lib Gem; -#X connect 21 0 22 0; -#X connect 22 0 21 0; -#X connect 26 0 31 0; -#X connect 28 0 31 0; -#X connect 29 0 31 2; -#X connect 31 0 27 0; -#X connect 32 0 31 1; -#X connect 33 0 31 3; +#X obj 524 263 _gemwin; +#X connect 22 0 27 0; +#X connect 24 0 27 0; +#X connect 25 0 27 2; +#X connect 27 0 23 0; +#X connect 28 0 27 1; +#X connect 29 0 27 3; diff --git a/help/alpha-help.pd b/help/alpha-help.pd index a7d6f8c3a..1d4ebfb7a 100644 --- a/help/alpha-help.pd +++ b/help/alpha-help.pd @@ -1,74 +1,38 @@ #N canvas 50 237 711 539 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 330 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 330 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 37 195 Inlets:; #X text 453 355 Outlets:; #X text 461 366 Outlet 1: gemlist; -#X obj 8 161 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 161 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 160 Arguments:; -#X obj 8 76 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 250 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 250 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 584 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 589 293 pd gemwin; -#X msg 589 274 create; -#X text 585 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 451 197 cnv 15 80 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 451 197 cnv 15 80 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 579 186 color 1 0 0 0.5; -#X text 60 219 Inlet 1: float: turn alpha blending on/off (default:1) -; +#X text 60 219 Inlet 1: float: turn alpha blending on/off (default:1); #X text 50 12 Synopsis: [alpha]; #X text 29 77 Description: enable alpha blending; #X obj 458 310 square; #X obj 458 233 alpha; #X obj 458 108 color 0 1 0 0.5; #X text 61 208 Inlet 1: gemlist; -#X text 60 231 Inlet 1: message "auto 1" | "auto 0" turn on/off automatic -depth detection; -#X floatatom 583 139 5 0 0 0 - - -; +#X text 60 231 Inlet 1: message "auto 1" | "auto 0" turn on/off automatic depth detection; +#X floatatom 583 139 5 0 0 0 - - - 0; #X obj 458 86 gemhead 51; #X obj 579 211 sphere; #X obj 458 137 rotate 114 0 1 0; #X obj 579 162 gemhead 50; #X msg 474 176 auto \$1; -#X obj 474 158 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 474 158 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 583 108 0 1 0 \$1; -#X floatatom 583 88 5 0 1 0 - - -; -#X obj 628 88 hsl 64 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144 --1 -1 0 1; -#X text 22 91 [alpha] turns on and off alpha blending. Be aware that -the rendering order matters \, so you probably want to set the gemhead -order number high so that the object is rendered after all of the non-alpha -blended ones.; -#X text 63 171 float : blending function (default:GL_ONE_MINUS_SRC_ALPHA) -; +#X floatatom 583 88 5 0 1 0 - - - 0; +#X obj 628 88 hsl 64 15 0 1 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; +#X text 22 91 [alpha] turns on and off alpha blending. Be aware that the rendering order matters \, so you probably want to set the gemhead order number high so that the object is rendered after all of the non-alpha blended ones.; +#X text 63 171 float : blending function (default:GL_ONE_MINUS_SRC_ALPHA); #X text 60 260 Inlet 2: float: blending function; #X text 70 272 0=GL_ONE_MINUS_SOURCE_ALPHA; #X text 70 282 1=GL_ONE; @@ -90,23 +54,21 @@ blended ones.; #X text 70 474 17=GL_ONE_MINUS_SRC1_COLOR; #X text 70 486 18=GL_SRC1_ALPHA; #X text 70 498 19=GL_ONE_MINUS_SRC1_ALPHA; -#X obj 477 210 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X floatatom 501 210 2 0 19 0 - - -; +#X obj 477 210 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 501 210 2 0 19 0 - - - 0; #X obj 588 8 declare -lib Gem; -#X connect 11 0 12 0; -#X connect 12 0 11 0; -#X connect 16 0 27 0; -#X connect 21 0 20 0; -#X connect 22 0 28 0; -#X connect 25 0 28 1; -#X connect 26 0 22 0; -#X connect 28 0 21 0; -#X connect 29 0 16 0; -#X connect 30 0 21 0; -#X connect 31 0 30 0; -#X connect 32 0 22 1; -#X connect 33 0 32 0; -#X connect 34 0 33 0; -#X connect 58 0 21 0; -#X connect 59 0 21 1; +#X obj 588 271 _gemwin; +#X connect 12 0 23 0; +#X connect 17 0 16 0; +#X connect 18 0 24 0; +#X connect 21 0 24 1; +#X connect 22 0 18 0; +#X connect 24 0 17 0; +#X connect 25 0 12 0; +#X connect 26 0 17 0; +#X connect 27 0 26 0; +#X connect 28 0 18 1; +#X connect 29 0 28 0; +#X connect 30 0 29 0; +#X connect 54 0 17 0; +#X connect 55 0 17 1; diff --git a/help/ambient-help.pd b/help/ambient-help.pd index edf8b9afb..ef77175e6 100644 --- a/help/ambient-help.pd +++ b/help/ambient-help.pd @@ -1,46 +1,18 @@ -#N canvas 260 145 639 369 10; +#N canvas 443 161 639 369 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 252 Outlets:; #X text 57 265 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 29 77 Description: ambient colouring; #X obj 451 193 cube; @@ -49,22 +21,19 @@ #X obj 500 211 rotate 180 1 0 0; #X text 62 156 a list of 3 (RGB) or 4 (RGBA) float-values.; #X text 60 171 defaults: 0.2 0.2 0.2 1; -#X text 22 91 [ambient] accepts a gemList and sets the ambient-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; +#X text 22 91 [ambient] accepts a gemList and sets the ambient-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 50 12 Synopsis: [ambient]; #X obj 451 156 ambient 0 1 0; #X msg 478 130 0.4 0.8 1; #X text 63 229 Inlet 2: list: 3(RGB) or 4(RGBA) float values; -#X floatatom 549 193 5 0 0 0 - - -; +#X floatatom 549 193 5 0 0 0 - - - 0; #X obj 84 332 ambientRGB; #X text 21 332 see also:; #X obj 519 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 27 0; -#X connect 20 0 22 0; -#X connect 22 0 21 0; -#X connect 27 0 19 0; -#X connect 28 0 27 1; -#X connect 30 0 22 1; +#X obj 461 256 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 23 0; +#X connect 16 0 18 0; +#X connect 18 0 17 0; +#X connect 23 0 15 0; +#X connect 24 0 23 1; +#X connect 26 0 18 1; diff --git a/help/ambientRGB-help.pd b/help/ambientRGB-help.pd index 970fecaf7..cb1993f93 100644 --- a/help/ambientRGB-help.pd +++ b/help/ambientRGB-help.pd @@ -1,55 +1,25 @@ #N canvas 6 61 641 366 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 292 Outlets:; #X text 57 305 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 29 77 Description: ambient colouring; #X obj 451 193 cube; #X obj 500 192 gemhead; #X obj 500 230 world_light; #X text 50 12 Synopsis: [ambientRGB]; -#X text 22 91 [ambientRGB] accepts a gemList and sets the ambient-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; +#X text 22 91 [ambientRGB] accepts a gemList and sets the ambient-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 62 156 a list of 3 (RGB) or 4 (RGBA) float-values.; #X text 60 171 defaults: 0.2 0.2 0.2 1; #X text 63 229 Inlet 2: float: red value; @@ -57,23 +27,22 @@ see any effects.; #X text 63 259 Inlet 4: float: blue value; #X text 63 274 Inlet 5: float: alpha value; #X obj 451 156 ambientRGB 0 1 0; -#X floatatom 477 122 3 0 1 0 - - -; -#X floatatom 504 122 3 0 1 0 - - -; -#X floatatom 531 122 3 0 1 0 - - -; -#X floatatom 558 122 3 0 1 0 - - -; -#X floatatom 548 192 5 0 0 0 - - -; +#X floatatom 477 122 3 0 1 0 - - - 0; +#X floatatom 504 122 3 0 1 0 - - - 0; +#X floatatom 531 122 3 0 1 0 - - - 0; +#X floatatom 558 122 3 0 1 0 - - - 0; +#X floatatom 548 192 5 0 0 0 - - - 0; #X obj 500 211 rotate 70 1 0 0; #X text 20 333 see also:; #X obj 93 332 ambient; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 30 0; -#X connect 20 0 36 0; -#X connect 30 0 19 0; -#X connect 31 0 30 1; -#X connect 32 0 30 2; -#X connect 33 0 30 3; -#X connect 34 0 30 4; -#X connect 35 0 36 1; -#X connect 36 0 21 0; +#X obj 453 260 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 26 0; +#X connect 16 0 32 0; +#X connect 26 0 15 0; +#X connect 27 0 26 1; +#X connect 28 0 26 2; +#X connect 29 0 26 3; +#X connect 30 0 26 4; +#X connect 31 0 32 1; +#X connect 32 0 17 0; diff --git a/help/camera-help.pd b/help/camera-help.pd index 3b0cec1b9..3782c9d36 100644 --- a/help/camera-help.pd +++ b/help/camera-help.pd @@ -23,33 +23,6 @@ #X floatatom 379 207 5 0 0 0 - - - 0; #X floatatom 379 170 5 0 0 0 - - - 0; #X msg 67 213 distance \$1; -#X obj 170 305 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X obj 67 41 route create destroy; -#X obj 298 42 loadbang; -#X msg 298 65 lighting 1; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 1 0; -#X connect 5 0 0 0; -#X connect 6 0 0 0; -#X connect 7 0 3 0; -#X connect 7 0 6 0; -#X connect 7 1 4 0; -#X connect 7 1 5 0; -#X connect 7 2 0 0; -#X connect 8 0 9 0; -#X connect 9 0 0 0; -#X restore 175 344 pd gemwin; -#X msg 175 325 create; -#X text 171 304 Create window:; #X obj 488 18 declare -lib Gem; #X msg 537 279 bang; #X obj 699 307 gemhead; @@ -68,44 +41,43 @@ #X obj 699 353 route 0 1; #X text 715 157 0.."local" mode; #X text 716 172 1.."gemwin" mode; +#X obj 227 387 _gemwin \; 0 \; 0 \; lighting 1; #X connect 0 0 12 0; #X connect 1 0 11 0; #X connect 2 0 4 0; #X connect 3 0 5 0; -#X connect 4 0 36 0; -#X connect 5 0 36 0; +#X connect 4 0 32 0; +#X connect 5 0 32 0; #X connect 6 0 9 0; #X connect 7 0 8 0; -#X connect 8 0 36 0; -#X connect 9 0 36 0; -#X connect 10 0 36 0; -#X connect 11 0 36 0; -#X connect 12 0 36 0; -#X connect 13 0 36 0; +#X connect 8 0 32 0; +#X connect 9 0 32 0; +#X connect 10 0 32 0; +#X connect 11 0 32 0; +#X connect 12 0 32 0; +#X connect 13 0 32 0; #X connect 14 0 13 0; #X connect 15 0 22 0; -#X connect 16 0 36 0; -#X connect 17 0 36 0; -#X connect 18 0 36 0; +#X connect 16 0 32 0; +#X connect 17 0 32 0; +#X connect 18 0 32 0; #X connect 19 0 16 0; #X connect 20 0 18 0; #X connect 21 0 17 0; -#X connect 22 0 36 0; -#X connect 24 0 25 0; -#X connect 25 0 24 0; -#X connect 28 0 36 0; -#X connect 29 0 37 0; -#X connect 31 0 32 0; -#X connect 32 0 24 0; -#X connect 33 0 34 0; -#X connect 35 1 31 0; -#X connect 36 0 35 0; -#X connect 36 1 40 0; -#X connect 37 0 42 0; -#X connect 38 0 39 0; -#X connect 39 0 41 0; -#X connect 39 1 37 1; -#X connect 40 0 30 0; -#X connect 41 0 36 0; -#X connect 42 0 40 0; -#X connect 42 1 30 0; +#X connect 22 0 32 0; +#X connect 24 0 32 0; +#X connect 25 0 33 0; +#X connect 27 0 28 0; +#X connect 28 0 41 0; +#X connect 29 0 30 0; +#X connect 31 1 27 0; +#X connect 32 0 31 0; +#X connect 32 1 36 0; +#X connect 33 0 38 0; +#X connect 34 0 35 0; +#X connect 35 0 37 0; +#X connect 35 1 33 1; +#X connect 36 0 26 0; +#X connect 37 0 32 0; +#X connect 38 0 36 0; +#X connect 38 1 26 0; diff --git a/help/circle-help.pd b/help/circle-help.pd index 5ed5a05b1..65711558c 100644 --- a/help/circle-help.pd +++ b/help/circle-help.pd @@ -3,18 +3,12 @@ #X text 33 14 Synopsis: [circle]; #X text 54 30 Class: geometric object; #X text 525 29 Example:; -#X obj 7 65 cnv 15 450 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 7 69 Description: Renders a circle.; -#X text 16 86 The circle object renders a circle flat disc at the current -position with current color. The look of the circle can be changed -with the draw message \, its size can be changed via the second inlet. -; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X text 16 86 The circle object renders a circle flat disc at the current position with current color. The look of the circle can be changed with the draw message \, its size can be changed via the second inlet.; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 166 cnv 15 450 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 166 cnv 15 450 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 165 Arguments:; #X text 27 261 Inlet 2: float: size; #X text 452 8 GEM object; @@ -22,46 +16,20 @@ with the draw message \, its size can be changed via the second inlet. #X text 9 280 Outlets:; #X text 21 293 Outlet 1: gemlist; #X text 63 177 size of the circle; -#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 584 224 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 589 263 pd gemwin; -#X msg 589 244 create; -#X text 585 223 Create window:; -#X obj 525 80 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 525 80 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 593 159 circle; #X msg 535 95 draw line; #X msg 535 116 draw fill; #X msg 535 138 draw point; #X obj 593 54 gemhead; -#X floatatom 626 130 5 0 0 2 size - -; +#X floatatom 626 130 5 0 0 2 size - - 0; #X text 64 191 default:1; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; #X obj 588 8 declare -lib Gem; -#X connect 18 0 19 0; +#X obj 541 245 _gemwin; #X connect 19 0 18 0; -#X connect 23 0 22 0; -#X connect 24 0 22 0; -#X connect 25 0 22 0; -#X connect 26 0 22 0; -#X connect 27 0 22 1; +#X connect 20 0 18 0; +#X connect 21 0 18 0; +#X connect 22 0 18 0; +#X connect 23 0 18 1; diff --git a/help/color-help.pd b/help/color-help.pd index 94af8b1c9..19a08a70f 100644 --- a/help/color-help.pd +++ b/help/color-help.pd @@ -1,46 +1,18 @@ #N canvas 48 102 639 342 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 292 Outlets:; #X text 57 305 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 66 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 66 cnv 15 170 200 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 66 cnv 15 170 200 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 49 Example:; -#X obj 510 183 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 515 222 pd gemwin; -#X msg 515 203 create; -#X text 511 182 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 107 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 107 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 73 gemhead; #X obj 451 182 cube; #X text 62 156 a list of 3 (RGB) or 4 (RGBA) float-values.; @@ -48,17 +20,13 @@ #X obj 451 145 color 0 1 0; #X msg 487 116 0 0 1; #X text 63 229 Inlet 2: list: 3(RGB) or 4(RGBA) float values; -#X text 22 81 [color] sets the colour of all subsequent shape and vertex -operations until reset by another [color]/[colorRGB] object. If you -set the alpha-value \, you will need an [alpha] object to enable alpha-blending -; +#X text 22 81 [color] sets the colour of all subsequent shape and vertex operations until reset by another [color]/[colorRGB] object. If you set the alpha-value \, you will need an [alpha] object to enable alpha-blending; #X text 50 12 Synopsis: [color]; #X text 29 67 Description: colouring; #X text 449 272 see also:; #X obj 452 301 colorRGB; #X obj 519 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 21 0; -#X connect 21 0 18 0; -#X connect 22 0 21 1; +#X obj 517 213 _gemwin; +#X connect 13 0 17 0; +#X connect 17 0 14 0; +#X connect 18 0 17 1; diff --git a/help/colorRGB-help.pd b/help/colorRGB-help.pd index 85cd3520d..bc516645f 100644 --- a/help/colorRGB-help.pd +++ b/help/colorRGB-help.pd @@ -1,46 +1,18 @@ #N canvas 42 61 639 342 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 292 Outlets:; #X text 57 305 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 66 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 66 cnv 15 170 200 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 66 cnv 15 170 200 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 49 Example:; -#X obj 514 190 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 229 pd gemwin; -#X msg 519 210 create; -#X text 515 189 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 107 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 107 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 73 gemhead; #X obj 451 182 cube; #X text 62 156 a list of 3 (RGB) or 4 (RGBA) float-values.; @@ -48,26 +20,22 @@ #X text 63 244 Inlet 3: float: green value; #X text 63 259 Inlet 4: float: blue value; #X text 63 274 Inlet 5: float: alpha value; -#X floatatom 479 111 3 0 1 0 - - -; -#X floatatom 508 111 3 0 1 0 - - -; -#X floatatom 536 111 3 0 1 0 - - -; -#X floatatom 565 111 3 0 1 0 - - -; +#X floatatom 479 111 3 0 1 0 - - - 0; +#X floatatom 508 111 3 0 1 0 - - - 0; +#X floatatom 536 111 3 0 1 0 - - - 0; +#X floatatom 565 111 3 0 1 0 - - - 0; #X text 60 171 defaults: 0 0 0 1; #X text 50 12 Synopsis: [colorRGB]; #X obj 451 145 colorRGB 0 1 0; #X text 29 67 Description: colouring; -#X text 22 81 [colorRGB] sets the colour of all subsequent shape and -vertex operations until reset by another [color]/[colorRGB] object. -If you set the alpha-value \, you will need an [alpha] object to enable -alpha-blending; +#X text 22 81 [colorRGB] sets the colour of all subsequent shape and vertex operations until reset by another [color]/[colorRGB] object. If you set the alpha-value \, you will need an [alpha] object to enable alpha-blending; #X text 447 272 see also:; #X obj 449 297 color; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 30 0; -#X connect 24 0 30 1; -#X connect 25 0 30 2; -#X connect 26 0 30 3; -#X connect 27 0 30 4; -#X connect 30 0 18 0; +#X obj 528 213 _gemwin; +#X connect 13 0 26 0; +#X connect 20 0 26 1; +#X connect 21 0 26 2; +#X connect 22 0 26 3; +#X connect 23 0 26 4; +#X connect 26 0 14 0; diff --git a/help/colorSquare-help.pd b/help/colorSquare-help.pd index 7944e6d24..fa1a32b79 100644 --- a/help/colorSquare-help.pd +++ b/help/colorSquare-help.pd @@ -1,38 +1,11 @@ #N canvas 130 61 696 468 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 107 cnv 15 200 250 empty empty empty 20 12 0 14 -228992 --66577 0; -#X obj 494 284 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 499 323 pd gemwin; -#X msg 499 304 create; -#X text 495 283 Create window:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 196 cnv 15 450 200 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 479 107 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 196 cnv 15 450 200 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 201 Inlets:; -#X obj 8 156 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; #X text 27 227 Inlet 1: message: draw [line|fill|point]; #X text 27 241 Inlet 2: float: size; @@ -41,16 +14,14 @@ #X text 9 350 Outlets:; #X text 21 363 Outlet 1: gemlist; #X text 485 89 Example:; -#X obj 482 137 cnv 15 190 110 empty empty empty 20 12 0 14 -81876 -66577 -0; +#X obj 482 137 cnv 15 190 110 empty empty empty 20 12 0 14 #4cfc4c #404040 0; #X text 33 14 Synopsis: [colorSquare]; -#X obj 534 252 cnv 15 100 30 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 534 252 cnv 15 100 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 485 145 draw line; #X msg 485 166 draw fill; #X msg 485 188 draw point; #X obj 543 114 gemhead; -#X floatatom 557 143 5 0 0 1 size - -; +#X floatatom 557 143 5 0 0 1 size - - 0; #X text 7 69 Description: Renders a square with several colors.; #X text 63 166 size of the square; #X obj 543 259 colorSquare; @@ -58,27 +29,19 @@ #X msg 600 203 0 0 1; #X msg 586 184 0 1 0; #X msg 571 165 1 0 0; -#X text 27 268 Inlet 3: list: 3(RGB) float values for the lowerleft -corner; -#X text 27 285 Inlet 4: list: 3(RGB) float values for the lowerright -corner; -#X text 27 305 Inlet 5: list: 3(RGB) float values for the upperright -corner; -#X text 27 322 Inlet 6: list: 3(RGB) float values for the upperleft -corner; -#X text 16 86 The colorSquare object renders a square at the current -position. The size of the square can be changed via the second inlet. -The colors of the 4 corners can be specified separately and are drawn -as gradients.; +#X text 27 268 Inlet 3: list: 3(RGB) float values for the lowerleft corner; +#X text 27 285 Inlet 4: list: 3(RGB) float values for the lowerright corner; +#X text 27 305 Inlet 5: list: 3(RGB) float values for the upperright corner; +#X text 27 322 Inlet 6: list: 3(RGB) float values for the upperleft corner; +#X text 16 86 The colorSquare object renders a square at the current position. The size of the square can be changed via the second inlet. The colors of the 4 corners can be specified separately and are drawn as gradients.; #X obj 578 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 21 0 28 0; -#X connect 22 0 28 0; -#X connect 23 0 28 0; -#X connect 24 0 28 0; -#X connect 25 0 28 1; -#X connect 29 0 28 5; -#X connect 30 0 28 4; -#X connect 31 0 28 3; -#X connect 32 0 28 2; +#X obj 587 308 _gemwin; +#X connect 17 0 24 0; +#X connect 18 0 24 0; +#X connect 19 0 24 0; +#X connect 20 0 24 0; +#X connect 21 0 24 1; +#X connect 25 0 24 5; +#X connect 26 0 24 4; +#X connect 27 0 24 3; +#X connect 28 0 24 2; diff --git a/help/cone-help.pd b/help/cone-help.pd index 2beb1377e..2d1a409f7 100644 --- a/help/cone-help.pd +++ b/help/cone-help.pd @@ -1,39 +1,12 @@ #N canvas 290 157 710 345 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 47 cnv 15 180 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 544 224 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 549 263 pd gemwin; -#X msg 549 244 create; -#X text 545 223 Create window:; +#X obj 479 47 cnv 15 180 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 485 29 Example:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 146 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; #X text 27 261 Inlet 2: float: size; #X text 452 8 GEM object; @@ -42,30 +15,26 @@ #X text 21 300 Outlet 1: gemlist; #X text 33 14 Synopsis: [cone]; #X text 7 69 Description: Renders a cone.; -#X text 14 86 The cone object renders a cone at the current position -with current color. The look of the cone can be changed with the draw -message \, its size can be changed via the second inlet.; -#X obj 542 130 cnv 15 100 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X text 14 86 The cone object renders a cone at the current position with current color. The look of the cone can be changed with the draw message \, its size can be changed via the second inlet.; +#X obj 542 130 cnv 15 100 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 485 65 draw line; #X msg 485 86 draw fill; #X msg 485 108 draw point; #X obj 553 54 gemhead; -#X floatatom 569 144 5 0 0 2 size - -; +#X floatatom 569 144 5 0 0 2 size - - 0; #X obj 553 79 rotateXYZ 90 0 0; -#X floatatom 586 171 5 0 0 2 segments - -; +#X floatatom 586 171 5 0 0 2 segments - - 0; #X text 27 272 Inlet 3: int: number of segments; #X obj 553 189 cone 1; #X text 64 180 defaults: 1 10; #X text 63 162 size of the cone \, number of segments; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; #X obj 548 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 21 0 29 0; -#X connect 22 0 29 0; -#X connect 23 0 29 0; -#X connect 24 0 26 0; -#X connect 25 0 29 1; -#X connect 26 0 29 0; -#X connect 27 0 29 2; +#X obj 540 224 _gemwin; +#X connect 17 0 25 0; +#X connect 18 0 25 0; +#X connect 19 0 25 0; +#X connect 20 0 22 0; +#X connect 21 0 25 1; +#X connect 22 0 25 0; +#X connect 23 0 25 2; diff --git a/help/cube-help.pd b/help/cube-help.pd index e0ef5eaee..90910bd2b 100644 --- a/help/cube-help.pd +++ b/help/cube-help.pd @@ -1,38 +1,11 @@ #N canvas 289 160 710 345 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 584 224 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 589 263 pd gemwin; -#X msg 589 244 create; -#X text 585 223 Create window:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 27 261 Inlet 2: float: size; @@ -43,24 +16,20 @@ #X text 33 14 Synopsis: [cube]; #X text 7 69 Description: Renders a cube.; #X text 63 186 size of the cube; -#X text 16 86 The cube object renders a cube at the current position -with current color. The size of the cube can be changed via the second -inlet.; +#X text 16 86 The cube object renders a cube at the current position with current color. The size of the cube can be changed via the second inlet.; #X text 525 29 Example:; -#X obj 522 78 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 522 78 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 525 128 draw point; #X obj 593 54 gemhead; -#X floatatom 624 114 5 0 0 0 - - -; +#X floatatom 624 114 5 0 0 0 - - - 0; #X text 624 98 size; #X obj 593 159 cube; #X msg 525 106 draw line; #X msg 525 85 draw default; #X obj 588 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 23 0 27 0; -#X connect 24 0 27 0; -#X connect 25 0 27 1; -#X connect 28 0 27 0; -#X connect 29 0 27 0; +#X obj 583 236 _gemwin; +#X connect 19 0 23 0; +#X connect 20 0 23 0; +#X connect 21 0 23 1; +#X connect 24 0 23 0; +#X connect 25 0 23 0; diff --git a/help/cuboid-help.pd b/help/cuboid-help.pd index edd04f184..f690709dd 100644 --- a/help/cuboid-help.pd +++ b/help/cuboid-help.pd @@ -1,75 +1,44 @@ #N canvas 289 160 710 363 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 584 224 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 589 263 pd gemwin; -#X msg 589 244 create; -#X text 585 223 Create window:; +#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 525 29 Example:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 452 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 310 Outlets:; #X text 21 323 Outlet 1: gemlist; -#X obj 522 82 cnv 15 160 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 522 82 cnv 15 160 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 525 95 draw line; #X msg 525 116 draw fill; #X msg 525 138 draw point; #X obj 593 54 gemhead; -#X floatatom 605 104 5 0 0 0 - - -; +#X floatatom 605 104 5 0 0 0 - - - 0; #X obj 593 179 cuboid; -#X floatatom 617 134 5 0 0 0 - - -; -#X floatatom 630 162 5 0 0 0 - - -; +#X floatatom 617 134 5 0 0 0 - - - 0; +#X floatatom 630 162 5 0 0 0 - - - 0; #X text 605 88 length; #X text 617 118 height; #X text 630 146 depth; #X text 63 167 dimensions of the cuboid (length width height); #X text 7 69 Description: Renders a cuboid box.; -#X text 16 86 The cuboid object renders a cuboid (box) at the current -position with current color. The dimensions of the cuboid can be changed -via the last three inlets.; +#X text 16 86 The cuboid object renders a cuboid (box) at the current position with current color. The dimensions of the cuboid can be changed via the last three inlets.; #X text 33 14 Synopsis: [cuboid]; #X text 27 260 Inlet 2: float: length (dimX); #X text 27 275 Inlet 3: float: height (dimY); #X text 27 289 Inlet 4: float: depth (dimZ); #X text 65 181 default: 1 1 0; #X obj 588 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 23 0; -#X connect 19 0 23 0; -#X connect 20 0 23 0; -#X connect 21 0 23 0; -#X connect 22 0 23 1; -#X connect 24 0 23 2; -#X connect 25 0 23 3; +#X obj 595 244 _gemwin; +#X connect 14 0 19 0; +#X connect 15 0 19 0; +#X connect 16 0 19 0; +#X connect 17 0 19 0; +#X connect 18 0 19 1; +#X connect 20 0 19 2; +#X connect 21 0 19 3; diff --git a/help/curve-help.pd b/help/curve-help.pd index 7a0811ae1..500d7713b 100644 --- a/help/curve-help.pd +++ b/help/curve-help.pd @@ -2,72 +2,37 @@ #X declare -lib Gem; #X text 54 30 Class: geometric object; #X text 475 39 Example:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 180 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 452 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 358 Outlets:; #X text 21 371 Outlet 1: gemlist; -#X obj 469 58 cnv 15 200 295 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 568 359 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy \, reset; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 573 398 pd gemwin; -#X msg 573 379 create; -#X text 569 358 Create window:; -#X obj 474 112 cnv 15 190 200 empty empty empty 20 12 0 14 -85973 -66577 -0; -#X obj 521 319 cnv 15 100 30 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X text 21 138 Each (additional) inlet will accept an X Y Z point which -is where the control point will be.; +#X obj 469 58 cnv 15 200 295 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 474 112 cnv 15 190 200 empty empty empty 20 12 0 14 #50fc50 #404040 0; +#X obj 521 319 cnv 15 100 30 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X text 21 138 Each (additional) inlet will accept an X Y Z point which is where the control point will be.; #X text 28 323 Inlet 2: list: 3(XYZ) float values; #X text 28 344 Inlet N: list: 3(XYZ) float values; #X text 52 330 ...; #X text 33 14 Synopsis: [curve]; #X text 7 69 Description: Renders a bezier-curve; #X text 63 187 number of control-points of the curve (mandatory); -#X text 27 247 Inlet 1: message: draw [line|linestrip|fill|point|tri|tristrip|trifan|quad|quadstrip] -; -#X text 22 88 [curve] creates a bezier curve. The initial argument -is the number of control-points of the curve. There is no maximum number -of control-points.; -#X text 27 306 Inlet 1: message: res : interpolation-resolution(30) -; +#X text 27 247 Inlet 1: message: draw [line|linestrip|fill|point|tri|tristrip|trifan|quad|quadstrip]; +#X text 22 88 [curve] creates a bezier curve. The initial argument is the number of control-points of the curve. There is no maximum number of control-points.; +#X text 27 306 Inlet 1: message: res : interpolation-resolution(30); #X text 27 293 Inlet 1: message: width : line-width(1); -#X obj 596 233 cnv 15 65 75 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 596 233 cnv 15 65 75 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 479 163 draw line; #X msg 479 118 draw fill; #X msg 479 140 draw point; #X obj 537 64 gemhead; #X msg 585 115 1 1 0; #X msg 593 135 1 -1 0; -#X floatatom 605 196 5 0 0 0 - - -; +#X floatatom 605 196 5 0 0 0 - - - 0; #X msg 603 175 -2 1 0; #X msg 599 155 -1 -1 -3; #X msg 479 183 draw linestrip; @@ -77,38 +42,37 @@ of control-points.; #X msg 478 269 draw quad; #X msg 478 291 draw quadstrip; #X obj 537 88 rotateXYZ; -#X floatatom 595 65 5 0 0 0 - - -; -#X obj 537 326 curve 5; +#X floatatom 595 65 5 0 0 0 - - - 0; +#X obj 537 326 curve 5, f 12; #X obj 608 89 loadbang; -#X floatatom 599 237 5 0 10 0 - - -; +#X floatatom 599 237 5 0 10 0 - - - 0; #X msg 599 253 width \$1; -#X floatatom 600 274 5 0 100 0 - - -; +#X floatatom 600 274 5 0 100 0 - - - 0; #X msg 600 291 res \$1; #X msg 605 213 \$1 \$1 \$1; #X obj 569 8 declare -lib Gem; -#X connect 13 0 14 0; -#X connect 14 0 13 0; -#X connect 30 0 47 0; -#X connect 31 0 47 0; -#X connect 32 0 47 0; -#X connect 33 0 45 0; -#X connect 34 0 47 1; -#X connect 35 0 47 2; -#X connect 36 0 53 0; -#X connect 37 0 47 4; -#X connect 38 0 47 3; -#X connect 39 0 47 0; -#X connect 40 0 47 0; -#X connect 41 0 47 0; -#X connect 42 0 47 0; -#X connect 43 0 47 0; -#X connect 44 0 47 0; -#X connect 45 0 47 0; -#X connect 46 0 45 1; -#X connect 46 0 45 3; -#X connect 48 0 34 0; -#X connect 49 0 50 0; -#X connect 50 0 47 0; -#X connect 51 0 52 0; -#X connect 52 0 47 0; -#X connect 53 0 47 5; +#X obj 571 357 _gemwin; +#X connect 26 0 43 0; +#X connect 27 0 43 0; +#X connect 28 0 43 0; +#X connect 29 0 41 0; +#X connect 30 0 43 1; +#X connect 31 0 43 2; +#X connect 32 0 49 0; +#X connect 33 0 43 4; +#X connect 34 0 43 3; +#X connect 35 0 43 0; +#X connect 36 0 43 0; +#X connect 37 0 43 0; +#X connect 38 0 43 0; +#X connect 39 0 43 0; +#X connect 40 0 43 0; +#X connect 41 0 43 0; +#X connect 42 0 41 1; +#X connect 42 0 41 3; +#X connect 44 0 30 0; +#X connect 45 0 46 0; +#X connect 46 0 43 0; +#X connect 47 0 48 0; +#X connect 48 0 43 0; +#X connect 49 0 43 5; diff --git a/help/curve3d-help.pd b/help/curve3d-help.pd index 25307c6d5..be3b653e3 100644 --- a/help/curve3d-help.pd +++ b/help/curve3d-help.pd @@ -1,56 +1,19 @@ #N canvas 362 96 968 580 10; #X declare -lib Gem; #X text 145 42 Class: geometric object; -#X obj 13 64 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 13 212 cnv 15 450 220 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 13 64 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 13 212 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 17 214 Inlets:; -#X obj 13 173 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 13 173 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 22 172 Arguments:; #X text 32 229 Inlet 1: gemlist; #X text 14 401 Outlets:; #X text 28 413 Outlet 1: gemlist; #X text 146 24 Synopsis: [curve3d]; -#X obj 475 63 cnv 15 480 500 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 845 484 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 455 304 gemwin 0; -#X obj 132 182 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X obj 294 56 gemhead; -#X obj 294 76 world_light; -#X msg 207 155 lighting 1; -#X obj 207 134 loadbang; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 9 0; -#X connect 10 0 0 0; -#X connect 11 0 10 0; -#X restore 861 523 pd gemwin; -#X msg 861 504 create; -#X text 857 483 Create window:; -#X obj 796 74 cnv 15 150 150 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 796 234 cnv 15 150 150 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 486 74 cnv 15 300 310 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 475 63 cnv 15 480 500 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 796 74 cnv 15 150 150 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 796 234 cnv 15 150 150 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 486 74 cnv 15 300 310 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 519 175 draw line; #X msg 519 155 draw fill; #X msg 519 195 draw point; @@ -81,15 +44,14 @@ #X obj 490 344 s curve3d; #X text 660 139 of the curve; #X text 647 125 draw control point; -#X obj 486 398 cnv 15 300 150 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 486 398 cnv 15 300 150 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 494 407 gemhead; -#X floatatom 522 450 5 0 0 0 - - -; -#X floatatom 557 450 5 0 0 0 - - -; -#X floatatom 593 450 5 0 0 0 - - -; -#X floatatom 562 408 5 0 0 0 - - -; -#X floatatom 610 408 5 0 0 0 - - -; -#X floatatom 659 408 5 0 0 0 - - -; +#X floatatom 522 450 5 0 0 0 - - - 0; +#X floatatom 557 450 5 0 0 0 - - - 0; +#X floatatom 593 450 5 0 0 0 - - - 0; +#X floatatom 562 408 5 0 0 0 - - - 0; +#X floatatom 610 408 5 0 0 0 - - - 0; +#X floatatom 659 408 5 0 0 0 - - - 0; #X obj 494 471 rotateXYZ 0 0 0; #X obj 494 428 translateXYZ -2.5 -2.5 -2; #X obj 504 496 r curve3d; @@ -99,8 +61,7 @@ #X text 826 250 curve grid; #X text 28 389 Inlet 2: not used; #X text 32 243 Inlet 1: message: draw [line|fill|point|...]; -#X obj 13 443 cnv 15 450 120 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 13 443 cnv 15 450 120 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 253 49 691 493 forme2 0; #N canvas 0 0 353 257 tripleRnd 0; #X obj 12 63 random 100; @@ -1107,10 +1068,8 @@ #X connect 51 0 24 0; #X connect 52 0 25 0; #X restore 136 509 pd forme2; -#X obj 136 490 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 57 490 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 136 490 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X obj 57 490 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 253 49 697 499 forme1 0; #X obj 76 418 outlet; #X obj 36 15 inlet; @@ -1570,9 +1529,9 @@ #X text 77 489 shape1; #X text 156 489 shape2; #X obj 57 469 loadbang; -#X floatatom 214 464 5 0 0 0 - - -; +#X floatatom 214 464 5 0 0 0 - - - 0; #X msg 214 506 set 3 2 \$1 \$2 \$3; -#X floatatom 247 464 5 0 0 0 - - -; +#X floatatom 247 464 5 0 0 0 - - - 0; #N canvas 0 0 173 130 pak 0; #X obj 73 39 t b f; #X obj 108 39 t b f; @@ -1590,72 +1549,66 @@ #X connect 5 0 0 0; #X connect 6 0 1 0; #X restore 214 484 pd pak f f f; -#X floatatom 281 464 5 0 0 0 - - -; +#X floatatom 281 464 5 0 0 0 - - - 0; #X obj 214 532 s examples_shape; #X obj 136 532 s curve3d; #X obj 57 532 s curve3d; #X text 13 68 Description: Renders a 3d bezier curve.; #X text 68 183 size of the control matrix (default : 2 2); #X obj 494 521 curve3d 5 5; -#X text 276 3 Create a 3D bezier curve \, using a matrix of control -points; +#X text 276 3 Create a 3D bezier curve \, using a matrix of control points; #X text 31 336 Inlet 1 : message: set Mx My X Y Z; #X text 31 296 Inlet 1: message: grid X Y; #X text 31 259 Inlet 1: message: res X Y; -#X text 53 272 This message is use for changing the size of the control -matrix (X \, Y are 2 int); -#X text 52 310 This message is use for changing the subdivision of -the displayed curve (X Y are 2 int); -#X text 53 349 This message can be use to set the position of a control -point. (Mx \, My : position of the point in the matrix. X \, Y \, Z -: position of this control point; +#X text 53 272 This message is use for changing the size of the control matrix (X \, Y are 2 int); +#X text 52 310 This message is use for changing the subdivision of the displayed curve (X Y are 2 int); +#X text 53 349 This message can be use to set the position of a control point. (Mx \, My : position of the point in the matrix. X \, Y \, Z : position of this control point; #X text 21 447 examples :; -#X text 29 87 The curve3d object renders a curve at the current position -with current color or texture. The shape of the curve is controlled -from a matrix. Note that control points are not necessarily part of -the curve.; +#X text 29 87 The curve3d object renders a curve at the current position with current color or texture. The shape of the curve is controlled from a matrix. Note that control points are not necessarily part of the curve.; #X obj 848 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 18 0 45 0; -#X connect 19 0 45 0; -#X connect 20 0 45 0; -#X connect 21 0 45 0; -#X connect 22 0 45 0; -#X connect 23 0 45 0; -#X connect 24 0 45 0; -#X connect 25 0 45 0; -#X connect 26 0 45 0; -#X connect 27 0 42 0; -#X connect 28 0 42 0; -#X connect 29 0 42 0; -#X connect 30 0 42 0; -#X connect 31 0 42 0; -#X connect 32 0 43 0; -#X connect 33 0 44 0; -#X connect 34 0 43 0; -#X connect 35 0 44 0; -#X connect 36 0 44 0; -#X connect 37 0 43 0; -#X connect 38 0 43 0; -#X connect 39 0 44 0; -#X connect 49 0 57 0; -#X connect 50 0 56 1; -#X connect 51 0 56 2; -#X connect 52 0 56 3; -#X connect 53 0 57 1; -#X connect 54 0 57 2; -#X connect 55 0 57 3; -#X connect 56 0 83 0; -#X connect 57 0 56 0; -#X connect 58 0 83 0; -#X connect 66 0 79 0; -#X connect 67 0 66 0; -#X connect 68 0 69 0; -#X connect 69 0 80 0; -#X connect 72 0 68 0; -#X connect 73 0 76 0; -#X connect 74 0 78 0; -#X connect 75 0 76 1; -#X connect 76 0 74 0; -#X connect 77 0 76 2; +#X obj 863 486 _gemwin \; 0 \; 0 \; lighting 1; +#X obj 871 416 gemhead; +#X obj 871 439 world_light; +#X connect 14 0 41 0; +#X connect 15 0 41 0; +#X connect 16 0 41 0; +#X connect 17 0 41 0; +#X connect 18 0 41 0; +#X connect 19 0 41 0; +#X connect 20 0 41 0; +#X connect 21 0 41 0; +#X connect 22 0 41 0; +#X connect 23 0 38 0; +#X connect 24 0 38 0; +#X connect 25 0 38 0; +#X connect 26 0 38 0; +#X connect 27 0 38 0; +#X connect 28 0 39 0; +#X connect 29 0 40 0; +#X connect 30 0 39 0; +#X connect 31 0 40 0; +#X connect 32 0 40 0; +#X connect 33 0 39 0; +#X connect 34 0 39 0; +#X connect 35 0 40 0; +#X connect 45 0 53 0; +#X connect 46 0 52 1; +#X connect 47 0 52 2; +#X connect 48 0 52 3; +#X connect 49 0 53 1; +#X connect 50 0 53 2; +#X connect 51 0 53 3; +#X connect 52 0 79 0; +#X connect 53 0 52 0; +#X connect 54 0 79 0; +#X connect 62 0 75 0; +#X connect 63 0 62 0; +#X connect 64 0 65 0; +#X connect 65 0 76 0; +#X connect 68 0 64 0; +#X connect 69 0 72 0; +#X connect 70 0 74 0; +#X connect 71 0 72 1; +#X connect 72 0 70 0; +#X connect 73 0 72 2; +#X connect 91 0 92 0; diff --git a/help/cylinder-help.pd b/help/cylinder-help.pd index 0628d331c..8ec03ee01 100644 --- a/help/cylinder-help.pd +++ b/help/cylinder-help.pd @@ -1,72 +1,40 @@ #N canvas 291 154 674 345 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 47 cnv 15 180 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 544 224 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 549 263 pd gemwin; -#X msg 549 244 create; -#X text 545 223 Create window:; +#X obj 479 47 cnv 15 180 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 485 29 Example:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; #X text 27 261 Inlet 2: float: size; #X text 452 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 287 Outlets:; #X text 21 300 Outlet 1: gemlist; -#X obj 546 130 cnv 15 100 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 546 130 cnv 15 100 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 485 65 draw line; #X msg 485 86 draw fill; #X msg 485 108 draw point; #X obj 553 54 gemhead; -#X floatatom 575 144 5 0 0 2 size - -; +#X floatatom 575 144 5 0 0 2 size - - 0; #X obj 553 79 rotateXYZ 90 0 0; -#X floatatom 598 172 3 0 0 2 segments - -; +#X floatatom 598 172 3 0 0 2 segments - - 0; #X text 27 272 Inlet 3: int: number of segments; #X text 33 14 Synopsis: [cylinder]; #X obj 553 189 cylinder; #X text 7 69 Description: Renders a cylinder.; -#X text 14 86 The cylinder object renders a cylinder at the current -position with current color. The look of the cylinder can be changed -with the draw message \, its size can be changed via the second inlet. -; +#X text 14 86 The cylinder object renders a cylinder at the current position with current color. The look of the cylinder can be changed with the draw message \, its size can be changed via the second inlet.; #X text 63 167 size of the cylinder \, segments; #X text 63 182 defaults: 1 \, 10; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; #X obj 558 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 27 0; -#X connect 19 0 27 0; -#X connect 20 0 27 0; -#X connect 21 0 23 0; -#X connect 22 0 27 1; -#X connect 23 0 27 0; -#X connect 24 0 27 2; +#X obj 561 241 _gemwin; +#X connect 14 0 23 0; +#X connect 15 0 23 0; +#X connect 16 0 23 0; +#X connect 17 0 19 0; +#X connect 18 0 23 1; +#X connect 19 0 23 0; +#X connect 20 0 23 2; diff --git a/help/depth-help.pd b/help/depth-help.pd index 38ddb56f5..765dc44c5 100644 --- a/help/depth-help.pd +++ b/help/depth-help.pd @@ -1,87 +1,47 @@ #N canvas 15 61 724 431 10; #X declare -lib Gem; -#X obj 17 299 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 17 299 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 28 302 Inlets:; #X text 28 339 Outlets:; -#X obj 17 264 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 17 264 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 26 263 Arguments:; -#X obj 17 69 cnv 15 430 190 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 17 69 cnv 15 430 190 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 46 352 Outlet 1: gemlist; #X text 52 316 Inlet 1: gemlist; #X text 466 15 GEM object; -#X obj 459 77 cnv 15 250 300 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 459 77 cnv 15 250 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 463 60 Example:; -#X obj 604 313 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 16 419 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 268 112 destroy; -#X msg 132 112 create \, 1; -#X obj 264 174 gemhead; -#X obj 264 200 world_light; -#X obj 238 68 r \$0-gemwin; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 9 0; -#X connect 10 0 0 0; -#X restore 609 352 pd gemwin; -#X msg 609 333 create; -#X text 605 312 Create window:; -#X obj 460 106 cnv 15 240 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 460 106 cnv 15 240 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 461 84 gemhead 51; #X obj 461 172 depth; #X text 60 22 Synopsis: [depth]; #X text 81 41 Class: manips object; #X text 27 72 Description: Activate / Deactivate depth test; -#X text 26 93 [depth] turns on and off depth test (also known as Z-buffering). -This is very useful if you are in single-buffer mode \, because then -a painting effect can be achieved. In double-buffered mode \, you probably -do not want to turn off the depth test \, unless you have taken control -of the rendering order by setting the priority of each gemhead (see -the gemhead example for explanation).; -#X obj 496 114 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X text 26 189 By default \, this object will turn OFF depth buffering -for the objects "below".; +#X text 26 93 [depth] turns on and off depth test (also known as Z-buffering). This is very useful if you are in single-buffer mode \, because then a painting effect can be achieved. In double-buffered mode \, you probably do not want to turn off the depth test \, unless you have taken control of the rendering order by setting the priority of each gemhead (see the gemhead example for explanation).; +#X obj 496 114 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 26 189 By default \, this object will turn OFF depth buffering for the objects "below".; #X text 72 274 float (0/1) : depth test on/off; #X text 52 329 Inlet 1: float (0/1) : depth test on/off; #X obj 461 293 cube; #X obj 461 260 rotateXYZ 0 30 30; -#X floatatom 560 239 5 0 0 0 - - -; -#X floatatom 494 202 5 0 0 0 - - -; -#X floatatom 527 218 5 0 0 0 - - -; -#X obj 607 210 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X floatatom 560 239 5 0 0 0 - - - 0; +#X floatatom 494 202 5 0 0 0 - - - 0; +#X floatatom 527 218 5 0 0 0 - - - 0; +#X obj 607 210 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 607 229 lighting \$1; -#X obj 607 252 s \$0-gemwin; #X text 630 210 lighting; #X text 516 113 turn depth test on/off; #X obj 608 8 declare -lib Gem; +#X obj 607 326 _gemwin; +#X obj 622 274 gemhead; +#X obj 622 297 world_light; #X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 16 0 17 0; -#X connect 17 0 27 0; -#X connect 22 0 17 0; -#X connect 27 0 26 0; -#X connect 28 0 27 3; -#X connect 29 0 27 1; -#X connect 30 0 27 2; -#X connect 31 0 32 0; -#X connect 32 0 33 0; +#X connect 13 0 23 0; +#X connect 18 0 13 0; +#X connect 23 0 22 0; +#X connect 24 0 23 3; +#X connect 25 0 23 1; +#X connect 26 0 23 2; +#X connect 27 0 28 0; +#X connect 28 0 32 0; +#X connect 33 0 34 0; diff --git a/help/diffuse-help.pd b/help/diffuse-help.pd index cbaecb2e2..373d5a7a1 100644 --- a/help/diffuse-help.pd +++ b/help/diffuse-help.pd @@ -1,46 +1,18 @@ -#N canvas 61 61 630 385 10; +#N canvas 61 61 636 395 10; #X declare -lib Gem; #X text 432 8 GEM object; -#X obj 8 196 cnv 15 430 180 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 34 198 Inlets:; #X text 58 211 Inlet 1: gemlist; #X text 34 252 Outlets:; #X text 52 265 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 193 cube; #X obj 500 192 gemhead; @@ -51,20 +23,17 @@ #X text 50 12 Synopsis: [diffuse]; #X text 29 77 Description: diffuse colouring; #X text 61 170 defaults: 0.8 0.8 0.8 1; -#X text 22 91 [diffuse] accepts a gemList and sets the diffuse-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; -#X floatatom 561 190 5 0 0 0 - - -; +#X text 22 91 [diffuse] accepts a gemList and sets the diffuse-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; +#X floatatom 561 190 5 0 0 0 - - - 0; #X obj 500 211 rotate 66 1 0 0; #X obj 451 156 diffuse 0 1 0; #X obj 451 355 diffuseRGB; #X text 448 332 see also:; #X obj 508 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 30 0; -#X connect 19 0 29 0; -#X connect 22 0 30 1; -#X connect 28 0 29 1; -#X connect 29 0 20 0; -#X connect 30 0 18 0; +#X obj 525 253 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 26 0; +#X connect 15 0 25 0; +#X connect 18 0 26 1; +#X connect 24 0 25 1; +#X connect 25 0 16 0; +#X connect 26 0 14 0; diff --git a/help/diffuseRGB-help.pd b/help/diffuseRGB-help.pd index 7f5a97deb..91fc44a89 100644 --- a/help/diffuseRGB-help.pd +++ b/help/diffuseRGB-help.pd @@ -1,46 +1,18 @@ #N canvas 61 61 632 388 10; #X declare -lib Gem; #X text 432 8 GEM object; -#X obj 8 196 cnv 15 430 180 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 292 Outlets:; #X text 57 305 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 193 cube; #X obj 500 192 gemhead; @@ -50,28 +22,25 @@ #X text 63 244 Inlet 3: float: green value; #X text 63 259 Inlet 4: float: blue value; #X text 63 274 Inlet 5: float: alpha value; -#X floatatom 477 122 3 0 1 0 - - -; -#X floatatom 504 122 3 0 1 0 - - -; -#X floatatom 531 122 3 0 1 0 - - -; -#X floatatom 558 122 3 0 1 0 - - -; +#X floatatom 477 122 3 0 1 0 - - - 0; +#X floatatom 504 122 3 0 1 0 - - - 0; +#X floatatom 531 122 3 0 1 0 - - - 0; +#X floatatom 558 122 3 0 1 0 - - - 0; #X text 50 12 Synopsis: [diffuseRGB]; #X text 29 77 Description: diffuse colouring; -#X text 22 91 [diffuseRGB] accepts a gemList and sets the diffuse-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; +#X text 22 91 [diffuseRGB] accepts a gemList and sets the diffuse-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X obj 451 156 diffuseRGB 0 1 0; #X text 60 171 defaults: 0.8 0.8 0.8 1; #X obj 500 211 rotate 63 1 0 0; #X text 447 331 see also:; #X obj 449 353 diffuse; #X obj 508 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 33 0; -#X connect 19 0 35 0; -#X connect 26 0 33 1; -#X connect 27 0 33 2; -#X connect 28 0 33 3; -#X connect 29 0 33 4; -#X connect 33 0 18 0; -#X connect 35 0 20 0; +#X obj 529 257 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 29 0; +#X connect 15 0 31 0; +#X connect 22 0 29 1; +#X connect 23 0 29 2; +#X connect 24 0 29 3; +#X connect 25 0 29 4; +#X connect 29 0 14 0; +#X connect 31 0 16 0; diff --git a/help/disk-help.pd b/help/disk-help.pd index 0219f1163..d423478ba 100644 --- a/help/disk-help.pd +++ b/help/disk-help.pd @@ -1,74 +1,41 @@ #N canvas 291 154 667 345 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 47 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 544 224 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 549 263 pd gemwin; -#X msg 549 244 create; -#X text 545 223 Create window:; +#X obj 479 47 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 485 29 Example:; -#X obj 7 65 cnv 15 450 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 166 cnv 15 450 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 166 cnv 15 450 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 165 Arguments:; #X text 452 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 307 Outlets:; #X text 21 320 Outlet 1: gemlist; -#X obj 481 81 cnv 15 165 140 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 481 81 cnv 15 165 140 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 485 95 draw line; #X msg 485 116 draw fill; #X msg 485 138 draw point; #X obj 553 54 gemhead; -#X floatatom 564 102 5 0 0 1 R - -; -#X floatatom 576 122 3 0 0 1 segments - -; -#X floatatom 589 147 5 0 0 1 r - -; +#X floatatom 564 102 5 0 0 1 R - - 0; +#X floatatom 576 122 3 0 0 1 segments - - 0; +#X floatatom 589 147 5 0 0 1 r - - 0; #X text 27 261 Inlet 2: float: size (= outer radius); #X text 33 14 Synopsis: [disk]; #X text 7 69 Description: Renders a disk.; -#X text 14 86 The disk object renders a flat disk with a hole in the -middle at the current position with current color. The look of the -disk can be changed with the draw message \, its size can be changed -via the second inlet \, the size of the hole via the third inlet.; +#X text 14 86 The disk object renders a flat disk with a hole in the middle at the current position with current color. The look of the disk can be changed with the draw message \, its size can be changed via the second inlet \, the size of the hole via the third inlet.; #X text 26 286 Inlet 4: float: inner radius (default:0); #X obj 553 199 disk 1; #X text 27 273 Inlet 3: int: number of segments (default:10); -#X text 28 177 disk size(=outer radius) \, segments \, hole size(=inner -radius); +#X text 28 177 disk size(=outer radius) \, segments \, hole size(=inner radius); #X text 29 191 defaults: 1 \, 10 \, 0; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; #X obj 548 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 17 0 29 0; -#X connect 18 0 29 0; -#X connect 19 0 29 0; -#X connect 20 0 29 0; -#X connect 21 0 29 1; -#X connect 22 0 29 2; -#X connect 23 0 29 3; +#X obj 557 241 _gemwin; +#X connect 13 0 25 0; +#X connect 14 0 25 0; +#X connect 15 0 25 0; +#X connect 16 0 25 0; +#X connect 17 0 25 1; +#X connect 18 0 25 2; +#X connect 19 0 25 3; diff --git a/help/emission-help.pd b/help/emission-help.pd index c84f8daeb..f19c4b7a1 100644 --- a/help/emission-help.pd +++ b/help/emission-help.pd @@ -1,51 +1,18 @@ #N canvas 61 61 639 342 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 252 Outlets:; #X text 57 265 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 200 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 200 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 510 209 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X msg 277 206 lighting \$1; -#X obj 313 182 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X connect 9 0 8 0; -#X restore 515 248 pd gemwin; -#X msg 515 229 create; -#X text 511 208 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 193 cube; #X text 62 156 a list of 3 (RGB) or 4 (RGBA) float-values.; @@ -55,14 +22,11 @@ #X text 50 12 Synopsis: [emission]; #X obj 451 156 emission 0 1 0; #X text 29 77 Description: emission colouring; -#X text 21 91 [emission] accepts a gemList and sets the emission-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; +#X text 21 91 [emission] accepts a gemList and sets the emission-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 448 285 see also:; #X obj 450 308 emissionRGB; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 24 0; -#X connect 20 0 24 1; -#X connect 24 0 18 0; +#X obj 527 206 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 20 0; +#X connect 16 0 20 1; +#X connect 20 0 14 0; diff --git a/help/emissionRGB-help.pd b/help/emissionRGB-help.pd index ee74e0eb3..67aa64118 100644 --- a/help/emissionRGB-help.pd +++ b/help/emissionRGB-help.pd @@ -1,46 +1,18 @@ #N canvas 61 61 639 342 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 63 211 Inlet 1: gemlist; #X text 39 292 Outlets:; #X text 57 305 Outlet 1: gemlist; -#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 200 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 200 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 509 208 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 514 247 pd gemwin; -#X msg 514 228 create; -#X text 510 207 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 193 cube; #X text 62 156 a list of 3 (RGB) or 4 (RGBA) float-values.; @@ -48,25 +20,22 @@ #X text 63 244 Inlet 3: float: green value; #X text 63 259 Inlet 4: float: blue value; #X text 63 274 Inlet 5: float: alpha value; -#X floatatom 479 122 3 0 1 0 - - -; -#X floatatom 508 122 3 0 1 0 - - -; -#X floatatom 536 122 3 0 1 0 - - -; -#X floatatom 565 122 3 0 1 0 - - -; +#X floatatom 479 122 3 0 1 0 - - - 0; +#X floatatom 508 122 3 0 1 0 - - - 0; +#X floatatom 536 122 3 0 1 0 - - - 0; +#X floatatom 565 122 3 0 1 0 - - - 0; #X obj 451 156 emissionRGB 0 1 0; #X text 60 171 defaults: 0 0 0 1; #X text 29 77 Description: emission colouring; #X text 50 12 Synopsis: [emissionRGB]; -#X text 22 91 [emissionRGB] accepts a gemList and sets the emission-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; +#X text 22 91 [emissionRGB] accepts a gemList and sets the emission-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 449 284 see also:; #X obj 451 307 emission; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 28 0; -#X connect 24 0 28 1; -#X connect 25 0 28 2; -#X connect 26 0 28 3; -#X connect 27 0 28 4; -#X connect 28 0 18 0; +#X obj 509 198 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 24 0; +#X connect 20 0 24 1; +#X connect 21 0 24 2; +#X connect 22 0 24 3; +#X connect 23 0 24 4; +#X connect 24 0 14 0; diff --git a/help/fragment_program-help.pd b/help/fragment_program-help.pd index a3a486121..19103910c 100644 --- a/help/fragment_program-help.pd +++ b/help/fragment_program-help.pd @@ -1,52 +1,22 @@ #N canvas 35 199 651 458 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 335 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 335 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 334 Inlets:; #X text 10 386 Outlets:; -#X obj 8 296 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 296 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 295 Arguments:; -#X obj 7 76 cnv 15 430 210 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 444 77 cnv 15 200 230 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 444 77 cnv 15 200 230 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 474 334 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 479 373 pd gemwin; -#X msg 479 354 create; -#X text 475 333 Create window:; -#X obj 450 178 cnv 15 190 70 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 178 cnv 15 190 70 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 63 306 ; #X text 28 399 Outlet 1: gemlist; #X text 35 346 Inlet 1: gemlist; -#X obj 10 211 cnv 15 420 70 empty empty empty 20 12 0 14 -225280 -66577 -0; +#X obj 10 211 cnv 15 420 70 empty empty empty 20 12 0 14 #d8fcfc #404040 0; #X text 71 31 Class: shader object; -#X obj 516 184 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 516 184 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 75 103 openpanel; #X obj 75 173 outlet; @@ -59,30 +29,22 @@ #X connect 3 0 1 0; #X connect 4 0 0 0; #X restore 459 183 pd open; -#X text 14 219 IMPORTANT NOTE: your openGL-implementation (gfx-card -driver \, ...) has to support either (or both) the ARB shader extensions -or the NV shader extensions in order to make use of this object.; -#X text 10 176 Of course \, you also have to supply anything else needed -for the shader to work (like textures \, ...); +#X text 14 219 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support either (or both) the ARB shader extensions or the NV shader extensions in order to make use of this object.; +#X text 10 176 Of course \, you also have to supply anything else needed for the shader to work (like textures \, ...); #X obj 451 266 teapot; #X msg 459 203 open examples/data/random.fp; #X text 50 12 Synopsis: [fragment_program]; #X text 12 76 Description: load and apply an ARB fragment shader; -#X text 24 95 [fragment_program] loads and applies an ARB (or NV) fragment -shader.; -#X text 11 123 If you want to modify the parameters of the shader-program -\, you have to set the modification up yourself \, via [GEMglProgramEnvParameter*] -working on GL_FRAGMENT_PROGRAM_ARB.; -#X text 35 358 Inlet 1: message: open : fragment shader -program to load; +#X text 24 95 [fragment_program] loads and applies an ARB (or NV) fragment shader.; +#X text 11 123 If you want to modify the parameters of the shader-program \, you have to set the modification up yourself \, via [GEMglProgramEnvParameter*] working on GL_FRAGMENT_PROGRAM_ARB.; +#X text 35 358 Inlet 1: message: open : fragment shader program to load; #X text 443 406 see also; #X obj 508 406 vertex_program; #X obj 451 226 fragment_program random.fp; #X obj 538 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 33 0; -#X connect 20 0 21 0; -#X connect 21 0 25 0; -#X connect 25 0 33 0; -#X connect 33 0 24 0; +#X obj 547 330 _gemwin; +#X connect 10 0 29 0; +#X connect 16 0 17 0; +#X connect 17 0 21 0; +#X connect 21 0 29 0; +#X connect 29 0 20 0; diff --git a/help/gemcubeframebuffer-help.pd b/help/gemcubeframebuffer-help.pd index d324b4fa6..094f2e782 100644 --- a/help/gemcubeframebuffer-help.pd +++ b/help/gemcubeframebuffer-help.pd @@ -1,59 +1,13 @@ #N canvas 584 161 745 692 10; #X declare -lib Gem; -#X obj 482 415 cnv 15 90 40 empty empty empty 20 12 0 14 -257985 -66577 -0; -#X obj 175 337 cnv 15 90 60 empty empty empty 20 12 0 14 -257985 -66577 -0; -#X obj 174 147 cnv 15 180 25 empty empty pre 2 12 0 14 -4032 -1 0; -#X obj 174 257 cnv 15 180 25 empty empty post 2 12 0 14 -4032 -1 0 -; -#X obj 20 571 cnv 15 600 30 empty empty empty 20 12 0 14 -260097 -66577 -0; -#X obj 27 92 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 234 575 448 300 gemwin 0; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 271 113 destroy; -#X msg 146 71 set create; -#X obj 67 41 route create; -#X msg 311 80 lighting \$1; -#X obj 311 56 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X msg 198 32 dimen 1024 768; -#X msg 190 10 dimen 1280 1024; -#X msg 132 112 create \, 1 \, view 0 0 3; -#X obj 86 132 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 342 29 inlet; -#X obj 132 149 gemwin; -#X obj 3 11 loadbang; -#X obj 217 197 gemhead 80; -#X obj 217 224 world_light; -#X connect 1 0 5 0; -#X connect 2 0 0 0; -#X connect 3 0 13 0; -#X connect 4 0 0 0; -#X connect 5 0 2 0; -#X connect 5 0 10 0; -#X connect 5 1 4 0; -#X connect 5 1 3 0; -#X connect 6 0 13 0; -#X connect 7 0 6 0; -#X connect 8 0 13 0; -#X connect 9 0 13 0; -#X connect 10 0 13 0; -#X connect 11 0 13 0; -#X connect 12 0 13 0; -#X connect 14 0 4 0; -#X connect 15 0 16 0; -#X restore 32 131 pd gemwin; -#X msg 32 109 create; -#X obj 174 225 cnv 15 180 30 empty empty empty 20 12 0 14 -4034 -66577 -0; -#X obj 184 24 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 482 415 cnv 15 90 40 empty empty empty 20 12 0 14 #f8fc00 #404040 0; +#X obj 175 337 cnv 15 90 60 empty empty empty 20 12 0 14 #f8fc00 #404040 0; +#X obj 174 147 cnv 15 180 25 empty empty pre 2 12 0 14 #00f8fc #000000 0; +#X obj 174 257 cnv 15 180 25 empty empty post 2 12 0 14 #00f8fc #000000 0; +#X obj 20 571 cnv 15 600 30 empty empty empty 20 12 0 14 #fc8000 #404040 0; +#X obj 27 72 cnv 15 100 90 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 174 225 cnv 15 180 30 empty empty empty 20 12 0 14 #00fc04 #404040 0; +#X obj 184 24 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 184 68 alpha; #N canvas 974 317 450 481 draw_6_faces 0; #X msg 177 365 face \$1; @@ -115,10 +69,10 @@ #X obj 81 47 inlet num_face; #X obj 50 9 inlet head; #X obj 50 304 outlet head; -#X floatatom 163 186 5 0 0 0 - - -; -#X floatatom 89 245 5 0 0 0 - - -; -#X floatatom 148 250 5 0 0 0 - - -; -#X floatatom 57 253 5 0 0 0 - - -; +#X floatatom 163 186 5 0 0 0 - - - 0; +#X floatatom 89 245 5 0 0 0 - - - 0; +#X floatatom 148 250 5 0 0 0 - - - 0; +#X floatatom 57 253 5 0 0 0 - - - 0; #X obj 50 216 rotateXYZ 0 90 0; #X obj 50 280 rotateXYZ -90 0 90; #X connect 0 0 15 1; @@ -156,10 +110,9 @@ #X obj 156 300 change; #X obj 138 191 change; #X msg 138 409 link \$1 \$2; -#X floatatom 156 324 2 0 0 0 ID - -; -#X floatatom 138 214 2 0 0 0 ID - -; -#X obj 120 60 tgl 15 0 \$0-shadOn-snd \$0-shadOn-rcv on/off 17 7 0 -10 -262144 -1 -1 1 1; +#X floatatom 156 324 2 0 0 0 ID - - 0; +#X floatatom 138 214 2 0 0 0 ID - - 0; +#X obj 120 60 tgl 15 0 \$0-shadOn-snd \$0-shadOn-rcv on/off 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 21 59 inlet gemlist; #X obj 21 489 outlet gemlist; #X msg 87 139 open \$1.vert; @@ -230,8 +183,7 @@ #X obj 326 575 sphere 4 50; #X obj 223 530 == 1; #X obj 39 553 translateXYZ 0 0 -7; -#X obj 33 184 vradio 20 1 0 4 empty empty empty 0 -8 0 10 -257985 -1 --1 3; +#X obj 33 184 vradio 20 1 0 4 empty empty empty 0 -8 0 10 #f8fc00 #000000 #000000 0; #X text 55 185 scene; #X text 55 204 equirectangular; #X text 55 224 mapped to sphere; @@ -246,11 +198,9 @@ #X obj 211 288 s \$0-sceneHead; #X obj 39 575 s \$0-sceneHead; #X msg 92 51 lighting \$1; -#X obj 92 27 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 -; -#X text 28 88 1:Create window; -#X obj 404 259 cnv 15 120 60 empty empty empty 20 12 0 14 -257985 -66577 -0; +#X obj 92 27 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 30 72 1:Create window; +#X obj 404 259 cnv 15 120 60 empty empty empty 20 12 0 14 #f8fc00 #404040 0; #N canvas 801 163 632 578 draw_scene 0; #X obj 243 285 rotateXYZ; #X obj 402 84 f; @@ -277,15 +227,14 @@ #X obj 390 386 + 1; #X obj 418 387 * -1; #X obj 418 414 + 1; -#X floatatom 320 341 5 0 0 0 - - -; +#X floatatom 320 341 5 0 0 0 - - - 0; #X obj 63 218 color 0.8 0.2 0.2; #X obj 243 218 color 0.2 0.8 0.2; #X obj 242 385 color 0.8 0.8 0.2; #X obj 62 385 color 0.2 0.2 0.8; #X obj 402 16 loadbang; -#X obj 402 40 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; -#X floatatom 156 320 5 0 0 0 - - -; +#X obj 402 40 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 156 320 5 0 0 0 - - - 0; #X obj 185 34 inlet; #X obj 185 88 rotateXYZ 0 0 0; #X obj 488 187 separator; @@ -355,8 +304,7 @@ #X restore 409 294 pd draw_scene; #X obj 409 265 r \$0-sceneHead; #X text 30 165 Show:; -#X obj 553 178 hsl 128 15 0 1 0 0 empty empty background_opacity -2 --8 0 10 -262144 -1 -1 0 1; +#X obj 553 178 hsl 128 15 0 1 0 0 empty empty background_opacity -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X msg 550 199 color 0 0.1 0.2 \$1; #X msg 225 199 dimen 512 512 \, format RGBA \, color 0 0.1 0.2 1; #X text 14 630 Antoine Rousseau nov 2015; @@ -373,10 +321,9 @@ #X obj 156 300 change; #X obj 138 191 change; #X msg 138 409 link \$1 \$2; -#X floatatom 156 324 2 0 0 0 ID - -; -#X floatatom 138 214 2 0 0 0 ID - -; -#X obj 120 60 tgl 15 0 \$0-shadOn-snd \$0-shadOn-rcv on/off 17 7 0 -10 -262144 -1 -1 1 1; +#X floatatom 156 324 2 0 0 0 ID - - 0; +#X floatatom 138 214 2 0 0 0 ID - - 0; +#X obj 120 60 tgl 15 0 \$0-shadOn-snd \$0-shadOn-rcv on/off 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 21 59 inlet gemlist; #X obj 21 489 outlet gemlist; #X msg 87 139 open \$1.vert; @@ -455,60 +402,62 @@ #X obj 184 46 gemhead; #X text 55 245 mapped to cube; #X obj 608 8 declare -lib Gem; -#X connect 6 0 7 0; -#X connect 7 0 6 0; -#X connect 9 0 74 0; -#X connect 10 0 15 0; -#X connect 11 0 13 0; -#X connect 11 1 12 1; -#X connect 12 0 40 0; -#X connect 13 0 12 0; -#X connect 13 1 17 1; -#X connect 14 0 51 0; -#X connect 15 0 18 0; -#X connect 15 1 19 0; -#X connect 16 0 24 0; -#X connect 16 0 39 0; -#X connect 17 0 16 0; -#X connect 17 0 59 0; -#X connect 18 0 17 0; -#X connect 18 0 37 0; -#X connect 19 0 11 0; -#X connect 20 0 56 0; -#X connect 23 0 25 0; -#X connect 24 0 21 0; -#X connect 26 0 24 1; -#X connect 27 0 41 0; -#X connect 28 0 33 0; -#X connect 32 0 26 0; -#X connect 34 0 38 0; -#X connect 35 0 36 0; +#X obj 34 90 _gemwin \; 0 \; 0 \; view 0 0 3; +#X obj 635 74 world_light; +#X obj 635 51 gemhead 80; +#X connect 7 0 72 0; +#X connect 8 0 13 0; +#X connect 9 0 11 0; +#X connect 9 1 10 1; +#X connect 10 0 38 0; +#X connect 11 0 10 0; +#X connect 11 1 15 1; +#X connect 12 0 49 0; +#X connect 13 0 16 0; +#X connect 13 1 17 0; +#X connect 14 0 22 0; +#X connect 14 0 37 0; +#X connect 15 0 14 0; +#X connect 15 0 57 0; +#X connect 16 0 15 0; +#X connect 16 0 35 0; +#X connect 17 0 9 0; +#X connect 18 0 54 0; +#X connect 21 0 23 0; +#X connect 22 0 19 0; +#X connect 24 0 22 1; +#X connect 25 0 39 0; +#X connect 26 0 31 0; +#X connect 30 0 24 0; +#X connect 32 0 36 0; +#X connect 33 0 34 0; +#X connect 34 0 35 1; +#X connect 35 0 25 0; #X connect 36 0 37 1; -#X connect 37 0 27 0; -#X connect 38 0 39 1; -#X connect 39 0 23 0; -#X connect 42 0 6 1; -#X connect 43 0 42 0; -#X connect 47 0 46 0; -#X connect 49 0 50 0; -#X connect 50 0 13 0; -#X connect 51 0 13 0; -#X connect 56 0 16 1; -#X connect 57 0 67 0; -#X connect 58 0 61 0; -#X connect 59 0 57 0; -#X connect 60 0 62 0; -#X connect 61 0 57 1; -#X connect 62 0 59 1; -#X connect 63 0 69 0; -#X connect 64 0 63 0; -#X connect 64 1 65 0; -#X connect 64 1 66 0; -#X connect 65 0 63 1; -#X connect 66 0 63 2; -#X connect 67 0 64 0; -#X connect 70 0 67 3; -#X connect 71 0 67 3; -#X connect 72 0 23 3; -#X connect 73 0 23 3; -#X connect 74 0 10 0; +#X connect 37 0 21 0; +#X connect 40 0 75 0; +#X connect 41 0 40 0; +#X connect 45 0 44 0; +#X connect 47 0 48 0; +#X connect 48 0 11 0; +#X connect 49 0 11 0; +#X connect 54 0 14 1; +#X connect 55 0 65 0; +#X connect 56 0 59 0; +#X connect 57 0 55 0; +#X connect 58 0 60 0; +#X connect 59 0 55 1; +#X connect 60 0 57 1; +#X connect 61 0 67 0; +#X connect 62 0 61 0; +#X connect 62 1 63 0; +#X connect 62 1 64 0; +#X connect 63 0 61 1; +#X connect 64 0 61 2; +#X connect 65 0 62 0; +#X connect 68 0 65 3; +#X connect 69 0 65 3; +#X connect 70 0 21 3; +#X connect 71 0 21 3; +#X connect 72 0 8 0; +#X connect 77 0 76 0; diff --git a/help/tube-help.pd b/help/tube-help.pd index f70838df1..0f2097fe2 100644 --- a/help/tube-help.pd +++ b/help/tube-help.pd @@ -1,67 +1,36 @@ -#N canvas 56 109 754 622 10; +#N canvas 877 124 754 622 10; #X declare -lib Gem; #X text 44 383 default = D1 and D2; #X text 54 27 Class: geometric object; -#X obj 479 47 cnv 15 250 550 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 484 533 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 454 304 gemwin 0; -#X obj 131 164 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 131 140 create \, 1 \, lighting 1; -#X obj 298 149 world_light; -#X obj 298 122 gemhead; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 9 0 8 0; -#X restore 489 572 pd gemwin; -#X msg 489 550 create; -#X text 485 532 Create window:; +#X obj 479 47 cnv 15 250 550 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 485 29 Example:; -#X obj 7 47 cnv 15 450 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 7 286 cnv 15 450 260 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 47 cnv 15 450 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 7 286 cnv 15 450 260 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 18 291 Inlets:; #X text 26 323 Inlet 1: message: draw [line|fill|point]; #X text 552 8 GEM object; #X text 26 308 Inlet 1: gemlist; #X text 8 498 Outlets:; #X text 19 511 Outlet 1: gemlist; -#X obj 484 141 cnv 15 240 380 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 484 141 cnv 15 240 380 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 494 54 gemhead; -#X floatatom 543 84 5 0 0 0 - - -; -#X obj 7 146 cnv 15 450 130 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X floatatom 543 84 5 0 0 0 - - - 0; +#X obj 7 146 cnv 15 450 130 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 494 111 rotateXYZ 135 0 0; #X msg 519 166 draw line; #X msg 528 188 draw fill; #X msg 537 210 width 1; #X msg 545 232 width 10; -#X floatatom 568 306 5 0 0 1 D1 - -; +#X floatatom 568 306 5 0 0 1 D1 - - 0; #X msg 510 144 draw point; -#X floatatom 578 325 5 0 0 1 D2 - -; -#X floatatom 588 344 5 0 0 1 H - -; -#X floatatom 598 363 5 0 0 1 Tx - -; -#X floatatom 606 382 5 0 0 1 Ty - -; -#X floatatom 614 401 5 0 0 1 R1x - -; -#X floatatom 623 420 5 0 0 1 R1y - -; -#X floatatom 632 439 5 0 0 1 R2x - -; -#X floatatom 641 458 5 0 0 1 R2y - -; +#X floatatom 578 325 5 0 0 1 D2 - - 0; +#X floatatom 588 344 5 0 0 1 H - - 0; +#X floatatom 598 363 5 0 0 1 Tx - - 0; +#X floatatom 606 382 5 0 0 1 Ty - - 0; +#X floatatom 614 401 5 0 0 1 R1x - - 0; +#X floatatom 623 420 5 0 0 1 R1y - - 0; +#X floatatom 632 439 5 0 0 1 R2x - - 0; +#X floatatom 641 458 5 0 0 1 R2y - - 0; #X obj 494 496 tube 0.5 0.9 2.5 30; #X text 33 11 Synopsis: [tube]; #X text 7 51 Description: Renders a complex tube; @@ -77,37 +46,37 @@ #X text 26 448 Inlet 8: Y rotation of 1st circle; #X text 26 480 Inlet 10: Y rotation of 2nd circle; #X text 26 465 Inlet 9: X rotation of 2nd circle; -#X floatatom 598 84 5 0 0 0 - - -; -#X floatatom 654 84 5 0 0 0 - - -; +#X floatatom 598 84 5 0 0 0 - - - 0; +#X floatatom 654 84 5 0 0 0 - - - 0; #X msg 558 278 numslices \$1; -#X floatatom 558 257 5 0 100 1 - - -; +#X floatatom 558 257 5 0 100 1 - - - 0; #X text 26 338 Inlet 1: message: numslices <#>; -#X text 7 72 The tube object generates a shape defined by 2 circles. -These 2 circles can be rotated and translated independently to create -different shapes.; +#X text 7 72 The tube object generates a shape defined by 2 circles. These 2 circles can be rotated and translated independently to create different shapes.; #X text 63 217 4 : number of segments; #X text 63 199 3 : height of the tube; #X obj 628 8 declare -lib Gem; -#X connect 4 0 5 0; -#X connect 5 0 4 0; -#X connect 17 0 20 0; -#X connect 18 0 20 1; -#X connect 20 0 35 0; -#X connect 21 0 35 0; -#X connect 22 0 35 0; -#X connect 23 0 35 0; -#X connect 24 0 35 0; -#X connect 25 0 35 1; -#X connect 26 0 35 0; -#X connect 27 0 35 2; -#X connect 28 0 35 3; -#X connect 29 0 35 4; -#X connect 30 0 35 5; -#X connect 31 0 35 6; -#X connect 32 0 35 7; -#X connect 33 0 35 8; -#X connect 34 0 35 9; -#X connect 50 0 20 2; -#X connect 51 0 20 3; -#X connect 52 0 35 0; -#X connect 53 0 52 0; +#X obj 513 527 _gemwin \; 0 \; 0 \; lighting 1; +#X obj 622 530 gemhead; +#X obj 622 553 world_light; +#X connect 13 0 16 0; +#X connect 14 0 16 1; +#X connect 16 0 31 0; +#X connect 17 0 31 0; +#X connect 18 0 31 0; +#X connect 19 0 31 0; +#X connect 20 0 31 0; +#X connect 21 0 31 1; +#X connect 22 0 31 0; +#X connect 23 0 31 2; +#X connect 24 0 31 3; +#X connect 25 0 31 4; +#X connect 26 0 31 5; +#X connect 27 0 31 6; +#X connect 28 0 31 7; +#X connect 29 0 31 8; +#X connect 30 0 31 9; +#X connect 46 0 16 2; +#X connect 47 0 16 3; +#X connect 48 0 31 0; +#X connect 49 0 48 0; +#X connect 56 0 57 0; From f5362c282a7e5d260a77d6b2d89813b6148f8bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 1 Mar 2024 09:14:00 +0100 Subject: [PATCH 110/387] add outlet for current rendering-state --- help/_gemwin.pd | 61 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/help/_gemwin.pd b/help/_gemwin.pd index e88afa11b..db6bf05b8 100644 --- a/help/_gemwin.pd +++ b/help/_gemwin.pd @@ -1,5 +1,5 @@ #N canvas 735 459 904 450 12; -#X obj 160 337 gemwin; +#X obj 297 337 gemwin; #X obj 102 121 cnv 25 25 25 empty empty empty 20 12 0 12 #000000 #404040 0; #X obj 104 123 tgl 21 0 \$0-tgl \$0-tgl create 25 10 0 12 #fcfcfc #000000 #000000 0 1; #N canvas 735 459 784 307 tgl 0; @@ -46,7 +46,7 @@ #X connect 19 1 18 0; #X connect 19 2 17 0; #X restore 364 149 pd tgl; -#X obj 160 310 r \$0-gemwin; +#X obj 160 280 r \$0-gemwin; #X obj 264 99 inlet; #X obj 264 124 t a a; #X obj 264 149 s \$0-gemwin; @@ -55,21 +55,72 @@ #X msg 482 59 bang; #X obj 537 149 route float; #X obj 538 174 t a a; -#X obj 538 199 s \$0-gemwin; -#X obj 160 362 outlet; +#X obj 538 239 s \$0-gemwin; +#X obj 297 362 outlet; #X obj 537 84 t b b; #X msg 664 108 reset; +#N canvas 0 0 524 388 args 0; +#X obj 78 113 list split 2; +#X obj 78 136 list split 1; +#X obj 59 90 t b a b; +#X obj 78 159 route float; +#X obj 112 187 route bang; +#X obj 59 256 pack 0 f s; +#X obj 271 191 unpack f s; +#X obj 59 283 route 0; +#X obj 59 306 unpack f s; +#X msg 116 213 symbol \$1; +#X msg 271 145 symbol; +#X msg 271 168 20 \$1; +#X obj 59 62 inlet args; +#X obj 59 329 outlet rate; +#X obj 151 329 outlet contextname; +#X text 52 22 taken from [gemwin]; +#X connect 0 0 1 0; +#X connect 0 2 1 0; +#X connect 1 0 3 0; +#X connect 1 1 4 0; +#X connect 2 0 5 0; +#X connect 2 1 0 0; +#X connect 2 2 10 0; +#X connect 3 0 5 1; +#X connect 3 1 4 0; +#X connect 4 1 9 0; +#X connect 5 0 7 0; +#X connect 6 0 5 1; +#X connect 6 1 5 2; +#X connect 7 0 8 0; +#X connect 8 0 13 0; +#X connect 8 1 14 0; +#X connect 9 0 5 2; +#X connect 10 0 11 0; +#X connect 11 0 6 0; +#X connect 12 0 2 0; +#X restore 663 156 pd args; +#X msg 663 181 frame \$1; +#X msg 742 183 context \$1; +#X text 745 208 ???; +#X obj 160 309 t a a, f 20; +#X obj 160 339 route float; +#X obj 160 363 outlet rendering; #X connect 0 0 14 0; -#X connect 4 0 0 0; +#X connect 4 0 21 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 6 1 3 0; #X connect 8 0 15 0; #X connect 9 0 11 0; +#X connect 9 1 17 0; #X connect 10 0 15 0; #X connect 11 1 12 0; #X connect 12 0 13 0; #X connect 15 0 9 0; #X connect 15 1 16 0; #X connect 16 0 13 0; +#X connect 17 0 18 0; +#X connect 17 1 19 0; +#X connect 18 0 13 0; +#X connect 21 0 22 0; +#X connect 21 1 0 0; +#X connect 22 0 23 0; #X coords 0 -1 1 1 85 46 1 100 100; From b6293f4c64be7b564b722565eec75fde4a2f12e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 1 Mar 2024 09:14:23 +0100 Subject: [PATCH 111/387] Update all help-patches except pix_* to use _gemwin --- help/GLdefine-help.pd | 63 ++----- help/gemhead-help.pd | 117 ++++-------- help/gemkeyboard-help.pd | 59 ++---- help/gemkeyname-help.pd | 66 ++----- help/gemlist-help.pd | 66 ++----- help/gemlist_info-help.pd | 253 +++++++++++-------------- help/gemlist_matrix-help.pd | 126 +++++-------- help/gemmouse-help.pd | 96 ++++------ help/gemvertexbuffer-help.pd | 339 ++++++++++++++-------------------- help/glsl_fragment-help.pd | 72 ++------ help/glsl_geometry-help.pd | 72 ++------ help/glsl_program-help.pd | 27 +-- help/glsl_vertex-help.pd | 69 ++----- help/imageVert-help.pd | 69 ++----- help/light-help.pd | 102 +++------- help/mesh_line-help.pd | 69 ++----- help/mesh_square-help.pd | 89 +++------ help/model-help.pd | 78 +++----- help/multimodel-help.pd | 67 ++----- help/newWave-help.pd | 155 ++++++---------- help/ortho-help.pd | 55 ++---- help/part_color-help.pd | 81 ++------ help/part_damp-help.pd | 84 ++------- help/part_draw-help.pd | 85 ++------- help/part_follow-help.pd | 83 ++------- help/part_gravity-help.pd | 81 ++------ help/part_head-help.pd | 87 ++------- help/part_info-help.pd | 92 +++------ help/part_killold-help.pd | 79 ++------ help/part_killslow-help.pd | 80 ++------ help/part_orbitpoint-help.pd | 81 ++------ help/part_render-help.pd | 87 ++------- help/part_sink-help.pd | 132 +++---------- help/part_size-help.pd | 88 +++------ help/part_source-help.pd | 132 +++---------- help/part_targetcolor-help.pd | 83 ++------- help/part_targetsize-help.pd | 83 ++------- help/part_velocity-help.pd | 125 ++----------- help/part_vertex-help.pd | 74 ++------ help/polygon-help.pd | 94 +++------- help/polygon_smooth-help.pd | 67 ++----- help/pqtorusknots-help.pd | 99 ++++------ help/primTri-help.pd | 90 +++------ help/rectangle-help.pd | 66 ++----- help/render_trigger-help.pd | 76 ++------ help/ripple-help.pd | 86 +++------ help/rotate-help.pd | 59 ++---- help/rotateXYZ-help.pd | 76 ++------ help/rubber-help.pd | 95 ++++------ help/scale-help.pd | 71 ++----- help/scaleXYZ-help.pd | 66 ++----- help/scopeXYZ~-help.pd | 146 ++++++--------- help/separator-help.pd | 133 +++++-------- help/shearXY-help.pd | 56 ++---- help/shearXZ-help.pd | 56 ++---- help/shearYX-help.pd | 56 ++---- help/shearYZ-help.pd | 58 ++---- help/shearZX-help.pd | 56 ++---- help/shearZY-help.pd | 56 ++---- help/shininess-help.pd | 63 ++----- help/slideSquares-help.pd | 59 ++---- help/specular-help.pd | 58 ++---- help/specularRGB-help.pd | 70 ++----- help/sphere-help.pd | 63 ++----- help/sphere3d-help.pd | 96 ++++------ help/spot_light-help.pd | 160 ++++++---------- help/square-help.pd | 58 ++---- help/surface3d-help.pd | 196 ++++++++------------ help/teapot-help.pd | 65 ++----- help/text2d-help.pd | 66 +++---- help/text3d-help.pd | 56 ++---- help/textextruded-help.pd | 50 ++--- help/textoutline-help.pd | 46 ++--- help/torus-help.pd | 69 ++----- help/translate-help.pd | 57 ++---- help/translateXYZ-help.pd | 61 ++---- help/trapezoid-help.pd | 65 ++----- help/triangle-help.pd | 59 ++---- help/tube-help.pd | 2 +- help/vertex_program-help.pd | 107 ++++------- help/world_light-help.pd | 98 +++------- 81 files changed, 1934 insertions(+), 4998 deletions(-) diff --git a/help/GLdefine-help.pd b/help/GLdefine-help.pd index 09235e0d3..e3e28bafc 100644 --- a/help/GLdefine-help.pd +++ b/help/GLdefine-help.pd @@ -1,67 +1,34 @@ #N canvas 78 61 701 310 10; #X declare -lib Gem; -#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 584 234 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 589 273 pd gemwin; -#X msg 589 254 create; -#X text 585 233 Create window:; +#X obj 519 47 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 525 29 Example:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 217 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 452 8 GEM object; #X text 11 266 Outlets:; -#X obj 522 71 cnv 15 150 140 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 522 71 cnv 15 150 140 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 530 192 GEMglBegin; #X obj 534 77 loadbang; #X text 54 30 Class: GEMgl object; #X text 33 14 Synopsis: [GLdefine]; -#X text 15 88 Send an OpenGL configuration constant to a GEMglBegin -to set up the OpenGL environment. These constants are defined in GL/gl.h -in the OpenGL C++ code.; -#X floatatom 584 167 5 0 0 0 - - -; +#X text 15 88 Send an OpenGL configuration constant to a GEMglBegin to set up the OpenGL environment. These constants are defined in GL/gl.h in the OpenGL C++ code.; +#X floatatom 584 167 5 0 0 0 - - - 0; #X text 29 229 Inlet 1: bang; #X text 23 279 Outlet 1: float; -#X text 14 137 for more \, see: http://www.glprogramming.com/blue/ch04.html -; +#X text 14 137 for more \, see: http://www.glprogramming.com/blue/ch04.html; #X text 7 69 Description: gets the value of a OpenGL constant; #X text 29 245 Inlet 1: message - the name of the constant; #X text 17 175 Arguments:; -#X text 29 189 the name of a OpenGL constant (e.g. GL_LINES or GL_POLYGON) -; +#X text 29 189 the name of a OpenGL constant (e.g. GL_LINES or GL_POLYGON); #X msg 542 98 GL_LINES; #X obj 534 142 GLdefine GL_ADD; #X msg 553 119 symbol GL_ACCUM; #X obj 588 8 declare -lib Gem; -#X connect 2 0 3 0; -#X connect 3 0 2 0; -#X connect 14 0 27 0; -#X connect 26 0 27 0; -#X connect 27 0 13 1; -#X connect 27 0 18 0; -#X connect 28 0 27 0; +#X obj 568 228 _gemwin; +#X connect 10 0 23 0; +#X connect 22 0 23 0; +#X connect 23 0 9 1; +#X connect 23 0 14 0; +#X connect 24 0 23 0; diff --git a/help/gemhead-help.pd b/help/gemhead-help.pd index 46bf8abf7..4ed8041fc 100644 --- a/help/gemhead-help.pd +++ b/help/gemhead-help.pd @@ -1,80 +1,39 @@ #N canvas 30 89 960 649 10; #X declare -lib Gem; #X text 742 8 GEM object; -#X obj 8 438 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 438 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 18 440 Inlets:; #X text 18 558 Outlets:; #X text 36 571 Outlet 1: gemlist; -#X obj 8 393 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 393 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 398 Arguments:; -#X obj 8 76 cnv 15 430 310 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 430 310 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 50 12 Synopsis: [gemhead]; #X text 71 31 Class: control object; #X text 29 77 Description: start a rendering chain; -#X obj 607 371 cnv 15 140 65 empty empty empty 20 12 0 14 -195568 -66577 -0; -#X msg 622 391 create; -#X text 618 370 Create window:; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 93 create \, 1 \, frame 2; -#X msg 198 112 destroy \, reset; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 622 411 pd gemwin (2fps); -#X text 21 91 [gemhead] connects the gem objects to the window manager. -The start of any gemList begins with the gemhead. Without the gemhead -\, gem objects will not receive the render command.; +#X text 21 91 [gemhead] connects the gem objects to the window manager. The start of any gemList begins with the gemhead. Without the gemhead \, gem objects will not receive the render command.; #X text 20 366 example: "1" before "50" before "-10" before "-23"; -#X text 22 149 Any gem object connected after the gemhead will receive -one render command per frame.; -#X text 20 294 The rendering-order value can also be negative. Negative -numbered [gemhead]s will be rendered AFTER all positive [gemhead]s. -Note \, that Higher values (-3) will be rendered BEFORE lower values -(-10). [gemhead]s with negative numbers will NOT be affected by view-point -changes !!!; +#X text 22 149 Any gem object connected after the gemhead will receive one render command per frame.; +#X text 20 294 The rendering-order value can also be negative. Negative numbered [gemhead]s will be rendered AFTER all positive [gemhead]s. Note \, that Higher values (-3) will be rendered BEFORE lower values (-10). [gemhead]s with negative numbers will NOT be affected by view-point changes !!!; #X text 62 409 float : priority (default : 50); #X text 42 471 Inlet 1: bang : force rendering now.; -#X text 42 453 Inlet 1: float (1/0): turn rendering on/off (default -1); -#X text 42 490 Inlet 1: set : change priority value of this -chain.; -#X obj 442 74 cnv 15 160 240 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X text 42 453 Inlet 1: float (1/0): turn rendering on/off (default 1); +#X text 42 490 Inlet 1: set : change priority value of this chain.; +#X obj 442 74 cnv 15 160 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 451 79 enable/disable rendering; -#X obj 451 123 cnv 15 100 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 451 123 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 470 240 gemList; #X obj 470 134 gemhead; #X msg 470 101 1; #X msg 506 101 0; #X obj 470 281 print ENABLE; #X obj 470 199 square 0.5; -#X obj 606 74 cnv 15 160 240 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 770 74 cnv 15 160 240 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 606 74 cnv 15 160 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 770 74 cnv 15 160 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 617 81 force rendering; #X text 789 79 set rendering order; -#X obj 621 128 cnv 15 100 40 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 781 135 cnv 15 100 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 621 128 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 781 135 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 630 101 bang; #X msg 791 101 set 45; #X obj 791 286 print SETTABLE; @@ -84,37 +43,29 @@ chain.; #X obj 630 202 circle 0.5; #X obj 791 204 triangle 0.5; #X obj 791 144 gemhead 105; -#X text 21 188 All chain will be rendered one after the other. You -can control precisely the rendering order by giving [gemhead] a priority -value (argument or message). The default value is 50 The lower the -value is \, the sooner the gemhead will receive the rendering command -(a value of 1 is the lowest possible value). This value is important -when you are doing alpha blending and for certain objects (such as -light).; +#X text 21 188 All chain will be rendered one after the other. You can control precisely the rendering order by giving [gemhead] a priority value (argument or message). The default value is 50 The lower the value is \, the sooner the gemhead will receive the rendering command (a value of 1 is the lowest possible value). This value is important when you are doing alpha blending and for certain objects (such as light).; #X obj 470 178 translateXYZ -2 0 0; #X msg 854 101 set 105; #X obj 630 181 translateXYZ 0 2 0; #X obj 630 138 gemhead 50; #X obj 791 183 translateXYZ 2 0 0; -#X text 42 520 Inlet 1: context : change rendering context (for -multiple windows).; +#X text 42 520 Inlet 1: context : change rendering context (for multiple windows).; #X obj 818 8 declare -lib Gem; -#X connect 12 0 14 0; -#X connect 14 0 12 0; -#X connect 26 0 30 0; -#X connect 27 0 48 0; -#X connect 28 0 27 0; -#X connect 29 0 27 0; -#X connect 31 0 26 0; -#X connect 38 0 51 0; -#X connect 39 0 46 0; -#X connect 42 0 41 0; -#X connect 43 0 40 0; -#X connect 44 0 42 0; -#X connect 45 0 43 0; -#X connect 46 0 52 0; -#X connect 48 0 31 0; -#X connect 49 0 46 0; -#X connect 50 0 44 0; -#X connect 51 0 50 0; -#X connect 52 0 45 0; +#X obj 690 421 _gemwin 2; +#X connect 22 0 26 0; +#X connect 23 0 44 0; +#X connect 24 0 23 0; +#X connect 25 0 23 0; +#X connect 27 0 22 0; +#X connect 34 0 47 0; +#X connect 35 0 42 0; +#X connect 38 0 37 0; +#X connect 39 0 36 0; +#X connect 40 0 38 0; +#X connect 41 0 39 0; +#X connect 42 0 48 0; +#X connect 44 0 27 0; +#X connect 45 0 42 0; +#X connect 46 0 40 0; +#X connect 47 0 46 0; +#X connect 48 0 41 0; diff --git a/help/gemkeyboard-help.pd b/help/gemkeyboard-help.pd index 8c08cacc4..38e515d65 100644 --- a/help/gemkeyboard-help.pd +++ b/help/gemkeyboard-help.pd @@ -1,64 +1,29 @@ #N canvas 64 61 679 445 10; #X declare -lib Gem; -#X obj 27 85 cnv 15 450 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 28 303 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 27 85 cnv 15 450 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 28 303 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 29 308 Inlets:; -#X obj 28 265 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 28 265 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 37 264 Arguments:; #X text 472 28 GEM object; #X text 29 337 Outlets:; #X text 485 69 Example:; #X text 74 50 Class: control object; -#X obj 486 84 cnv 15 170 180 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 495 101 cnv 15 150 80 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 546 194 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 551 233 pd gemwin; -#X msg 551 214 create; -#X text 547 193 Create window:; +#X obj 486 84 cnv 15 170 180 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 495 101 cnv 15 150 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 53 34 Synopsis: [gemkeyboard]; -#X text 27 89 Description: output keyboard events in the GEM window -; -#X text 36 106 [gemkeyboard] sends out keyboard events which occur -in the GEM window. Such event will appear on KEY_DOWN and will give -the KeyCode of the button.; -#X text 34 181 Furthermore \, i would like to make this object really -cross-platform one day. Thus the KeyCode might change on one system -or another in future times.; +#X text 27 89 Description: output keyboard events in the GEM window; +#X text 36 106 [gemkeyboard] sends out keyboard events which occur in the GEM window. Such event will appear on KEY_DOWN and will give the KeyCode of the button.; +#X text 34 181 Furthermore \, i would like to make this object really cross-platform one day. Thus the KeyCode might change on one system or another in future times.; #X text 34 228 USE AT YOUR OWN RISK !!!; -#X text 35 148 It is not guaranteed \, that Windows / Linux / OSX versions -will give the same KeyCode for the same key pressed !!!; +#X text 35 148 It is not guaranteed \, that Windows / Linux / OSX versions will give the same KeyCode for the same key pressed !!!; #X text 83 275 none; #X text 47 320 Inlet 1: non - used; #X text 41 350 Outlet 1: keyCode; #X obj 508 115 gemkeyboard; -#X floatatom 508 153 5 0 0 1 keyCode - -; +#X floatatom 508 153 5 0 0 1 keyCode - - 0; #X text 488 274 see also:; #X obj 489 299 gemkeyname; #X obj 556 30 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 24 0 25 0; +#X obj 548 201 _gemwin; +#X connect 20 0 21 0; diff --git a/help/gemkeyname-help.pd b/help/gemkeyname-help.pd index 44f2323c8..6a87a711b 100644 --- a/help/gemkeyname-help.pd +++ b/help/gemkeyname-help.pd @@ -1,70 +1,32 @@ #N canvas 64 61 679 445 10; #X declare -lib Gem; -#X obj 27 85 cnv 15 450 200 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 27 325 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 27 85 cnv 15 450 200 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 27 325 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 35 332 Inlets:; -#X obj 27 290 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 27 290 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 36 291 Arguments:; #X text 472 28 GEM object; #X text 35 361 Outlets:; #X text 495 69 Example:; #X text 74 50 Class: control object; -#X obj 486 84 cnv 15 170 180 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 495 101 cnv 15 150 80 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 546 194 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 551 233 pd gemwin; -#X msg 551 214 create; -#X text 547 193 Create window:; -#X text 38 89 Description: output keyboard events in the GEM window -; +#X obj 486 84 cnv 15 170 180 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 495 101 cnv 15 150 80 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X text 38 89 Description: output keyboard events in the GEM window; #X text 37 265 USE AT YOUR OWN RISK !!!; #X text 82 302 none; #X text 53 344 Inlet 1: non - used; #X text 488 274 see also:; #X text 53 34 Synopsis: [gemkeyname]; -#X text 36 108 [gemkeyname] sends out keyboard events which occur in -the GEM window. Such event will give a symbolic description of the -button. The "state"-outlet will be 1 for KEY_DOWN and 0 for KEY_UP. -; -#X text 37 219 Furthermore \, i would like to make this object really -cross-platform one day. Thus the KeyName might change on one system -or another in future times.; -#X text 37 161 It is not guaranteed \, that Windows / Linux / OSX versions -will give the same description for the same key pressed !!! Also \, -there is no guarantee \, that the Pd-object [keyname] will return the -same symbols as [gemkeyname]; +#X text 36 108 [gemkeyname] sends out keyboard events which occur in the GEM window. Such event will give a symbolic description of the button. The "state"-outlet will be 1 for KEY_DOWN and 0 for KEY_UP.; +#X text 37 219 Furthermore \, i would like to make this object really cross-platform one day. Thus the KeyName might change on one system or another in future times.; +#X text 37 161 It is not guaranteed \, that Windows / Linux / OSX versions will give the same description for the same key pressed !!! Also \, there is no guarantee \, that the Pd-object [keyname] will return the same symbols as [gemkeyname]; #X text 53 376 Outlet 1: state; #X text 53 390 Outlet 2: keyName; #X obj 489 299 gemkeyboard; -#X floatatom 508 160 2 0 0 1 state - -; -#X symbolatom 565 134 10 0 0 0 keyName - -; +#X floatatom 508 160 2 0 0 1 state - - 0; +#X symbolatom 565 134 10 0 0 0 keyName - - 0; #X obj 508 115 gemkeyname; #X obj 558 28 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 29 0 27 0; -#X connect 29 1 28 0; +#X obj 552 203 _gemwin; +#X connect 25 0 23 0; +#X connect 25 1 24 0; diff --git a/help/gemlist-help.pd b/help/gemlist-help.pd index b2b5a834d..e06c716b3 100644 --- a/help/gemlist-help.pd +++ b/help/gemlist-help.pd @@ -1,12 +1,9 @@ #N canvas 443 181 661 405 10; #X declare -lib Gem; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 452 8 GEM object; #X text 27 233 Inlet 1: gemlist; @@ -19,35 +16,9 @@ #X text 27 247 Inlet 1: bang; #X text 27 261 Inlet 2: gemlist; #X text 7 69 Description: Store a gemlist; -#X text 16 86 The gemlist object stores a gemlist \, which may de output -by sending it a "bang" message.; -#X obj 467 47 cnv 15 170 340 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 475 81 cnv 15 150 130 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 528 320 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 533 359 pd gemwin; -#X msg 533 340 create; -#X text 529 319 Create window:; +#X text 16 86 The gemlist object stores a gemlist \, which may de output by sending it a "bang" message.; +#X obj 467 47 cnv 15 170 340 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 475 81 cnv 15 150 130 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 498 59 gemhead; #X obj 484 190 gemlist; #X obj 484 169 until; @@ -55,21 +26,20 @@ by sending it a "bang" message.; #X obj 484 243 translateXYZ 0.5 0 0; #X msg 484 149 30; #X obj 484 265 rotateXYZ 0 0 30; -#X obj 484 221 circle 0.3 33; #X obj 498 107 route gem_state; #X obj 498 127 route float; #X obj 498 86 t a a; #X obj 538 8 declare -lib Gem; -#X connect 20 0 21 0; +#X obj 524 317 _gemwin; +#X obj 484 221 circle 0.3; +#X connect 19 0 28 0; +#X connect 20 0 31 0; #X connect 21 0 20 0; -#X connect 23 0 33 0; -#X connect 24 0 30 0; -#X connect 25 0 24 0; -#X connect 27 0 29 0; -#X connect 28 0 25 0; -#X connect 29 0 26 0; -#X connect 30 0 27 0; -#X connect 31 0 32 0; -#X connect 32 1 28 0; -#X connect 33 0 31 0; -#X connect 33 1 24 1; +#X connect 23 0 25 0; +#X connect 24 0 21 0; +#X connect 25 0 22 0; +#X connect 26 0 27 0; +#X connect 27 1 24 0; +#X connect 28 0 26 0; +#X connect 28 1 20 1; +#X connect 31 0 23 0; diff --git a/help/gemlist_info-help.pd b/help/gemlist_info-help.pd index 2cfcf2b0a..685824db4 100644 --- a/help/gemlist_info-help.pd +++ b/help/gemlist_info-help.pd @@ -1,106 +1,73 @@ #N canvas 594 117 688 676 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 63 231 Inlet 1: gemlist; #X text 38 240 Outlets:; #X text 62 253 Outlet 1: gemlist; -#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 453 60 Example:; -#X obj 9 415 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 454 304 gemwin 0; -#X obj 132 160 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 133 destroy; -#X obj 288 57 world_light; -#X obj 288 28 gemhead; -#X msg 132 112 create \, 1 \, lighting 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 9 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 8 0 7 0; -#X connect 9 0 0 0; -#X restore 14 454 pd gemwin; -#X msg 14 435 create; -#X text 10 414 Create window:; #X text 50 12 Synopsis: [gemlist_info]; #X text 71 31 Class: information object; -#X text 29 77 Description: get current transformation of a gemlist -; -#X text 42 94 [gemlist_info] accepts a gemList decompost the transformation -matrix in basic transformation (translation \, scale \, shear \, rotation) -; +#X text 29 77 Description: get current transformation of a gemlist; +#X text 42 94 [gemlist_info] accepts a gemList decompost the transformation matrix in basic transformation (translation \, scale \, shear \, rotation); #X text 60 174 no argument; #X text 62 299 Outlet 5: 3 float list : translationX \, Y and Z; #X text 62 265 Outlet 2: 3 float list : RotationX \, Y and Z; #X text 62 277 Outlet 3: 3 float list : shear YX \, YZ and ZX; #X text 62 288 Outlet 4: 3 float list : scale X \, Y and Z; -#X obj 9 336 cnv 15 430 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 336 cnv 15 430 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 0 0 452 890 more 0; #X obj 30 122 gemhead; -#X floatatom 44 144 5 0 0 0 - - -; -#X floatatom 78 144 5 0 0 0 - - -; -#X floatatom 112 144 5 0 0 0 - - -; -#X floatatom 46 184 5 0 0 0 - - -; -#X floatatom 80 184 5 0 0 0 - - -; -#X floatatom 114 184 5 0 0 0 - - -; -#X floatatom 52 227 5 0 0 0 - - -; -#X floatatom 86 227 5 0 0 0 - - -; -#X floatatom 120 227 5 0 0 0 - - -; +#X floatatom 44 144 5 0 0 0 - - - 0; +#X floatatom 78 144 5 0 0 0 - - - 0; +#X floatatom 112 144 5 0 0 0 - - - 0; +#X floatatom 46 184 5 0 0 0 - - - 0; +#X floatatom 80 184 5 0 0 0 - - - 0; +#X floatatom 114 184 5 0 0 0 - - - 0; +#X floatatom 52 227 5 0 0 0 - - - 0; +#X floatatom 86 227 5 0 0 0 - - - 0; +#X floatatom 120 227 5 0 0 0 - - - 0; #X obj 30 433 gemlist_info; #X obj 192 568 unpack f f f; #X obj 178 396 gemhead; #X obj 178 536 translateXYZ; -#X floatatom 192 591 5 0 0 0 - - -; -#X floatatom 225 591 5 0 0 0 - - -; -#X floatatom 259 591 5 0 0 0 - - -; -#X floatatom 193 761 5 0 0 0 - - -; -#X floatatom 226 761 5 0 0 0 - - -; -#X floatatom 260 761 5 0 0 0 - - -; -#X floatatom 200 516 5 0 0 0 - - -; -#X floatatom 233 516 5 0 0 0 - - -; -#X floatatom 267 516 5 0 0 0 - - -; +#X floatatom 192 591 5 0 0 0 - - - 0; +#X floatatom 225 591 5 0 0 0 - - - 0; +#X floatatom 259 591 5 0 0 0 - - - 0; +#X floatatom 193 761 5 0 0 0 - - - 0; +#X floatatom 226 761 5 0 0 0 - - - 0; +#X floatatom 260 761 5 0 0 0 - - - 0; +#X floatatom 200 516 5 0 0 0 - - - 0; +#X floatatom 233 516 5 0 0 0 - - - 0; +#X floatatom 267 516 5 0 0 0 - - - 0; #X obj 193 734 unpack f f f; #X obj 200 490 unpack f f f; #X obj 178 421 GEMglLoadIdentity; #X obj 178 450 color 1 0 0; -#X floatatom 46 336 5 0 0 0 - - -; -#X floatatom 80 336 5 0 0 0 - - -; -#X floatatom 114 336 5 0 0 0 - - -; -#X floatatom 52 379 5 0 0 0 - - -; -#X floatatom 86 379 5 0 0 0 - - -; -#X floatatom 120 379 5 0 0 0 - - -; +#X floatatom 46 336 5 0 0 0 - - - 0; +#X floatatom 80 336 5 0 0 0 - - - 0; +#X floatatom 114 336 5 0 0 0 - - - 0; +#X floatatom 52 379 5 0 0 0 - - - 0; +#X floatatom 86 379 5 0 0 0 - - - 0; +#X floatatom 120 379 5 0 0 0 - - - 0; #X obj 30 163 scaleXYZ 1 1 1; #X obj 30 205 rotateXYZ 0 0 0; #X obj 30 247 translateXYZ 0 0 0; #X obj 30 357 rotateXYZ 0 0 0; #X obj 30 399 translateXYZ 0 0 0; -#X floatatom 44 283 5 0 0 0 - - -; -#X floatatom 78 283 5 0 0 0 - - -; -#X floatatom 112 283 5 0 0 0 - - -; +#X floatatom 44 283 5 0 0 0 - - - 0; +#X floatatom 78 283 5 0 0 0 - - - 0; +#X floatatom 112 283 5 0 0 0 - - - 0; #X obj 30 302 scaleXYZ 1 1 1; #X obj 30 512 cube; #X obj 30 484 scaleXYZ 1 1 0.2; -#X floatatom 192 665 8 0 0 0 - - -; -#X floatatom 225 681 8 0 0 0 - - -; -#X floatatom 259 697 8 0 0 0 - - -; +#X floatatom 192 665 8 0 0 0 - - - 0; +#X floatatom 225 681 8 0 0 0 - - - 0; +#X floatatom 259 697 8 0 0 0 - - - 0; #X obj 192 643 unpack f f f; #N canvas 296 410 419 328 shear 0; #X obj 28 17 inlet; @@ -123,14 +90,12 @@ matrix in basic transformation (translation \, scale \, shear \, rotation) #X connect 10 0 1 0; #X restore 178 711 pd shear; #X obj 178 811 cube 0.5; -#X obj 178 80 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 178 80 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 178 785 rotateXYZ; #X obj 178 610 scaleXYZ; #X obj 178 30 loadbang; #X msg 178 55 0; -#X text 50 844 this show the transformation needed to create a specific -transformation matrix decomposed with gemlist_info; +#X text 50 844 this show the transformation needed to create a specific transformation matrix decomposed with gemlist_info; #X connect 0 0 33 0; #X connect 1 0 33 1; #X connect 2 0 33 2; @@ -198,36 +163,34 @@ transformation matrix decomposed with gemlist_info; #X connect 53 0 54 0; #X connect 54 0 50 0; #X restore 15 349 pd more; -#X obj 449 77 cnv 15 200 570 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 459 310 cnv 15 180 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 449 77 cnv 15 200 570 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 459 310 cnv 15 180 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 472 89 gemhead; -#X floatatom 494 121 5 0 0 0 - - -; -#X floatatom 528 121 5 0 0 0 - - -; -#X floatatom 562 121 5 0 0 0 - - -; -#X floatatom 488 264 5 0 0 0 - - -; -#X floatatom 522 264 5 0 0 0 - - -; -#X floatatom 556 264 5 0 0 0 - - -; -#X floatatom 486 170 5 0 0 0 - - -; -#X floatatom 520 170 5 0 0 0 - - -; -#X floatatom 554 170 5 0 0 0 - - -; +#X floatatom 494 121 5 0 0 0 - - - 0; +#X floatatom 528 121 5 0 0 0 - - - 0; +#X floatatom 562 121 5 0 0 0 - - - 0; +#X floatatom 488 264 5 0 0 0 - - - 0; +#X floatatom 522 264 5 0 0 0 - - - 0; +#X floatatom 556 264 5 0 0 0 - - - 0; +#X floatatom 486 170 5 0 0 0 - - - 0; +#X floatatom 520 170 5 0 0 0 - - - 0; +#X floatatom 554 170 5 0 0 0 - - - 0; #X obj 472 320 gemlist_info; -#X obj 488 596 unpack f f f; -#X floatatom 488 619 5 0 0 0 - - -; -#X floatatom 521 619 5 0 0 0 - - -; -#X floatatom 555 619 5 0 0 0 - - -; -#X floatatom 522 470 5 0 0 0 - - -; -#X floatatom 555 470 5 0 0 0 - - -; -#X floatatom 589 470 5 0 0 0 - - -; -#X floatatom 539 394 5 0 0 0 - - -; -#X floatatom 572 394 5 0 0 0 - - -; -#X floatatom 606 394 5 0 0 0 - - -; -#X obj 522 444 unpack f f f; -#X obj 539 371 unpack f f f; -#X text 547 356 position; -#X text 533 428 size; -#X obj 505 520 unpack f f f; +#X obj 489 596 unpack f f f; +#X floatatom 489 619 5 0 0 0 - - - 0; +#X floatatom 522 619 5 0 0 0 - - - 0; +#X floatatom 556 619 5 0 0 0 - - - 0; +#X floatatom 523 470 5 0 0 0 - - - 0; +#X floatatom 556 470 5 0 0 0 - - - 0; +#X floatatom 590 470 5 0 0 0 - - - 0; +#X floatatom 541 394 5 0 0 0 - - - 0; +#X floatatom 574 394 5 0 0 0 - - - 0; +#X floatatom 608 394 5 0 0 0 - - - 0; +#X obj 523 444 unpack f f f; +#X obj 541 371 unpack f f f; +#X text 549 356 position; +#X text 534 428 size; +#X obj 506 520 unpack f f f; #N canvas 437 191 389 322 shear 0; #X obj 37 27 inlet; #X obj 37 280 outlet; @@ -251,50 +214,52 @@ transformation matrix decomposed with gemlist_info; #X obj 472 285 rotateXYZ; #X obj 472 189 scaleXYZ; #X obj 472 144 translateXYZ; -#X floatatom 486 216 5 0 0 0 - - -; -#X floatatom 520 216 5 0 0 0 - - -; -#X floatatom 554 216 5 0 0 0 - - -; -#X floatatom 505 545 5 0 0 0 - - -; -#X floatatom 538 545 5 0 0 0 - - -; -#X floatatom 572 545 5 0 0 0 - - -; -#X text 498 580 orientation; -#X text 514 504 shear (YX \, ZX \, ZY); +#X floatatom 486 216 5 0 0 0 - - - 0; +#X floatatom 520 216 5 0 0 0 - - - 0; +#X floatatom 554 216 5 0 0 0 - - - 0; +#X floatatom 506 545 5 0 0 0 - - - 0; +#X floatatom 539 545 5 0 0 0 - - - 0; +#X floatatom 573 545 5 0 0 0 - - - 0; +#X text 500 580 orientation; +#X text 515 504 shear (YX \, ZX \, ZY); #X text 76 349 <- more about gemlist_info; #X text 18 375 see also :; #X obj 100 375 gemlist_matrix; #X obj 548 8 declare -lib Gem; -#X connect 11 0 12 0; -#X connect 12 0 11 0; -#X connect 27 0 56 0; -#X connect 28 0 56 1; -#X connect 29 0 56 2; -#X connect 30 0 56 3; -#X connect 31 0 54 1; -#X connect 32 0 54 2; -#X connect 33 0 54 3; -#X connect 34 0 55 1; -#X connect 35 0 55 2; -#X connect 36 0 55 3; -#X connect 37 1 38 0; -#X connect 37 2 52 0; -#X connect 37 3 48 0; -#X connect 37 4 49 0; -#X connect 38 0 39 0; -#X connect 38 1 40 0; -#X connect 38 2 41 0; -#X connect 48 0 42 0; -#X connect 48 1 43 0; -#X connect 48 2 44 0; -#X connect 49 0 45 0; -#X connect 49 1 46 0; -#X connect 49 2 47 0; -#X connect 52 0 60 0; -#X connect 52 1 61 0; -#X connect 52 2 62 0; -#X connect 53 0 54 0; -#X connect 54 0 37 0; -#X connect 55 0 53 0; -#X connect 56 0 55 0; -#X connect 57 0 53 1; -#X connect 58 0 53 2; -#X connect 59 0 53 3; +#X obj 222 422 gemhead; +#X obj 222 445 world_light; +#X obj 17 421 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 23 0 52 0; +#X connect 24 0 52 1; +#X connect 25 0 52 2; +#X connect 26 0 52 3; +#X connect 27 0 50 1; +#X connect 28 0 50 2; +#X connect 29 0 50 3; +#X connect 30 0 51 1; +#X connect 31 0 51 2; +#X connect 32 0 51 3; +#X connect 33 1 34 0; +#X connect 33 2 48 0; +#X connect 33 3 44 0; +#X connect 33 4 45 0; +#X connect 34 0 35 0; +#X connect 34 1 36 0; +#X connect 34 2 37 0; +#X connect 44 0 38 0; +#X connect 44 1 39 0; +#X connect 44 2 40 0; +#X connect 45 0 41 0; +#X connect 45 1 42 0; +#X connect 45 2 43 0; +#X connect 48 0 56 0; +#X connect 48 1 57 0; +#X connect 48 2 58 0; +#X connect 49 0 50 0; +#X connect 50 0 33 0; +#X connect 51 0 49 0; +#X connect 52 0 51 0; +#X connect 53 0 49 1; +#X connect 54 0 49 2; +#X connect 55 0 49 3; +#X connect 65 0 66 0; diff --git a/help/gemlist_matrix-help.pd b/help/gemlist_matrix-help.pd index 17bbe6381..1682b8f35 100644 --- a/help/gemlist_matrix-help.pd +++ b/help/gemlist_matrix-help.pd @@ -1,62 +1,30 @@ #N canvas 594 117 675 520 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 63 231 Inlet 1: gemlist; #X text 38 240 Outlets:; #X text 62 253 Outlet 1: gemlist; -#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 453 60 Example:; -#X obj 9 385 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 454 304 gemwin 0; -#X obj 132 160 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 133 destroy; -#X obj 288 57 world_light; -#X obj 288 28 gemhead; -#X msg 132 112 create \, 1 \, lighting 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 9 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 8 0 7 0; -#X connect 9 0 0 0; -#X restore 14 424 pd gemwin; -#X msg 14 405 create; -#X text 10 384 Create window:; #X text 71 31 Class: information object; #X text 60 174 no argument; -#X obj 9 336 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; -#X obj 449 77 cnv 15 200 400 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 459 310 cnv 15 180 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 9 336 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 449 77 cnv 15 200 400 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 459 310 cnv 15 180 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 472 89 gemhead; -#X floatatom 494 121 5 0 0 0 - - -; -#X floatatom 528 121 5 0 0 0 - - -; -#X floatatom 562 121 5 0 0 0 - - -; -#X floatatom 488 264 5 0 0 0 - - -; -#X floatatom 522 264 5 0 0 0 - - -; -#X floatatom 556 264 5 0 0 0 - - -; -#X floatatom 486 170 5 0 0 0 - - -; -#X floatatom 520 170 5 0 0 0 - - -; -#X floatatom 554 170 5 0 0 0 - - -; +#X floatatom 494 121 5 0 0 0 - - - 0; +#X floatatom 528 121 5 0 0 0 - - - 0; +#X floatatom 562 121 5 0 0 0 - - - 0; +#X floatatom 488 264 5 0 0 0 - - - 0; +#X floatatom 522 264 5 0 0 0 - - - 0; +#X floatatom 556 264 5 0 0 0 - - - 0; +#X floatatom 486 170 5 0 0 0 - - - 0; +#X floatatom 520 170 5 0 0 0 - - - 0; +#X floatatom 554 170 5 0 0 0 - - - 0; #N canvas 437 191 753 491 shear 0; #X obj 25 17 inlet; #X obj 28 270 outlet; @@ -80,43 +48,39 @@ #X obj 472 285 rotateXYZ; #X obj 472 189 scaleXYZ; #X obj 472 144 translateXYZ; -#X floatatom 486 216 5 0 0 0 - - -; -#X floatatom 520 216 5 0 0 0 - - -; -#X floatatom 554 216 5 0 0 0 - - -; +#X floatatom 486 216 5 0 0 0 - - - 0; +#X floatatom 520 216 5 0 0 0 - - - 0; +#X floatatom 554 216 5 0 0 0 - - - 0; #X obj 101 348 gemlist_info; #X obj 472 320 gemlist_matrix; #X text 14 351 see also :; -#X text 29 77 Description: get current transformation matrix of a gemlist -; -#X msg 496 378 \$1 \$2 \$3; -#X msg 503 398 \$5 \$6 \$7; -#X msg 510 419 \$9 \$10 \$11; -#X msg 517 440 \$13 \$14 \$15; +#X text 29 77 Description: get current transformation matrix of a gemlist; #X text 50 12 Synopsis: [gemlist_matrix]; -#X text 42 94 [gemlist_matrix] accepts a gemList and output the transformation -matrix.; +#X text 42 94 [gemlist_matrix] accepts a gemList and output the transformation matrix.; #X text 62 265 Outlet 2: transformation matrix (16 floats); #X obj 538 8 declare -lib Gem; -#X connect 11 0 12 0; -#X connect 12 0 11 0; -#X connect 19 0 32 0; -#X connect 20 0 32 1; -#X connect 21 0 32 2; -#X connect 22 0 32 3; -#X connect 23 0 30 1; -#X connect 24 0 30 2; -#X connect 25 0 30 3; -#X connect 26 0 31 1; -#X connect 27 0 31 2; -#X connect 28 0 31 3; -#X connect 29 0 30 0; -#X connect 30 0 37 0; -#X connect 31 0 29 0; -#X connect 32 0 31 0; -#X connect 33 0 29 1; -#X connect 34 0 29 2; -#X connect 35 0 29 3; -#X connect 37 1 40 0; -#X connect 37 1 41 0; -#X connect 37 1 42 0; -#X connect 37 1 43 0; +#X obj 342 391 gemhead; +#X obj 342 414 world_light; +#X obj 22 383 _gemwin \; 0 \; 0 \; lighting 1; +#X msg 466 392 1 0 0 0 \; 0 0 0 0 \; 0 0 1 0 \; 0 0 -4 1 \;; +#X msg 466 343 set \, add \$1 \$2 \$3 \$4 \, add \$5 \$6 \$7 \$8 \, add \$9 \$10 \$11 \$12 \, add \$13 \$14 \$15 \$16, f 28; +#X connect 15 0 28 0; +#X connect 16 0 28 1; +#X connect 17 0 28 2; +#X connect 18 0 28 3; +#X connect 19 0 26 1; +#X connect 20 0 26 2; +#X connect 21 0 26 3; +#X connect 22 0 27 1; +#X connect 23 0 27 2; +#X connect 24 0 27 3; +#X connect 25 0 26 0; +#X connect 26 0 33 0; +#X connect 27 0 25 0; +#X connect 28 0 27 0; +#X connect 29 0 25 1; +#X connect 30 0 25 2; +#X connect 31 0 25 3; +#X connect 33 1 44 0; +#X connect 40 0 41 0; +#X connect 44 0 43 0; diff --git a/help/gemmouse-help.pd b/help/gemmouse-help.pd index e604ef4dc..0ac7f1ce5 100644 --- a/help/gemmouse-help.pd +++ b/help/gemmouse-help.pd @@ -1,53 +1,22 @@ #N canvas 179 61 929 414 10; #X declare -lib Gem; -#X obj 7 65 cnv 15 450 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 283 cnv 15 450 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 283 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 288 Inlets:; -#X obj 8 245 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 245 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 244 Arguments:; #X text 712 8 GEM object; #X text 9 317 Outlets:; #X text 475 29 Example:; #X text 54 30 Class: control object; -#X obj 466 64 cnv 15 170 180 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 466 284 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 471 323 pd gemwin; -#X msg 471 304 create; -#X text 467 283 Create window:; +#X obj 466 64 cnv 15 170 180 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 27 300 Inlet 1: non - used; #X text 468 364 see also:; #X text 33 14 Synopsis: [gemmouse]; #X text 7 69 Description: mouse events in the GEM window; -#X text 16 86 [gemmouse] sends out mouse events which occur in the -GEM window. The X and Y Position go from 0 to the size of the window -in pixels. The point (0 \, 0) is in the top left of the window.; -#X text 15 141 You can also set some normalization of the output coordinates -with arguments.; -#X text 15 170 The button outlets send a 1 when the specified button -is pressed and a 0 when it is released.; +#X text 16 86 [gemmouse] sends out mouse events which occur in the GEM window. The X and Y Position go from 0 to the size of the window in pixels. The point (0 \, 0) is in the top left of the window.; +#X text 15 141 You can also set some normalization of the output coordinates with arguments.; +#X text 15 170 The button outlets send a 1 when the specified button is pressed and a 0 when it is released.; #X text 63 255 [list : x-normalization y-normalization]; #X text 21 330 Outlet 1: x position; #X text 21 343 Outlet 2: y position; @@ -55,25 +24,23 @@ is pressed and a 0 when it is released.; #X text 21 368 Outlet 4: middle button state; #X text 21 381 Outlet 5: right button state; #X obj 466 385 gemkeyboard; -#X obj 478 82 cnv 15 100 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 478 82 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 491 93 gemmouse; -#X floatatom 491 218 9 0 0 1 X-position - -; -#X floatatom 502 196 8 0 0 1 Y-position - -; -#X floatatom 513 174 2 0 0 1 left-Button - -; -#X floatatom 524 153 2 0 0 1 middle-Button - -; -#X floatatom 536 129 2 0 0 1 right-Button - -; -#X obj 642 64 cnv 15 280 180 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 654 82 cnv 15 100 40 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X floatatom 657 135 9 0 0 1 X-position - -; -#X floatatom 674 113 8 0 0 1 Y-position - -; +#A saved init; +#X floatatom 491 218 9 0 0 1 X-position - - 0; +#X floatatom 502 196 8 0 0 1 Y-position - - 0; +#X floatatom 513 174 2 0 0 1 left-Button - - 0; +#X floatatom 524 153 2 0 0 1 middle-Button - - 0; +#X floatatom 536 129 2 0 0 1 right-Button - - 0; +#X obj 642 64 cnv 15 280 180 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 654 82 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X floatatom 657 135 9 0 0 1 X-position - - 0; +#X floatatom 674 113 8 0 0 1 Y-position - - 0; #X text 792 134 (normalized to 0..1); #X obj 657 89 gemmouse 1 1; +#A saved init; #X text 791 111 (normalized to 0..1); -#X obj 656 186 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; +#X obj 656 186 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #N canvas 589 352 498 353 follow_mouse 0; #X obj 112 29 inlet; #X obj 168 74 * 8; @@ -103,15 +70,14 @@ is pressed and a 0 when it is released.; #X connect 13 0 11 0; #X restore 656 209 pd follow_mouse; #X obj 788 8 declare -lib Gem; -#X connect 11 0 12 0; -#X connect 12 0 11 0; -#X connect 29 0 30 0; -#X connect 29 1 31 0; -#X connect 29 2 32 0; -#X connect 29 3 33 0; -#X connect 29 4 34 0; -#X connect 37 0 43 1; -#X connect 38 0 43 2; -#X connect 40 0 37 0; -#X connect 40 1 38 0; -#X connect 42 0 43 0; +#X obj 464 299 _gemwin; +#X connect 25 0 26 0; +#X connect 25 1 27 0; +#X connect 25 2 28 0; +#X connect 25 3 29 0; +#X connect 25 4 30 0; +#X connect 33 0 39 1; +#X connect 34 0 39 2; +#X connect 36 0 33 0; +#X connect 36 1 34 0; +#X connect 38 0 39 0; diff --git a/help/gemvertexbuffer-help.pd b/help/gemvertexbuffer-help.pd index 7037570ee..f66ae6573 100644 --- a/help/gemvertexbuffer-help.pd +++ b/help/gemvertexbuffer-help.pd @@ -1,4 +1,4 @@ -#N canvas 152 61 983 713 10; +#N canvas 505 74 983 713 10; #X declare -lib Gem; #N canvas 1 89 450 300 fps 0; #X obj 46 -61 gemhead; @@ -18,19 +18,15 @@ #X connect 6 0 7 0; #X connect 7 0 5 0; #X restore 466 149 pd fps; -#X floatatom 466 172 5 0 0 1 fps - -; -#X obj 6 76 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 7 236 cnv 15 450 375 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 7 181 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X floatatom 466 172 5 0 0 1 fps - - 0; +#X obj 6 76 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 7 236 cnv 15 450 375 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 7 181 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 59 27 Class: geometric object; #X text 467 7 GEM object; #X text 61 7 Synopsis: [gemvertexbuffer]; -#X obj 462 76 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 5 76 450 300 gemwin 0; +#X obj 462 76 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#N canvas 1327 265 450 300 gemwin 0; #X obj 132 246 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; @@ -74,69 +70,44 @@ #X text 27 253 Inlet 1: gemlist; #X text 9 580 Outlets:; #X text 21 593 Outlet 1: gemlist; -#X obj 569 7 cnv 15 400 700 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 576 668 cnv 15 150 30 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 569 7 cnv 15 400 700 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 576 668 cnv 15 150 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 792 593 draw line; #X msg 802 614 draw points; #X msg 692 384 color_enable \$1; -#X obj 673 384 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 673 384 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 579 134 GEMglPointSize 1; #X obj 816 638 loadbang; #X obj 579 76 translateXYZ 0 0 -2; #X obj 579 114 rotateXYZ -45 0 -50; #X obj 579 54 gemhead; #X text 594 254 update VBO using table value; -#X obj 643 366 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 643 366 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 665 364 position_enable \$1; -#X obj 729 424 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 699 406 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 729 424 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 699 406 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 721 404 texture_enable \$1; #X msg 748 424 normal_enable \$1; -#X obj 579 215 pix_image; #X obj 579 234 pix_texture; -#X obj 593 153 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#N canvas 1 51 450 300 openpanel 0; -#X obj 114 62 inlet; -#X obj 121 254 outlet; -#X obj 114 125 openpanel; -#X msg 114 162 set open \$1; -#X obj 114 199 t b a; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 4 0 1 0; -#X connect 4 1 1 0; -#X restore 593 170 pd openpanel; -#X msg 593 189; #X text 671 349 enable / disable specific VBO; -#X obj 579 32 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 579 32 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 577 14 Example:; #X msg 816 658 resize 128; -#X floatatom 636 96 5 0 0 0 - - -; +#X floatatom 636 96 5 0 0 0 - - - 0; #X obj 579 95 scale 3; #X msg 593 271 position blablax blablay blablaz; #X msg 604 290 color colorr colorg colorb colora; #X msg 614 310 texture colorr colorg; #X msg 627 331 normal colorr blablay blablaz; -#X obj 696 169 bng 15 250 50 0 empty \$0-init100 empty 17 7 0 10 -262144 --1 -1; -#X obj 841 56 cnv 15 120 160 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 696 169 bng 15 250 50 0 empty \$0-init100 empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 841 56 cnv 15 120 160 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #N canvas 615 145 657 666 lorenz 0; -#X floatatom 82 248 5 0 0 0 - - -; -#X floatatom 124 248 5 0 0 0 - - -; -#X floatatom 83 201 5 0 0 0 - - -; -#X floatatom 125 201 5 0 0 0 - - -; -#X floatatom 81 156 5 0 0 0 - - -; -#X floatatom 124 156 5 0 0 0 - - -; +#X floatatom 82 248 5 0 0 0 - - - 0; +#X floatatom 124 248 5 0 0 0 - - - 0; +#X floatatom 83 201 5 0 0 0 - - - 0; +#X floatatom 125 201 5 0 0 0 - - - 0; +#X floatatom 81 156 5 0 0 0 - - - 0; +#X floatatom 124 156 5 0 0 0 - - - 0; #N canvas 145 116 1131 666 table 0; #X obj 266 31 loadbang; #X msg 266 53 dsp 1; @@ -147,44 +118,37 @@ #X obj 88 160 abs~; #X obj 87 223 osc~ 11; #X obj 86 243 abs~; -#X obj 38 58 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 38 58 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 87 310 sig~ 0.7; #X obj 392 275 v pr; #X obj 523 276 v r; #X obj 449 277 v b; -#X floatatom 392 246 5 0 0 0 - - -; -#X floatatom 523 248 5 0 0 0 - - -; +#X floatatom 392 246 5 0 0 0 - - - 0; +#X floatatom 523 248 5 0 0 0 - - - 0; #X msg 393 221 10; #X obj 447 218 expr 8./3; #X msg 344 344 set 1.2 2.3 4.4; -#X floatatom 449 247 7 0 0 0 - - -; +#X floatatom 449 247 7 0 0 0 - - - 0; #X msg 321 308 stop; #X msg 291 275 start; -#X floatatom 615 248 5 0 0 0 - - -; +#X floatatom 615 248 5 0 0 0 - - - 0; #X obj 615 277 v dt; #X msg 526 220 18; #X msg 611 221 0.01; -#X obj 344 167 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1 --1; +#X obj 344 167 bng 15 250 50 0 empty empty empty 20 8 0 8 #fcfcfc #000000 #000000; #X text 679 250 <- experiment with these numbers; #X obj 705 223 line; #X obj 344 449 /~ 20; #X obj 450 446 /~ 20; #X obj 556 445 /~ 20; #X msg 706 198 0.01 \, 0.04 5000; -#X obj 344 393 fexpr~ $y1+(pr*$y2-pr*$y1)*dt \; $y2 +(-$y1*$y3 + r*$y1-$y2)*dt -\; $y3+($y1*$y2 - b*$y3)*dt; +#X obj 344 393 fexpr~ $y1+(pr*$y2-pr*$y1)*dt \; $y2 +(-$y1*$y3 + r*$y1-$y2)*dt \; $y3+($y1*$y2 - b*$y3)*dt; #X obj 276 164 loadbang; -#X text 329 108 This is an example of how fexpr~ could be used for -solving differential equations \, in this case the lorenz equations -which generate chaotic signals; +#X text 329 108 This is an example of how fexpr~ could be used for solving differential equations \, in this case the lorenz equations which generate chaotic signals; #X text 577 390 Note the following shorthands:; #X text 576 406 $y1 -> $y1[-1] \, $y2 -> $y2[-1] \, .....; -#X text 464 344 the 'set' commands sets the initial previous values -; -#X obj 639 442 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X text 464 344 the 'set' commands sets the initial previous values; +#X obj 639 442 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 673 437 loadbang; #X obj 572 473 sig~ -1; #X obj 673 467 metro 1000; @@ -251,38 +215,32 @@ which generate chaotic signals; #X obj 38 136 alpha; #X msg 118 577 draw line; #X msg 184 575 draw points; -#X floatatom 147 288 5 0 0 0 - - -; +#X floatatom 147 288 5 0 0 0 - - - 0; #X msg 82 449 color_enable \$1; -#X obj 82 430 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 82 430 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 38 222 scaleXYZ 3 3 3; #X obj 38 305 GEMglPointSize 1; #X obj 38 174 translateXYZ 0 0 -2; #X obj 38 267 rotateXYZ -45 0 -50; #X obj 38 114 gemhead; #X obj 56 346 gemhead 10; -#X obj 56 327 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 56 327 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 56 367 t b; #X obj 98 115 switch~; -#X obj 38 43 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 -; +#X obj 38 43 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 116 10 loadbang; #X obj 90 497 delay 1000; #X obj 90 475 sel 1; #X obj 38 13 inlet; -#X obj 218 469 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 218 469 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 218 444 loadbang; #X obj 38 614 gemvertexbuffer 100000; #X msg 116 32 0; #X obj 91 516 i \$0; -#X msg 90 538 colorR \$1colorr2 \, colorG \$1colorg2 \, colorB \$1colorb2 -\, colorA \$1colora2; +#X msg 90 538 colorR \$1colorr2 \, colorG \$1colorg2 \, colorB \$1colorb2 \, colorA \$1colora2; #X obj 38 69 t f f f f; #X obj 56 387 i \$0; -#X msg 56 407 posX \$1blablax2 \, posY \$1blablay2 \, posZ \$1blablaz2 -; +#X msg 56 407 posX \$1blablax2 \, posY \$1blablay2 \, posZ \$1blablaz2; #X connect 0 0 16 1; #X connect 1 0 16 2; #X connect 2 0 13 1; @@ -320,22 +278,20 @@ which generate chaotic signals; #X connect 34 0 35 0; #X connect 35 0 29 0; #X restore 849 100 pd lorenz; -#X obj 849 80 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 849 80 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #N canvas 285 255 805 628 wave 0; -#X floatatom 87 237 5 0 0 0 - - -; -#X floatatom 129 237 5 0 0 0 - - -; -#X floatatom 172 237 5 0 0 0 - - -; -#X floatatom 88 190 5 0 0 0 - - -; -#X floatatom 130 190 5 0 0 0 - - -; -#X floatatom 173 190 5 0 0 0 - - -; -#X floatatom 86 145 5 0 0 0 - - -; -#X floatatom 129 145 5 0 0 0 - - -; -#X floatatom 173 145 5 0 0 0 - - -; +#X floatatom 87 237 5 0 0 0 - - - 0; +#X floatatom 129 237 5 0 0 0 - - - 0; +#X floatatom 172 237 5 0 0 0 - - - 0; +#X floatatom 88 190 5 0 0 0 - - - 0; +#X floatatom 130 190 5 0 0 0 - - - 0; +#X floatatom 173 190 5 0 0 0 - - - 0; +#X floatatom 86 145 5 0 0 0 - - - 0; +#X floatatom 129 145 5 0 0 0 - - - 0; +#X floatatom 173 145 5 0 0 0 - - - 0; #X obj 43 592 gemvertexbuffer; #N canvas 145 161 1131 747 table 0; -#X obj 36 59 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 36 59 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 583 129 until; #X msg 583 110 100; #N canvas 0 50 450 300 count 0; @@ -354,8 +310,7 @@ which generate chaotic signals; #X connect 4 1 3 0; #X connect 5 0 1 1; #X restore 583 148 pd count; -#X obj 440 70 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 440 70 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 583 91 t b b; #X obj 583 264 until; #X msg 583 245 100; @@ -461,24 +416,20 @@ which generate chaotic signals; #X obj 341 72 t b b; #X obj 349 318 f; #X obj 440 380 +; -#X floatatom 903 395 5 0 0 0 - - -; -#X obj 583 71 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X floatatom 903 395 5 0 0 0 - - - 0; +#X obj 583 71 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 87 310 sig~ 0.3; #X obj 903 371 / 99; #X msg 903 347 1; #X obj 383 322 - 0.1; #X obj 440 354 * 7; #X obj 440 31 t b b b; -#X text 162 619 color and position are updated at every frame. you -just have to change array value....; -#X text 156 504 replace this with iem_tab_* stuff in order to increase -performance if you wish to update point positions at every frame; +#X text 162 619 color and position are updated at every frame. you just have to change array value....; +#X text 156 504 replace this with iem_tab_* stuff in order to increase performance if you wish to update point positions at every frame; #X obj 36 -2 inlet; #X obj 123 122 f; #X obj 279 120 f; -#X obj 438 6 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 438 6 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 123 56 sin; #X obj 123 78 + 1; #X obj 123 100 * 0.5; @@ -609,8 +560,7 @@ performance if you wish to update point positions at every frame; #X obj 106 549 loadbang; #X obj 43 163 translateXYZ 0 0 -2; #X obj 43 63 gemhead; -#X obj 61 306 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 61 306 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 61 346 t b; #X msg 106 572 resize 60000; #X msg 94 495 draw triangle; @@ -664,13 +614,11 @@ performance if you wish to update point positions at every frame; #X connect 33 0 34 0; #X connect 34 0 16 0; #X restore 849 184 pd wave; -#X obj 849 162 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 849 162 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #N canvas 786 231 654 435 oscillo~ 0; #X obj 47 78 gemhead; #X obj 122 116 adc~; -#X obj 218 63 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; +#X obj 218 63 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 218 41 loadbang; #X obj 47 5 inlet; #X obj 123 152 *~ 3; @@ -696,12 +644,12 @@ performance if you wish to update point positions at every frame; #X obj 118 231 table \$0phasor 8192; #X obj 79 306 i \$0; #X msg 79 342 posX \$1phasor \, posY \$1sound; -#X floatatom 155 34 5 0 0 0 - - -; +#X floatatom 155 34 5 0 0 0 - - - 0; #X obj 15 157 scale 1; -#X floatatom 52 115 5 0 0 0 - - -; +#X floatatom 52 115 5 0 0 0 - - - 0; #X msg 227 395 draw points; #X msg 298 73 8192; -#X floatatom 298 95 5 0 0 0 - - -; +#X floatatom 298 95 5 0 0 0 - - - 0; #X obj 298 234 /; #X obj 298 118 t f b f f; #X msg 414 154 resize \$1; @@ -752,31 +700,22 @@ performance if you wish to update point positions at every frame; #X connect 37 1 38 0; #X connect 37 2 39 0; #X restore 849 141 pd oscillo~; -#X obj 849 121 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 849 121 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 846 60 other examples; -#X text 27 327 Inlet 1: message: texture / textureU / textureV: update -vertex texcoords from tables; -#X text 27 357 Inlet 1: message: normal / normalX / normalY / normalZ: -update vertex normals from tables; -#X text 27 297 Inlet 1: message: color / colorR / colorG / colorB / -colorA: update vertex colors from tables; -#X text 27 267 Inlet 1: message: position / posX / posY / posZ: update -vertex positions from tables; +#X text 27 327 Inlet 1: message: texture / textureU / textureV: update vertex texcoords from tables; +#X text 27 357 Inlet 1: message: normal / normalX / normalY / normalZ: update vertex normals from tables; +#X text 27 297 Inlet 1: message: color / colorR / colorG / colorB / colorA: update vertex colors from tables; +#X text 27 267 Inlet 1: message: position / posX / posY / posZ: update vertex positions from tables; #N canvas 428 155 679 574 tabledata 0; #X text 65 43 applying table data as vertex data; #X msg 30 100 position tabX tabY tabZ 0; #X msg 30 130 position tabXYZ 0; -#X text 200 102 will read X \, Y & Z values from the 3 tables as position -data \, starting at offset=0 (offset can be omitted); -#X text 200 132 will read interleaved X \, Y & Z values from the table -tabXYZ \, starting at offset=0 (offset can be omitted); -#X text 200 172 will update only X values from given table (starting -at offset=10); +#X text 200 102 will read X \, Y & Z values from the 3 tables as position data \, starting at offset=0 (offset can be omitted); +#X text 200 132 will read interleaved X \, Y & Z values from the table tabXYZ \, starting at offset=0 (offset can be omitted); +#X text 200 172 will update only X values from given table (starting at offset=10); #X msg 31 169 posX tabX 10; #X msg 31 209 posY tabY; -#X text 200 212 will update only Y values from given table (starting -at default offset=0); +#X text 200 212 will update only Y values from given table (starting at default offset=0); #X text 39 290 the same applies to the other vertex data types:; #X msg 234 346 colorR r; #X msg 294 346 colorG g; @@ -798,15 +737,11 @@ at default offset=0); #X msg 234 316 positionX X; #X msg 314 316 positionY Y; #X msg 394 316 positionZ Z; -#X text 51 453 offset is always optional (default:0) \, and comes after -the table names; +#X text 51 453 offset is always optional (default:0) \, and comes after the table names; #X text 50 507 unset table data is initialized to 0.f; #X restore 464 333 pd tabledata; -#X text 27 384 Inlet 1: message: resize float : change the number of -vertex to use; -#X text 23 98 Vertex position \, color etc can be copy from pd table -to the vertex buffer (VBO = Vertex Buffer Object). This object can -draw lot's of points very efficiently.; +#X text 27 384 Inlet 1: message: resize float : change the number of vertex to use; +#X text 23 98 Vertex position \, color etc can be copy from pd table to the vertex buffer (VBO = Vertex Buffer Object). This object can draw lot's of points very efficiently.; #X obj 696 191 t b b b; #N canvas 990 92 450 459 load_tables 0; #X obj 31 71 noise~; @@ -856,78 +791,80 @@ draw lot's of points very efficiently.; #X obj 579 675 gemvertexbuffer; #X msg 728 569 draw_range \$1 \$2; #X obj 728 549 pack 0 0; -#X floatatom 728 507 5 0 0 0 - - -; -#X floatatom 774 507 5 0 0 0 - - -; +#X floatatom 728 507 5 0 0 0 - - - 0; +#X floatatom 774 507 5 0 0 0 - - - 0; #X obj 774 526 t b f; -#X text 27 452 Inlet 1: message: draw_range float float : set the range -for partial draw.; -#X text 726 480 set start and end indexes to draw only a range of VBO -, f 33; +#X text 27 452 Inlet 1: message: draw_range float float : set the range for partial draw.; +#X text 726 480 set start and end indexes to draw only a range of VBO, f 33; #X text 668 458 as soon as they are updated; -#X text 598 443 default : all VBO are disabled \, but they are enabled -; -#X floatatom 699 135 5 1 64 0 - - -; -#X floatatom 719 113 5 0 0 0 - - -; -#X text 27 479 Inlet 1: message: program float : set the id for glsl -program.; -#X text 27 409 Inlet 1: message: position_enable float \, color_enable -float \, texture_enable float \, normal_enable float \, attribute_enable -float : enable/disable the use of this data; -#X text 27 507 Inlet 1: message: attribute name table (offset) : add -attribute / update attribute from table; -#X text 27 537 Inlet 1: message: reset_attributes : clear attribute -data; -#X text 27 552 Inlet 1: message: print_attributes : print active attributes -; -#X text 14 646 see examples/10.glsl/16.vertexbuffer_attributes.pd on -how to; +#X text 598 443 default : all VBO are disabled \, but they are enabled; +#X floatatom 699 135 5 1 64 0 - - - 0; +#X floatatom 719 113 5 0 0 0 - - - 0; +#X text 27 479 Inlet 1: message: program float : set the id for glsl program.; +#X text 27 409 Inlet 1: message: position_enable float \, color_enable float \, texture_enable float \, normal_enable float \, attribute_enable float : enable/disable the use of this data; +#X text 27 507 Inlet 1: message: attribute name table (offset) : add attribute / update attribute from table; +#X text 27 537 Inlet 1: message: reset_attributes : clear attribute data; +#X text 27 552 Inlet 1: message: print_attributes : print active attributes; +#X text 14 646 see examples/10.glsl/16.vertexbuffer_attributes.pd on how to; #X text 15 661 use attribute tables with the vertex buffer.; -#X text 57 190 number of vertices to be used. if this is a power of -two (2^n) \, you might have some performance gain.; +#X text 57 190 number of vertices to be used. if this is a power of two (2^n) \, you might have some performance gain.; #X obj 868 8 declare -lib Gem; +#N canvas 735 418 450 300 startDSP 0; +#X obj 46 30 inlet; +#X obj 46 97 select 1; +#X obj 46 120 t b b; +#X obj 46 143 delay 100; +#X obj 46 166 s \$0-init100; +#X msg 137 166 \; pd dsp 1; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 5 0; +#X connect 3 0 4 0; +#X restore 469 484 pd startDSP; +#X obj 469 426 _gemwin 100; +#X obj 579 195 pix_test \; noise 0; #X connect 0 0 1 0; #X connect 9 0 10 0; #X connect 10 0 9 0; -#X connect 20 0 69 0; -#X connect 21 0 69 0; -#X connect 22 0 69 0; +#X connect 20 0 65 0; +#X connect 21 0 65 0; +#X connect 22 0 65 0; #X connect 23 0 22 0; -#X connect 24 0 36 0; -#X connect 25 0 44 0; -#X connect 26 0 46 0; +#X connect 24 0 88 0; +#X connect 25 0 40 0; +#X connect 26 0 42 0; #X connect 27 0 24 0; #X connect 28 0 26 0; #X connect 30 0 31 0; -#X connect 31 0 69 0; +#X connect 31 0 65 0; #X connect 32 0 35 0; #X connect 33 0 34 0; -#X connect 34 0 69 0; -#X connect 35 0 69 0; -#X connect 36 0 37 0; -#X connect 37 0 69 0; -#X connect 38 0 39 0; -#X connect 39 0 40 0; -#X connect 40 0 36 0; -#X connect 42 0 28 0; -#X connect 44 0 69 0; -#X connect 45 0 46 1; -#X connect 46 0 27 0; -#X connect 47 0 69 0; -#X connect 48 0 69 0; -#X connect 49 0 69 0; -#X connect 50 0 69 0; -#X connect 51 0 67 0; +#X connect 34 0 65 0; +#X connect 35 0 65 0; +#X connect 36 0 65 0; +#X connect 38 0 28 0; +#X connect 40 0 65 0; +#X connect 41 0 42 1; +#X connect 42 0 27 0; +#X connect 43 0 65 0; +#X connect 44 0 65 0; +#X connect 45 0 65 0; +#X connect 46 0 65 0; +#X connect 47 0 63 0; +#X connect 50 0 49 0; +#X connect 52 0 51 0; #X connect 54 0 53 0; -#X connect 56 0 55 0; -#X connect 58 0 57 0; -#X connect 67 0 47 0; -#X connect 67 1 48 0; -#X connect 67 2 68 0; -#X connect 70 0 69 0; -#X connect 71 0 70 0; -#X connect 72 0 71 0; -#X connect 73 0 74 0; -#X connect 74 0 71 0; -#X connect 74 1 71 1; -#X connect 79 0 24 1; -#X connect 80 0 27 3; +#X connect 63 0 43 0; +#X connect 63 1 44 0; +#X connect 63 2 64 0; +#X connect 66 0 65 0; +#X connect 67 0 66 0; +#X connect 68 0 67 0; +#X connect 69 0 70 0; +#X connect 70 0 67 0; +#X connect 70 1 67 1; +#X connect 75 0 24 1; +#X connect 76 0 27 3; +#X connect 87 0 86 0; +#X connect 88 0 36 0; diff --git a/help/glsl_fragment-help.pd b/help/glsl_fragment-help.pd index c374e193d..76d68e194 100644 --- a/help/glsl_fragment-help.pd +++ b/help/glsl_fragment-help.pd @@ -1,73 +1,36 @@ #N canvas 90 61 633 413 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 257 cnv 15 430 140 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 257 cnv 15 430 140 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 258 Inlets:; #X text 10 348 Outlets:; -#X obj 8 222 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 222 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 222 Arguments:; -#X obj 7 66 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 451 77 cnv 15 170 170 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 66 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 451 77 cnv 15 170 170 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 456 108 cnv 15 160 130 empty empty empty 35 12 0 14 -24198 -66577 -0; +#X obj 456 108 cnv 15 160 130 empty empty empty 35 12 0 14 #14e814 #404040 0; #X text 14 361 Outlet 1: gemlist; #X text 21 272 Inlet 1: gemlist; -#X obj 10 153 cnv 15 420 50 empty empty empty 20 12 0 14 -225280 -66577 -0; +#X obj 10 153 cnv 15 420 50 empty empty empty 20 12 0 14 #d8fcfc #404040 0; #X text 71 31 Class: shader object; #X text 451 325 see also:; #X obj 453 362 glsl_vertex; -#X text 14 157 IMPORTANT NOTE: your openGL-implementation (gfx-card -driver \, ...) has to support the GLSL-standard (which is part of openGL-2.0) -in order to make use of this object.; -#X floatatom 545 216 0 0 0 0 ID - -; +#X text 14 157 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support the GLSL-standard (which is part of openGL-2.0) in order to make use of this object.; +#X floatatom 545 216 0 0 0 0 ID - - 0; #X obj 459 193 glsl_fragment; #X obj 453 342 glsl_program; #X text 50 12 Synopsis: [glsl_fragment]; #X text 13 66 Description: load a GLSL fragment shader; -#X text 14 85 [glsl_fragment] loads and compiles a GLSL fragment shader -into a module \, suitable for linking with [glsl_program]; -#X text 17 118 An ID of the generated module is sent to the 2nd outlet. -Use this ID in the "shader" message to [glsl_program]; -#X text 63 233 : filename to load as GLSL fragment shader -; -#X text 21 284 Inlet 1: "open ": filename to load as GLSL -fragment shader module.; -#X text 21 315 Inlet 1: "print": print info about the GLSL-support -in your openGL implementation; +#X text 14 85 [glsl_fragment] loads and compiles a GLSL fragment shader into a module \, suitable for linking with [glsl_program]; +#X text 17 118 An ID of the generated module is sent to the 2nd outlet. Use this ID in the "shader" message to [glsl_program]; +#X text 63 233 : filename to load as GLSL fragment shader; +#X text 21 284 Inlet 1: "open ": filename to load as GLSL fragment shader module.; +#X text 21 315 Inlet 1: "print": print info about the GLSL-support in your openGL implementation; #X text 14 376 Outlet 2: : ID of the GLSL-module; #X obj 459 86 gemhead; #X msg 552 170 print; -#X obj 521 261 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 526 300 pd gemwin; -#X msg 526 281 create; -#X text 522 260 Create window:; -#X obj 527 117 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 527 117 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 open 0; #X obj 312 45 openpanel; #X obj 311 157 outlet; @@ -83,11 +46,10 @@ in your openGL implementation; #X msg 470 136 open Toon.frag; #X obj 453 382 glsl_geometry; #X obj 518 8 declare -lib Gem; +#X obj 533 252 _gemwin; #X connect 18 1 17 0; #X connect 28 0 18 0; #X connect 29 0 18 0; +#X connect 30 0 31 0; #X connect 31 0 32 0; -#X connect 32 0 31 0; -#X connect 34 0 35 0; -#X connect 35 0 36 0; -#X connect 36 0 18 0; +#X connect 32 0 18 0; diff --git a/help/glsl_geometry-help.pd b/help/glsl_geometry-help.pd index 4b4b36796..899d3fa6d 100644 --- a/help/glsl_geometry-help.pd +++ b/help/glsl_geometry-help.pd @@ -1,70 +1,35 @@ #N canvas 40 61 638 426 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 257 cnv 15 430 140 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 257 cnv 15 430 140 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 258 Inlets:; #X text 10 348 Outlets:; -#X obj 8 222 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 222 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 222 Arguments:; -#X obj 7 66 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 451 77 cnv 15 170 170 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 66 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 451 77 cnv 15 170 170 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 456 108 cnv 15 160 130 empty empty empty 35 12 0 14 -24198 -66577 -0; +#X obj 456 108 cnv 15 160 130 empty empty empty 35 12 0 14 #14e814 #404040 0; #X text 14 361 Outlet 1: gemlist; #X text 21 272 Inlet 1: gemlist; -#X obj 10 153 cnv 15 420 50 empty empty empty 20 12 0 14 -225280 -66577 -0; +#X obj 10 153 cnv 15 420 50 empty empty empty 20 12 0 14 #d8fcfc #404040 0; #X text 71 31 Class: shader object; #X text 451 325 see also:; -#X floatatom 546 219 0 0 0 0 ID - -; +#X floatatom 546 219 0 0 0 0 ID - - 0; #X obj 460 196 glsl_geometry; #X obj 453 342 glsl_program; #X text 50 12 Synopsis: [glsl_geometry]; #X text 13 66 Description: load a GLSL geometry shader; -#X text 14 85 [glsl_geometry] loads and compiles a GLSL geometry shader -into a module \, suitable for linking with [glsl_program]; -#X text 17 118 An ID of the generated module is sent to the 2nd outlet. -Use this ID in the "shader" message to [glsl_program]; -#X text 63 233 : filename to load as GLSL geometry shader -; -#X text 21 284 Inlet 1: "open ": filename to load as GLSL -geometry shader module.; -#X text 21 315 Inlet 1: "print": print info about the GLSL-support -in your openGL implementation; +#X text 14 85 [glsl_geometry] loads and compiles a GLSL geometry shader into a module \, suitable for linking with [glsl_program]; +#X text 17 118 An ID of the generated module is sent to the 2nd outlet. Use this ID in the "shader" message to [glsl_program]; +#X text 63 233 : filename to load as GLSL geometry shader; +#X text 21 284 Inlet 1: "open ": filename to load as GLSL geometry shader module.; +#X text 21 315 Inlet 1: "print": print info about the GLSL-support in your openGL implementation; #X text 14 376 Outlet 2: : ID of the GLSL-module; #X obj 460 86 gemhead; #X msg 521 174 print; -#X obj 521 261 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 526 300 pd gemwin; -#X msg 526 281 create; -#X text 522 260 Create window:; #X obj 453 363 glsl_fragment; -#X obj 530 120 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 530 120 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 open 0; #X obj 312 45 openpanel; #X obj 312 157 outlet; @@ -79,15 +44,12 @@ in your openGL implementation; #X restore 473 119 pd open; #X obj 453 383 glsl_geometry; #X msg 473 141 open Toon.geom; -#X text 14 157 IMPORTANT NOTE: your openGL-implementation (gfx-card -driver \, ...) has to support the GLSL-standard (which is part of openGL-2.1) -in order to make use of this object.; +#X text 14 157 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support the GLSL-standard (which is part of openGL-2.1) in order to make use of this object.; #X obj 518 8 declare -lib Gem; +#X obj 533 262 _gemwin; #X connect 16 1 15 0; #X connect 26 0 16 0; #X connect 27 0 16 0; #X connect 29 0 30 0; -#X connect 30 0 29 0; -#X connect 33 0 34 0; -#X connect 34 0 36 0; -#X connect 36 0 16 0; +#X connect 30 0 32 0; +#X connect 32 0 16 0; diff --git a/help/glsl_program-help.pd b/help/glsl_program-help.pd index afaeff970..b6931356b 100644 --- a/help/glsl_program-help.pd +++ b/help/glsl_program-help.pd @@ -37,28 +37,6 @@ #X obj 451 86 gemhead; #X msg 460 120 print; #X msg 518 141 link 1 3; -#X obj 513 257 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 518 296 pd gemwin; -#X msg 518 277 create; -#X text 514 256 Create window:; #X text 21 367 Inlet 1: "print": print info about the GLSL-support in your openGL implementation and about the linked program, f 67; #N canvas 74 576 496 338 geometry 1; #X obj 28 27 cnv 15 430 280 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -100,6 +78,7 @@ #X connect 10 0 9 0; #X connect 12 0 2 0; #X restore 84 201 pd uniform variables; +#X obj 523 272 _gemwin; #X connect 16 0 17 0; #X connect 16 1 31 0; #X connect 32 0 16 0; @@ -107,6 +86,4 @@ #X connect 34 0 16 0; #X connect 35 0 16 0; #X connect 36 0 16 0; -#X connect 38 0 39 0; -#X connect 39 0 38 0; -#X connect 45 0 16 0; +#X connect 41 0 16 0; diff --git a/help/glsl_vertex-help.pd b/help/glsl_vertex-help.pd index cf444dd58..6f0da800c 100644 --- a/help/glsl_vertex-help.pd +++ b/help/glsl_vertex-help.pd @@ -1,72 +1,36 @@ #N canvas 40 61 633 413 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 257 cnv 15 430 140 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 257 cnv 15 430 140 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 258 Inlets:; #X text 10 348 Outlets:; -#X obj 8 222 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 222 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 222 Arguments:; -#X obj 7 66 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 451 77 cnv 15 170 170 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 66 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 451 77 cnv 15 170 170 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 456 108 cnv 15 160 130 empty empty empty 35 12 0 14 -24198 -66577 -0; +#X obj 456 108 cnv 15 160 130 empty empty empty 35 12 0 14 #14e814 #404040 0; #X text 14 361 Outlet 1: gemlist; #X text 21 272 Inlet 1: gemlist; -#X obj 10 153 cnv 15 420 50 empty empty empty 20 12 0 14 -225280 -66577 -0; +#X obj 10 153 cnv 15 420 50 empty empty empty 20 12 0 14 #d8fcfc #404040 0; #X text 71 31 Class: shader object; #X text 451 325 see also:; -#X text 14 157 IMPORTANT NOTE: your openGL-implementation (gfx-card -driver \, ...) has to support the GLSL-standard (which is part of openGL-2.0) -in order to make use of this object.; -#X floatatom 546 219 0 0 0 0 ID - -; +#X text 14 157 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support the GLSL-standard (which is part of openGL-2.0) in order to make use of this object.; +#X floatatom 546 219 0 0 0 0 ID - - 0; #X obj 460 196 glsl_vertex; #X obj 453 342 glsl_program; #X text 50 12 Synopsis: [glsl_vertex]; #X text 13 66 Description: load a GLSL vertex shader; -#X text 14 85 [glsl_vertex] loads and compiles a GLSL vertex shader -into a module \, suitable for linking with [glsl_program]; -#X text 17 118 An ID of the generated module is sent to the 2nd outlet. -Use this ID in the "shader" message to [glsl_program]; +#X text 14 85 [glsl_vertex] loads and compiles a GLSL vertex shader into a module \, suitable for linking with [glsl_program]; +#X text 17 118 An ID of the generated module is sent to the 2nd outlet. Use this ID in the "shader" message to [glsl_program]; #X text 63 233 : filename to load as GLSL vertex shader; -#X text 21 284 Inlet 1: "open ": filename to load as GLSL -vertex shader module.; -#X text 21 315 Inlet 1: "print": print info about the GLSL-support -in your openGL implementation; +#X text 21 284 Inlet 1: "open ": filename to load as GLSL vertex shader module.; +#X text 21 315 Inlet 1: "print": print info about the GLSL-support in your openGL implementation; #X text 14 376 Outlet 2: : ID of the GLSL-module; #X obj 460 86 gemhead; #X msg 521 174 print; -#X obj 521 261 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 526 300 pd gemwin; -#X msg 526 281 create; -#X text 522 260 Create window:; #X obj 453 362 glsl_fragment; -#X obj 530 120 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 530 120 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 open 0; #X obj 312 45 openpanel; #X obj 311 157 outlet; @@ -82,11 +46,10 @@ in your openGL implementation; #X msg 473 139 open Toon.vert; #X obj 453 382 glsl_geometry; #X obj 518 8 declare -lib Gem; +#X obj 533 252 _gemwin; #X connect 17 1 16 0; #X connect 27 0 17 0; #X connect 28 0 17 0; #X connect 30 0 31 0; -#X connect 31 0 30 0; -#X connect 34 0 35 0; -#X connect 35 0 36 0; -#X connect 36 0 17 0; +#X connect 31 0 32 0; +#X connect 32 0 17 0; diff --git a/help/imageVert-help.pd b/help/imageVert-help.pd index c99b9bf68..726bb9fda 100644 --- a/help/imageVert-help.pd +++ b/help/imageVert-help.pd @@ -1,46 +1,17 @@ #N canvas 344 61 655 397 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 250 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 186 cnv 15 80 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 186 cnv 15 80 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 591 370 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -50,9 +21,7 @@ #X obj 77 281 pix_buf; #X msg 103 257 auto 1; #X obj 103 236 loadbang; -#X text 156 263 [pix_buf] with auto 1 is important if we want to recalculate -our pix-effect each frame but don't want to reload the image all the -time.; +#X text 156 263 [pix_buf] with auto 1 is important if we want to recalculate our pix-effect each frame but don't want to reload the image all the time.; #X obj 77 205 pix_image examples/data/fractal.JPG; #X connect 0 0 9 0; #X connect 2 0 4 0; @@ -69,22 +38,18 @@ time.; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 196 imageVert; -#X text 10 135 This is still experimental...please report any problems -or suggestions with it.; -#X text 14 91 [imageVert] maps a pix to a series of polygons. The height -of the polygons is the sum of the colors (so brighter pixels will be -taller \, while darker pixels are shorter).; +#X text 10 135 This is still experimental...please report any problems or suggestions with it.; +#X text 14 91 [imageVert] maps a pix to a series of polygons. The height of the polygons is the sum of the colors (so brighter pixels will be taller \, while darker pixels are shorter).; #X text 29 77 Description: map luminance to height; #X text 50 12 Synopsis: [imageVertp]; #X text 71 31 Class: geometric object; #X obj 451 165 rotateXYZ; -#X floatatom 476 144 5 0 0 0 - - -; +#X floatatom 476 144 5 0 0 0 - - - 0; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 28 0; -#X connect 28 0 22 0; -#X connect 29 0 28 1; -#X connect 29 0 28 2; +#X obj 522 272 _gemwin; +#X connect 10 0 12 0; +#X connect 11 0 12 1; +#X connect 12 0 24 0; +#X connect 24 0 18 0; +#X connect 25 0 24 1; +#X connect 25 0 24 2; diff --git a/help/light-help.pd b/help/light-help.pd index 967d8e44a..eb05bd6b6 100644 --- a/help/light-help.pd +++ b/help/light-help.pd @@ -1,100 +1,56 @@ #N canvas 124 217 710 507 10; #X declare -lib Gem; #X text 475 49 Example:; -#X obj 7 64 cnv 15 450 220 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 336 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 64 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 336 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 339 Inlets:; -#X obj 8 296 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 296 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 295 Arguments:; #X text 452 8 GEM object; #X text 27 351 Inlet 1: gemlist; #X text 9 406 Outlets:; #X text 21 419 Outlet 1: gemlist; -#X obj 469 67 cnv 15 170 320 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 474 321 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 256 112 destroy; -#X obj 322 45 inlet; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 8 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X restore 479 360 pd gemwin; -#X msg 479 341 create; -#X text 475 320 Create window:; -#X obj 475 160 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 469 67 cnv 15 170 320 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 475 160 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 483 74 gemhead; #X text 33 14 Synopsis: [light]; #X text 53 30 Class: non-geometric object; #X text 7 69 Description: adds a point-light to the scene; -#X text 18 86 [light] produces a light which is local to the scene -(unlike [world_light] which is at an infinite distance). Because light -is local light \, there is more computation required. Use a world_light -if you don't mind parallel light rays.; +#X text 18 86 [light] produces a light which is local to the scene (unlike [world_light] which is at an infinite distance). Because light is local light \, there is more computation required. Use a world_light if you don't mind parallel light rays.; #X text 27 373 Inlet 1: message: debug 1|0 (default:0); #X text 28 388 Inlet 2: list: 3(RGB) or 4(RGBA) float values; #X obj 483 235 light; #X msg 570 213 1 1 1; -#X obj 527 163 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 527 163 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 527 184 debug \$1; -#X text 19 219 Keep in mind that the attributes have to be set before -rendering the vertices \, so if you are trying for frame accurate rendering -\, you will want to set the gemhead order to a low number so that all -of the values of the light get set first.; +#X text 19 219 Keep in mind that the attributes have to be set before rendering the vertices \, so if you are trying for frame accurate rendering \, you will want to set the gemhead order to a low number so that all of the values of the light get set first.; #X obj 472 296 sphere; -#X floatatom 563 78 5 0 0 0 - - -; +#X floatatom 563 78 5 0 0 0 - - - 0; #X obj 483 139 translateXYZ 2 0 0; #X obj 483 96 rotateXYZ 0 -120 0; #X obj 472 274 gemhead 40; -#X floatatom 523 121 5 1 4 0 - - -; -#X obj 549 266 cnv 15 85 50 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X floatatom 523 121 5 1 4 0 - - - 0; +#X obj 549 266 cnv 15 85 50 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 551 293 lighting \$1; -#X obj 551 271 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X text 17 155 You can place the light with [rotate] and [translate]. -If you are lost use "debug" to display the light source as a small -sphere.; +#X obj 551 271 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X text 17 155 You can place the light with [rotate] and [translate]. If you are lost use "debug" to display the light source as a small sphere.; #X msg 513 213 1 1 0; -#X text 18 200 The second inlet sets the color of the light-source. -; +#X text 18 200 The second inlet sets the color of the light-source.; #X text 63 307 light-number; -#X obj 492 175 tgl 20 0 empty \$0-onoff empty 17 7 0 10 -262144 -1 --1 0 1; +#X obj 492 175 tgl 20 0 empty \$0-onoff empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 27 362 Inlet 1: float: turn light on/off (default:1); #X obj 538 9 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 16 0 31 0; -#X connect 24 0 23 1; -#X connect 25 0 26 0; -#X connect 26 0 23 0; -#X connect 29 0 31 2; -#X connect 30 0 23 0; -#X connect 31 0 30 0; -#X connect 32 0 28 0; -#X connect 33 0 30 1; -#X connect 35 0 12 1; -#X connect 36 0 35 0; -#X connect 38 0 23 1; -#X connect 41 0 23 0; +#X obj 551 337 _gemwin; +#X connect 12 0 27 0; +#X connect 20 0 19 1; +#X connect 21 0 22 0; +#X connect 22 0 19 0; +#X connect 25 0 27 2; +#X connect 26 0 19 0; +#X connect 27 0 26 0; +#X connect 28 0 24 0; +#X connect 29 0 26 1; +#X connect 31 0 40 0; +#X connect 32 0 31 0; +#X connect 34 0 19 1; +#X connect 37 0 19 0; diff --git a/help/mesh_line-help.pd b/help/mesh_line-help.pd index bc600d922..de3a56d8a 100644 --- a/help/mesh_line-help.pd +++ b/help/mesh_line-help.pd @@ -1,38 +1,11 @@ #N canvas 379 171 706 465 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 470 65 cnv 15 230 390 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 593 385 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 598 424 pd gemwin; -#X msg 598 405 create; -#X text 594 384 Create window:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 150 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 470 65 cnv 15 230 390 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 27 277 Inlet 2: float: size; #X text 508 8 GEM object; @@ -40,39 +13,33 @@ #X text 9 321 Outlets:; #X text 21 334 Outlet 1: gemlist; #X text 476 47 Example:; -#X obj 473 96 cnv 15 220 280 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 473 96 cnv 15 220 280 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 476 127 draw line; #X msg 476 146 draw point; #X obj 544 72 gemhead; -#X floatatom 647 318 5 0 0 0 - - -; +#X floatatom 647 318 5 0 0 0 - - - 0; #X text 647 302 size; #X msg 476 108 draw default; #X msg 478 223 grid \$1; -#X floatatom 478 205 5 0 0 0 - - -; +#X floatatom 478 205 5 0 0 0 - - - 0; #X obj 478 292 t a; #X obj 476 167 t a; #X text 7 69 Description: Renders a mesh; #X text 27 247 Inlet 1: message: draw [line|default|point]; -#X text 27 261 Inlet 1: list: grid float : change the grid resolution -; +#X text 27 261 Inlet 1: list: grid float : change the grid resolution; #X obj 544 340 mesh_line 3; #X text 32 14 Synopsis: [mesh_line]; -#X text 16 86 The [mesh_line] object renders a mesh in a line at the -current position with current color. The size of the line can be changed -via the second inlet. This object is useful when working with vertex_shader -; +#X text 16 86 The [mesh_line] object renders a mesh in a line at the current position with current color. The size of the line can be changed via the second inlet. This object is useful when working with vertex_shader; #X text 63 186 resolution of the line mesh; #X text 575 107 (draw line); #X obj 578 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 27 0; -#X connect 19 0 27 0; -#X connect 20 0 31 0; -#X connect 21 0 31 1; +#X obj 603 402 _gemwin; +#X connect 14 0 23 0; +#X connect 15 0 23 0; +#X connect 16 0 27 0; +#X connect 17 0 27 1; +#X connect 19 0 23 0; +#X connect 20 0 22 0; +#X connect 21 0 20 0; +#X connect 22 0 27 0; #X connect 23 0 27 0; -#X connect 24 0 26 0; -#X connect 25 0 24 0; -#X connect 26 0 31 0; -#X connect 27 0 31 0; diff --git a/help/mesh_square-help.pd b/help/mesh_square-help.pd index 1f983ee57..bac10c299 100644 --- a/help/mesh_square-help.pd +++ b/help/mesh_square-help.pd @@ -1,38 +1,11 @@ #N canvas 91 105 706 465 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 470 65 cnv 15 230 390 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 593 385 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 598 424 pd gemwin; -#X msg 598 405 create; -#X text 594 384 Create window:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 150 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 470 65 cnv 15 230 390 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 27 302 Inlet 2: float: size; #X text 508 11 GEM object; @@ -40,50 +13,42 @@ #X text 9 321 Outlets:; #X text 21 334 Outlet 1: gemlist; #X text 476 47 Example:; -#X obj 473 96 cnv 15 220 280 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 473 96 cnv 15 220 280 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 476 127 draw line; #X msg 476 146 draw point; #X obj 544 72 gemhead; -#X floatatom 647 318 5 0 0 0 - - -; +#X floatatom 647 318 5 0 0 0 - - - 0; #X text 647 302 size; #X text 32 14 Synopsis: [mesh_square]; #X obj 545 342 mesh_square 3 3; #X msg 476 108 draw default; #X msg 478 223 grid \$1; -#X floatatom 478 205 5 0 0 0 - - -; -#X floatatom 483 247 5 0 0 0 - - -; +#X floatatom 478 205 5 0 0 0 - - - 0; +#X floatatom 483 247 5 0 0 0 - - - 0; #X msg 483 265 gridX \$1; -#X floatatom 552 247 5 0 0 0 - - -; +#X floatatom 552 247 5 0 0 0 - - - 0; #X msg 552 265 gridY \$1; #X obj 478 292 t a; #X obj 476 167 t a; #X text 7 69 Description: Renders a mesh; #X text 63 186 resolution of the mesh; #X text 27 247 Inlet 1: message: draw [line|default|point]; -#X text 27 261 Inlet 1: list: grid float : change the grid resolution -; -#X text 27 274 Inlet 1: list: gridX float : change the X grid resolution -; -#X text 27 288 Inlet 1: list: gridY float : change the Y grid resolution -; -#X text 16 86 The [mesh_square] object renders a mesh in a square at -the current position with current color. The size of the square can -be changed via the second inlet. This object is useful when working -with vertex_shader; +#X text 27 261 Inlet 1: list: grid float : change the grid resolution; +#X text 27 274 Inlet 1: list: gridX float : change the X grid resolution; +#X text 27 288 Inlet 1: list: gridY float : change the Y grid resolution; +#X text 16 86 The [mesh_square] object renders a mesh in a square at the current position with current color. The size of the square can be changed via the second inlet. This object is useful when working with vertex_shader; #X obj 578 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 33 0; -#X connect 19 0 33 0; -#X connect 20 0 24 0; -#X connect 21 0 24 1; -#X connect 25 0 33 0; -#X connect 26 0 32 0; -#X connect 27 0 26 0; -#X connect 28 0 29 0; -#X connect 29 0 32 0; -#X connect 30 0 31 0; -#X connect 31 0 32 0; -#X connect 32 0 24 0; -#X connect 33 0 24 0; +#X obj 603 402 _gemwin; +#X connect 14 0 29 0; +#X connect 15 0 29 0; +#X connect 16 0 20 0; +#X connect 17 0 20 1; +#X connect 21 0 29 0; +#X connect 22 0 28 0; +#X connect 23 0 22 0; +#X connect 24 0 25 0; +#X connect 25 0 28 0; +#X connect 26 0 27 0; +#X connect 27 0 28 0; +#X connect 28 0 20 0; +#X connect 29 0 20 0; diff --git a/help/model-help.pd b/help/model-help.pd index 5aaad4b51..bbdcc27de 100644 --- a/help/model-help.pd +++ b/help/model-help.pd @@ -2,28 +2,7 @@ #X declare -lib Gem; #X text 54 30 Class: geometric object; #X obj 464 77 cnv 15 200 480 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 466 564 cnv 15 200 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1 \, lighting 1; -#X msg 298 112 destroy \, reset; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 471 603 pd gemwin; -#X msg 471 584 create; -#X text 468 565 Create window:; +#X obj 466 564 cnv 15 200 80 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 475 59 Example:; #X obj 7 67 cnv 15 450 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 316 cnv 15 450 320 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -40,7 +19,7 @@ #X text 16 86 The model object renders 3D-models that are saved in Alias/Wavefront's OBJ-format.; #X text 63 292 optional: name of a OBJ-file to be loaded; #X obj 470 473 cnv 15 50 30 empty empty empty 20 12 0 14 #14e814 #404040 0; -#X obj 583 584 gemhead; +#X obj 583 581 gemhead; #X obj 583 603 world_light; #X obj 473 84 gemhead; #X obj 473 479 model; @@ -119,31 +98,30 @@ #X connect 8 0 16 0; #X connect 10 0 16 0; #X restore 353 648 pd properties; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 22 0 23 0; -#X connect 24 0 48 0; -#X connect 25 1 64 0; -#X connect 26 0 27 0; -#X connect 27 0 37 0; +#X obj 473 572 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 19 0 20 0; +#X connect 21 0 45 0; +#X connect 22 1 61 0; +#X connect 23 0 24 0; +#X connect 24 0 34 0; +#X connect 25 0 26 0; +#X connect 26 0 56 0; +#X connect 27 0 55 0; #X connect 28 0 29 0; -#X connect 29 0 59 0; -#X connect 30 0 58 0; -#X connect 31 0 32 0; -#X connect 32 0 59 0; -#X connect 33 0 58 0; -#X connect 34 0 59 0; -#X connect 35 0 59 0; -#X connect 36 0 30 0; -#X connect 37 0 58 0; -#X connect 38 0 35 0; -#X connect 48 0 58 0; -#X connect 49 0 33 0; -#X connect 52 0 34 0; -#X connect 54 0 61 0; -#X connect 55 0 61 0; -#X connect 57 0 61 0; -#X connect 58 0 25 0; -#X connect 59 0 25 0; -#X connect 61 0 25 0; -#X connect 63 0 25 0; +#X connect 29 0 56 0; +#X connect 30 0 55 0; +#X connect 31 0 56 0; +#X connect 32 0 56 0; +#X connect 33 0 27 0; +#X connect 34 0 55 0; +#X connect 35 0 32 0; +#X connect 45 0 55 0; +#X connect 46 0 30 0; +#X connect 49 0 31 0; +#X connect 51 0 58 0; +#X connect 52 0 58 0; +#X connect 54 0 58 0; +#X connect 55 0 22 0; +#X connect 56 0 22 0; +#X connect 58 0 22 0; +#X connect 60 0 22 0; diff --git a/help/multimodel-help.pd b/help/multimodel-help.pd index 2f41a929e..e88095692 100644 --- a/help/multimodel-help.pd +++ b/help/multimodel-help.pd @@ -1,71 +1,36 @@ #N canvas 368 61 710 490 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 464 77 cnv 15 200 180 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 466 294 cnv 15 200 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1 \, lighting 1; -#X msg 298 112 destroy \, reset; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 471 333 pd gemwin; -#X msg 471 314 create; -#X text 468 295 Create window:; +#X obj 464 77 cnv 15 200 180 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 466 294 cnv 15 200 80 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 475 59 Example:; -#X obj 7 67 cnv 15 450 200 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 316 cnv 15 450 160 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 67 cnv 15 450 200 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 316 cnv 15 450 160 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 321 Inlets:; -#X obj 8 276 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 276 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 275 Arguments:; #X text 452 8 GEM object; #X text 27 333 Inlet 1: gemlist; #X text 9 420 Outlets:; #X text 21 433 Outlet 1: gemlist; -#X obj 469 146 cnv 15 190 35 empty empty empty 20 12 0 14 -106458 -66577 -0; -#X obj 470 203 cnv 15 50 30 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 583 314 gemhead; +#X obj 469 146 cnv 15 190 35 empty empty empty 20 12 0 14 #64fc64 #404040 0; +#X obj 470 203 cnv 15 50 30 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 583 311 gemhead; #X obj 583 333 world_light; #X obj 473 84 gemhead; #X obj 492 413 model; #X text 472 394 see also:; #X text 33 14 Synopsis: [multimodel]; -#X text 19 117 The open message is the name of the of model file \, -the base model number (ie \, what number to start at) \, the top model -number (what number to end at) \, and the skip rate (how to count). -; -#X text 18 180 When you send the open message \, multimodel looks for -the * in the file name and replaces it with a number.; +#X text 19 117 The open message is the name of the of model file \, the base model number (ie \, what number to start at) \, the top model number (what number to end at) \, and the skip rate (how to count).; +#X text 18 180 When you send the open message \, multimodel looks for the * in the file name and replaces it with a number.; #X obj 473 209 multimodel; #X msg 482 156 open mymodel*.obj 0 10 1; -#X text 27 350 Inlet 1: message: open - ; +#X text 27 350 Inlet 1: message: open ; #X obj 563 412 pix_multiimage; -#X text 7 69 Description: load multiple an Alias/Wavefront-Model and -renders one of them; +#X text 7 69 Description: load multiple an Alias/Wavefront-Model and renders one of them; #X text 18 386 for other messages to [multimodel] see [model]; #X obj 558 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 19 0; -#X connect 20 0 26 0; -#X connect 27 0 26 0; +#X obj 483 301 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 15 0 16 0; +#X connect 17 0 23 0; +#X connect 24 0 23 0; diff --git a/help/newWave-help.pd b/help/newWave-help.pd index 7c021a30a..57cff1149 100644 --- a/help/newWave-help.pd +++ b/help/newWave-help.pd @@ -1,54 +1,23 @@ #N canvas 402 236 760 620 10; #X declare -lib Gem; #X text 54 27 Class: geometric object; -#X obj 479 47 cnv 15 250 550 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 484 533 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 454 304 gemwin 0; -#X obj 131 164 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 131 140 create \, 1 \, lighting 1; -#X obj 298 149 world_light; -#X obj 298 122 gemhead; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 9 0 8 0; -#X restore 489 571 pd gemwin; -#X msg 489 552 create; -#X text 485 532 Create window:; +#X obj 479 47 cnv 15 250 550 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 485 29 Example:; -#X obj 7 47 cnv 15 450 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 199 cnv 15 450 260 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 47 cnv 15 450 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 199 cnv 15 450 260 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 19 198 Inlets:; -#X obj 8 143 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 143 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 142 Arguments:; #X text 26 347 Inlet 1: message: draw [line|fill|point]; #X text 552 8 GEM object; #X text 27 210 Inlet 1: gemlist; #X text 9 420 Outlets:; #X text 20 433 Outlet 1: gemlist; -#X obj 484 141 cnv 15 240 380 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 484 141 cnv 15 240 380 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 494 54 gemhead; -#X floatatom 592 446 5 0 0 2 size - -; -#X floatatom 593 475 5 0 0 2 height - -; -#X floatatom 526 96 5 0 0 0 - - -; +#X floatatom 592 446 5 0 0 2 size - - 0; +#X floatatom 593 475 5 0 0 2 height - - 0; +#X floatatom 526 96 5 0 0 0 - - - 0; #X msg 523 172 draw line; #X msg 523 192 draw fill; #X msg 523 212 draw point; @@ -56,26 +25,22 @@ #X text 26 377 Inlet 2: float: size (dimX & dimY); #X text 26 391 Inlet 3: float: height (dimZ); #X text 26 405 Inlet 4: int: action; -#X obj 565 254 vradio 11 1 0 11 empty empty action -10 -6 0 8 -262144 --1 -1 0; -#X floatatom 626 158 5 0 100 0 - - -; +#X obj 565 254 vradio 11 1 0 11 empty empty action -10 -6 0 8 #fcfcfc #000000 #000000 0; +#X floatatom 626 158 5 0 100 0 - - - 0; #X obj 626 176 / 100; #X msg 626 195 K1 \$1; -#X text 16 68 The newWaves object renders a number of waving square -at the current position with current color. The size of the square -can be changed via the inlet2 \, the height of the wave can be set -via the 3rd inlet. You can also set the wave-form (inlet4); +#X text 16 68 The newWaves object renders a number of waving square at the current position with current color. The size of the square can be changed via the inlet2 \, the height of the wave can be set via the 3rd inlet. You can also set the wave-form (inlet4); #X text 26 223 Inlet 1: bang: trigger waving; #X obj 494 459 t a b; -#X floatatom 626 218 5 0 100 0 - - -; +#X floatatom 626 218 5 0 100 0 - - - 0; #X obj 626 236 / 100; -#X floatatom 626 278 5 0 100 0 - - -; +#X floatatom 626 278 5 0 100 0 - - - 0; #X obj 626 296 / 100; -#X floatatom 676 158 5 0 100 0 - - -; +#X floatatom 676 158 5 0 100 0 - - - 0; #X obj 676 176 / 100; -#X floatatom 676 218 5 0 100 0 - - -; +#X floatatom 676 218 5 0 100 0 - - - 0; #X obj 676 236 / 100; -#X floatatom 676 278 5 0 100 0 - - -; +#X floatatom 676 278 5 0 100 0 - - - 0; #X obj 676 296 / 100; #X msg 676 195 D1 \$1; #X msg 676 255 D2 \$1; @@ -85,16 +50,12 @@ via the 3rd inlet. You can also set the wave-form (inlet4); #X obj 595 272 t a; #X obj 595 212 t a; #X obj 595 332 t a; -#X text 27 237 Inlet 1: K1 \, D1 \, K2 \, D2 \, K3 \, D3: weight/damping -factors (defaults: K1=0.05 D1=0.1 K2=K3=D2=D3=0); +#X text 27 237 Inlet 1: K1 \, D1 \, K2 \, D2 \, K3 \, D3: weight/damping factors (defaults: K1=0.05 D1=0.1 K2=K3=D2=D3=0); #X msg 590 364 position 1 1 10; -#X text 25 265 Inlet 1: message: position (X Y Z): clamp the node at -(X Y) to a certain height and release it; -#X text 7 51 Description: Renders a waving square (mass-spring-system) -; +#X text 25 265 Inlet 1: message: position (X Y Z): clamp the node at (X Y) to a certain height and release it; +#X text 7 51 Description: Renders a waving square (mass-spring-system); #X msg 592 414 noise 1; -#X obj 8 465 cnv 15 450 130 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 465 cnv 15 450 130 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 13 465 actions:; #X text 84 471 00..retrigger current action; #X text 84 482 01..flat; @@ -113,48 +74,48 @@ factors (defaults: K1=0.05 D1=0.1 K2=K3=D2=D3=0); #X msg 502 146 texture 0; #X msg 591 389 force 15 5 -0.5; #X obj 494 115 rotateXYZ 135 0 0; -#X text 24 290 Inlet 1: message: force (X Y val): apply a force of -value "val" onto the wave at position (X Y); +#X text 24 290 Inlet 1: message: force (X Y val): apply a force of value "val" onto the wave at position (X Y); #X text 63 159 1 : X grid-resolution \, default : 3; #X text 63 171 2 : Y grid resolution \, default : X value; -#X text 26 362 Inlet 1 : message texture [1|2] : change texturing mode -; +#X text 26 362 Inlet 1 : message texture [1|2] : change texturing mode; #X obj 628 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 77 0; -#X connect 19 0 74 1; -#X connect 20 0 74 2; -#X connect 21 0 77 1; -#X connect 22 0 74 0; -#X connect 23 0 74 0; -#X connect 24 0 74 0; -#X connect 29 0 74 3; -#X connect 30 0 31 0; -#X connect 31 0 32 0; -#X connect 32 0 52 0; -#X connect 35 0 74 0; -#X connect 35 1 74 0; +#X obj 648 569 world_light; +#X obj 648 542 gemhead; +#X obj 492 528 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 14 0 73 0; +#X connect 15 0 70 1; +#X connect 16 0 70 2; +#X connect 17 0 73 1; +#X connect 18 0 70 0; +#X connect 19 0 70 0; +#X connect 20 0 70 0; +#X connect 25 0 70 3; +#X connect 26 0 27 0; +#X connect 27 0 28 0; +#X connect 28 0 48 0; +#X connect 31 0 70 0; +#X connect 31 1 70 0; +#X connect 32 0 33 0; +#X connect 33 0 46 0; +#X connect 34 0 35 0; +#X connect 35 0 45 0; #X connect 36 0 37 0; -#X connect 37 0 50 0; +#X connect 37 0 42 0; #X connect 38 0 39 0; -#X connect 39 0 49 0; +#X connect 39 0 43 0; #X connect 40 0 41 0; -#X connect 41 0 46 0; -#X connect 42 0 43 0; +#X connect 41 0 44 0; +#X connect 42 0 48 0; #X connect 43 0 47 0; -#X connect 44 0 45 0; -#X connect 45 0 48 0; -#X connect 46 0 52 0; -#X connect 47 0 51 0; -#X connect 48 0 53 0; -#X connect 49 0 53 0; -#X connect 50 0 51 0; -#X connect 51 0 53 0; -#X connect 52 0 51 0; -#X connect 53 0 74 0; -#X connect 55 0 74 0; -#X connect 58 0 74 0; -#X connect 75 0 74 0; -#X connect 76 0 74 0; -#X connect 77 0 35 0; +#X connect 44 0 49 0; +#X connect 45 0 49 0; +#X connect 46 0 47 0; +#X connect 47 0 49 0; +#X connect 48 0 47 0; +#X connect 49 0 70 0; +#X connect 51 0 70 0; +#X connect 54 0 70 0; +#X connect 71 0 70 0; +#X connect 72 0 70 0; +#X connect 73 0 31 0; +#X connect 80 0 79 0; diff --git a/help/ortho-help.pd b/help/ortho-help.pd index 21c1f1235..7d7a98648 100644 --- a/help/ortho-help.pd +++ b/help/ortho-help.pd @@ -1,27 +1,5 @@ #N canvas 397 92 665 345 10; #X declare -lib Gem; -#X obj 462 275 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 467 314 pd gemwin; -#X msg 467 295 create; -#X text 463 274 Create window:; #X text 465 49 Example:; #X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 216 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -55,21 +33,20 @@ #X obj 487 114 i 45; #X obj 581 114 t f f; #X text 19 92 [ortho] changes the current viewing-mode from (evtl.) "perspective" (objects that are far away appear smaller than objects that are near) to "orthographic" (parallels appear parallel) for all subsequent shapes., f 70; -#X connect 1 0 2 0; -#X connect 2 0 1 0; -#X connect 22 0 24 0; +#X obj 484 280 _gemwin; +#X connect 18 0 20 0; +#X connect 20 0 25 0; +#X connect 20 1 30 0; +#X connect 21 0 19 0; +#X connect 22 0 21 0; +#X connect 23 0 24 1; #X connect 24 0 29 0; -#X connect 24 1 34 0; -#X connect 25 0 23 0; -#X connect 26 0 25 0; -#X connect 27 0 28 1; -#X connect 28 0 33 0; -#X connect 29 0 25 0; -#X connect 30 0 25 0; -#X connect 31 0 30 0; -#X connect 33 0 35 0; -#X connect 34 0 28 0; -#X connect 35 0 34 1; -#X connect 35 1 29 1; -#X connect 35 1 29 2; -#X connect 35 1 29 3; +#X connect 25 0 21 0; +#X connect 26 0 21 0; +#X connect 27 0 26 0; +#X connect 29 0 31 0; +#X connect 30 0 24 0; +#X connect 31 0 30 1; +#X connect 31 1 25 1; +#X connect 31 1 25 2; +#X connect 31 1 25 3; diff --git a/help/part_color-help.pd b/help/part_color-help.pd index 6675eb92c..4086ad291 100644 --- a/help/part_color-help.pd +++ b/help/part_color-help.pd @@ -3,66 +3,19 @@ #X text 31 14 Synopsis: [part_color]; #X text 51 37 Class: Particle System; #X obj 539 18 declare -lib Gem; -#X obj 7 75 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 468 74 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 326 pd gemwin; -#X obj 472 246 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; -#X obj 8 186 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 7 75 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 74 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 246 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 8 186 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 18 GEM object; #X text 467 55 Example:; -#X obj 7 225 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 225 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 481 293 part_draw; #X obj 481 101 gemhead; #X msg 509 208 0 0 1; #X msg 538 229 1 0 0; #X obj 481 122 part_head; -#X text 14 111 sets the color(s) of a particle-system. You can set -2 different colors \, particles will have either the one or the other. -; +#X text 14 111 sets the color(s) of a particle-system. You can set 2 different colors \, particles will have either the one or the other.; #X text 12 85 Description: Defines color of particles; #X obj 481 256 part_color; #X text 12 195 argument : none; @@ -71,17 +24,17 @@ #X text 577 230 color 2; #X text 19 271 Inlet 2: color R1 G1 B1; #X text 19 291 Inlet 3: color R2 G2 B2; -#X obj 481 79 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 481 79 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 481 185 part_velocity sphere 0 0 0 0.1; #X obj 481 144 part_source 40; #X obj 481 164 part_killold 20; -#X connect 12 0 15 0; -#X connect 13 0 18 1; -#X connect 14 0 18 2; -#X connect 15 0 27 0; -#X connect 18 0 11 0; -#X connect 25 0 12 0; -#X connect 26 0 18 0; -#X connect 27 0 28 0; -#X connect 28 0 26 0; +#X obj 483 323 _gemwin; +#X connect 11 0 14 0; +#X connect 12 0 17 1; +#X connect 13 0 17 2; +#X connect 14 0 26 0; +#X connect 17 0 10 0; +#X connect 24 0 11 0; +#X connect 25 0 17 0; +#X connect 26 0 27 0; +#X connect 27 0 25 0; diff --git a/help/part_damp-help.pd b/help/part_damp-help.pd index 5a5b2b42d..a4a7a6f94 100644 --- a/help/part_damp-help.pd +++ b/help/part_damp-help.pd @@ -2,58 +2,13 @@ #X declare -lib Gem; #X text 31 14 Synopsis: [part_damp]; #X obj 539 8 declare -lib Gem; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 468 64 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 306 pd gemwin; -#X obj 472 233 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 64 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 233 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 8 GEM object; #X text 467 45 Example:; -#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 38 Class: Particle System; #X text 22 228 inlet 1: gemlist (with part_head); #X text 22 255 Inlet 2: V1 V2 V3; @@ -63,26 +18,23 @@ #X obj 481 277 part_draw; #X msg 604 222 \$1 1 1; #X obj 481 247 part_damp 0.1 0.1 0.1; -#X obj 481 68 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 481 68 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 481 137 part_source 10; #X obj 481 213 part_killold 50; #X obj 481 161 part_velocity sphere 0 0 0 0.1; #X text 20 182 Arguments:; #X text 92 182 domain \, V1 V2 V3; -#X text 19 99 part_damp dampens the velocity of the particles. A damping -vector less than 1 \, 1 \, 1 will slow the particles down. A damping -vector greater than 1 \, 1 \, 1 will speed up the particles., f 70 -; +#X text 19 99 part_damp dampens the velocity of the particles. A damping vector less than 1 \, 1 \, 1 will slow the particles down. A damping vector greater than 1 \, 1 \, 1 will speed up the particles., f 70; #X obj 604 202 * 0.01; #X floatatom 604 183 5 0 0 0 damping\ vector - - 0; -#X connect 14 0 15 0; -#X connect 15 0 20 0; -#X connect 17 0 18 1; -#X connect 18 0 16 0; -#X connect 19 0 14 0; -#X connect 20 0 22 0; -#X connect 21 0 18 0; -#X connect 22 0 21 0; -#X connect 26 0 17 0; -#X connect 27 0 26 0; +#X obj 492 311 _gemwin; +#X connect 13 0 14 0; +#X connect 14 0 19 0; +#X connect 16 0 17 1; +#X connect 17 0 15 0; +#X connect 18 0 13 0; +#X connect 19 0 21 0; +#X connect 20 0 17 0; +#X connect 21 0 20 0; +#X connect 25 0 16 0; +#X connect 26 0 25 0; diff --git a/help/part_draw-help.pd b/help/part_draw-help.pd index 93b06ad8f..114c31319 100644 --- a/help/part_draw-help.pd +++ b/help/part_draw-help.pd @@ -5,58 +5,13 @@ #X obj 86 359 part_render; #X text 31 14 Synopsis: [part_draw]; #X obj 541 30 declare -lib Gem; -#X obj 9 87 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 470 86 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 478 344 pd gemwin; -#X obj 474 296 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; -#X obj 10 198 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 9 87 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 470 86 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 474 296 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 10 198 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 466 30 GEM object; #X text 469 67 Example:; -#X obj 9 237 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 9 237 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X msg 514 255 draw point; #X obj 487 112 gemhead; #X obj 487 133 part_head; @@ -64,25 +19,23 @@ #X msg 588 254 draw \$1; #X floatatom 588 235 5 0 13 0 - - - 0; #X text 23 105 Description: Draw a particle system; -#X text 22 128 [part_draw] finally draws a particle system that was -set up with [part_head] and other [part_]-objects.; -#X text 24 251 inlet 1: gemlist (with part_head) \, draw [line|point|] -; +#X text 22 128 [part_draw] finally draws a particle system that was set up with [part_head] and other [part_]-objects.; +#X text 24 251 inlet 1: gemlist (with part_head) \, draw [line|point|]; #X text 495 215 drawing mode:; #X obj 487 157 part_source 1; #X obj 487 177 part_killold 50; #X obj 487 308 part_draw; #X text 17 199 Arguments: none; -#X obj 487 89 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 487 89 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 487 197 part_velocity sphere 0 0 0 0.1; -#X connect 13 0 25 0; -#X connect 14 0 15 0; -#X connect 15 0 23 0; -#X connect 16 0 25 0; -#X connect 17 0 25 0; -#X connect 18 0 17 0; -#X connect 23 0 24 0; -#X connect 24 0 28 0; -#X connect 27 0 14 0; -#X connect 28 0 25 0; +#X obj 494 367 _gemwin; +#X connect 12 0 24 0; +#X connect 13 0 14 0; +#X connect 14 0 22 0; +#X connect 15 0 24 0; +#X connect 16 0 24 0; +#X connect 17 0 16 0; +#X connect 22 0 23 0; +#X connect 23 0 27 0; +#X connect 26 0 13 0; +#X connect 27 0 24 0; diff --git a/help/part_follow-help.pd b/help/part_follow-help.pd index d87fb1224..966e9c6df 100644 --- a/help/part_follow-help.pd +++ b/help/part_follow-help.pd @@ -2,82 +2,35 @@ #X declare -lib Gem; #X text 34 1 Synopsis: [part_follow]; #X obj 546 8 declare -lib Gem; -#X obj 14 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 66 25 Class: particle object; -#X obj 475 64 cnv 15 220 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 491 316 pd gemwin; -#X obj 484 234 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; -#X obj 15 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 475 64 cnv 15 220 275 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 484 234 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 15 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 471 8 GEM object; #X text 474 45 Example:; -#X obj 14 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X text 119 105 [part_follow] lets the particles follow each other. -; +#X obj 14 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 119 105 [part_follow] lets the particles follow each other.; #X text 32 83 Description: Particle follow each other; -#X text 27 132 inlet 1: gemlist (with part_head) \, draw [line|point|] -; +#X text 27 132 inlet 1: gemlist (with part_head) \, draw [line|point|]; #X obj 489 92 gemhead; #X obj 489 113 part_head; #X obj 489 285 part_draw; #X text 24 178 Arguments: particle follow; -#X obj 489 71 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 489 71 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X floatatom 594 202 5 0 100 2 particle\ follow - - 0; #X obj 489 156 part_velocity point 0 -0.1 0; #X obj 489 175 part_killold 40; #X obj 489 137 part_source 10; #X obj 594 221 * 0.0001; #X obj 489 249 part_follow 0.0001; -#X connect 14 0 15 0; -#X connect 15 0 22 0; -#X connect 18 0 14 0; -#X connect 19 0 23 0; -#X connect 20 0 21 0; -#X connect 21 0 24 0; -#X connect 22 0 20 0; -#X connect 23 0 24 1; -#X connect 24 0 16 0; +#X obj 528 353 _gemwin; +#X connect 13 0 14 0; +#X connect 14 0 21 0; +#X connect 17 0 13 0; +#X connect 18 0 22 0; +#X connect 19 0 20 0; +#X connect 20 0 23 0; +#X connect 21 0 19 0; +#X connect 22 0 23 1; +#X connect 23 0 15 0; diff --git a/help/part_gravity-help.pd b/help/part_gravity-help.pd index 197730e14..c8f7abf3b 100644 --- a/help/part_gravity-help.pd +++ b/help/part_gravity-help.pd @@ -1,61 +1,14 @@ #N canvas 450 384 693 443 10; #X declare -lib Gem; #X obj 539 28 declare -lib Gem; -#X obj 7 85 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 468 84 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 337 pd gemwin; -#X obj 472 238 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; -#X obj 8 196 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 7 85 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 84 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 238 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 8 196 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 28 GEM object; #X text 467 65 Example:; -#X obj 7 235 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X text 32 103 [part_gravity] sets the gravity-vector of the particle-system. -No matter in which direction particles are emitted (pE. via [part_velsphere]) -in the end \, they have to follow the gravity.; +#X obj 7 235 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 32 103 [part_gravity] sets the gravity-vector of the particle-system. No matter in which direction particles are emitted (pE. via [part_velsphere]) in the end \, they have to follow the gravity.; #X obj 482 107 gemhead; #X obj 482 128 part_head; #X obj 482 284 part_draw; @@ -68,15 +21,15 @@ in the end \, they have to follow the gravity.; #X msg 572 211 0 0.01 0; #X obj 482 249 part_gravity; #X msg 502 211 0 -0.01 0; -#X obj 482 87 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 482 87 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 493 191 gravitation vector x y z; -#X connect 10 0 11 0; -#X connect 11 0 15 0; -#X connect 12 0 14 0; -#X connect 13 0 20 0; -#X connect 15 0 13 0; -#X connect 19 0 20 1; -#X connect 20 0 12 0; -#X connect 21 0 20 1; -#X connect 22 0 10 0; +#X obj 489 343 _gemwin; +#X connect 9 0 10 0; +#X connect 10 0 14 0; +#X connect 11 0 13 0; +#X connect 12 0 19 0; +#X connect 14 0 12 0; +#X connect 18 0 19 1; +#X connect 19 0 11 0; +#X connect 20 0 19 1; +#X connect 21 0 9 0; diff --git a/help/part_head-help.pd b/help/part_head-help.pd index f306bb723..c8d199598 100644 --- a/help/part_head-help.pd +++ b/help/part_head-help.pd @@ -1,86 +1,35 @@ #N canvas 619 383 725 370 10; #X declare -lib Gem; #X obj 539 8 declare -lib Gem; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X text 13 78 starts a particle-system. The particle-list normally -holds a number of [part_source]s (particle-generators) [part_]-modifiers -and ends with a particle-renderer such as [part_draw]; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 13 78 starts a particle-system. The particle-list normally holds a number of [part_source]s (particle-generators) [part_]-modifiers and ends with a particle-renderer such as [part_draw]; #X text 42 9 Synopsis: [part_head]; #X text 52 29 Class: particle object; -#X obj 468 64 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 306 pd gemwin; +#X obj 468 64 cnv 15 170 220 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X msg 559 105 speed \$1; #X floatatom 559 81 5 0 0 0 - - - 0; -#X obj 472 124 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 472 124 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 476 94 gemhead; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 464 8 GEM object; #X text 467 45 Example:; -#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X text 14 255 if your particles do not die (e.g.: because the are -killed with [part_killold]) \, your particle source will stop emitting -particles after some time.; -#X text 90 176 the number of particles that can exist in one instance -of time as a creation-argument. (default:1000); -#X text 14 231 speed of the particle-emission with the speed-message. -; +#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 14 255 if your particles do not die (e.g.: because the are killed with [part_killold]) \, your particle source will stop emitting particles after some time.; +#X text 90 176 the number of particles that can exist in one instance of time as a creation-argument. (default:1000); +#X text 14 231 speed of the particle-emission with the speed-message.; #X obj 476 138 part_head; #X obj 476 178 part_source 1; #X obj 476 202 part_velocity point 0 -0.1 0; #X obj 476 251 part_draw; #X obj 476 224 part_killold 50; -#X obj 476 74 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; -#X connect 7 0 19 0; -#X connect 8 0 7 0; -#X connect 10 0 19 0; +#X obj 476 74 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 494 288 _gemwin; +#X connect 6 0 18 0; +#X connect 7 0 6 0; +#X connect 9 0 18 0; +#X connect 18 0 19 0; #X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 21 0 23 0; -#X connect 23 0 22 0; -#X connect 24 0 10 0; +#X connect 20 0 22 0; +#X connect 22 0 21 0; +#X connect 23 0 9 0; diff --git a/help/part_info-help.pd b/help/part_info-help.pd index e8bd5c4dc..33b7d4c75 100644 --- a/help/part_info-help.pd +++ b/help/part_info-help.pd @@ -1,68 +1,19 @@ #N canvas 469 318 684 479 10; #X declare -lib Gem; #X obj 539 58 declare -lib Gem; -#X obj 7 115 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 468 114 cnv 15 200 320 empty empty empty 20 12 0 14 #dce4fc -#404040 0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 390 pd gemwin; -#X obj 468 246 cnv 15 200 120 empty empty empty 20 12 0 14 #14e814 -#404040 0; -#X obj 8 226 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 7 115 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 114 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 468 246 cnv 15 200 120 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 8 226 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 58 GEM object; #X text 467 95 Example:; -#X obj 7 265 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 265 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 481 140 gemhead; #X obj 481 161 part_head; -#X obj 481 118 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 481 118 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 481 250 part_info, f 18; -#X text 24 130 [part_info] gives you all available information of all -the particles in the system draws a particle system set up with [part_head] -and other [part_]-objects.; -#X text 25 179 If your system contains 15 particles \, then you will -get the information on the outlets 15 times per rendering circle.; +#X text 24 130 [part_info] gives you all available information of all the particles in the system draws a particle system set up with [part_head] and other [part_]-objects.; +#X text 25 179 If your system contains 15 particles \, then you will get the information on the outlets 15 times per rendering circle.; #X text 39 88 Class: Particle System; #X text 39 58 Synopsis [part_render]; #X floatatom 633 270 5 0 0 3 age - - 0; @@ -75,16 +26,17 @@ get the information on the outlets 15 times per rendering circle.; #X obj 481 204 part_velocity point 0 0.1 0; #X obj 481 184 part_source 1; #X obj 481 224 part_draw; -#X connect 9 0 10 0; -#X connect 10 0 25 0; -#X connect 11 0 9 0; -#X connect 12 0 23 0; -#X connect 12 1 22 0; -#X connect 12 2 21 0; -#X connect 12 3 20 0; -#X connect 12 4 19 0; -#X connect 12 5 18 0; -#X connect 12 6 17 0; -#X connect 24 0 26 0; -#X connect 25 0 24 0; -#X connect 26 0 12 0; +#X obj 487 402 _gemwin; +#X connect 8 0 9 0; +#X connect 9 0 24 0; +#X connect 10 0 8 0; +#X connect 11 0 22 0; +#X connect 11 1 21 0; +#X connect 11 2 20 0; +#X connect 11 3 19 0; +#X connect 11 4 18 0; +#X connect 11 5 17 0; +#X connect 11 6 16 0; +#X connect 23 0 25 0; +#X connect 24 0 23 0; +#X connect 25 0 11 0; diff --git a/help/part_killold-help.pd b/help/part_killold-help.pd index 231dc0257..498b1dc11 100644 --- a/help/part_killold-help.pd +++ b/help/part_killold-help.pd @@ -1,82 +1,35 @@ #N canvas 619 333 677 430 10; #X declare -lib Gem; #X obj 541 10 declare -lib Gem; -#X obj 9 67 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 9 67 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 54 31 Class: particle object; -#X obj 470 66 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 485 308 pd gemwin; -#X obj 481 219 cnv 15 120 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 470 66 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 481 219 cnv 15 120 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 485 96 gemhead; -#X obj 10 178 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 10 178 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 466 10 GEM object; #X text 469 47 Example:; -#X obj 9 217 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 9 217 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 485 174 part_velocity point 0 -0.1 0; #X obj 485 265 part_draw; -#X text 28 97 kill all particles which are older than the kill time. -The default time is 10 Make the number longer for particles to live -longer and shorter to remove them quicker.; +#X text 28 97 kill all particles which are older than the kill time. The default time is 10 Make the number longer for particles to live longer and shorter to remove them quicker.; #X obj 485 123 part_head; #X text 44 11 Synopsis: [part_killold]; #X text 17 179 Arguments: kill time; #X floatatom 572 199 5 0 100 1 kill\ time - - 0; #X msg 584 127 0 4 0; -#X obj 485 76 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 485 76 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 584 106 loadbang; #X text 625 127 xyz; #X obj 485 153 part_source 10, f 17; #X obj 485 231 part_killold 40; -#X connect 6 0 14 0; -#X connect 11 0 23 0; -#X connect 14 0 22 0; -#X connect 17 0 23 1; -#X connect 18 0 22 3; -#X connect 19 0 6 0; -#X connect 20 0 18 0; +#X obj 504 322 _gemwin; +#X connect 5 0 13 0; +#X connect 10 0 22 0; +#X connect 13 0 21 0; +#X connect 16 0 22 1; +#X connect 17 0 21 3; +#X connect 18 0 5 0; +#X connect 19 0 17 0; +#X connect 21 0 10 0; #X connect 22 0 11 0; -#X connect 23 0 12 0; diff --git a/help/part_killslow-help.pd b/help/part_killslow-help.pd index 8655e52cb..c96db5c42 100644 --- a/help/part_killslow-help.pd +++ b/help/part_killslow-help.pd @@ -1,80 +1,34 @@ #N canvas 726 285 682 383 10; #X declare -lib Gem; #X obj 541 10 declare -lib Gem; -#X obj 9 67 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 9 67 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 54 31 Class: particle object; -#X obj 470 66 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 488 318 pd gemwin; -#X obj 484 236 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 470 66 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 484 236 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 488 96 gemhead; -#X obj 10 178 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 10 178 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 466 10 GEM object; #X text 469 47 Example:; -#X obj 9 217 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 9 217 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 488 283 part_draw; #X obj 488 118 part_head; #X text 17 179 Arguments: kill time; #X floatatom 563 226 5 0 0 1 kill\ time - - 0; -#X text 36 96 kill all particles which are slower than the kill speed. -The default speed is 0.01; +#X text 36 96 kill all particles which are slower than the kill speed. The default speed is 0.01; #X text 43 11 Synopsis: [part_killslow]; #X obj 488 246 part_killslow; #X obj 488 141 part_source 10; #X obj 488 164 part_orbitpoint 0 1 0 0.1; #X floatatom 563 185 5 0 0 0 - - - 0; #X obj 563 204 * 0.001; -#X obj 488 76 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; -#X connect 6 0 12 0; -#X connect 12 0 18 0; -#X connect 14 0 17 1; -#X connect 17 0 11 0; -#X connect 18 0 19 0; -#X connect 19 0 17 0; -#X connect 20 0 21 0; -#X connect 21 0 14 0; -#X connect 22 0 6 0; +#X obj 488 76 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 496 322 _gemwin; +#X connect 5 0 11 0; +#X connect 11 0 17 0; +#X connect 13 0 16 1; +#X connect 16 0 10 0; +#X connect 17 0 18 0; +#X connect 18 0 16 0; +#X connect 19 0 20 0; +#X connect 20 0 13 0; +#X connect 21 0 5 0; diff --git a/help/part_orbitpoint-help.pd b/help/part_orbitpoint-help.pd index bbe3d76c8..422678b68 100644 --- a/help/part_orbitpoint-help.pd +++ b/help/part_orbitpoint-help.pd @@ -1,62 +1,17 @@ #N canvas 573 367 673 438 10; #X declare -lib Gem; #X obj 546 22 declare -lib Gem; -#X obj 14 79 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 79 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 59 43 Class: particle object; -#X obj 475 78 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 493 330 pd gemwin; -#X obj 486 234 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 475 78 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 486 234 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 493 104 gemhead; #X obj 493 279 part_draw; #X obj 493 303 part_killold 50; -#X obj 15 190 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 15 190 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 471 22 GEM object; #X text 474 59 Example:; -#X obj 14 229 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 229 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 493 126 part_head; #X floatatom 580 213 5 0 0 1 attraction - - 0; #X obj 493 145 part_source 10; @@ -65,18 +20,16 @@ #X text 512 170 orbipoint x y z; #X text 61 17 Synopsis: [part_orbitpoint]; #X text 24 192 Arguments: orbipoint x y z \, attraction; -#X text 28 110 [part_orbitpoint] will make the particles orbit about -the position x \, y \, z. The gravity is how attracted the particles -are to the point. The default attraction is 1; +#X text 28 110 [part_orbitpoint] will make the particles orbit about the position x \, y \, z. The gravity is how attracted the particles are to the point. The default attraction is 1; #X obj 493 246 part_orbitpoint 0 1 0 0.1; -#X obj 493 85 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; -#X connect 6 0 13 0; -#X connect 7 0 8 0; -#X connect 13 0 15 0; -#X connect 14 0 22 2; -#X connect 15 0 22 0; -#X connect 16 0 22 1; -#X connect 17 0 22 1; -#X connect 22 0 7 0; -#X connect 23 0 6 0; +#X obj 493 85 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 495 338 _gemwin; +#X connect 5 0 12 0; +#X connect 6 0 7 0; +#X connect 12 0 14 0; +#X connect 13 0 21 2; +#X connect 14 0 21 0; +#X connect 15 0 21 1; +#X connect 16 0 21 1; +#X connect 21 0 6 0; +#X connect 22 0 5 0; diff --git a/help/part_render-help.pd b/help/part_render-help.pd index 7d8df6041..69fb03806 100644 --- a/help/part_render-help.pd +++ b/help/part_render-help.pd @@ -1,71 +1,21 @@ #N canvas 503 464 695 398 10; #X declare -lib Gem; #X obj 539 -2 declare -lib Gem; -#X obj 7 55 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 468 54 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 306 pd gemwin; -#X obj 472 223 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; -#X obj 8 166 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 7 55 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 54 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 223 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 8 166 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 -2 GEM object; #X text 467 35 Example:; -#X obj 7 205 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 205 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 28 Class: Particle System; #X obj 481 80 gemhead; #X obj 481 101 part_head; -#X obj 481 58 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 481 58 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 481 121 part_source 10; -#X text 20 61 [part_render] finally draws a particle system that was -set up with [part_head] and other [part_]-objects. The particles are -normal gemLists (for instance a [sphere]); -#X text 21 106 you can turn on/off colouring of paticles (via [part_color]) -; -#X text 21 126 you can turn on/off sizing of paticles (via [part_size]) -; +#X text 20 61 [part_render] finally draws a particle system that was set up with [part_head] and other [part_]-objects. The particles are normal gemLists (for instance a [sphere]); +#X text 21 106 you can turn on/off colouring of paticles (via [part_color]); +#X text 21 126 you can turn on/off sizing of paticles (via [part_size]); #X obj 481 237 part_render; #X obj 481 268 cube 0.1 \; draw line; #X text 41 5 Synopsis [part_render]; @@ -74,12 +24,13 @@ normal gemLists (for instance a [sphere]); #X text 16 170 Arguments: none; #X obj 481 160 part_killold 50; #X obj 481 141 part_velocity sphere 0 0 0 0.1; -#X connect 10 0 11 0; -#X connect 11 0 13 0; -#X connect 12 0 10 0; -#X connect 13 0 24 0; -#X connect 17 0 18 0; -#X connect 20 0 17 0; -#X connect 21 0 17 0; -#X connect 23 0 17 0; -#X connect 24 0 23 0; +#X obj 476 306 _gemwin; +#X connect 9 0 10 0; +#X connect 10 0 12 0; +#X connect 11 0 9 0; +#X connect 12 0 23 0; +#X connect 16 0 17 0; +#X connect 19 0 16 0; +#X connect 20 0 16 0; +#X connect 22 0 16 0; +#X connect 23 0 22 0; diff --git a/help/part_sink-help.pd b/help/part_sink-help.pd index 98b01b764..cea0a2445 100644 --- a/help/part_sink-help.pd +++ b/help/part_sink-help.pd @@ -1,74 +1,21 @@ #N canvas 696 105 686 425 10; #X declare -lib Gem; #X obj 539 8 declare -lib Gem; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 52 29 Class: particle object; -#X obj 468 64 cnv 15 170 320 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 335 pd gemwin; -#X obj 472 238 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 468 64 cnv 1 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 238 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 476 74 gemhead; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 8 GEM object; #X text 467 45 Example:; -#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 476 98 part_head; #X obj 476 308 part_draw; -#X text 22 217 : one of "point" \, "line" \, "triangle" \, -"plane" \, "box" \, "sphere" \, "cylinder" \, "cone" \, "blob" \, "disc" -\, "rectangle"; -#X text 22 255 : up to 9 floats \, defining the specified -domain (like "x y z" for "point" \, "x1 y1 z1 x2 y2 z2" for "line" -\, "x y z r" for "sphere" \, ...). The meaning of the arguments depends --of course- on the domain.; -#X text 26 75 [part_sink] sets up a sink for the particles within the -system \, where they will vanish. You can set the sink-domain (shape) -and the corresponding arguments.; -#X text 29 127 you can turn on/off the killing of particles (default:off) -; +#X text 22 217 : one of "point" \, "line" \, "triangle" \, "plane" \, "box" \, "sphere" \, "cylinder" \, "cone" \, "blob" \, "disc" \, "rectangle"; +#X text 22 255 : up to 9 floats \, defining the specified domain (like "x y z" for "point" \, "x1 y1 z1 x2 y2 z2" for "line" \, "x y z r" for "sphere" \, ...). The meaning of the arguments depends -of course- on the domain.; +#X text 26 75 [part_sink] sets up a sink for the particles within the system \, where they will vanish. You can set the sink-domain (shape) and the corresponding arguments.; +#X text 29 127 you can turn on/off the killing of particles (default:off); #X obj 476 253 part_sink; #X msg 501 214 symbol sphere; #X obj 476 142 part_velocity sphere 0 0 0 0.1; @@ -79,53 +26,22 @@ and the corresponding arguments.; #X text 96 182 domain \, arguments; #X text 42 9 Synopsis: [part_sink]; #N canvas 146 246 934 704 domain_infos 0; -#X text 36 9 'point' \; A point in space \; arg.1 X pos \; arg.2 Y -pos \; arg.3 Z pos \; \; 'line' \; A line between two points. \; arg.1-3 -Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of -point 1 \; \; 'rectangle' \; A rectangular space between four points. -The fourth point is assumed automatically. \; arg.1-3 Positions X \, -Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7-9 -Positions X \, Y \, Z of point 2 \; \; 'sphere' A space within a sphere. -When argument 5 is larger than zero \, the core is left blank with -the given radius. \; arg.1-3 Positions X \, Y \, Z of center. \; arg.4 -Outer radius \; arg.5 Inner radius \; \; 'box' \; By specifying the -position of two diagonal corners \, the rest will be assumed \; arg.1-3 -Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of -point 1 \; \; 'cylinder' \; When argument 8 is larger than zero \, -the core is left blank with the given radius. arg.1-3 Positions X \, -Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 -Outer radius \; arg.8 Inner radius \; \; 'cone' \; When argument 8 -is larger than zero \, the core is left blank with the given radius. -arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, -Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; -'blob' \; Not too sure what this is other than that it seems to be -a random range. arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Standard -deviation (??) \; \; 'plane' \; You will being specifying two points. -The plain will include point 0 and perpendicular to a line between -the two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 -Positions X \, Y \, Z of point 1 \; Note: When used with [part_source] -this domain always return the position of point 0 and is useless for -such context. \; \; 'disc' \; The concept of arguments 1 through 6 -are identical to 'plane'. \; You can additionally limit the area by -specifying the outer/inner radius of a circle centering at point 0 -\; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X -\, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; -, f 211; +#X text 36 9 'point' \; A point in space \; arg.1 X pos \; arg.2 Y pos \; arg.3 Z pos \; \; 'line' \; A line between two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; \; 'rectangle' \; A rectangular space between four points. The fourth point is assumed automatically. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7-9 Positions X \, Y \, Z of point 2 \; \; 'sphere' A space within a sphere. When argument 5 is larger than zero \, the core is left blank with the given radius. \; arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Outer radius \; arg.5 Inner radius \; \; 'box' \; By specifying the position of two diagonal corners \, the rest will be assumed \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; \; 'cylinder' \; When argument 8 is larger than zero \, the core is left blank with the given radius. arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; 'cone' \; When argument 8 is larger than zero \, the core is left blank with the given radius. arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; 'blob' \; Not too sure what this is other than that it seems to be a random range. arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Standard deviation (??) \; \; 'plane' \; You will being specifying two points. The plain will include point 0 and perpendicular to a line between the two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; Note: When used with [part_source] this domain always return the position of point 0 and is useless for such context. \; \; 'disc' \; The concept of arguments 1 through 6 are identical to 'plane'. \; You can additionally limit the area by specifying the outer/inner radius of a circle centering at point 0 \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \;, f 211; #X restore 14 326 pd domain_infos; #X obj 597 196 * 0.1; #X msg 488 191 kill \$1; -#X obj 488 171 tgl 15 0 empty empty kill 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 488 171 tgl 15 0 empty empty kill 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 476 284 part_killold 50; -#X connect 6 0 11 0; -#X connect 11 0 22 0; -#X connect 17 0 30 0; -#X connect 18 0 17 1; -#X connect 19 0 17 0; -#X connect 20 0 27 0; -#X connect 21 0 17 2; -#X connect 22 0 19 0; -#X connect 27 0 21 0; -#X connect 28 0 17 0; -#X connect 29 0 28 0; -#X connect 30 0 12 0; +#X obj 476 345 _gemwin; +#X connect 5 0 10 0; +#X connect 10 0 21 0; +#X connect 16 0 29 0; +#X connect 17 0 16 1; +#X connect 18 0 16 0; +#X connect 19 0 26 0; +#X connect 20 0 16 2; +#X connect 21 0 18 0; +#X connect 26 0 20 0; +#X connect 27 0 16 0; +#X connect 28 0 27 0; +#X connect 29 0 11 0; diff --git a/help/part_size-help.pd b/help/part_size-help.pd index 3ed3d134d..e3f6eb383 100644 --- a/help/part_size-help.pd +++ b/help/part_size-help.pd @@ -1,63 +1,17 @@ #N canvas 320 413 706 458 10; #X declare -lib Gem; #X obj 546 2 declare -lib Gem; -#X obj 14 59 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 59 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 59 23 Class: particle object; -#X obj 475 58 cnv 15 200 350 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 483 361 pd gemwin; -#X obj 476 233 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 475 58 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 476 233 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 483 81 gemhead; -#X obj 15 170 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 15 170 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 471 2 GEM object; #X text 474 39 Example:; -#X obj 14 209 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 209 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 483 102 part_head; -#X text 31 72 change the size of the particles of a particle-system. -You can also give an initial value.; +#X text 31 72 change the size of the particles of a particle-system. You can also give an initial value.; #X text 31 113 the particle-size defaults to 1.0f; #X obj 483 245 part_size; #X floatatom 534 225 5 0 0 1 size - - 0; @@ -67,22 +21,22 @@ You can also give an initial value.; #X obj 483 324 square 0.1 \; draw line; #X text 24 172 Arguments: size; #X text 32 2 Synopsis: [part_size]; -#X obj 483 63 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 483 63 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 483 143 part_source 1; #X obj 483 123 part_velocity sphere 0 0 0 0.1; #X obj 534 204 / 100; #X obj 534 183 random 200; -#X connect 6 0 11 0; -#X connect 11 0 24 0; -#X connect 14 0 16 0; -#X connect 15 0 14 1; -#X connect 16 0 17 0; -#X connect 17 0 19 0; -#X connect 18 0 14 0; -#X connect 18 1 26 0; -#X connect 22 0 6 0; -#X connect 23 0 18 0; -#X connect 24 0 23 0; -#X connect 25 0 15 0; -#X connect 26 0 25 0; +#X obj 483 360 _gemwin; +#X connect 5 0 10 0; +#X connect 10 0 23 0; +#X connect 13 0 15 0; +#X connect 14 0 13 1; +#X connect 15 0 16 0; +#X connect 16 0 18 0; +#X connect 17 0 13 0; +#X connect 17 1 25 0; +#X connect 21 0 5 0; +#X connect 22 0 17 0; +#X connect 23 0 22 0; +#X connect 24 0 14 0; +#X connect 25 0 24 0; diff --git a/help/part_source-help.pd b/help/part_source-help.pd index ef4b4aa6e..ef93b2167 100644 --- a/help/part_source-help.pd +++ b/help/part_source-help.pd @@ -1,72 +1,21 @@ #N canvas 542 204 699 427 10; #X declare -lib Gem; #X obj 546 12 declare -lib Gem; -#X obj 14 69 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 69 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 59 33 Class: particle object; -#X obj 475 68 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 493 318 pd gemwin; -#X obj 480 196 cnv 15 120 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 475 68 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 480 196 cnv 15 120 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 493 96 gemhead; #X obj 493 269 part_draw; #X obj 493 295 part_killold 50; -#X obj 15 180 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 15 180 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 24 179 Arguments:; #X text 471 12 GEM object; #X text 474 49 Example:; -#X obj 14 219 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X text 24 77 add a particle-source. You will need this if you want -any particles in your particle-system.; -#X text 44 226 : one of "point" \, "line" \, "triangle" \, -"plane" \, "box" \, "sphere" \, "cylinder" \, "cone" \, "blob" \, "disc" -\, "rectangle"; -#X text 43 266 : up to 9 floats \, defining the specified -domain (like "x y z" for "point" \, "x1 y1 z1 x2 y2 z2" for "line" -\, "x y z r" for "sphere" \, ...). The meaning of the arguments depends --of course- on the domain.; +#X obj 14 219 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 24 77 add a particle-source. You will need this if you want any particles in your particle-system.; +#X text 44 226 : one of "point" \, "line" \, "triangle" \, "plane" \, "box" \, "sphere" \, "cylinder" \, "cone" \, "blob" \, "disc" \, "rectangle"; +#X text 43 266 : up to 9 floats \, defining the specified domain (like "x y z" for "point" \, "x1 y1 z1 x2 y2 z2" for "line" \, "x y z r" for "sphere" \, ...). The meaning of the arguments depends -of course- on the domain.; #X obj 493 117 part_head; #X obj 493 207 part_source 20; #X text 49 13 Synopsis: [part_source]; @@ -74,57 +23,22 @@ domain (like "x y z" for "point" \, "x1 y1 z1 x2 y2 z2" for "line" #X msg 547 166 symbol sphere; #X msg 595 185 0 0 0 1; #X obj 493 246 part_velocity point 0 0 0.1; -#X text 96 181 the number of particles that are emitted at each rendering-frame -; -#X text 23 108 Newly created particles will appear in a random position -within the domain.; -#X text 22 132 The key is to pair [part_source] to adjust the rate -of particles appearing and [part_killold] to control its mass in order -to archive the desired effect.; -#X obj 493 77 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X text 96 181 the number of particles that are emitted at each rendering-frame; +#X text 23 108 Newly created particles will appear in a random position within the domain.; +#X text 22 132 The key is to pair [part_source] to adjust the rate of particles appearing and [part_killold] to control its mass in order to archive the desired effect.; +#X obj 493 77 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 631 164 domain; #X text 644 185 args; #N canvas 146 246 934 704 domain_infos 0; -#X text 36 9 'point' \; A point in space \; arg.1 X pos \; arg.2 Y -pos \; arg.3 Z pos \; \; 'line' \; A line between two points. \; arg.1-3 -Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of -point 1 \; \; 'rectangle' \; A rectangular space between four points. -The fourth point is assumed automatically. \; arg.1-3 Positions X \, -Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7-9 -Positions X \, Y \, Z of point 2 \; \; 'sphere' A space within a sphere. -When argument 5 is larger than zero \, the core is left blank with -the given radius. \; arg.1-3 Positions X \, Y \, Z of center. \; arg.4 -Outer radius \; arg.5 Inner radius \; \; 'box' \; By specifying the -position of two diagonal corners \, the rest will be assumed \; arg.1-3 -Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of -point 1 \; \; 'cylinder' \; When argument 8 is larger than zero \, -the core is left blank with the given radius. arg.1-3 Positions X \, -Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 -Outer radius \; arg.8 Inner radius \; \; 'cone' \; When argument 8 -is larger than zero \, the core is left blank with the given radius. -arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, -Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; -'blob' \; Not too sure what this is other than that it seems to be -a random range. arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Standard -deviation (??) \; \; 'plane' \; You will being specifying two points. -The plain will include point 0 and perpendicular to a line between -the two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 -Positions X \, Y \, Z of point 1 \; Note: When used with [part_source] -this domain always return the position of point 0 and is useless for -such context. \; \; 'disc' \; The concept of arguments 1 through 6 -are identical to 'plane'. \; You can additionally limit the area by -specifying the outer/inner radius of a circle centering at point 0 -\; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X -\, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; -, f 211; +#X text 36 9 'point' \; A point in space \; arg.1 X pos \; arg.2 Y pos \; arg.3 Z pos \; \; 'line' \; A line between two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; \; 'rectangle' \; A rectangular space between four points. The fourth point is assumed automatically. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7-9 Positions X \, Y \, Z of point 2 \; \; 'sphere' A space within a sphere. When argument 5 is larger than zero \, the core is left blank with the given radius. \; arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Outer radius \; arg.5 Inner radius \; \; 'box' \; By specifying the position of two diagonal corners \, the rest will be assumed \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; \; 'cylinder' \; When argument 8 is larger than zero \, the core is left blank with the given radius. arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; 'cone' \; When argument 8 is larger than zero \, the core is left blank with the given radius. arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; 'blob' \; Not too sure what this is other than that it seems to be a random range. arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Standard deviation (??) \; \; 'plane' \; You will being specifying two points. The plain will include point 0 and perpendicular to a line between the two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; Note: When used with [part_source] this domain always return the position of point 0 and is useless for such context. \; \; 'disc' \; The concept of arguments 1 through 6 are identical to 'plane'. \; You can additionally limit the area by specifying the outer/inner radius of a circle centering at point 0 \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \;, f 211; #X restore 18 331 pd domain_infos; -#X connect 6 0 17 0; -#X connect 7 0 8 0; -#X connect 17 0 18 0; -#X connect 18 0 23 0; -#X connect 20 0 18 1; -#X connect 21 0 18 2; -#X connect 22 0 18 3; -#X connect 23 0 7 0; -#X connect 27 0 6 0; +#X obj 493 328 _gemwin; +#X connect 5 0 16 0; +#X connect 6 0 7 0; +#X connect 16 0 17 0; +#X connect 17 0 22 0; +#X connect 19 0 17 1; +#X connect 20 0 17 2; +#X connect 21 0 17 3; +#X connect 22 0 6 0; +#X connect 26 0 5 0; diff --git a/help/part_targetcolor-help.pd b/help/part_targetcolor-help.pd index 14b196a03..18dc85414 100644 --- a/help/part_targetcolor-help.pd +++ b/help/part_targetcolor-help.pd @@ -1,67 +1,19 @@ -#N canvas 733 504 656 395 10; +#N canvas 733 504 678 395 10; #X declare -lib Gem; #X text 51 27 Class: Particle System; #X obj 539 8 declare -lib Gem; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 468 64 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 316 pd gemwin; -#X obj 472 234 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 64 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 234 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 8 GEM object; #X text 467 45 Example:; -#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 215 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 481 283 part_draw; #X obj 481 91 gemhead; #X obj 481 112 part_head; -#X obj 481 69 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; -#X text 39 81 part_targetcolor changes the color of the particles by -a scale factor every frame. The target color can be an RGB or RGBA -vector. The scale value defaults to 0.05; +#X obj 481 69 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 39 81 part_targetcolor changes the color of the particles by a scale factor every frame. The target color can be an RGB or RGBA vector. The scale value defaults to 0.05; #X obj 481 175 part_velocity sphere 0 0 0 0.1; #X msg 560 213 1 0 0; #X text 31 4 Synopsis: [part_targetcolor]; @@ -72,12 +24,13 @@ vector. The scale value defaults to 0.05; #X text 12 185 argument : rgb (or rgba) \, scale; #X text 554 197 rgb; #X text 604 195 scale; -#X connect 11 0 12 0; -#X connect 12 0 18 0; -#X connect 13 0 11 0; -#X connect 15 0 20 0; -#X connect 16 0 20 1; -#X connect 18 0 19 0; -#X connect 19 0 15 0; -#X connect 20 0 10 0; -#X connect 21 0 20 2; +#X obj 476 316 _gemwin; +#X connect 10 0 11 0; +#X connect 11 0 17 0; +#X connect 12 0 10 0; +#X connect 14 0 19 0; +#X connect 15 0 19 1; +#X connect 17 0 18 0; +#X connect 18 0 14 0; +#X connect 19 0 9 0; +#X connect 20 0 19 2; diff --git a/help/part_targetsize-help.pd b/help/part_targetsize-help.pd index 7877ca506..01b972aac 100644 --- a/help/part_targetsize-help.pd +++ b/help/part_targetsize-help.pd @@ -1,83 +1,36 @@ #N canvas 796 353 716 478 10; #X declare -lib Gem; #X obj 546 32 declare -lib Gem; -#X obj 14 89 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 89 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 59 53 Class: particle object; -#X obj 475 88 cnv 15 200 350 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 483 391 pd gemwin; -#X obj 476 249 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 475 88 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 476 249 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 483 117 gemhead; -#X obj 15 200 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 15 200 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 471 32 GEM object; #X text 474 69 Example:; -#X obj 14 239 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 239 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 483 138 part_head; #X obj 483 296 part_killold 50; #X obj 483 318 part_render; -#X obj 483 99 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X obj 483 99 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 483 179 part_source 1; #X obj 483 159 part_velocity sphere 0 0 0 0.1; -#X text 36 110 part_targetsize changes the size of the particles by -a scale factor every frame. The default size is 1 The scale value defaults -to 0.05; +#X text 36 110 part_targetsize changes the size of the particles by a scale factor every frame. The default size is 1 The scale value defaults to 0.05; #X text 26 18 Synopsis: part_targetsize; #X obj 483 258 part_targetsize; #X floatatom 526 205 5 0 10 1 size - - 0; #X obj 483 339 square 0.1 \; draw line; #X floatatom 570 226 5 0 10 1 scale - - 0; #X text 24 202 Arguments: size \, scale; -#X connect 6 0 11 0; -#X connect 11 0 16 0; -#X connect 12 0 13 0; -#X connect 13 0 21 0; -#X connect 14 0 6 0; -#X connect 15 0 19 0; -#X connect 16 0 15 0; -#X connect 19 0 12 0; -#X connect 20 0 19 1; -#X connect 22 0 19 2; +#X obj 483 391 _gemwin; +#X connect 5 0 10 0; +#X connect 10 0 15 0; +#X connect 11 0 12 0; +#X connect 12 0 20 0; +#X connect 13 0 5 0; +#X connect 14 0 18 0; +#X connect 15 0 14 0; +#X connect 18 0 11 0; +#X connect 19 0 18 1; +#X connect 21 0 18 2; diff --git a/help/part_velocity-help.pd b/help/part_velocity-help.pd index 4b35b6701..eae7e192c 100644 --- a/help/part_velocity-help.pd +++ b/help/part_velocity-help.pd @@ -1,128 +1,43 @@ #N canvas 600 294 692 462 10; #X declare -lib Gem; #X obj 546 22 declare -lib Gem; -#X obj 14 79 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; -#X obj 475 78 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 484 324 pd gemwin; -#X obj 480 222 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 14 79 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 475 78 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 480 222 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 484 102 gemhead; #X obj 484 295 part_draw; #X obj 484 266 part_killold 50; -#X obj 15 190 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 15 190 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 471 22 GEM object; #X text 474 59 Example:; -#X obj 14 229 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 14 229 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 484 123 part_head; #X obj 484 143 part_source 20; #X obj 484 233 part_velocity point 0 0 0.1; -#X text 48 90 [part_velocity] sets velocity of newly emitted particles -within the system. You can set the velocity-domain and the corresponding -arguments.; -#X text 37 232 : one of "point" \, "line" \, "triangle" \, -"plane" \, "box" \, "sphere" \, "cylinder" \, "cone" \, "blob" \, "disc" -\, "rectangle"; -#X text 36 273 : up to 9 floats \, defining the specified -domain (like "x y z" for "point" \, "x1 y1 z1 x2 y2 z2" for "line" -\, "x y z r" for "sphere" \, ...). The meaning of the arguments depends --of course- on the domain.; +#X text 48 90 [part_velocity] sets velocity of newly emitted particles within the system. You can set the velocity-domain and the corresponding arguments.; +#X text 37 232 : one of "point" \, "line" \, "triangle" \, "plane" \, "box" \, "sphere" \, "cylinder" \, "cone" \, "blob" \, "disc" \, "rectangle"; +#X text 36 273 : up to 9 floats \, defining the specified domain (like "x y z" for "point" \, "x1 y1 z1 x2 y2 z2" for "line" \, "x y z r" for "sphere" \, ...). The meaning of the arguments depends -of course- on the domain.; #X text 59 43 Class: particle object; #X text 49 13 Synopsis: [part_velocity]; #X text 24 192 Arguments:; #X text 96 192 domain \, arguments; #X msg 489 181 symbol sphere; #X msg 579 202 0 0.1 0 0.1; -#X text 48 126 A newly created particle will be given an initial velocity -directing to a random point within the domain. The speed will also -vary according to how far the point is.; -#X obj 484 83 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 -#000000 0 1; +#X text 48 126 A newly created particle will be given an initial velocity directing to a random point within the domain. The speed will also vary according to how far the point is.; +#X obj 484 83 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 578 176 0.1 -0.1 0 0.05; #X text 578 160 arguments; #X text 489 162 domain; #N canvas 146 246 934 704 domain_infos 0; -#X text 36 9 'point' \; A point in space \; arg.1 X pos \; arg.2 Y -pos \; arg.3 Z pos \; \; 'line' \; A line between two points. \; arg.1-3 -Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of -point 1 \; \; 'rectangle' \; A rectangular space between four points. -The fourth point is assumed automatically. \; arg.1-3 Positions X \, -Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7-9 -Positions X \, Y \, Z of point 2 \; \; 'sphere' A space within a sphere. -When argument 5 is larger than zero \, the core is left blank with -the given radius. \; arg.1-3 Positions X \, Y \, Z of center. \; arg.4 -Outer radius \; arg.5 Inner radius \; \; 'box' \; By specifying the -position of two diagonal corners \, the rest will be assumed \; arg.1-3 -Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of -point 1 \; \; 'cylinder' \; When argument 8 is larger than zero \, -the core is left blank with the given radius. arg.1-3 Positions X \, -Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 -Outer radius \; arg.8 Inner radius \; \; 'cone' \; When argument 8 -is larger than zero \, the core is left blank with the given radius. -arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, -Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; -'blob' \; Not too sure what this is other than that it seems to be -a random range. arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Standard -deviation (??) \; \; 'plane' \; You will being specifying two points. -The plain will include point 0 and perpendicular to a line between -the two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 -Positions X \, Y \, Z of point 1 \; Note: When used with [part_source] -this domain always return the position of point 0 and is useless for -such context. \; \; 'disc' \; The concept of arguments 1 through 6 -are identical to 'plane'. \; You can additionally limit the area by -specifying the outer/inner radius of a circle centering at point 0 -\; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X -\, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; -, f 211; +#X text 36 9 'point' \; A point in space \; arg.1 X pos \; arg.2 Y pos \; arg.3 Z pos \; \; 'line' \; A line between two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; \; 'rectangle' \; A rectangular space between four points. The fourth point is assumed automatically. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7-9 Positions X \, Y \, Z of point 2 \; \; 'sphere' A space within a sphere. When argument 5 is larger than zero \, the core is left blank with the given radius. \; arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Outer radius \; arg.5 Inner radius \; \; 'box' \; By specifying the position of two diagonal corners \, the rest will be assumed \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; \; 'cylinder' \; When argument 8 is larger than zero \, the core is left blank with the given radius. arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; 'cone' \; When argument 8 is larger than zero \, the core is left blank with the given radius. arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \; \; 'blob' \; Not too sure what this is other than that it seems to be a random range. arg.1-3 Positions X \, Y \, Z of center. \; arg.4 Standard deviation (??) \; \; 'plane' \; You will being specifying two points. The plain will include point 0 and perpendicular to a line between the two points. \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; Note: When used with [part_source] this domain always return the position of point 0 and is useless for such context. \; \; 'disc' \; The concept of arguments 1 through 6 are identical to 'plane'. \; You can additionally limit the area by specifying the outer/inner radius of a circle centering at point 0 \; arg.1-3 Positions X \, Y \, Z of point 0 \; arg.4-6 Positions X \, Y \, Z of point 1 \; arg.7 Outer radius \; arg.8 Inner radius \;, f 211; #X restore 18 342 pd domain_infos; -#X connect 5 0 12 0; -#X connect 7 0 6 0; +#X obj 484 343 _gemwin; +#X connect 4 0 11 0; +#X connect 6 0 5 0; +#X connect 11 0 12 0; #X connect 12 0 13 0; -#X connect 13 0 14 0; -#X connect 14 0 7 0; -#X connect 22 0 14 1; -#X connect 23 0 14 2; -#X connect 25 0 5 0; -#X connect 26 0 14 2; +#X connect 13 0 6 0; +#X connect 21 0 13 1; +#X connect 22 0 13 2; +#X connect 24 0 4 0; +#X connect 25 0 13 2; diff --git a/help/part_vertex-help.pd b/help/part_vertex-help.pd index 2bf510449..212099ff8 100644 --- a/help/part_vertex-help.pd +++ b/help/part_vertex-help.pd @@ -1,65 +1,18 @@ #N canvas 609 462 664 466 10; #X declare -lib Gem; #X obj 539 28 declare -lib Gem; -#X obj 7 85 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 85 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 52 49 Class: particle object; -#X obj 468 84 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 -0; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc -#000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 476 326 pd gemwin; -#X obj 472 204 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 -0; +#X obj 468 84 cnv 15 170 220 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 204 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 476 104 gemhead; -#X obj 8 196 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 -0; +#X obj 8 196 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 28 GEM object; #X text 467 65 Example:; -#X obj 7 235 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 -0; +#X obj 7 235 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 476 128 part_head; #X obj 476 271 part_draw; -#X text 23 110 add a particle at the specified offset. You will need -this if you want any particles in your particle-system \, especially -with moving particle sources.; +#X text 23 110 add a particle at the specified offset. You will need this if you want any particles in your particle-system \, especially with moving particle sources.; #X text 42 29 Synopsis: [part_vertex]; #X obj 476 222 part_vertex; #X msg 539 184 -1 1 0; @@ -68,10 +21,11 @@ with moving particle sources.; #X obj 476 155 part_velocity point 0 -0.05 0; #X text 17 195 Arguments: default x y z; #X text 536 170 position x y z; -#X connect 6 0 11 0; -#X connect 11 0 19 0; -#X connect 15 0 18 0; -#X connect 16 0 15 1; -#X connect 17 0 15 1; -#X connect 18 0 12 0; -#X connect 19 0 15 0; +#X obj 476 326 _gemwin; +#X connect 5 0 10 0; +#X connect 10 0 18 0; +#X connect 14 0 17 0; +#X connect 15 0 14 1; +#X connect 16 0 14 1; +#X connect 17 0 11 0; +#X connect 18 0 14 0; diff --git a/help/polygon-help.pd b/help/polygon-help.pd index 4dcf2b485..5385ba295 100644 --- a/help/polygon-help.pd +++ b/help/polygon-help.pd @@ -1,47 +1,18 @@ #N canvas 27 382 680 461 10; #X declare -lib Gem; #X text 475 39 Example:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 180 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 492 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 358 Outlets:; #X text 21 371 Outlet 1: gemlist; -#X obj 469 58 cnv 15 200 270 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 528 354 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 533 393 pd gemwin; -#X msg 533 374 create; -#X text 529 353 Create window:; -#X obj 474 85 cnv 15 190 200 empty empty empty 20 12 0 14 -85973 -66577 -0; -#X obj 521 292 cnv 15 100 30 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 469 58 cnv 15 200 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 474 85 cnv 15 190 200 empty empty empty 20 12 0 14 #50fc50 #404040 0; +#X obj 521 292 cnv 15 100 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 479 136 draw line; #X msg 479 91 draw fill; #X msg 479 113 draw point; @@ -49,10 +20,9 @@ #X msg 605 194 0 \$1 0; #X msg 585 92 1 1 0; #X msg 593 112 1 -1 0; -#X floatatom 605 177 5 0 0 0 - - -; +#X floatatom 605 177 5 0 0 0 - - - 0; #X msg 603 152 -2 1 0; -#X text 21 138 Each (additional) inlet will accept an X Y Z point which -is where the control point will be.; +#X text 21 138 Each (additional) inlet will accept an X Y Z point which is where the control point will be.; #X text 26 309 Inlet 2: list: 3(XYZ) float values; #X text 26 330 Inlet N: list: 3(XYZ) float values; #X text 51 317 ...; @@ -65,35 +35,31 @@ is where the control point will be.; #X msg 478 221 draw trifan; #X msg 478 242 draw quad; #X msg 478 264 draw quadstrip; -#X text 27 247 Inlet 1: message: draw [line|linestrip|fill|point|tri|tristrip|trifan|quad|quadstrip] -; +#X text 27 247 Inlet 1: message: draw [line|linestrip|fill|point|tri|tristrip|trifan|quad|quadstrip]; #X text 54 30 Class: geometric object; #X text 33 14 Synopsis: [polygon]; #X text 7 69 Description: Renders a polygon.; -#X text 22 88 [polygon] creates a polygon graphics. The initial argument -is the number of points in the polygon. The maximum number of points -is unlimited.; +#X text 22 88 [polygon] creates a polygon graphics. The initial argument is the number of points in the polygon. The maximum number of points is unlimited.; #X obj 537 299 polygon 5; #X msg 603 246 width \$1; -#X floatatom 619 226 5 0 10 0 - - -; +#X floatatom 619 226 5 0 10 0 - - - 0; #X obj 568 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 44 0; -#X connect 18 0 44 0; -#X connect 19 0 44 0; -#X connect 20 0 44 0; -#X connect 21 0 44 5; -#X connect 22 0 44 1; -#X connect 23 0 44 2; -#X connect 24 0 21 0; -#X connect 25 0 44 4; -#X connect 31 0 44 3; -#X connect 33 0 44 0; -#X connect 34 0 44 0; -#X connect 35 0 44 0; -#X connect 36 0 44 0; -#X connect 37 0 44 0; -#X connect 38 0 44 0; -#X connect 45 0 44 0; -#X connect 46 0 45 0; +#X obj 514 340 _gemwin; +#X connect 13 0 40 0; +#X connect 14 0 40 0; +#X connect 15 0 40 0; +#X connect 16 0 40 0; +#X connect 17 0 40 5; +#X connect 18 0 40 1; +#X connect 19 0 40 2; +#X connect 20 0 17 0; +#X connect 21 0 40 4; +#X connect 27 0 40 3; +#X connect 29 0 40 0; +#X connect 30 0 40 0; +#X connect 31 0 40 0; +#X connect 32 0 40 0; +#X connect 33 0 40 0; +#X connect 34 0 40 0; +#X connect 41 0 40 0; +#X connect 42 0 41 0; diff --git a/help/polygon_smooth-help.pd b/help/polygon_smooth-help.pd index 896fbb8f8..f18cd561a 100644 --- a/help/polygon_smooth-help.pd +++ b/help/polygon_smooth-help.pd @@ -1,72 +1,39 @@ #N canvas 288 248 639 408 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 228 Inlets:; #X text 63 241 Inlet 1: gemlist; #X text 39 292 Outlets:; #X text 57 305 Outlet 1: gemlist; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 8 76 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 261 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 300 pd gemwin; -#X msg 519 281 create; -#X text 515 260 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 146 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 146 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X floatatom 477 186 2 0 0 0 - - -; +#X floatatom 477 186 2 0 0 0 - - - 0; #X obj 451 207 polygon_smooth; #X text 50 12 Synopsis: [polygon_smooth]; #X text 29 77 Description: turn on/off polygon smoothing; -#X text 22 91 [polygon_smooth] turns on/off smoothing for polygons -\, aka antialiasing . You can either turn smoothing on (1) \, off (1) -or leave it unchanged (-1).; -#X text 23 138 Note that this might be very CPU-consumptive \, if you -don't have hw-acceleration.; +#X text 22 91 [polygon_smooth] turns on/off smoothing for polygons \, aka antialiasing . You can either turn smoothing on (1) \, off (1) or leave it unchanged (-1).; +#X text 23 138 Note that this might be very CPU-consumptive \, if you don't have hw-acceleration.; #X text 63 196 ; #X text 63 255 Inlet 1: float: turn polygon-smoothing on/off/nop.; -#X obj 477 150 hradio 15 1 1 3 empty empty empty 0 -6 0 8 -262144 -1 --1 2; +#X obj 477 150 hradio 15 1 1 3 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 2; #X obj 477 167 - 1; #X text 20 343 See also:; #X text 48 362 FSAA antialiasing message to; #X obj 224 362 gemwin; #X obj 451 111 alpha 1; -#X obj 451 240 circle 1 30; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 31 0; -#X connect 18 0 19 0; -#X connect 19 0 32 0; -#X connect 26 0 27 0; -#X connect 27 0 18 0; -#X connect 31 0 19 0; +#X obj 451 240 circle 1; +#X obj 524 271 _gemwin; +#X connect 13 0 27 0; +#X connect 14 0 15 0; +#X connect 15 0 29 0; +#X connect 22 0 23 0; +#X connect 23 0 14 0; +#X connect 27 0 15 0; diff --git a/help/pqtorusknots-help.pd b/help/pqtorusknots-help.pd index dbe44f585..268adad89 100644 --- a/help/pqtorusknots-help.pd +++ b/help/pqtorusknots-help.pd @@ -1,97 +1,64 @@ #N canvas 100 61 710 412 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 469 47 cnv 15 235 290 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 474 274 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 479 313 pd gemwin; -#X msg 479 294 create; -#X text 475 273 Create window:; +#X obj 469 47 cnv 15 235 290 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 475 29 Example:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 213 cnv 15 450 180 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 213 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 217 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 521 8 GEM object; #X text 29 229 Inlet 1: gemlist; #X text 11 356 Outlets:; #X text 23 369 Outlet 1: gemlist; -#X obj 472 75 cnv 15 230 195 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 472 75 cnv 15 230 195 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 475 88 draw line; #X msg 475 111 draw fill; #X obj 543 54 gemhead; -#X floatatom 553 89 5 -5 5 2 size - -; +#X floatatom 553 89 5 -5 5 2 size - - 0; #X text 29 243 Inlet 1: message: draw [line|fill|points]; #X msg 476 132 draw point; #X text 7 69 Description: Renders a 3d knot; #X text 34 14 Synopsis: [pqtorusknots]; #X msg 592 88 scale \$1; -#X floatatom 553 110 5 10 256 2 - - -; +#X floatatom 553 110 5 10 256 2 - - - 0; #X msg 593 109 steps \$1; -#X floatatom 553 130 5 0 20 2 - - -; -#X floatatom 553 150 5 0.2 1 2 - - -; +#X floatatom 553 130 5 0 20 2 - - - 0; +#X floatatom 553 150 5 0.2 1 2 - - - 0; #X msg 593 129 facets \$1; #X msg 593 149 thick \$1; #X msg 593 171 clump \$1 0.5 1; -#X floatatom 553 173 2 9 20 0 - - -; +#X floatatom 553 173 2 9 20 0 - - - 0; #X msg 593 225 uvScale 1 1; -#X floatatom 548 199 5 0 0 0 - - -; +#X floatatom 548 199 5 0 0 0 - - - 0; #X msg 593 197 pq \$1 3; -#X text 15 88 The [pqtorusknot] object renders a 3dimensional knot -at the current position with current color.; +#X text 15 88 The [pqtorusknot] object renders a 3dimensional knot at the current position with current color.; #X obj 544 249 pqtorusknots; #X text 63 186 ; -#X text 15 119 You can set various parameters \, like number of facets -\, number of clumps \, winding \, ...; +#X text 15 119 You can set various parameters \, like number of facets \, number of clumps \, winding \, ...; #X text 29 257 Inlet 1: message: steps ; #X text 29 272 Inlet 1: message: facets ; #X text 29 287 Inlet 1: message: thick ; -#X text 29 302 Inlet 1: message: clump <#clumps> -; +#X text 29 302 Inlet 1: message: clump <#clumps> ; #X text 29 317 Inlet 1: message: pq ; -#X text 29 332 Inlet 1: message: ivScale : for texturing -; +#X text 29 332 Inlet 1: message: ivScale : for texturing; #X obj 588 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 17 0 38 0; -#X connect 18 0 38 0; -#X connect 19 0 38 0; -#X connect 20 0 25 0; -#X connect 22 0 38 0; -#X connect 25 0 38 0; -#X connect 26 0 27 0; -#X connect 27 0 38 0; -#X connect 28 0 30 0; -#X connect 29 0 31 0; -#X connect 30 0 38 0; -#X connect 31 0 38 0; -#X connect 32 0 38 0; -#X connect 33 0 32 0; -#X connect 34 0 38 0; -#X connect 35 0 36 0; -#X connect 36 0 38 0; +#X obj 475 277 _gemwin; +#X connect 13 0 34 0; +#X connect 14 0 34 0; +#X connect 15 0 34 0; +#X connect 16 0 21 0; +#X connect 18 0 34 0; +#X connect 21 0 34 0; +#X connect 22 0 23 0; +#X connect 23 0 34 0; +#X connect 24 0 26 0; +#X connect 25 0 27 0; +#X connect 26 0 34 0; +#X connect 27 0 34 0; +#X connect 28 0 34 0; +#X connect 29 0 28 0; +#X connect 30 0 34 0; +#X connect 31 0 32 0; +#X connect 32 0 34 0; diff --git a/help/primTri-help.pd b/help/primTri-help.pd index d237c8784..05a1dc0b5 100644 --- a/help/primTri-help.pd +++ b/help/primTri-help.pd @@ -1,38 +1,11 @@ #N canvas 130 61 696 468 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 107 cnv 15 200 250 empty empty empty 20 12 0 14 -228992 --66577 0; -#X obj 494 294 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 499 333 pd gemwin; -#X msg 499 314 create; -#X text 495 293 Create window:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 196 cnv 15 450 220 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 479 107 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 196 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 201 Inlets:; -#X obj 8 156 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; #X text 27 227 Inlet 1: message: draw [line|fill|point]; #X text 512 8 GEM object; @@ -40,10 +13,8 @@ #X text 9 380 Outlets:; #X text 21 393 Outlet 1: gemlist; #X text 485 89 Example:; -#X obj 482 137 cnv 15 190 110 empty empty empty 20 12 0 14 -81876 -66577 -0; -#X obj 534 252 cnv 15 100 30 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 482 137 cnv 15 190 110 empty empty empty 20 12 0 14 #4cfc4c #404040 0; +#X obj 534 252 cnv 15 100 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 485 145 draw line; #X msg 485 166 draw fill; #X msg 485 188 draw point; @@ -61,34 +32,25 @@ #X text 635 218 (XYZ)2; #X text 645 238 (XYZ)3; #X text 32 14 Synopsis: [primTri]; -#X text 7 69 Description: Renders a triangle with gradient colors. -; -#X text 16 86 The [primTri] object renders a triangle. The corner-points -can be specified with respect to position and color.; +#X text 7 69 Description: Renders a triangle with gradient colors.; +#X text 16 86 The [primTri] object renders a triangle. The corner-points can be specified with respect to position and color.; #X text 63 166 (none); -#X text 27 248 Inlet 2: list: 3(XYZ) float values (position of 1st -corner); -#X text 27 265 Inlet 3: list: 3(XYZ) float values (position of 2nd -corner); -#X text 27 282 Inlet 4: list: 3(XYZ) float values (position of 3rd -corner); -#X text 27 298 Inlet 5: list: 3(RGB) or 4(RGBA) float values (color -of 1st corner); -#X text 27 325 Inlet 6: list: 3(RGB) or 4(RGBA) float values (color -of 2nd corner); -#X text 27 352 Inlet 7: list: 3(RGB) or 4(RGBA) float values (color -of 3rd corner); -#X obj 543 259 primTri; +#X text 27 248 Inlet 2: list: 3(XYZ) float values (position of 1st corner); +#X text 27 265 Inlet 3: list: 3(XYZ) float values (position of 2nd corner); +#X text 27 282 Inlet 4: list: 3(XYZ) float values (position of 3rd corner); +#X text 27 298 Inlet 5: list: 3(RGB) or 4(RGBA) float values (color of 1st corner); +#X text 27 325 Inlet 6: list: 3(RGB) or 4(RGBA) float values (color of 2nd corner); +#X text 27 352 Inlet 7: list: 3(RGB) or 4(RGBA) float values (color of 3rd corner); +#X obj 543 259 primTri, f 10; #X obj 578 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 19 0 45 0; -#X connect 20 0 45 0; -#X connect 21 0 45 0; -#X connect 22 0 45 0; -#X connect 23 0 45 3; -#X connect 24 0 45 2; -#X connect 25 0 45 1; -#X connect 29 0 45 6; -#X connect 30 0 45 5; -#X connect 31 0 45 4; +#X obj 491 296 _gemwin; +#X connect 15 0 41 0; +#X connect 16 0 41 0; +#X connect 17 0 41 0; +#X connect 18 0 41 0; +#X connect 19 0 41 3; +#X connect 20 0 41 2; +#X connect 21 0 41 1; +#X connect 25 0 41 6; +#X connect 26 0 41 5; +#X connect 27 0 41 4; diff --git a/help/rectangle-help.pd b/help/rectangle-help.pd index 957b3a34d..b8c979a69 100644 --- a/help/rectangle-help.pd +++ b/help/rectangle-help.pd @@ -1,38 +1,11 @@ #N canvas 35 433 710 345 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 499 67 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 564 244 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 569 283 pd gemwin; -#X msg 569 264 create; -#X text 565 243 Create window:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 110 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 499 67 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 522 8 GEM object; @@ -40,33 +13,26 @@ #X text 9 290 Outlets:; #X text 21 303 Outlet 1: gemlist; #X text 505 49 Example:; -#X obj 502 98 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 502 98 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 505 105 draw line; #X msg 505 126 draw fill; #X msg 505 148 draw point; #X obj 548 74 gemhead; -#X floatatom 591 118 5 0 0 2 width - -; -#X floatatom 609 149 5 0 0 2 height - -; +#X floatatom 591 118 5 0 0 2 width - - 0; +#X floatatom 609 149 5 0 0 2 height - - 0; #X text 63 186 width & height of the rectangle; #X text 33 14 Synopsis: [rectangle]; #X text 7 69 Description: Renders a rectangle; #X obj 548 179 rectangle 3 1; #X text 27 261 Inlet 2: float: width (default to 1); #X text 27 274 Inlet 3: float: height (default to 1); -#X text 16 86 The [rectangle] object renders a rectangle at the current -position with current color. The width and height of the rectangle -can be set by the arguments and changed via the second and third inlet. -; -#X text 19 133 note for the nitpickers: the rectangle will span from -(-width|-height) to (+width|+height) so the actual size is really double -the specified size.; +#X text 16 86 The [rectangle] object renders a rectangle at the current position with current color. The width and height of the rectangle can be set by the arguments and changed via the second and third inlet.; +#X text 19 133 note for the nitpickers: the rectangle will span from (-width|-height) to (+width|+height) so the actual size is really double the specified size.; #X obj 588 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 27 0; -#X connect 19 0 27 0; -#X connect 20 0 27 0; -#X connect 21 0 27 0; -#X connect 22 0 27 1; -#X connect 23 0 27 2; +#X obj 562 262 _gemwin; +#X connect 14 0 23 0; +#X connect 15 0 23 0; +#X connect 16 0 23 0; +#X connect 17 0 23 0; +#X connect 18 0 23 1; +#X connect 19 0 23 2; diff --git a/help/render_trigger-help.pd b/help/render_trigger-help.pd index f9c6586a4..20c522fa7 100644 --- a/help/render_trigger-help.pd +++ b/help/render_trigger-help.pd @@ -1,18 +1,10 @@ #N canvas 450 81 684 364 10; #X declare -lib Gem; -#X obj 499 97 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 509 283 cnv 15 140 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#X msg 524 303 create; -#X text 520 282 Create window:; -#X obj 7 65 cnv 15 450 140 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 256 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 499 97 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 7 65 cnv 15 450 140 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 256 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 261 Inlets:; -#X obj 8 216 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 216 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 215 Arguments:; #X text 482 8 GEM object; #X text 27 273 Inlet 1: gemlist; @@ -20,58 +12,28 @@ #X text 21 303 Outlet 1: gemlist; #X text 505 79 Example:; #X text 33 14 Synopsis: [render_trigger]; -#X obj 502 128 cnv 15 160 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 502 128 cnv 15 160 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 510 102 gemhead; #X obj 510 137 render_trigger; #X obj 510 183 t b a b; #X obj 532 258 square; #X text 54 30 Class: control object; #X text 7 69 Description: triggers on rendering; -#X text 29 85 render_trigger allows you to know when the actual rendering -is occurring in a gemlist. If you think of the gemlist as a list of -actions which occur \, the pre-bang outlet sends a bang out before -any of the actions below the render_trigger in the gemlist. The post-bang -sends out a bang after all of the actions have occurred.; +#X text 29 85 render_trigger allows you to know when the actual rendering is occurring in a gemlist. If you think of the gemlist as a list of actions which occur \, the pre-bang outlet sends a bang out before any of the actions below the render_trigger in the gemlist. The post-bang sends out a bang after all of the actions have occurred.; #X text 72 225 (none); #X text 21 316 Outlet 2: bang : pre-render; #X text 21 330 Outlet 2: bang : post-render; -#X text 9 172 !THIS IS OBOLETE AS YOU CAN NOW USE THE [trigger] OBJECT -FOR THE SAME PURPOSE!; -#X obj 602 158 bng 15 250 50 0 empty empty post 20 8 0 8 -262144 -1 --1; -#X obj 556 158 bng 15 250 50 0 empty empty pre 20 8 0 8 -262144 -1 --1; -#X obj 510 227 bng 15 250 50 0 empty empty post 20 8 0 8 -262144 -1 --1; -#X obj 554 208 bng 15 250 50 0 empty empty pre 20 8 0 8 -262144 -1 --1; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 93 create \, 1 \, frame 2; -#X msg 198 112 destroy \, reset; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 524 323 pd gemwin (2fps); +#X text 9 172 !THIS IS OBOLETE AS YOU CAN NOW USE THE [trigger] OBJECT FOR THE SAME PURPOSE!; +#X obj 602 158 bng 15 250 50 0 empty empty post 20 8 0 8 #fcfcfc #000000 #000000; +#X obj 556 158 bng 15 250 50 0 empty empty pre 20 8 0 8 #fcfcfc #000000 #000000; +#X obj 510 227 bng 15 250 50 0 empty empty post 20 8 0 8 #fcfcfc #000000 #000000; +#X obj 554 208 bng 15 250 50 0 empty empty pre 20 8 0 8 #fcfcfc #000000 #000000; #X obj 558 8 declare -lib Gem; -#X connect 2 0 31 0; -#X connect 16 0 17 0; -#X connect 17 0 18 0; -#X connect 17 1 28 0; -#X connect 17 2 27 0; -#X connect 18 0 29 0; -#X connect 18 1 19 0; -#X connect 18 2 30 0; -#X connect 31 0 2 0; +#X obj 519 294 _gemwin 2; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 14 1 25 0; +#X connect 14 2 24 0; +#X connect 15 0 26 0; +#X connect 15 1 16 0; +#X connect 15 2 27 0; diff --git a/help/ripple-help.pd b/help/ripple-help.pd index 7128efb2b..3bd4b5a11 100644 --- a/help/ripple-help.pd +++ b/help/ripple-help.pd @@ -1,56 +1,27 @@ #N canvas 45 61 661 402 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 77 cnv 15 170 300 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 544 314 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 549 353 pd gemwin; -#X msg 549 334 create; -#X text 545 313 Create window:; +#X obj 479 77 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 485 59 Example:; -#X obj 7 52 cnv 15 450 132 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 244 cnv 15 450 145 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 52 cnv 15 450 132 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 244 cnv 15 450 145 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 249 Inlets:; -#X obj 8 189 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 189 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 189 Arguments:; #X text 27 275 Inlet 1: message: draw [line|fill|point]; #X text 472 8 GEM object; #X text 27 261 Inlet 1: gemlist; #X text 9 358 Outlets:; #X text 20 371 Outlet 1: gemlist; -#X obj 484 171 cnv 15 160 140 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 484 171 cnv 15 160 140 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 488 84 gemhead; -#X floatatom 566 89 5 0 0 0 - - -; +#X floatatom 566 89 5 0 0 0 - - - 0; #X msg 494 174 draw line; #X msg 494 194 draw fill; #X msg 494 214 draw point; #X obj 488 109 rotateXYZ 135 0 0; -#X obj 574 186 bng 25 250 50 0 empty empty grab 0 -6 0 8 -262144 -1 --1; -#X floatatom 572 222 5 0 0 1 amount - -; +#X obj 574 186 bng 25 250 50 0 empty empty grab 0 -6 0 8 #fcfcfc #000000 #000000; +#X floatatom 572 222 5 0 0 1 amount - - 0; #X text 7 56 Description: Renders and distorts a square.; #X text 27 331 Inlet 4: float: posX (centered); #X text 27 343 Inlet 5: float: posY (centered); @@ -59,31 +30,24 @@ #X text 63 202 segments of the square; #X text 33 14 Synopsis: [ripple]; #X obj 488 289 ripple 16 16; -#X text 16 73 When banged \, ripple will grab the vertex nearest to -the specified (ctrX ctrY) position. The vertices will be accelerated -towards the selected one for a moment and then gradually fall back -to their original position.; -#X obj 575 244 tgl 15 0 empty empty ctrX 18 8 0 8 -262144 -1 -1 0 1 -; -#X obj 575 264 tgl 15 0 empty empty ctrY 18 8 0 8 -262144 -1 -1 0 1 -; +#X text 16 73 When banged \, ripple will grab the vertex nearest to the specified (ctrX ctrY) position. The vertices will be accelerated towards the selected one for a moment and then gradually fall back to their original position.; +#X obj 575 244 tgl 15 0 empty empty ctrX 18 8 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 575 264 tgl 15 0 empty empty ctrY 18 8 0 8 #fcfcfc #000000 #000000 0 1; #X text 27 317 Inlet 3: float: amount; #X text 17 131 The amount of excursion can be specified.; -#X floatatom 510 247 5 0 0 0 - - -; -#X text 17 150 note: [ripple] distorts a bit different when texture-mapping -is used!; +#X floatatom 510 247 5 0 0 0 - - - 0; +#X text 17 150 note: [ripple] distorts a bit different when texture-mapping is used!; #X text 27 303 Inlet 2: float: size; #X obj 548 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 23 0; -#X connect 19 0 23 1; -#X connect 20 0 33 0; -#X connect 21 0 33 0; -#X connect 22 0 33 0; -#X connect 23 0 33 0; -#X connect 24 0 33 0; -#X connect 25 0 33 2; -#X connect 35 0 33 3; -#X connect 36 0 33 4; -#X connect 39 0 33 1; +#X obj 508 326 _gemwin; +#X connect 14 0 19 0; +#X connect 15 0 19 1; +#X connect 16 0 29 0; +#X connect 17 0 29 0; +#X connect 18 0 29 0; +#X connect 19 0 29 0; +#X connect 20 0 29 0; +#X connect 21 0 29 2; +#X connect 31 0 29 3; +#X connect 32 0 29 4; +#X connect 35 0 29 1; diff --git a/help/rotate-help.pd b/help/rotate-help.pd index 23b5444c6..b1fcbb04b 100644 --- a/help/rotate-help.pd +++ b/help/rotate-help.pd @@ -1,70 +1,39 @@ #N canvas 57 61 633 363 10; #X declare -lib Gem; #X text 442 8 GEM object; -#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 63 231 Inlet 1: gemlist; #X text 39 282 Outlets:; #X text 57 295 Outlet 1: gemlist; -#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 233 square; #X text 50 12 Synopsis: [rotate]; #X text 29 77 Description: rotation; -#X text 41 98 rotate accepts a gemList and changes the current transformation -matrix by the specified rotation; +#X text 41 98 rotate accepts a gemList and changes the current transformation matrix by the specified rotation; #X obj 451 186 rotate 45 0 0 1; -#X floatatom 468 162 5 0 0 0 - - -; +#X floatatom 468 162 5 0 0 0 - - - 0; #X msg 551 163 1 0 0; #X msg 566 187 0 1 1; #X text 63 166 1st argument: initial rotation amount (in degree); #X text 63 179 2nd-4th argument: (X Y Z) of the rotation-axis; -#X text 63 246 Inlet 2: float: rotation amount around axis (in deg) -; +#X text 63 246 Inlet 2: float: rotation amount around axis (in deg); #X text 63 264 Inlet 3: list: rotation axis (X Y Z); #X text 39 130 the (x y z) vector determines the axis of rotation; #X text 38 332 see also:; #X obj 101 332 rotateXYZ; #X obj 169 332 accumrotate; #X obj 508 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 22 0; -#X connect 22 0 18 0; -#X connect 23 0 22 1; -#X connect 24 0 22 2; -#X connect 25 0 22 2; +#X obj 521 271 _gemwin; +#X connect 13 0 18 0; +#X connect 18 0 14 0; +#X connect 19 0 18 1; +#X connect 20 0 18 2; +#X connect 21 0 18 2; diff --git a/help/rotateXYZ-help.pd b/help/rotateXYZ-help.pd index 522feb506..7f7b8c948 100644 --- a/help/rotateXYZ-help.pd +++ b/help/rotateXYZ-help.pd @@ -1,75 +1,39 @@ #N canvas 445 99 639 383 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 37 228 Inlets:; #X text 51 241 Inlet 1: gemlist; #X text 37 302 Outlets:; #X text 55 315 Outlet 1: gemlist; -#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 114 cnv 15 160 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 114 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 233 square; #X text 29 77 Description: rotation; -#X text 32 92 rotate accepts a gemList and changes the current transformation -matrix by the specified rotation; -#X floatatom 486 122 5 0 0 1 X[deg] - -; +#X text 32 92 rotate accepts a gemList and changes the current transformation matrix by the specified rotation; +#X floatatom 486 122 5 0 0 1 X[deg] - - 0; #X obj 451 186 rotateXYZ 45 0 0; -#X floatatom 506 142 5 0 0 1 Y[deg] - -; -#X floatatom 530 162 5 0 0 1 Z[deg] - -; +#X floatatom 506 142 5 0 0 1 Y[deg] - - 0; +#X floatatom 530 162 5 0 0 1 Z[deg] - - 0; #X text 50 12 Synopsis: [rotateXYZ]; -#X text 29 126 the rotation around the X- \, Y- and Z-axis (in this -order) can be specified separately by arguments and changed via inlets. -; -#X text 15 191 1st-3rd argument: rotation (in deg) around X- \, Y- -and Z-axis; -#X text 51 256 Inlet 2: float: rotation amount around X-axis (in deg) -; -#X text 51 282 Inlet 4: float: rotation amount around Z-axis (in deg) -; -#X text 51 269 Inlet 3: float: rotation amount around Y-axis (in deg) -; +#X text 29 126 the rotation around the X- \, Y- and Z-axis (in this order) can be specified separately by arguments and changed via inlets.; +#X text 15 191 1st-3rd argument: rotation (in deg) around X- \, Y- and Z-axis; +#X text 51 256 Inlet 2: float: rotation amount around X-axis (in deg); +#X text 51 282 Inlet 4: float: rotation amount around Z-axis (in deg); +#X text 51 269 Inlet 3: float: rotation amount around Y-axis (in deg); #X text 22 349 see also:; #X obj 85 349 rotate; #X obj 132 349 accumrotate; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 22 0; -#X connect 21 0 22 1; -#X connect 22 0 18 0; -#X connect 23 0 22 2; -#X connect 24 0 22 3; +#X obj 526 277 _gemwin; +#X connect 13 0 18 0; +#X connect 17 0 18 1; +#X connect 18 0 14 0; +#X connect 19 0 18 2; +#X connect 20 0 18 3; diff --git a/help/rubber-help.pd b/help/rubber-help.pd index 069a28293..3b84c1455 100644 --- a/help/rubber-help.pd +++ b/help/rubber-help.pd @@ -1,72 +1,40 @@ #N canvas 6 61 710 387 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 57 cnv 15 170 300 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 544 294 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 549 333 pd gemwin; -#X msg 549 314 create; -#X text 545 293 Create window:; +#X obj 479 57 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 485 39 Example:; -#X obj 7 65 cnv 15 450 102 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 226 cnv 15 450 145 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 102 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 226 cnv 15 450 145 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 231 Inlets:; -#X obj 8 171 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 171 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 170 Arguments:; #X text 27 257 Inlet 1: message: draw [line|fill|point]; #X text 482 8 GEM object; #X text 27 243 Inlet 1: gemlist; #X text 9 340 Outlets:; #X text 20 353 Outlet 1: gemlist; -#X obj 484 151 cnv 15 160 140 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 484 151 cnv 15 160 140 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 488 58 gemhead; -#X floatatom 530 77 5 -10 10 0 - - -; +#X floatatom 530 77 5 -10 10 0 - - - 0; #X msg 494 154 draw line; #X msg 494 174 draw fill; #X msg 494 194 draw point; -#X obj 581 166 bng 15 250 50 0 empty empty grab 20 7 0 8 -262144 -1 --1; +#X obj 581 166 bng 15 250 50 0 empty empty grab 20 7 0 8 #fcfcfc #000000 #000000; #X obj 581 132 select 1; -#X floatatom 573 227 5 0 0 1 ctrX - -; -#X floatatom 573 244 5 0 0 1 ctrY - -; -#X floatatom 582 185 5 0 0 1 size - -; -#X floatatom 582 202 5 0 0 1 height - -; +#X floatatom 573 227 5 0 0 1 ctrX - - 0; +#X floatatom 573 244 5 0 0 1 ctrY - - 0; +#X floatatom 582 185 5 0 0 1 size - - 0; +#X floatatom 582 202 5 0 0 1 height - - 0; #X text 33 14 Synopsis: [rubber]; #X text 7 69 Description: Renders and distorts a square.; #X text 27 313 Inlet 4: float: posX (centered); #X text 27 325 Inlet 5: float: posY (centered); -#X text 16 86 When banged \, rubber will grab the vertex of the square -specified by ctrX and ctrY and expose it at the specified height. You -can then move the grabbed vertex and the adjacent vertices will follow -inertly. When you bang the rubber object again \, the grabbed vertex -will fall back to its original position; +#X text 16 86 When banged \, rubber will grab the vertex of the square specified by ctrX and ctrY and expose it at the specified height. You can then move the grabbed vertex and the adjacent vertices will follow inertly. When you bang the rubber object again \, the grabbed vertex will fall back to its original position; #X text 65 197 default: 32 32; #X text 63 183 segments of the square; #X text 480 362 and move the mouse; #X obj 542 113 gemmouse 1 1; +#A saved init; #X obj 488 269 rubber 8 8; #X text 27 270 Inlet 1: bang: grab/release; #X text 27 285 Inlet 2: float: size; @@ -74,22 +42,21 @@ will fall back to its original position; #X obj 488 94 accumrotate 135 0 0; #X obj 488 77 t a b; #X obj 548 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 43 0; -#X connect 19 0 42 1; -#X connect 20 0 38 0; -#X connect 21 0 38 0; -#X connect 22 0 38 0; -#X connect 23 0 38 0; -#X connect 24 0 23 0; -#X connect 25 0 38 3; -#X connect 26 0 38 4; -#X connect 27 0 38 1; -#X connect 28 0 38 2; -#X connect 37 0 25 0; -#X connect 37 1 26 0; -#X connect 37 2 24 0; -#X connect 42 0 38 0; -#X connect 43 0 42 0; -#X connect 43 1 19 0; +#X obj 554 302 _gemwin; +#X connect 14 0 39 0; +#X connect 15 0 38 1; +#X connect 16 0 34 0; +#X connect 17 0 34 0; +#X connect 18 0 34 0; +#X connect 19 0 34 0; +#X connect 20 0 19 0; +#X connect 21 0 34 3; +#X connect 22 0 34 4; +#X connect 23 0 34 1; +#X connect 24 0 34 2; +#X connect 33 0 21 0; +#X connect 33 1 22 0; +#X connect 33 2 20 0; +#X connect 38 0 34 0; +#X connect 39 0 38 0; +#X connect 39 1 15 0; diff --git a/help/scale-help.pd b/help/scale-help.pd index f504184a9..e22845a35 100644 --- a/help/scale-help.pd +++ b/help/scale-help.pd @@ -1,59 +1,27 @@ #N canvas 207 61 639 441 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 306 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 306 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 318 Inlets:; #X text 63 331 Inlet 1: gemlist; #X text 39 382 Outlets:; #X text 57 395 Outlet 1: gemlist; -#X obj 8 256 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 256 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 255 Arguments:; -#X obj 8 76 cnv 15 430 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 126 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 126 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 50 12 Synopsis: [scale]; #X text 29 77 Description: scale; -#X text 39 97 scale accepts a gemList and changes the current transformation -matrix by the specified scale; +#X text 39 97 scale accepts a gemList and changes the current transformation matrix by the specified scale; #X text 39 129 The xyz vector determine the vector for scaling; -#X text 24 159 With 1 argument \, the entire object is scaled by this -amount; -#X text 22 177 With 3 arguments \, the object is scaled in each dimension -by the vector; -#X text 22 206 With 4 arguments \, the object is scaled by the amount -by the vector.; -#X floatatom 480 130 5 0 0 1 amount - -; +#X text 24 159 With 1 argument \, the entire object is scaled by this amount; +#X text 22 177 With 3 arguments \, the object is scaled in each dimension by the vector; +#X text 22 206 With 4 arguments \, the object is scaled by the amount by the vector.; +#X floatatom 480 130 5 0 0 1 amount - - 0; #X msg 524 174 1 1 1; #X msg 509 150 3 2 1; #X obj 451 263 cube; @@ -68,13 +36,12 @@ by the vector.; #X text 450 339 see also:; #X obj 452 363 scaleXYZ; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 29 0; -#X connect 25 0 36 1; -#X connect 26 0 36 2; -#X connect 27 0 36 2; -#X connect 29 0 36 0; -#X connect 30 0 31 0; -#X connect 31 0 28 0; -#X connect 36 0 28 0; +#X obj 529 276 _gemwin; +#X connect 13 0 25 0; +#X connect 21 0 32 1; +#X connect 22 0 32 2; +#X connect 23 0 32 2; +#X connect 25 0 32 0; +#X connect 26 0 27 0; +#X connect 27 0 24 0; +#X connect 32 0 24 0; diff --git a/help/scaleXYZ-help.pd b/help/scaleXYZ-help.pd index d77d79cce..83f5cc399 100644 --- a/help/scaleXYZ-help.pd +++ b/help/scaleXYZ-help.pd @@ -1,73 +1,39 @@ #N canvas 207 61 639 433 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 212 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 212 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 211 Inlets:; #X text 63 228 Inlet 1: gemlist; #X text 39 295 Outlets:; #X text 57 312 Outlet 1: gemlist; -#X obj 8 154 cnv 15 430 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 154 cnv 15 430 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 153 Arguments:; -#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 262 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 301 pd gemwin; -#X msg 519 282 create; -#X text 515 261 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 106 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 106 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X floatatom 491 110 5 0 0 1 X-scale - -; -#X obj 451 263 cube; -#X obj 459 222 loadbang; -#X msg 459 239 draw line; +#X floatatom 491 110 5 0 0 1 X-scale - - 0; #X text 50 12 Synopsis: [scaleXYZ]; #X text 29 77 Description: scale along the X- \, Y- and Z-axis; #X obj 451 176 scaleXYZ 1 0.5 0.7; -#X floatatom 506 131 5 0 0 1 Y-scale - -; -#X floatatom 527 150 5 0 0 1 Z-scale - -; +#X floatatom 506 131 5 0 0 1 Y-scale - - 0; +#X floatatom 527 150 5 0 0 1 Z-scale - - 0; #X text 54 173 : scaling factors along the axes.; #X text 63 244 Inlet 2: float: scaling amount along the X-axis; #X text 63 276 Inlet 4: float: scaling amount along the Z-axis; #X text 63 260 Inlet 3: float: scaling amount along the Y-axis; #X obj 451 200 rotate 45 1 1 1; -#X text 39 97 [scaleXYZ] accepts a gemList and changes the current -transformation matrix by the specified scale; +#X text 39 97 [scaleXYZ] accepts a gemList and changes the current transformation matrix by the specified scale; #X text 17 340 see also:; #X obj 83 340 scale; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; +#X obj 519 262 _gemwin; +#X obj 451 263 cube \; draw line; +#X connect 13 0 17 0; +#X connect 14 0 17 1; #X connect 17 0 24 0; -#X connect 18 0 24 1; -#X connect 20 0 21 0; -#X connect 21 0 19 0; -#X connect 24 0 31 0; -#X connect 25 0 24 2; -#X connect 26 0 24 3; -#X connect 31 0 19 0; +#X connect 18 0 17 2; +#X connect 19 0 17 3; +#X connect 24 0 30 0; diff --git a/help/scopeXYZ~-help.pd b/help/scopeXYZ~-help.pd index 9343d2574..baf914a67 100644 --- a/help/scopeXYZ~-help.pd +++ b/help/scopeXYZ~-help.pd @@ -1,50 +1,21 @@ #N canvas 30 348 677 461 10; #X declare -lib Gem; #X text 475 39 Example:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 219 cnv 15 450 210 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 219 cnv 15 450 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 172 cnv 15 450 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 172 cnv 15 450 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 171 Arguments:; #X text 502 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 398 Outlets:; #X text 21 411 Outlet 1: gemlist; -#X obj 469 58 cnv 15 200 295 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 470 359 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy \, reset; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 475 398 pd gemwin; -#X msg 475 379 create; -#X text 471 358 Create window:; -#X obj 474 112 cnv 15 190 200 empty empty empty 20 12 0 14 -85973 -66577 -0; -#X obj 521 319 cnv 15 110 30 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 469 58 cnv 15 200 295 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 470 359 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 474 112 cnv 15 190 200 empty empty empty 20 12 0 14 #50fc50 #404040 0; +#X obj 521 319 cnv 15 110 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 27 293 Inlet 1: message: width : line-width(1); -#X obj 596 233 cnv 15 65 75 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 596 233 cnv 15 65 75 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 479 143 draw line; #X msg 479 183 draw fill; #X msg 479 120 draw point; @@ -56,32 +27,35 @@ #X msg 478 269 draw quad; #X msg 478 291 draw quadstrip; #X obj 527 88 rotateXYZ; -#X floatatom 585 65 5 0 0 0 - - -; -#X floatatom 599 167 5 0 10 0 - - -; +#X floatatom 585 65 5 0 0 0 - - - 0; +#X floatatom 599 167 5 0 10 0 - - - 0; #X msg 599 183 width \$1; -#X floatatom 600 124 5 0 100 0 - - -; -#X obj 579 359 cnv 15 90 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#X text 27 247 Inlet 1: message: draw [default|line|linestrip|fill|point|tri|tristrip|trifan|quad|quadstrip] -; -#N canvas 0 0 450 300 dsp 0; +#X floatatom 600 124 5 0 100 0 - - - 0; +#X obj 579 359 cnv 15 90 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 27 247 Inlet 1: message: draw [default|line|linestrip|fill|point|tri|tristrip|trifan|quad|quadstrip]; +#N canvas 0 0 629 304 dsp 0; #X obj 74 87 r \$0-dsp; -#X obj 74 108 route set; -#X msg 132 131 \; pd dsp \$1; -#X obj 280 98 r pd; -#X obj 280 119 route dsp; -#X obj 280 170 s \$0-dsp; -#X msg 280 148 set \$1; -#X connect 0 0 1 0; -#X connect 1 1 2 0; +#X msg 74 131 \; pd dsp \$1; +#X obj 74 108 route float; +#X obj 199 84 r pd-dsp-started; +#X msg 199 107 1; +#X msg 199 130 set \$1; +#X obj 199 153 s \$0-dsp; +#X msg 309 107 0; +#X obj 309 84 r pd-dsp-stopped; +#X obj 301 44 loadbang; +#X connect 0 0 2 0; +#X connect 2 0 1 0; #X connect 3 0 4 0; -#X connect 4 0 6 0; -#X connect 6 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X connect 9 0 7 0; #X restore 587 396 pd dsp; -#X obj 590 362 tgl 30 0 \$0-dsp \$0-dsp dsp 35 15 2 12 -262144 -1 -1 -0 1; +#X obj 590 362 tgl 30 0 \$0-dsp \$0-dsp dsp 35 15 2 12 #fcfcfc #000000 #000000 0 1; #X obj 527 326 scopeXYZ~ 1024; -#X floatatom 599 216 5 0 0 0 - - -; +#X floatatom 599 216 5 0 0 0 - - - 0; #X obj 599 283 osc~ 882; #X obj 599 262 osc~ 221; #X obj 599 239 osc~ 40; @@ -89,39 +63,33 @@ #X text 33 14 Synopsis: [scopeXYZ~]; #X text 54 30 Class: geometric object \, DSP-object; #X text 7 69 Description: 3D oscilloscope; -#X text 22 87 [scopeXYZ~] is a 3-dimensional oscilloscope. It reads -3 input signals and applies the values as excursions along the respective -axis. The initial argument is the number of signal-points that are -be stored.; -#X text 27 306 Inlet 1: message: length : number of signal points -to be stored; -#X text 63 183 number of signal points that are stored (defaults to -blocksize); +#X text 22 87 [scopeXYZ~] is a 3-dimensional oscilloscope. It reads 3 input signals and applies the values as excursions along the respective axis. The initial argument is the number of signal-points that are be stored.; +#X text 27 306 Inlet 1: message: length : number of signal points to be stored; +#X text 63 183 number of signal points that are stored (defaults to blocksize); #X text 23 144 You can use it for Lissajou-patterns; #X text 28 343 Inlet 2: signal: X-values of the oscillograph; #X text 28 356 Inlet 3: signal: Y-values of the oscillograph; #X text 28 371 Inlet 4: signal: Z-values of the oscillograph; #X obj 568 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 19 0 38 0; -#X connect 20 0 38 0; -#X connect 21 0 38 0; -#X connect 22 0 29 0; -#X connect 23 0 38 0; -#X connect 24 0 38 0; -#X connect 25 0 38 0; -#X connect 26 0 38 0; -#X connect 27 0 38 0; -#X connect 28 0 38 0; -#X connect 29 0 38 0; -#X connect 30 0 29 1; -#X connect 30 0 29 3; -#X connect 31 0 32 0; -#X connect 32 0 38 0; -#X connect 33 0 43 0; -#X connect 39 0 42 0; -#X connect 40 0 38 3; -#X connect 41 0 38 2; -#X connect 42 0 38 1; -#X connect 43 0 38 0; +#X obj 477 366 _gemwin; +#X connect 16 0 35 0; +#X connect 17 0 35 0; +#X connect 18 0 35 0; +#X connect 19 0 26 0; +#X connect 20 0 35 0; +#X connect 21 0 35 0; +#X connect 22 0 35 0; +#X connect 23 0 35 0; +#X connect 24 0 35 0; +#X connect 25 0 35 0; +#X connect 26 0 35 0; +#X connect 27 0 26 1; +#X connect 27 0 26 3; +#X connect 28 0 29 0; +#X connect 29 0 35 0; +#X connect 30 0 40 0; +#X connect 36 0 39 0; +#X connect 37 0 35 3; +#X connect 38 0 35 2; +#X connect 39 0 35 1; +#X connect 40 0 35 0; diff --git a/help/separator-help.pd b/help/separator-help.pd index dbe727c81..0d813735c 100644 --- a/help/separator-help.pd +++ b/help/separator-help.pd @@ -3,17 +3,14 @@ #X text 692 8 GEM object; #X text 71 31 Class: manipulation object; #X text 50 12 Synopsis: [separator]; -#X obj 8 337 cnv 15 430 60 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 337 cnv 15 430 60 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 339 Inlets:; #X text 63 352 Inlet 1: gemlist; #X text 39 368 Outlets:; #X text 57 381 Outlet 1: gemlist; -#X obj 8 204 cnv 15 430 120 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 204 cnv 15 430 120 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 206 Arguments:; -#X obj 8 76 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 29 77 Description: separate render chains; #X text 72 236 "modelview" = "model" = "m"; #X text 72 249 "color" = "c"; @@ -21,65 +18,26 @@ #X text 72 276 "projection" = "p"; #X text 63 217 list of matrices to work on; #X text 63 298 default: "m c t p" (all matrices); -#X text 42 135 for the openGL-savvy: [separator] pushes (saves) the -modelview \, color \, texture and projection matrices to the stack -(unless the stack is full). Once rendering below [separator] is done -\, the matrices are popped \, thus restoring the state before [separator] -was called.; -#X text 42 95 [separator] isolates parallel render-chains with regard -to transformation effects (translation \, rotation \, ...) \, so you -don't get side-effects; -#X obj 8 411 cnv 15 430 130 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X text 42 135 for the openGL-savvy: [separator] pushes (saves) the modelview \, color \, texture and projection matrices to the stack (unless the stack is full). Once rendering below [separator] is done \, the matrices are popped \, thus restoring the state before [separator] was called.; +#X text 42 95 [separator] isolates parallel render-chains with regard to transformation effects (translation \, rotation \, ...) \, so you don't get side-effects; +#X obj 8 411 cnv 15 430 130 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 162 448 pix_separator; -#X text 53 420 NOTE: [separator] has no effect on pixel-operations. -to isolate [pix_*]-chains from each other \, use:; -#X text 55 476 NOTE: the color will not be affected by [separator]. -if you change the [color] in the subchain rendered first \, the same -color will automatically be applied to subchains rendered later. the -only way to work around this \, is to reset the color in the other -subchains.; -#X obj 602 440 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 607 479 pd gemwin; -#X msg 607 460 create; -#X text 603 439 Create window:; -#X obj 439 229 cnv 15 210 40 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 658 229 cnv 15 210 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X text 53 420 NOTE: [separator] has no effect on pixel-operations. to isolate [pix_*]-chains from each other \, use:; +#X text 55 476 NOTE: the color will not be affected by [separator]. if you change the [color] in the subchain rendered first \, the same color will automatically be applied to subchains rendered later. the only way to work around this \, is to reset the color in the other subchains.; +#X obj 602 440 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 439 229 cnv 15 210 40 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 658 229 cnv 15 210 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 446 241 separator; #X obj 446 188 translateXYZ 2 0 0; #X obj 520 242 separator; #X obj 446 148 gemhead; #X obj 446 168 color 1 0 0; -#X obj 446 119 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; -#X obj 661 122 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 446 55 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 -; +#X obj 446 119 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 661 122 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 446 55 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 446 73 t f f; #X obj 661 96 == 0; -#X floatatom 581 197 5 0 0 0 - - -; +#X floatatom 581 197 5 0 0 0 - - - 0; #X obj 446 33 loadbang; #X text 472 56 toggle between separated/unseparated rendering; #X text 694 117 blue; @@ -89,9 +47,7 @@ subchains.; #X obj 661 168 color 0 0 1; #X obj 446 208 t a a; #X obj 661 208 t a a; -#X text 465 326 If you did not use a [separator] in the example \, -then one of the chains would have an extra rotation (depending on which -subchain is rendered first).; +#X text 465 326 If you did not use a [separator] in the example \, then one of the chains would have an extra rotation (depending on which subchain is rendered first).; #X obj 747 273 rotateXYZ 0 45 0; #X obj 747 293 square; #X obj 520 273 rotateXYZ 0 45 0; @@ -100,34 +56,31 @@ subchain is rendered first).; #X obj 446 271 color 0 1 1; #X obj 520 293 circle; #X obj 446 293 cone; -#X text 464 364 With the [separator] \, both objects will by translated -\, but the rotation in one branch will not effect the other branch. -; +#X text 464 364 With the [separator] \, both objects will by translated \, but the rotation in one branch will not effect the other branch.; #X obj 768 8 declare -lib Gem; -#X connect 25 0 26 0; -#X connect 26 0 25 0; -#X connect 30 0 56 0; -#X connect 31 0 48 0; -#X connect 32 0 53 0; -#X connect 33 0 34 0; -#X connect 34 0 31 0; -#X connect 35 0 33 0; -#X connect 36 0 46 0; -#X connect 37 0 38 0; -#X connect 38 0 35 0; -#X connect 38 1 39 0; -#X connect 39 0 36 0; -#X connect 40 0 51 1; -#X connect 40 0 53 1; -#X connect 41 0 37 0; -#X connect 45 0 49 0; -#X connect 46 0 47 0; -#X connect 47 0 45 0; -#X connect 48 0 30 0; -#X connect 48 1 32 0; -#X connect 49 0 55 0; -#X connect 49 1 51 0; -#X connect 51 0 52 0; -#X connect 53 0 57 0; -#X connect 55 0 54 0; -#X connect 56 0 58 0; +#X obj 608 450 _gemwin; +#X connect 27 0 53 0; +#X connect 28 0 45 0; +#X connect 29 0 50 0; +#X connect 30 0 31 0; +#X connect 31 0 28 0; +#X connect 32 0 30 0; +#X connect 33 0 43 0; +#X connect 34 0 35 0; +#X connect 35 0 32 0; +#X connect 35 1 36 0; +#X connect 36 0 33 0; +#X connect 37 0 48 1; +#X connect 37 0 50 1; +#X connect 38 0 34 0; +#X connect 42 0 46 0; +#X connect 43 0 44 0; +#X connect 44 0 42 0; +#X connect 45 0 27 0; +#X connect 45 1 29 0; +#X connect 46 0 52 0; +#X connect 46 1 48 0; +#X connect 48 0 49 0; +#X connect 50 0 54 0; +#X connect 52 0 51 0; +#X connect 53 0 55 0; diff --git a/help/shearXY-help.pd b/help/shearXY-help.pd index fa1f38a3a..4b248d691 100644 --- a/help/shearXY-help.pd +++ b/help/shearXY-help.pd @@ -1,61 +1,31 @@ #N canvas 57 61 625 322 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 233 Inlets:; #X text 63 246 Inlet 1: gemlist; #X text 39 276 Outlets:; #X text 57 289 Outlet 1: gemlist; -#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 288 pd gemwin; -#X msg 519 269 create; -#X text 515 248 Create window:; +#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 71 31 Class: manipulation object; -#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X floatatom 500 117 3 -4 4 0 - - -; +#X floatatom 500 117 3 -4 4 0 - - - 0; #X obj 451 138 shearXY 1; #X text 50 12 Synopsis: [shearXY]; #X text 29 77 Description: shear; -#X text 41 91 [shearXY] accepts a gemList and changes the current transformation -matrix by the specified shear; -#X text 36 122 the X translation depend on Y position and the shear -factor (float).; +#X text 41 91 [shearXY] accepts a gemList and changes the current transformation matrix by the specified shear; +#X text 36 122 the X translation depend on Y position and the shear factor (float).; #X text 60 194 1st argument: shear factor (XY); #X text 63 261 Inlet 2: float: XY shear factor; #X obj 451 179 cube; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 19 0; -#X connect 18 0 19 1; -#X connect 19 0 26 0; +#X obj 521 256 _gemwin; +#X connect 14 0 16 0; +#X connect 15 0 16 1; +#X connect 16 0 23 0; diff --git a/help/shearXZ-help.pd b/help/shearXZ-help.pd index c68c3372b..8cb0707c8 100644 --- a/help/shearXZ-help.pd +++ b/help/shearXZ-help.pd @@ -1,61 +1,31 @@ #N canvas 57 61 625 325 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 233 Inlets:; #X text 63 246 Inlet 1: gemlist; #X text 39 276 Outlets:; #X text 57 289 Outlet 1: gemlist; -#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 453 60 Example:; #X text 71 31 Class: manipulation object; #X text 29 77 Description: shear; #X text 50 12 Synopsis: [shearXZ]; -#X text 41 91 [shearXZ] accepts a gemList and changes the current transformation -matrix by the specified shear; +#X text 41 91 [shearXZ] accepts a gemList and changes the current transformation matrix by the specified shear; #X text 60 194 1st argument: shear factor (XZ); #X text 63 261 Inlet 2: float: XZ shear factor; -#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 288 pd gemwin; -#X msg 519 269 create; -#X text 515 248 Create window:; -#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 458 82 gemhead; #X obj 458 177 square; -#X floatatom 507 115 3 -4 4 0 - - -; +#X floatatom 507 115 3 -4 4 0 - - - 0; #X obj 458 136 shearXZ 1; -#X text 36 122 the X translation depend on Z position and the shear -factor (float).; +#X text 36 122 the X translation depend on Z position and the shear factor (float).; #X obj 518 8 declare -lib Gem; -#X connect 18 0 19 0; -#X connect 19 0 18 0; -#X connect 22 0 25 0; -#X connect 24 0 25 1; -#X connect 25 0 23 0; +#X obj 521 254 _gemwin; +#X connect 19 0 22 0; +#X connect 21 0 22 1; +#X connect 22 0 20 0; diff --git a/help/shearYX-help.pd b/help/shearYX-help.pd index 4257de1be..6947f964d 100644 --- a/help/shearYX-help.pd +++ b/help/shearYX-help.pd @@ -1,61 +1,31 @@ #N canvas 335 193 634 330 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 233 Inlets:; #X text 63 246 Inlet 1: gemlist; #X text 39 276 Outlets:; #X text 57 289 Outlet 1: gemlist; -#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 453 60 Example:; #X text 71 31 Class: manipulation object; #X text 29 77 Description: shear; -#X text 36 122 the X translation depend on Y position and the shear -factor (float).; +#X text 36 122 the X translation depend on Y position and the shear factor (float).; #X text 50 12 Synopsis: [shearYX]; -#X text 41 91 [shearYX] accepts a gemList and changes the current transformation -matrix by the specified shear; +#X text 41 91 [shearYX] accepts a gemList and changes the current transformation matrix by the specified shear; #X text 60 194 1st argument: shear factor (YX); #X text 63 261 Inlet 2: float: YX shear factor; -#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 288 pd gemwin; -#X msg 519 269 create; -#X text 515 248 Create window:; -#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 179 square; -#X floatatom 500 117 3 -4 4 0 - - -; +#X floatatom 500 117 3 -4 4 0 - - - 0; #X obj 451 138 shearYX 1; #X obj 518 8 declare -lib Gem; -#X connect 19 0 20 0; -#X connect 20 0 19 0; -#X connect 23 0 26 0; -#X connect 25 0 26 1; -#X connect 26 0 24 0; +#X obj 522 257 _gemwin; +#X connect 20 0 23 0; +#X connect 22 0 23 1; +#X connect 23 0 21 0; diff --git a/help/shearYZ-help.pd b/help/shearYZ-help.pd index aef9a6932..acf31e83a 100644 --- a/help/shearYZ-help.pd +++ b/help/shearYZ-help.pd @@ -1,63 +1,33 @@ #N canvas 357 249 631 328 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 233 Inlets:; #X text 63 246 Inlet 1: gemlist; #X text 39 276 Outlets:; #X text 57 289 Outlet 1: gemlist; -#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 453 60 Example:; #X text 71 31 Class: manipulation object; #X text 29 77 Description: shear; #X text 50 12 Synopsis: [shearYZ]; #X text 60 194 1st argument: shear factor (YZ); #X text 63 261 Inlet 2: float: YZ shear factor; -#X text 41 91 [shearYZ] accepts a gemList and changes the current transformation -matrix by the specified shear; -#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 288 pd gemwin; -#X msg 519 269 create; -#X text 515 248 Create window:; -#X obj 450 148 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X text 41 91 [shearYZ] accepts a gemList and changes the current transformation matrix by the specified shear; +#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 148 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X floatatom 500 157 3 -4 4 0 - - -; +#X floatatom 500 157 3 -4 4 0 - - - 0; #X obj 451 178 shearYZ 1; -#X text 36 122 the Y translation depend on Z position and the shear -factor (float).; +#X text 36 122 the Y translation depend on Z position and the shear factor (float).; #X obj 451 217 cube; #X obj 451 120 rotateXYZ 0 45 0; #X obj 518 8 declare -lib Gem; -#X connect 18 0 19 0; -#X connect 19 0 18 0; -#X connect 22 0 27 0; -#X connect 23 0 24 1; -#X connect 24 0 26 0; -#X connect 27 0 24 0; +#X obj 522 258 _gemwin; +#X connect 19 0 24 0; +#X connect 20 0 21 1; +#X connect 21 0 23 0; +#X connect 24 0 21 0; diff --git a/help/shearZX-help.pd b/help/shearZX-help.pd index 246ba9d8d..cf9298e12 100644 --- a/help/shearZX-help.pd +++ b/help/shearZX-help.pd @@ -1,61 +1,31 @@ #N canvas 356 249 630 329 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 233 Inlets:; #X text 63 246 Inlet 1: gemlist; #X text 39 276 Outlets:; #X text 57 289 Outlet 1: gemlist; -#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 453 60 Example:; #X text 71 31 Class: manipulation object; #X text 29 77 Description: shear; #X text 50 12 Synopsis: [shearZX]; -#X text 42 91 [shearZX] accepts a gemList and changes the current transformation -matrix by the specified shear; +#X text 42 91 [shearZX] accepts a gemList and changes the current transformation matrix by the specified shear; #X text 60 194 1st argument: shear factor (ZX); #X text 63 261 Inlet 2: float: ZX shear factor; -#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 288 pd gemwin; -#X msg 519 269 create; -#X text 515 248 Create window:; -#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 514 249 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X floatatom 500 117 3 -4 4 0 - - -; +#X floatatom 500 117 3 -4 4 0 - - - 0; #X obj 451 138 shearZX 1; -#X text 36 122 the Z translation depend on X position and the shear -factor (float).; +#X text 36 122 the Z translation depend on X position and the shear factor (float).; #X obj 451 179 teapot; #X obj 518 8 declare -lib Gem; -#X connect 18 0 19 0; -#X connect 19 0 18 0; -#X connect 22 0 24 0; -#X connect 23 0 24 1; -#X connect 24 0 26 0; +#X obj 519 257 _gemwin; +#X connect 19 0 21 0; +#X connect 20 0 21 1; +#X connect 21 0 23 0; diff --git a/help/shearZY-help.pd b/help/shearZY-help.pd index 2f1c8cf92..523c907aa 100644 --- a/help/shearZY-help.pd +++ b/help/shearZY-help.pd @@ -1,61 +1,31 @@ #N canvas 57 61 628 330 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 233 Inlets:; #X text 63 246 Inlet 1: gemlist; #X text 39 276 Outlets:; #X text 57 289 Outlet 1: gemlist; -#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 440 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 239 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 246 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 285 pd gemwin; -#X msg 519 266 create; -#X text 515 245 Create window:; +#X obj 514 246 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 71 31 Class: manipulation object; -#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 108 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 451 179 square; -#X floatatom 500 117 3 -4 4 0 - - -; +#X floatatom 500 117 3 -4 4 0 - - - 0; #X text 29 77 Description: shear; -#X text 41 91 [shearYZ] accepts a gemList and changes the current transformation -matrix by the specified shear; +#X text 41 91 [shearYZ] accepts a gemList and changes the current transformation matrix by the specified shear; #X text 60 194 1st argument: shear factor (ZY); #X text 63 261 Inlet 2: float: ZY shear factor; #X text 50 12 Synopsis: [shearYZ]; #X obj 451 138 shearZY 1; -#X text 36 122 the Y translation depend on Z position and the shear -factor (float).; +#X text 36 122 the Y translation depend on Z position and the shear factor (float).; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 25 0; -#X connect 19 0 25 1; -#X connect 25 0 18 0; +#X obj 521 251 _gemwin; +#X connect 14 0 22 0; +#X connect 16 0 22 1; +#X connect 22 0 15 0; diff --git a/help/shininess-help.pd b/help/shininess-help.pd index a104db212..7fd46f4be 100644 --- a/help/shininess-help.pd +++ b/help/shininess-help.pd @@ -1,70 +1,39 @@ #N canvas 61 61 639 342 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 63 231 Inlet 1: gemlist; #X text 39 272 Outlets:; #X text 57 285 Outlet 1: gemlist; -#X obj 8 166 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 166 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 165 Arguments:; -#X obj 8 66 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; +#X obj 514 254 cnv 15 100 75 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 71 31 Class: manipulation object; -#X obj 450 112 cnv 15 120 50 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 112 cnv 15 120 50 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 500 192 gemhead; #X obj 500 230 world_light; #X obj 451 193 sphere; #X obj 500 211 rotate 90 1 0 0; #X obj 451 166 specular 1 0 0; -#X floatatom 509 121 5 0 128 0 shiny - -; +#X floatatom 509 121 5 0 128 0 shiny - - 0; #X text 63 249 Inlet 2: int: shininess 0..128; #X text 62 176 the shininess value; #X text 13 69 Description: shininess of the material; #X text 50 12 Synopsis: [shininess]; -#X text 22 86 [shininess] accepts a gemList and sets the shininess-value -for all subsequent vertex operations; -#X text 20 114 [shininess] accepts a single shininess-value that ranges -between 0 and 128 the shininess can be set via an initial argument. -; +#X text 22 86 [shininess] accepts a gemList and sets the shininess-value for all subsequent vertex operations; +#X text 20 114 [shininess] accepts a single shininess-value that ranges between 0 and 128 the shininess can be set via an initial argument.; #X obj 451 140 shininess; #X text 60 191 default:0; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 30 0; -#X connect 18 0 21 0; -#X connect 21 0 19 0; -#X connect 22 0 20 0; -#X connect 23 0 30 1; -#X connect 30 0 22 0; +#X obj 518 258 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 14 0 27 0; +#X connect 15 0 18 0; +#X connect 18 0 16 0; +#X connect 19 0 17 0; +#X connect 20 0 27 1; +#X connect 27 0 19 0; diff --git a/help/slideSquares-help.pd b/help/slideSquares-help.pd index ef43340c4..538393914 100644 --- a/help/slideSquares-help.pd +++ b/help/slideSquares-help.pd @@ -1,66 +1,35 @@ #N canvas 289 160 683 363 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 499 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 564 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 569 293 pd gemwin; -#X msg 569 274 create; -#X text 565 253 Create window:; +#X obj 499 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 564 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 505 59 Example:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 502 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 310 Outlets:; #X text 21 323 Outlet 1: gemlist; -#X obj 502 112 cnv 15 160 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 502 112 cnv 15 160 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 513 84 gemhead; -#X floatatom 566 134 5 0 0 0 - - -; -#X floatatom 620 165 5 0 0 0 - - -; +#X floatatom 566 134 5 0 0 0 - - - 0; +#X floatatom 620 165 5 0 0 0 - - - 0; #X text 620 149 height; #X text 27 275 Inlet 3: float: height (dimY); #X text 566 118 width; #X text 33 14 Synopsis: [slideSquares]; #X text 7 69 Description: Renders sliding rectangles.; -#X text 16 86 The slideSquares object renders a number of sliding rectangles -at the current position with current color. The dimensions of the sliding -rectangles can be changed via the inlet2 and inlet3.; -#X text 63 167 dimensions of the sliding rectangles (width height) -; +#X text 16 86 The slideSquares object renders a number of sliding rectangles at the current position with current color. The dimensions of the sliding rectangles can be changed via the inlet2 and inlet3.; +#X text 63 167 dimensions of the sliding rectangles (width height); #X text 65 181 default: 1 1; #X text 27 260 Inlet 2: float: width (dimX); #X obj 513 209 slideSquares 1 1; #X obj 568 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 30 0; -#X connect 19 0 30 1; -#X connect 20 0 30 2; +#X obj 571 261 _gemwin; +#X connect 15 0 27 0; +#X connect 16 0 27 1; +#X connect 17 0 27 2; diff --git a/help/specular-help.pd b/help/specular-help.pd index 48dca55a5..8759c9f44 100644 --- a/help/specular-help.pd +++ b/help/specular-help.pd @@ -1,46 +1,19 @@ #N canvas 61 61 632 364 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 63 231 Inlet 1: gemlist; #X text 39 272 Outlets:; #X text 57 285 Outlet 1: gemlist; -#X obj 8 166 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 166 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 165 Arguments:; -#X obj 8 76 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; +#X obj 513 254 cnv 15 100 75 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 500 192 gemhead; #X obj 500 230 world_light; @@ -54,17 +27,14 @@ #X msg 462 132 0 10 0 0.4; #X obj 451 156 specular 1 0 0; #X text 60 191 defaults: 0 0 0 1; -#X text 22 96 [specular] accepts a gemList and sets the specular-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; +#X text 22 96 [specular] accepts a gemList and sets the specular-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 36 323 see also:; #X obj 97 323 specularRGB; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 28 0; -#X connect 18 0 25 0; -#X connect 25 0 19 0; -#X connect 26 0 28 1; -#X connect 27 0 28 1; -#X connect 28 0 24 0; +#X obj 520 258 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 14 0 25 0; +#X connect 15 0 22 0; +#X connect 22 0 16 0; +#X connect 23 0 25 1; +#X connect 24 0 25 1; +#X connect 25 0 21 0; diff --git a/help/specularRGB-help.pd b/help/specularRGB-help.pd index bd889397c..85d15356a 100644 --- a/help/specularRGB-help.pd +++ b/help/specularRGB-help.pd @@ -1,46 +1,18 @@ #N canvas 61 61 629 372 10; #X declare -lib Gem; #X text 432 8 GEM object; -#X obj 8 216 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 63 231 Inlet 1: gemlist; #X text 39 302 Outlets:; #X text 57 315 Outlet 1: gemlist; -#X obj 8 166 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 166 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 165 Arguments:; -#X obj 8 76 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 197 134 destroy; -#X msg 132 112 reset \, lighting 1 \, create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X text 71 31 Class: manipulation object; -#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 118 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X obj 500 192 gemhead; #X obj 500 230 world_light; @@ -50,14 +22,12 @@ #X obj 500 211 rotate 90 1 0 0; #X text 60 191 defaults: 0 0 0 1; #X obj 451 156 specularRGB 1 0 0; -#X floatatom 479 121 3 0 10 0 R - -; -#X floatatom 508 137 3 0 10 0 G - -; -#X floatatom 536 119 3 0 10 0 B - -; -#X floatatom 565 135 3 0 10 0 A - -; +#X floatatom 479 121 3 0 10 0 R - - 0; +#X floatatom 508 137 3 0 10 0 G - - 0; +#X floatatom 536 119 3 0 10 0 B - - 0; +#X floatatom 565 135 3 0 10 0 A - - 0; #X text 50 12 Synopsis: [specularRGB]; -#X text 22 96 [specularRGB] accepts a gemList and sets the specular-color -for all subsequent vertex-operations. You have to enable lighting to -see any effects.; +#X text 22 96 [specularRGB] accepts a gemList and sets the specular-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 62 247 Inlet 2: float: Red-value; #X text 62 287 Inlet 5: float: Alpha-value; #X text 62 274 Inlet 4: float: Blue-value; @@ -65,13 +35,13 @@ see any effects.; #X text 35 341 see also:; #X obj 107 342 specular; #X obj 508 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 25 0; -#X connect 18 0 23 0; -#X connect 23 0 19 0; -#X connect 25 0 22 0; -#X connect 26 0 25 1; -#X connect 27 0 25 2; -#X connect 28 0 25 3; -#X connect 29 0 25 4; +#X obj 513 254 cnv 15 100 75 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 520 258 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 21 0; +#X connect 14 0 19 0; +#X connect 19 0 15 0; +#X connect 21 0 18 0; +#X connect 22 0 21 1; +#X connect 23 0 21 2; +#X connect 24 0 21 3; +#X connect 25 0 21 4; diff --git a/help/sphere-help.pd b/help/sphere-help.pd index a7f6bfdf5..9d79938c0 100644 --- a/help/sphere-help.pd +++ b/help/sphere-help.pd @@ -1,39 +1,13 @@ #N canvas 274 73 663 374 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 47 cnv 15 170 270 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 485 252 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 490 291 pd gemwin; -#X msg 490 272 create; -#X text 486 251 Create window:; +#X obj 479 47 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 485 252 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 485 29 Example:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 154 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 154 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 153 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 27 261 Inlet 2: float: size; @@ -41,34 +15,29 @@ #X text 27 233 Inlet 1: gemlist; #X text 9 287 Outlets:; #X text 21 300 Outlet 1: gemlist; -#X obj 486 184 cnv 15 130 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 486 184 cnv 15 130 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 506 88 draw line; #X msg 512 111 draw fill; #X msg 519 132 draw point; #X obj 497 59 gemhead; -#X floatatom 519 187 3 0 0 0 - - -; +#X floatatom 519 187 3 0 0 0 - - - 0; #X text 542 186 size; -#X floatatom 542 204 3 0 0 0 - - -; +#X floatatom 542 204 3 0 0 0 - - - 0; #X text 565 203 segments; #X text 27 272 Inlet 3: int: number of segments; #X text 33 14 Synopsis: [sphere]; #X text 16 69 Description: Renders a sphere.; -#X text 30 85 The sphere object renders a segmented sphere at the current -position with current color. The look of the sphere can be changed -with the draw message \, its size can be changed via the second inlet. -; +#X text 30 85 The sphere object renders a segmented sphere at the current position with current color. The look of the sphere can be changed with the draw message \, its size can be changed via the second inlet.; #X obj 497 222 sphere 1; #X text 35 168 size of the sphere \, segments; #X text 34 184 defaults: 1 \, 10; #X text 33 330 see also:; #X obj 102 331 sphere3d; #X obj 548 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 19 0 31 0; -#X connect 20 0 31 0; -#X connect 21 0 31 0; -#X connect 22 0 31 0; -#X connect 23 0 31 1; -#X connect 25 0 31 2; +#X obj 492 257 _gemwin; +#X connect 16 0 28 0; +#X connect 17 0 28 0; +#X connect 18 0 28 0; +#X connect 19 0 28 0; +#X connect 20 0 28 1; +#X connect 22 0 28 2; diff --git a/help/sphere3d-help.pd b/help/sphere3d-help.pd index 33580a0ed..42ec319a7 100644 --- a/help/sphere3d-help.pd +++ b/help/sphere3d-help.pd @@ -1,39 +1,13 @@ #N canvas 67 280 714 379 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 479 47 cnv 15 230 280 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 544 264 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 549 303 pd gemwin; -#X msg 549 284 create; -#X text 545 263 Create window:; +#X obj 479 47 cnv 15 230 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 544 264 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 480 31 Example:; -#X obj 7 61 cnv 15 450 120 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 226 cnv 15 450 140 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 61 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 226 cnv 15 450 140 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 226 Inlets:; -#X obj 8 186 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; #X text 27 252 Inlet 1: message: draw [line|fill|point]; #X text 27 307 Inlet 2: float: size; @@ -41,58 +15,50 @@ #X text 27 238 Inlet 1: gemlist; #X text 9 334 Outlets:; #X text 21 347 Outlet 1: gemlist; -#X obj 534 135 cnv 15 175 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 534 135 cnv 15 175 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 483 56 draw line; #X msg 483 76 draw fill; #X msg 483 95 draw point; #X obj 553 54 gemhead; -#X floatatom 571 194 5 0 0 1 size - -; -#X floatatom 616 231 3 0 0 2 segments - -; +#X floatatom 571 194 5 0 0 1 size - - 0; +#X floatatom 616 231 3 0 0 2 segments - - 0; #X text 27 318 Inlet 3: int: number of segments; #X text 33 14 Synopsis: [sphere3d]; #X text 7 65 Description: Renders a sphere3d.; -#X text 14 82 The sphere3d object renders a segmented sphere3d at the -current position with current color. The look of the sphere3d can be -changed with the draw message \, its size can be changed via the second -inlet.; +#X text 14 82 The sphere3d object renders a segmented sphere3d at the current position with current color. The look of the sphere3d can be changed with the draw message \, its size can be changed via the second inlet.; #X text 63 197 size of the sphere3d; -#X floatatom 488 150 5 0 0 0 - - -; -#X floatatom 486 179 5 0 0 0 - - -; +#X floatatom 488 150 5 0 0 0 - - - 0; +#X floatatom 486 179 5 0 0 0 - - - 0; #X obj 479 230 r \$0-s3d; #X obj 483 117 s \$0-s3d; #X text 27 266 Inlet 1: message: setCartesian ; -#X text 27 279 Inlet 1: message: setSpherical -; +#X text 27 279 Inlet 1: message: setSpherical ; #X msg 535 151 setCartesian 2 3 \$1 1 0; #X obj 552 114 rotateXYZ; -#X floatatom 578 93 5 0 0 0 - - -; +#X floatatom 578 93 5 0 0 0 - - - 0; #X text 505 333 see also; #X obj 575 334 sphere; #X msg 548 174 setSpherical 2 3 \$1 45 45; #X obj 481 287 s \$0-s3d; #X msg 481 266 print; #X obj 553 229 sphere3d; -#X text 14 139 Unlike [sphere] \, you can modify (dislocate) each point -at the sphere via the setCartesian and setSpherical messages (for cartesian -and spherical (in deg) coordinates resp.); +#X text 14 139 Unlike [sphere] \, you can modify (dislocate) each point at the sphere via the setCartesian and setSpherical messages (for cartesian and spherical (in deg) coordinates resp.); #X text 27 292 Inlet 1: message: print; #X obj 578 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 19 0 33 0; -#X connect 20 0 33 0; -#X connect 21 0 33 0; -#X connect 22 0 37 0; -#X connect 23 0 44 1; -#X connect 24 0 44 2; -#X connect 30 0 36 0; -#X connect 31 0 41 0; -#X connect 32 0 44 0; -#X connect 36 0 44 0; -#X connect 37 0 44 0; -#X connect 38 0 37 1; -#X connect 38 0 37 2; -#X connect 38 0 37 3; -#X connect 41 0 44 0; -#X connect 43 0 42 0; +#X obj 550 270 _gemwin; +#X connect 16 0 30 0; +#X connect 17 0 30 0; +#X connect 18 0 30 0; +#X connect 19 0 34 0; +#X connect 20 0 41 1; +#X connect 21 0 41 2; +#X connect 27 0 33 0; +#X connect 28 0 38 0; +#X connect 29 0 41 0; +#X connect 33 0 41 0; +#X connect 34 0 41 0; +#X connect 35 0 34 1; +#X connect 35 0 34 2; +#X connect 35 0 34 3; +#X connect 38 0 41 0; +#X connect 40 0 39 0; diff --git a/help/spot_light-help.pd b/help/spot_light-help.pd index 15cef435f..125fac229 100644 --- a/help/spot_light-help.pd +++ b/help/spot_light-help.pd @@ -1,92 +1,55 @@ #N canvas 34 73 724 516 10; #X declare -lib Gem; #X text 471 28 Example:; -#X obj 7 64 cnv 15 450 265 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 377 cnv 15 450 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 64 cnv 15 450 265 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 377 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 19 374 Inlets:; -#X obj 8 337 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 337 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 336 Arguments:; #X text 452 8 GEM object; #X text 37 386 Inlet 1: gemlist; #X text 22 468 Outlets:; #X text 34 481 Outlet 1: gemlist; -#X obj 468 47 cnv 15 225 400 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 473 49 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 256 112 destroy; -#X obj 322 45 inlet; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 8 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X restore 478 88 pd gemwin; -#X msg 478 69 create; -#X text 474 48 Create window:; -#X obj 472 197 cnv 15 220 210 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 468 47 cnv 15 225 400 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 473 49 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 472 197 cnv 15 220 210 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 483 128 gemhead; #X text 53 30 Class: non-geometric object; #X msg 489 316 1 1 1; -#X obj 482 385 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 482 385 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 500 385 debug \$1; -#X floatatom 563 132 5 0 0 0 - - -; -#X obj 586 55 cnv 15 85 50 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X floatatom 563 132 5 0 0 0 - - - 0; +#X obj 586 55 cnv 15 85 50 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 588 81 lighting \$1; -#X obj 588 59 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 588 59 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 489 335 1 1 0; -#X text 18 186 The second inlet sets the color of the light-source. -; -#X text 17 154 You can adjust the light with [rotate]. If you are lost -use "debug" to display the light source as a small cone.; +#X text 18 186 The second inlet sets the color of the light-source.; +#X text 17 154 You can adjust the light with [rotate]. If you are lost use "debug" to display the light source as a small cone.; #X text 33 14 Synopsis: [spot_light]; #X text 7 64 Description: adds a spot-light to the scene; -#X text 37 417 Inlet 1: message: debug 1|0 : show debugging object -(default:0), f 64; -#X text 37 447 Inlet 3: list: linear_attenuation \, cone_cutoff_angle -\, decay_at_edges, f 69; +#X text 37 417 Inlet 1: message: debug 1|0 : show debugging object (default:0), f 64; +#X text 37 447 Inlet 3: list: linear_attenuation \, cone_cutoff_angle \, decay_at_edges, f 69; #X obj 484 362 spot_light; #N canvas 611 263 574 368 spheres 0; #X obj 66 12 gemhead; -#X floatatom 84 243 5 0 0 0 - - -; -#X obj 49 14 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; -#X floatatom 99 43 5 0 0 0 - - -; -#X floatatom 132 60 5 0 0 0 - - -; -#X floatatom 166 77 5 0 0 0 - - -; -#X floatatom 103 261 5 0 0 0 - - -; +#X floatatom 84 243 5 0 0 0 - - - 0; +#X obj 49 14 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X floatatom 99 43 5 0 0 0 - - - 0; +#X floatatom 132 60 5 0 0 0 - - - 0; +#X floatatom 166 77 5 0 0 0 - - - 0; +#X floatatom 103 261 5 0 0 0 - - - 0; #X obj 66 96 rotateXYZ 0 0 0; -#X floatatom 106 130 5 0 0 0 - - -; -#X floatatom 146 147 5 0 0 0 - - -; -#X floatatom 187 163 5 0 0 0 - - -; +#X floatatom 106 130 5 0 0 0 - - - 0; +#X floatatom 146 147 5 0 0 0 - - - 0; +#X floatatom 187 163 5 0 0 0 - - - 0; #X obj 66 183 translateXYZ 0 0 0; #X obj 306 74 gemhead; -#X floatatom 410 143 5 0 0 0 - - -; -#X floatatom 450 160 5 0 0 0 - - -; -#X floatatom 491 176 5 0 0 0 - - -; -#X floatatom 409 54 5 0 0 0 - - -; -#X floatatom 442 71 5 0 0 0 - - -; -#X floatatom 476 88 5 0 0 0 - - -; +#X floatatom 410 143 5 0 0 0 - - - 0; +#X floatatom 450 160 5 0 0 0 - - - 0; +#X floatatom 491 176 5 0 0 0 - - - 0; +#X floatatom 409 54 5 0 0 0 - - - 0; +#X floatatom 442 71 5 0 0 0 - - - 0; +#X floatatom 476 88 5 0 0 0 - - - 0; #X obj 373 284 sphere 0.2; #X msg 304 214 20; #X obj 302 181 loadbang; @@ -119,54 +82,43 @@ use "debug" to display the light source as a small cone.; #X connect 22 0 23 0; #X connect 23 0 19 0; #X restore 476 418 pd spheres; -#X text 15 262 Keep in mind that the attributes have to be set before -rendering the vertices \, so if you are trying for frame accurate rendering -\, you will want to set the gemhead order to a low number so that all -of the values of the light get set first.; +#X text 15 262 Keep in mind that the attributes have to be set before rendering the vertices \, so if you are trying for frame accurate rendering \, you will want to set the gemhead order to a low number so that all of the values of the light get set first.; #X text 63 348 none; #X obj 483 176 translateXYZ 0 0 2; -#X floatatom 498 211 5 0 0 1 linear_attenuation - -; -#X floatatom 550 248 5 0 0 2 cone_cutoff_angle - -; -#X floatatom 588 278 5 0 0 2 decay_at_edges - -; +#X floatatom 498 211 5 0 0 1 linear_attenuation - - 0; +#X floatatom 550 248 5 0 0 2 cone_cutoff_angle - - 0; +#X floatatom 588 278 5 0 0 2 decay_at_edges - - 0; #X obj 588 297 t b f; #X obj 550 317 t b f; #X text 490 299 color; #X obj 483 150 rotateXYZ -33 0 0; #X text 37 432 Inlet 2: list: 3(RGB) float values; -#X text 17 205 The third inlet receives a list of three floats: linear_attenuation: -only accepts positive values cone_cutoff_angle: 0-90 or 180 decay_at_edges/exponent: -0-128; -#X text 19 81 [spot_light] produces a light which is at a variable -distance from the scene. It can be used to make a pinpoint light \, -or widened for larger illumination. The edges may appear jagged when -lighting low polygon models: to smooth \, increase the polygon's # -of vertices (or "slices").; +#X text 17 205 The third inlet receives a list of three floats: linear_attenuation: only accepts positive values cone_cutoff_angle: 0-90 or 180 decay_at_edges/exponent: 0-128; +#X text 19 81 [spot_light] produces a light which is at a variable distance from the scene. It can be used to make a pinpoint light \, or widened for larger illumination. The edges may appear jagged when lighting low polygon models: to smooth \, increase the polygon's # of vertices (or "slices").; #X obj 548 337 pack 0 90 3; -#X obj 492 265 tgl 20 0 empty \$0-onoff empty 17 7 0 10 -262144 -1 --1 0 1; +#X obj 492 265 tgl 20 0 empty \$0-onoff empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 480 457 see also:; #X obj 527 477 world_light; #X obj 485 477 light; #X text 37 401 Inlet 1: float: turn light on/off (default:1); #X obj 578 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 16 0 43 0; -#X connect 18 0 32 1; -#X connect 19 0 20 0; -#X connect 20 0 32 0; -#X connect 21 0 43 2; -#X connect 23 0 12 1; -#X connect 24 0 23 0; -#X connect 25 0 32 1; -#X connect 36 0 32 0; -#X connect 37 0 47 0; -#X connect 38 0 41 0; -#X connect 39 0 40 0; -#X connect 40 0 47 0; -#X connect 40 1 47 2; -#X connect 41 0 47 0; -#X connect 41 1 47 1; -#X connect 43 0 36 0; -#X connect 47 0 32 2; -#X connect 48 0 32 0; +#X obj 476 56 _gemwin; +#X connect 13 0 40 0; +#X connect 15 0 29 1; +#X connect 16 0 17 0; +#X connect 17 0 29 0; +#X connect 18 0 40 2; +#X connect 20 0 51 0; +#X connect 21 0 20 0; +#X connect 22 0 29 1; +#X connect 33 0 29 0; +#X connect 34 0 44 0; +#X connect 35 0 38 0; +#X connect 36 0 37 0; +#X connect 37 0 44 0; +#X connect 37 1 44 2; +#X connect 38 0 44 0; +#X connect 38 1 44 1; +#X connect 40 0 33 0; +#X connect 44 0 29 2; +#X connect 45 0 29 0; diff --git a/help/square-help.pd b/help/square-help.pd index 2df4559d8..9dfcd7066 100644 --- a/help/square-help.pd +++ b/help/square-help.pd @@ -1,38 +1,12 @@ #N canvas 289 160 710 345 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 489 57 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 554 234 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 559 273 pd gemwin; -#X msg 559 254 create; -#X text 555 233 Create window:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 489 57 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 554 234 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 27 261 Inlet 2: float: size; @@ -41,26 +15,22 @@ #X text 9 280 Outlets:; #X text 21 293 Outlet 1: gemlist; #X text 495 39 Example:; -#X obj 492 88 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 492 88 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 495 95 draw line; #X msg 495 116 draw fill; #X msg 495 138 draw point; #X obj 563 64 gemhead; -#X floatatom 594 124 5 0 0 0 - - -; +#X floatatom 594 124 5 0 0 0 - - - 0; #X text 594 108 size; #X obj 563 169 square; #X text 7 69 Description: Renders a square; #X text 33 14 Synopsis: [square]; #X text 63 186 size of the square; -#X text 16 86 The [square] object renders a square at the current position -with current color. The size of the square can be changed via the second -inlet.; +#X text 16 86 The [square] object renders a square at the current position with current color. The size of the square can be changed via the second inlet.; #X obj 578 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 19 0 25 0; -#X connect 20 0 25 0; -#X connect 21 0 25 0; -#X connect 22 0 25 0; -#X connect 23 0 25 1; +#X obj 557 238 _gemwin; +#X connect 16 0 22 0; +#X connect 17 0 22 0; +#X connect 18 0 22 0; +#X connect 19 0 22 0; +#X connect 20 0 22 1; diff --git a/help/surface3d-help.pd b/help/surface3d-help.pd index 8fc68d0da..5e0ce33fb 100644 --- a/help/surface3d-help.pd +++ b/help/surface3d-help.pd @@ -1,55 +1,18 @@ #N canvas 41 102 968 681 10; #X declare -lib Gem; #X text 58 45 Class: geometric object; -#X obj 13 64 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 13 212 cnv 15 450 280 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 13 64 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 13 212 cnv 15 450 280 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 17 214 Inlets:; -#X obj 13 173 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 13 173 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 22 172 Arguments:; #X text 32 229 Inlet 1: gemlist; #X text 16 448 Outlets:; #X text 30 460 Outlet 1: gemlist; -#X obj 475 63 cnv 15 480 560 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 805 544 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 455 304 gemwin 0; -#X obj 132 182 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X obj 294 56 gemhead; -#X obj 294 76 world_light; -#X msg 207 155 lighting 1; -#X obj 207 134 loadbang; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 9 0; -#X connect 10 0 0 0; -#X connect 11 0 10 0; -#X restore 821 583 pd gemwin; -#X msg 821 564 create; -#X text 817 543 Create window:; -#X obj 796 74 cnv 15 150 150 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 796 234 cnv 15 150 150 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 486 74 cnv 15 300 310 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 475 63 cnv 15 480 560 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 796 74 cnv 15 150 150 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 796 234 cnv 15 150 150 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 486 74 cnv 15 300 310 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 519 175 draw line; #X msg 519 155 draw fill; #X msg 519 195 draw point; @@ -78,15 +41,14 @@ #X obj 807 356 s curve3d; #X text 660 139 of the curve; #X text 647 125 draw control point; -#X obj 486 398 cnv 15 300 210 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 486 398 cnv 15 300 210 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 494 407 gemhead; -#X floatatom 522 450 5 0 0 0 - - -; -#X floatatom 557 450 5 0 0 0 - - -; -#X floatatom 593 450 5 0 0 0 - - -; -#X floatatom 562 408 5 0 0 0 - - -; -#X floatatom 610 408 5 0 0 0 - - -; -#X floatatom 659 408 5 0 0 0 - - -; +#X floatatom 522 450 5 0 0 0 - - - 0; +#X floatatom 557 450 5 0 0 0 - - - 0; +#X floatatom 593 450 5 0 0 0 - - - 0; +#X floatatom 562 408 5 0 0 0 - - - 0; +#X floatatom 610 408 5 0 0 0 - - - 0; +#X floatatom 659 408 5 0 0 0 - - - 0; #X obj 494 471 rotateXYZ 0 0 0; #X obj 494 428 translateXYZ -2.5 -2.5 -2; #X obj 504 496 r curve3d; @@ -96,8 +58,7 @@ #X text 826 250 curve grid; #X text 28 430 Inlet 2: not used; #X text 32 243 Inlet 1: message: draw [line|fill|point|...]; -#X obj 13 503 cnv 15 450 120 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 13 503 cnv 15 450 120 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 253 49 691 493 forme2 0; #N canvas 0 0 353 257 tripleRnd 0; #X obj 12 63 random 100; @@ -1104,10 +1065,8 @@ #X connect 51 0 24 0; #X connect 52 0 25 0; #X restore 136 549 pd forme2; -#X obj 136 530 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 57 550 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 136 530 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X obj 57 550 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 253 49 697 499 forme1 0; #X obj 76 418 outlet; #X obj 36 15 inlet; @@ -1572,13 +1531,9 @@ #X text 31 336 Inlet 1 : message: set Mx My X Y Z; #X text 31 296 Inlet 1: message: grid X Y; #X text 31 259 Inlet 1: message: res X Y; -#X text 53 272 This message is use for changing the size of the control -matrix (X \, Y are 2 int); -#X text 52 310 This message is use for changing the subdivision of -the displayed curve (X Y are 2 int); -#X text 53 349 This message can be use to set the position of a control -point. (Mx \, My : position of the point in the matrix. X \, Y \, Z -: position of this control point; +#X text 53 272 This message is use for changing the size of the control matrix (X \, Y are 2 int); +#X text 52 310 This message is use for changing the subdivision of the displayed curve (X Y are 2 int); +#X text 53 349 This message can be use to set the position of a control point. (Mx \, My : position of the point in the matrix. X \, Y \, Z : position of this control point; #X text 21 507 examples :; #X obj 494 520 surface3d 5 5; #X obj 504 561 r curve3d; @@ -1587,70 +1542,65 @@ point. (Mx \, My : position of the point in the matrix. X \, Y \, Z #X text 59 28 Synopsis: [surface3d]; #X text 13 68 Description: Renders a 3d bicubic curve.; #X text 67 182 size of the control matrix (default : 4 4); -#X text 33 85 The surface3d object renders a curve at the current position -with current color or texture. The shape of the curve is controlled -from a matrix. The curve go throw all control points (between point -1 to res-1); +#X text 33 85 The surface3d object renders a curve at the current position with current color or texture. The shape of the curve is controlled from a matrix. The curve go throw all control points (between point 1 to res-1); #X text 31 388 Inlet 1: normal 0/1; -#X text 51 399 since computing normal use a lot's of processing power -\, you can disable normal with this message; +#X text 51 399 since computing normal use a lot's of processing power \, you can disable normal with this message; #X obj 490 344 s curve3d_render; #X obj 623 343 s curve3d_render; #X obj 580 496 r curve3d_render; #X obj 594 539 loadbang; -#X obj 795 399 cnv 15 150 110 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 795 399 cnv 15 150 110 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 812 434 normal \$1; -#X obj 812 415 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 812 415 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 812 455 s curve3d_render; #X text 33 146 This object is related to curve3d; -#X text 271 4 Create a 3d bicubic curve \, using a matrix of control -points; +#X text 271 4 Create a 3d bicubic curve \, using a matrix of control points; #X obj 848 8 declare -lib Gem; -#X connect 11 0 12 0; -#X connect 12 0 11 0; -#X connect 17 0 89 0; -#X connect 18 0 89 0; -#X connect 19 0 89 0; -#X connect 20 0 89 0; -#X connect 21 0 89 0; -#X connect 22 0 89 0; -#X connect 23 0 89 0; -#X connect 24 0 89 0; -#X connect 25 0 89 0; -#X connect 26 0 90 0; -#X connect 27 0 90 0; -#X connect 28 0 90 0; -#X connect 29 0 90 0; -#X connect 30 0 90 0; -#X connect 31 0 41 0; -#X connect 32 0 42 0; -#X connect 33 0 41 0; -#X connect 34 0 42 0; -#X connect 35 0 42 0; -#X connect 36 0 41 0; -#X connect 37 0 41 0; -#X connect 38 0 42 0; -#X connect 46 0 54 0; -#X connect 47 0 53 1; -#X connect 48 0 53 2; -#X connect 49 0 53 3; -#X connect 50 0 54 1; -#X connect 51 0 54 2; -#X connect 52 0 54 3; -#X connect 53 0 79 0; -#X connect 54 0 53 0; -#X connect 55 0 79 0; -#X connect 63 0 70 0; -#X connect 64 0 63 0; -#X connect 65 0 66 0; -#X connect 66 0 71 0; -#X connect 69 0 65 0; -#X connect 79 0 81 0; -#X connect 80 0 81 0; -#X connect 82 0 81 0; -#X connect 91 0 79 0; -#X connect 92 0 82 0; -#X connect 94 0 96 0; -#X connect 95 0 94 0; +#X obj 821 582 gemhead; +#X obj 821 602 world_light; +#X obj 815 515 _gemwin \; 0 \; 0 \; lighting 1; +#X connect 13 0 85 0; +#X connect 14 0 85 0; +#X connect 15 0 85 0; +#X connect 16 0 85 0; +#X connect 17 0 85 0; +#X connect 18 0 85 0; +#X connect 19 0 85 0; +#X connect 20 0 85 0; +#X connect 21 0 85 0; +#X connect 22 0 86 0; +#X connect 23 0 86 0; +#X connect 24 0 86 0; +#X connect 25 0 86 0; +#X connect 26 0 86 0; +#X connect 27 0 37 0; +#X connect 28 0 38 0; +#X connect 29 0 37 0; +#X connect 30 0 38 0; +#X connect 31 0 38 0; +#X connect 32 0 37 0; +#X connect 33 0 37 0; +#X connect 34 0 38 0; +#X connect 42 0 50 0; +#X connect 43 0 49 1; +#X connect 44 0 49 2; +#X connect 45 0 49 3; +#X connect 46 0 50 1; +#X connect 47 0 50 2; +#X connect 48 0 50 3; +#X connect 49 0 75 0; +#X connect 50 0 49 0; +#X connect 51 0 75 0; +#X connect 59 0 66 0; +#X connect 60 0 59 0; +#X connect 61 0 62 0; +#X connect 62 0 67 0; +#X connect 65 0 61 0; +#X connect 75 0 77 0; +#X connect 76 0 77 0; +#X connect 78 0 77 0; +#X connect 87 0 75 0; +#X connect 88 0 78 0; +#X connect 90 0 92 0; +#X connect 91 0 90 0; +#X connect 96 0 97 0; diff --git a/help/teapot-help.pd b/help/teapot-help.pd index 98ccfec20..242c32369 100644 --- a/help/teapot-help.pd +++ b/help/teapot-help.pd @@ -1,39 +1,13 @@ #N canvas 312 148 709 361 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 489 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 554 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 559 293 pd gemwin; -#X msg 559 274 create; -#X text 555 253 Create window:; +#X obj 489 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 554 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 495 59 Example:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 236 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 236 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 235 Inlets:; -#X obj 8 176 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 29 275 Inlet 2: float: size; #X text 505 8 GEM object; @@ -43,29 +17,24 @@ #X text 33 14 Synopsis: [teapot]; #X text 7 69 Description: Renders a teapot.; #X text 63 186 size of the teapot; -#X obj 492 111 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 492 111 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 495 118 draw line; #X msg 495 141 draw fill; #X obj 563 84 gemhead; -#X floatatom 581 129 5 -5 5 2 size - -; -#X floatatom 600 161 5 0 20 2 grid - -; +#X floatatom 581 129 5 -5 5 2 size - - 0; +#X floatatom 600 161 5 0 20 2 grid - - 0; #X text 29 289 Inlet 3: float: number of slices; #X text 29 261 Inlet 1: message: draw [line|fill|points]; -#X text 14 130 You can also specify the "number of slices" via the -3rd inlet.; +#X text 14 130 You can also specify the "number of slices" via the 3rd inlet.; #X msg 496 162 draw point; -#X text 15 88 The teapot object renders a teapot at the current position -with current color. The size of the teapot can be changed via the second -inlet.; +#X text 15 88 The teapot object renders a teapot at the current position with current color. The size of the teapot can be changed via the second inlet.; #X obj 563 189 teapot 2 14; #X text 63 200 number of slices; #X obj 578 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 21 0 31 0; -#X connect 22 0 31 0; -#X connect 23 0 31 0; -#X connect 24 0 31 1; -#X connect 25 0 31 2; -#X connect 29 0 31 0; +#X obj 559 257 _gemwin; +#X connect 18 0 28 0; +#X connect 19 0 28 0; +#X connect 20 0 28 0; +#X connect 21 0 28 1; +#X connect 22 0 28 2; +#X connect 26 0 28 0; diff --git a/help/text2d-help.pd b/help/text2d-help.pd index a863f676e..991fc13cf 100644 --- a/help/text2d-help.pd +++ b/help/text2d-help.pd @@ -3,27 +3,6 @@ #X text 54 30 Class: geometric object; #X obj 465 65 cnv 15 170 370 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 465 452 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 470 491 pd gemwin; -#X msg 470 472 create; -#X text 466 451 Create window:; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 335 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 340 Inlets:; @@ -120,27 +99,26 @@ #X obj 540 138 / 10; #X floatatom 545 115 5 0 0 0 - - - 0; #X floatatom 581 116 5 0 0 0 - - - 0; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 17 0 52 0; -#X connect 18 0 53 1; +#X obj 472 455 _gemwin; +#X connect 14 0 49 0; +#X connect 15 0 50 1; +#X connect 16 0 50 0; +#X connect 17 0 16 0; +#X connect 18 0 50 0; +#X connect 19 0 50 0; #X connect 19 0 53 0; -#X connect 20 0 19 0; -#X connect 21 0 53 0; -#X connect 22 0 53 0; -#X connect 22 0 56 0; -#X connect 23 0 53 0; -#X connect 29 0 53 0; -#X connect 30 0 52 3; -#X connect 31 0 52 1; -#X connect 46 0 47 0; -#X connect 52 0 59 0; -#X connect 54 0 23 0; -#X connect 55 0 20 0; -#X connect 56 0 53 0; -#X connect 57 0 53 0; -#X connect 59 0 60 0; -#X connect 60 0 53 0; -#X connect 61 0 62 0; -#X connect 62 0 60 1; -#X connect 63 0 59 2; +#X connect 20 0 50 0; +#X connect 26 0 50 0; +#X connect 27 0 49 3; +#X connect 28 0 49 1; +#X connect 43 0 44 0; +#X connect 49 0 56 0; +#X connect 51 0 20 0; +#X connect 52 0 17 0; +#X connect 53 0 50 0; +#X connect 54 0 50 0; +#X connect 56 0 57 0; +#X connect 57 0 50 0; +#X connect 58 0 59 0; +#X connect 59 0 57 1; +#X connect 60 0 56 2; diff --git a/help/text3d-help.pd b/help/text3d-help.pd index c9383f6a6..cf2af1618 100644 --- a/help/text3d-help.pd +++ b/help/text3d-help.pd @@ -3,27 +3,6 @@ #X text 54 30 Class: geometric object; #X obj 465 65 cnv 15 180 510 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 467 433 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 472 472 pd gemwin; -#X msg 472 453 create; -#X text 468 432 Create window:; #X obj 7 65 cnv 15 450 260 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 374 cnv 15 450 190 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 379 Inlets:; @@ -77,21 +56,20 @@ #X obj 562 352 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 30 567 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 43 571 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 17 0 36 0; -#X connect 18 0 37 1; -#X connect 19 0 37 0; -#X connect 20 0 19 0; -#X connect 21 0 20 0; -#X connect 22 0 37 0; -#X connect 23 0 37 0; -#X connect 29 0 37 0; -#X connect 30 0 36 3; -#X connect 31 0 36 1; -#X connect 36 0 37 0; -#X connect 42 0 37 0; -#X connect 51 0 37 0; -#X connect 52 0 37 0; -#X connect 55 0 37 0; -#X connect 56 0 55 0; +#X obj 473 440 _gemwin; +#X connect 14 0 33 0; +#X connect 15 0 34 1; +#X connect 16 0 34 0; +#X connect 17 0 16 0; +#X connect 18 0 17 0; +#X connect 19 0 34 0; +#X connect 20 0 34 0; +#X connect 26 0 34 0; +#X connect 27 0 33 3; +#X connect 28 0 33 1; +#X connect 33 0 34 0; +#X connect 39 0 34 0; +#X connect 48 0 34 0; +#X connect 49 0 34 0; +#X connect 52 0 34 0; +#X connect 53 0 52 0; diff --git a/help/textextruded-help.pd b/help/textextruded-help.pd index 4256fa5b2..37fc6d19d 100644 --- a/help/textextruded-help.pd +++ b/help/textextruded-help.pd @@ -3,27 +3,6 @@ #X text 54 30 Class: geometric object; #X obj 466 65 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 466 341 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 471 380 pd gemwin; -#X msg 471 361 create; -#X text 467 340 Create window:; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 336 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 341 Inlets:; @@ -73,18 +52,17 @@ #X obj 531 8 declare -lib Gem; #X obj 20 527 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 33 531 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 17 0 37 0; -#X connect 18 0 40 1; -#X connect 19 0 40 0; -#X connect 20 0 19 0; -#X connect 21 0 20 0; -#X connect 22 0 40 0; -#X connect 23 0 40 0; -#X connect 30 0 40 0; -#X connect 31 0 37 3; -#X connect 32 0 37 1; -#X connect 37 0 40 0; -#X connect 42 0 40 0; -#X connect 43 0 42 0; +#X obj 472 344 _gemwin; +#X connect 14 0 34 0; +#X connect 15 0 37 1; +#X connect 16 0 37 0; +#X connect 17 0 16 0; +#X connect 18 0 17 0; +#X connect 19 0 37 0; +#X connect 20 0 37 0; +#X connect 27 0 37 0; +#X connect 28 0 34 3; +#X connect 29 0 34 1; +#X connect 34 0 37 0; +#X connect 39 0 37 0; +#X connect 40 0 39 0; diff --git a/help/textoutline-help.pd b/help/textoutline-help.pd index 136ce6f2f..204353aeb 100644 --- a/help/textoutline-help.pd +++ b/help/textoutline-help.pd @@ -3,27 +3,6 @@ #X text 54 30 Class: geometric object; #X obj 466 66 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 468 346 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 473 385 pd gemwin; -#X msg 473 366 create; -#X text 469 345 Create window:; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 335 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 340 Inlets:; @@ -69,16 +48,15 @@ #X obj 528 8 declare -lib Gem; #X obj 30 527 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 43 531 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 17 0 37 0; -#X connect 18 0 41 1; -#X connect 19 0 41 0; -#X connect 20 0 19 0; -#X connect 21 0 20 0; -#X connect 22 0 41 0; -#X connect 23 0 41 0; -#X connect 30 0 41 0; -#X connect 31 0 37 3; -#X connect 32 0 37 1; -#X connect 37 0 41 0; +#X obj 472 353 _gemwin; +#X connect 14 0 34 0; +#X connect 15 0 38 1; +#X connect 16 0 38 0; +#X connect 17 0 16 0; +#X connect 18 0 17 0; +#X connect 19 0 38 0; +#X connect 20 0 38 0; +#X connect 27 0 38 0; +#X connect 28 0 34 3; +#X connect 29 0 34 1; +#X connect 34 0 38 0; diff --git a/help/torus-help.pd b/help/torus-help.pd index 9ee350510..68c8caaa2 100644 --- a/help/torus-help.pd +++ b/help/torus-help.pd @@ -1,75 +1,44 @@ #N canvas 279 150 677 369 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 489 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 554 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 559 293 pd gemwin; -#X msg 559 274 create; -#X text 555 253 Create window:; +#X obj 489 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 554 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 495 59 Example:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 236 cnv 15 450 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 236 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 237 Inlets:; -#X obj 8 176 cnv 15 450 55 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 55 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 29 277 Inlet 2: float: size; #X text 482 8 GEM object; #X text 29 249 Inlet 1: gemlist; #X text 11 326 Outlets:; #X text 23 339 Outlet 1: gemlist; -#X obj 492 111 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 492 111 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 495 118 draw line; #X msg 495 141 draw fill; #X obj 563 84 gemhead; -#X floatatom 573 116 5 -5 5 2 size - -; -#X floatatom 583 144 5 0 20 2 slices - -; +#X floatatom 573 116 5 -5 5 2 size - - 0; +#X floatatom 583 144 5 0 20 2 slices - - 0; #X text 29 291 Inlet 3: float: number of slices; #X text 29 263 Inlet 1: message: draw [line|fill|points]; -#X text 14 130 You can also specify the "number of slices" via the -3rd inlet.; +#X text 14 130 You can also specify the "number of slices" via the 3rd inlet.; #X msg 496 162 draw point; #X text 33 14 Synopsis: [torus]; #X text 63 186 size of the torus; #X text 7 69 Description: Renders a torus.; -#X text 15 88 The torus object renders a torus (aka: doughnut) at the -current position with current color. The size of the torus can be changed -via the second inlet.; -#X floatatom 593 171 5 0 20 2 thickness - -; +#X text 15 88 The torus object renders a torus (aka: doughnut) at the current position with current color. The size of the torus can be changed via the second inlet.; +#X floatatom 593 171 5 0 20 2 thickness - - 0; #X obj 563 189 torus 1; #X text 63 199 # of slices; #X text 62 214 thickness (R-r); #X text 29 307 Inlet 3: float: thickness of the torus (R-r); #X obj 548 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 32 0; -#X connect 19 0 32 0; -#X connect 20 0 32 0; -#X connect 21 0 32 1; -#X connect 22 0 32 2; -#X connect 26 0 32 0; -#X connect 31 0 32 3; +#X obj 561 261 _gemwin; +#X connect 15 0 29 0; +#X connect 16 0 29 0; +#X connect 17 0 29 0; +#X connect 18 0 29 1; +#X connect 19 0 29 2; +#X connect 23 0 29 0; +#X connect 28 0 29 3; diff --git a/help/translate-help.pd b/help/translate-help.pd index 4bec04968..d4301c790 100644 --- a/help/translate-help.pd +++ b/help/translate-help.pd @@ -1,55 +1,27 @@ #N canvas 22 88 639 383 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 63 231 Inlet 1: gemlist; #X text 39 282 Outlets:; #X text 57 295 Outlet 1: gemlist; -#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 71 31 Class: manipulation object; -#X obj 454 108 cnv 15 160 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 454 108 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 455 84 gemhead; #X obj 455 216 square; -#X floatatom 485 140 5 0 0 2 amount - -; +#X floatatom 485 140 5 0 0 2 amount - - 0; #X msg 570 150 0 1 1; #X text 50 12 Synopsis: [translate]; #X msg 548 128 0.1 0 0; #X text 29 77 Description: translation; -#X text 41 91 translate accepts a gemList and changes the current transformation -matrix by the specified translation; +#X text 41 91 translate accepts a gemList and changes the current transformation matrix by the specified translation; #X text 36 122 the a*(x y z) vector determines the translation; #X text 63 166 1st argument: translation scale; #X text 63 179 2nd-4th argument: translation-axis (XYZ); @@ -59,10 +31,9 @@ matrix by the specified translation; #X text 35 332 see also:; #X obj 99 333 translateXYZ; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 30 0; -#X connect 19 0 30 1; -#X connect 20 0 30 2; -#X connect 22 0 30 2; -#X connect 30 0 18 0; +#X obj 520 261 _gemwin; +#X connect 14 0 27 0; +#X connect 16 0 27 1; +#X connect 17 0 27 2; +#X connect 19 0 27 2; +#X connect 27 0 15 0; diff --git a/help/translateXYZ-help.pd b/help/translateXYZ-help.pd index 8d513ccd4..bfaa06657 100644 --- a/help/translateXYZ-help.pd +++ b/help/translateXYZ-help.pd @@ -1,68 +1,39 @@ #N canvas 57 61 639 383 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 206 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 213 Inlets:; #X text 63 226 Inlet 1: gemlist; #X text 39 287 Outlets:; #X text 57 300 Outlet 1: gemlist; -#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 70 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 71 31 Class: manipulation object; -#X obj 454 108 cnv 15 160 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 454 108 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 457 84 gemhead; #X obj 457 218 square; -#X floatatom 497 122 3 -4 4 0 X - -; +#X floatatom 497 122 3 -4 4 0 X - - 0; #X text 29 77 Description: translation; #X obj 457 178 translateXYZ 1 2 0; -#X floatatom 537 139 3 -4 4 0 Y - -; -#X floatatom 578 154 3 -16 3 0 Z - -; +#X floatatom 537 139 3 -4 4 0 Y - - 0; +#X floatatom 578 154 3 -16 3 0 Z - - 0; #X text 36 122 the translation is determined by a vector (X Y Z); #X text 60 174 1st-3rd argument: translation vector (XYZ); #X text 63 241 Inlet 2: float: translation along X-axis; #X text 63 266 Inlet 4: float: translation along Z-axis; #X text 63 254 Inlet 3: float: translation along Y-axis; #X text 50 12 Synopsis: [translateXYZ]; -#X text 41 91 [translateXYZ] accepts a gemList and changes the current -transformation matrix by the specified translation; +#X text 41 91 [translateXYZ] accepts a gemList and changes the current transformation matrix by the specified translation; #X text 23 333 see also:; #X obj 85 334 translate; #X obj 518 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 17 0 21 0; -#X connect 19 0 21 1; -#X connect 21 0 18 0; -#X connect 22 0 21 2; -#X connect 23 0 21 3; +#X obj 520 260 _gemwin; +#X connect 14 0 18 0; +#X connect 16 0 18 1; +#X connect 18 0 15 0; +#X connect 19 0 18 2; +#X connect 20 0 18 3; diff --git a/help/trapezoid-help.pd b/help/trapezoid-help.pd index c8cf5a86b..297b9dc9a 100644 --- a/help/trapezoid-help.pd +++ b/help/trapezoid-help.pd @@ -1,72 +1,41 @@ #N canvas 6 61 673 358 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 489 87 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 554 264 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 559 303 pd gemwin; -#X msg 559 284 create; -#X text 555 263 Create window:; +#X obj 489 87 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 554 264 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 495 69 Example:; -#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 65 cnv 15 450 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 472 8 GEM object; #X text 27 233 Inlet 1: gemlist; #X text 9 310 Outlets:; #X text 21 323 Outlet 1: gemlist; -#X obj 492 122 cnv 15 160 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 492 122 cnv 15 160 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 495 135 draw line; #X msg 495 156 draw fill; #X msg 495 178 draw point; #X obj 549 94 gemhead; -#X floatatom 587 174 5 0 0 0 - - -; -#X floatatom 600 202 5 0 0 0 - - -; +#X floatatom 587 174 5 0 0 0 - - - 0; +#X floatatom 600 202 5 0 0 0 - - - 0; #X text 587 158 size; #X text 600 186 top line; #X text 33 14 Synopsis: [trapezoid]; #X text 7 69 Description: Renders a trapezoid box.; -#X text 15 86 The trapezoid object renders a trapezoid (box) at the -current position with current color. The dimensions and shape of the -trapezoid can be changed via the last two inlets.; +#X text 15 86 The trapezoid object renders a trapezoid (box) at the current position with current color. The dimensions and shape of the trapezoid can be changed via the last two inlets.; #X text 63 167 dimensions of the trapezoid (size topline); #X text 65 181 default: 1 1; #X text 27 260 Inlet 2: float: size; -#X text 27 275 Inlet 3: float: length of top line \, relative to the -size; +#X text 27 275 Inlet 3: float: length of top line \, relative to the size; #X obj 549 225 trapezoid 1 0.7; #X obj 548 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 18 0 33 0; -#X connect 19 0 33 0; -#X connect 20 0 33 0; -#X connect 21 0 33 0; -#X connect 22 0 33 1; -#X connect 23 0 33 2; +#X obj 560 271 _gemwin; +#X connect 15 0 30 0; +#X connect 16 0 30 0; +#X connect 17 0 30 0; +#X connect 18 0 30 0; +#X connect 19 0 30 1; +#X connect 20 0 30 2; diff --git a/help/triangle-help.pd b/help/triangle-help.pd index 475b95b79..3f4be9de5 100644 --- a/help/triangle-help.pd +++ b/help/triangle-help.pd @@ -1,38 +1,12 @@ #N canvas 289 160 710 345 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 489 57 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 554 234 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 559 273 pd gemwin; -#X msg 559 254 create; -#X text 555 233 Create window:; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 489 57 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 554 234 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 216 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; #X text 27 247 Inlet 1: message: draw [line|fill|point]; #X text 27 261 Inlet 2: float: size; @@ -41,27 +15,22 @@ #X text 9 280 Outlets:; #X text 21 293 Outlet 1: gemlist; #X text 495 39 Example:; -#X obj 492 88 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 492 88 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 495 95 draw line; #X msg 495 116 draw fill; #X msg 495 138 draw point; #X obj 563 64 gemhead; -#X floatatom 594 124 5 0 0 0 - - -; +#X floatatom 594 124 5 0 0 0 - - - 0; #X text 594 108 size; #X text 63 186 size of the triangle; #X text 33 14 Synopsis: [triangle]; #X obj 563 168 triangle 2; #X text 7 69 Description: Renders an isosceles triangle; -#X text 16 86 The [triangle] object renders an equal-sided (where the -height equals the base) triangle at the current position with current -color. The size of the triangle can be changed via the second inlet. -; +#X text 16 86 The [triangle] object renders an equal-sided (where the height equals the base) triangle at the current position with current color. The size of the triangle can be changed via the second inlet.; #X obj 588 8 declare -lib Gem; -#X connect 3 0 4 0; -#X connect 4 0 3 0; -#X connect 19 0 27 0; -#X connect 20 0 27 0; -#X connect 21 0 27 0; -#X connect 22 0 27 0; -#X connect 23 0 27 1; +#X obj 561 241 _gemwin; +#X connect 16 0 24 0; +#X connect 17 0 24 0; +#X connect 18 0 24 0; +#X connect 19 0 24 0; +#X connect 20 0 24 1; diff --git a/help/tube-help.pd b/help/tube-help.pd index 0f2097fe2..4f866d90c 100644 --- a/help/tube-help.pd +++ b/help/tube-help.pd @@ -1,4 +1,4 @@ -#N canvas 877 124 754 622 10; +#N canvas 436 84 754 622 10; #X declare -lib Gem; #X text 44 383 default = D1 and D2; #X text 54 27 Class: geometric object; diff --git a/help/vertex_program-help.pd b/help/vertex_program-help.pd index ac6866762..9e2d2e6e7 100644 --- a/help/vertex_program-help.pd +++ b/help/vertex_program-help.pd @@ -1,46 +1,18 @@ #N canvas 35 199 631 458 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 335 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 335 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 336 Inlets:; #X text 10 386 Outlets:; -#X obj 8 296 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 296 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 295 Arguments:; -#X obj 7 76 cnv 15 430 210 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 474 334 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 479 373 pd gemwin; -#X msg 479 354 create; -#X text 475 333 Create window:; -#X obj 450 158 cnv 15 160 70 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 474 334 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 70 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -60,15 +32,12 @@ #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 136 pix_texture; -#X obj 10 211 cnv 15 420 70 empty empty empty 20 12 0 14 -225280 -66577 -0; +#X obj 10 211 cnv 15 420 70 empty empty empty 20 12 0 14 #d8fcfc #404040 0; #X text 50 12 Synopsis: [vertex_program]; #X text 71 31 Class: shader object; #X text 13 76 Description: set the ARB vertex shader; -#X text 24 95 [vertex_program] loads and applies an ARB (or NV) vertex -shader.; -#X obj 520 164 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X text 24 95 [vertex_program] loads and applies an ARB (or NV) vertex shader.; +#X obj 520 164 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 75 103 openpanel; #X obj 75 173 outlet; @@ -82,23 +51,17 @@ shader.; #X connect 4 0 0 0; #X restore 463 163 pd open; #X msg 463 183 open examples/data/toon.vp; -#X obj 450 252 cnv 15 160 30 empty empty empty 20 12 0 14 -102041 -66577 -0; +#X obj 450 252 cnv 15 160 30 empty empty empty 20 12 0 14 #60e860 #404040 0; #N canvas 0 0 752 303 parameter 0; #X obj 81 44 inlet; #X obj 81 270 outlet; -#X obj 241 47 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 --262144 -1 -1 0 256; -#X obj 288 64 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 --262144 -1 -1 35 256; -#X obj 328 82 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 --262144 -1 -1 1 256; +#X obj 241 47 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 288 64 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 328 82 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 #fcfcfc #000000 #000000 0 256; #X obj 288 101 t b f; #X obj 328 101 t b f; -#X obj 149 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 --262144 -1 -1 34336 256; -#X obj 217 162 nbx 5 14 -1e+37 1e+37 0 0 empty empty parameter# 0 -6 -0 10 -262144 -1 -1 0 256; +#X obj 149 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 217 162 nbx 5 14 -1e+37 1e+37 0 0 empty empty parameter# 0 -6 0 10 #fcfcfc #000000 #000000 0 256; #X obj 81 248 GEMglProgramEnvParameter4fvARB; #X obj 88 175 loadbang; #X obj 88 207 GLdefine GL_VERTEX_PROGRAM_ARB; @@ -128,8 +91,7 @@ shader.; #X restore 217 25 pd defaults; #X msg 217 8 default; #X obj 286 121 pack 0 35 1 0; -#X text 301 250 "glProgramEnvParameter" to work on "GL_VERTEX_PROGRAM_ARB" -; +#X text 301 250 "glProgramEnvParameter" to work on "GL_VERTEX_PROGRAM_ARB"; #X text 301 158 which parameter we want to modify; #X text 398 122 the values for the parameter; #X connect 0 0 9 0; @@ -152,29 +114,22 @@ shader.; #X connect 14 0 13 0; #X connect 15 0 9 3; #X restore 451 256 pd parameter; -#X text 11 123 If you want to modify the parameters of the shader-program -\, you have to set the modification up yourself \, via [GEMglProgramEnvParameter*] -working on GL_VERTEX_PROGRAM_ARB.; -#X text 14 219 IMPORTANT NOTE: your openGL-implementation (gfx-card -driver \, ...) has to support either (or both) the ARB shader extensions -or the NV shader extensions in order to make use of this object.; -#X text 10 176 Of course \, you also have to supply anything else needed -for the shader to work (like textures \, ...); -#X text 35 362 Inlet 1: message: open : vertex shader program -to load; +#X text 11 123 If you want to modify the parameters of the shader-program \, you have to set the modification up yourself \, via [GEMglProgramEnvParameter*] working on GL_VERTEX_PROGRAM_ARB.; +#X text 14 219 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support either (or both) the ARB shader extensions or the NV shader extensions in order to make use of this object.; +#X text 10 176 Of course \, you also have to supply anything else needed for the shader to work (like textures \, ...); +#X text 35 362 Inlet 1: message: open : vertex shader program to load; #X obj 451 296 teapot; #X obj 453 422 fragment_program; #X text 451 405 see also:; #X obj 451 206 vertex_program toon.vp; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 22 0; -#X connect 22 0 40 0; -#X connect 28 0 29 0; -#X connect 29 0 30 0; -#X connect 30 0 40 0; -#X connect 32 0 37 0; -#X connect 40 0 32 0; +#X obj 479 340 _gemwin; +#X connect 11 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 19 0; +#X connect 19 0 37 0; +#X connect 25 0 26 0; +#X connect 26 0 27 0; +#X connect 27 0 37 0; +#X connect 29 0 34 0; +#X connect 37 0 29 0; diff --git a/help/world_light-help.pd b/help/world_light-help.pd index a2ffeb0eb..17bfffe2a 100644 --- a/help/world_light-help.pd +++ b/help/world_light-help.pd @@ -1,98 +1,56 @@ #N canvas 265 153 653 455 10; #X declare -lib Gem; #X text 475 59 Example:; -#X obj 7 64 cnv 15 450 200 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 7 317 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 64 cnv 15 450 200 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 7 317 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 26 322 Inlets:; -#X obj 8 276 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 276 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 275 Arguments:; #X text 452 8 GEM object; #X text 44 334 Inlet 1: gemlist; #X text 26 388 Outlets:; #X text 38 401 Outlet 1: gemlist; -#X obj 469 77 cnv 15 170 320 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 474 331 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 256 112 destroy; -#X obj 322 45 inlet; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 8 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X restore 479 370 pd gemwin; -#X msg 479 351 create; -#X text 475 330 Create window:; -#X obj 473 129 cnv 15 150 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 469 77 cnv 15 170 320 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 474 331 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 473 129 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 481 84 gemhead; #X text 53 30 Class: non-geometric object; #X text 7 69 Description: adds a point-light to the scene; -#X text 44 360 Inlet 1: message: debug 1|0 : show debugging object -(default:0), f 66; +#X text 44 360 Inlet 1: message: debug 1|0 : show debugging object (default:0), f 66; #X text 44 373 Inlet 2: list: 3(RGB) or 4(RGBA) float values; #X msg 568 182 1 1 1; -#X obj 495 157 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 495 157 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 495 178 debug \$1; -#X text 19 189 Keep in mind that the attributes have to be set before -rendering the vertices \, so if you are trying for frame accurate rendering -\, you will want to set the gemhead order to a low number so that all -of the values of the light get set first.; +#X text 19 189 Keep in mind that the attributes have to be set before rendering the vertices \, so if you are trying for frame accurate rendering \, you will want to set the gemhead order to a low number so that all of the values of the light get set first.; #X obj 480 264 sphere; -#X floatatom 561 88 5 0 0 0 - - -; +#X floatatom 561 88 5 0 0 0 - - - 0; #X obj 481 106 rotateXYZ 0 -120 0; #X obj 480 242 gemhead 40; -#X obj 537 271 cnv 15 85 50 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 537 271 cnv 15 85 50 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 539 298 lighting \$1; -#X obj 539 276 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 539 276 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 567 159 1 1 0; -#X text 18 169 The second inlet sets the color of the light-source. -; +#X text 18 169 The second inlet sets the color of the light-source.; #X text 63 287 light-number; #X obj 481 204 world_light; -#X text 19 86 [world_light] produces a light which is at an infinite -distance from the scene. This means that all of the light rays are -parallel \, which reduces the computation somewhat.; -#X text 17 135 You can adjust the light with [rotate]. If you are lost -use "debug" to display the light source as a small cone.; +#X text 19 86 [world_light] produces a light which is at an infinite distance from the scene. This means that all of the light rays are parallel \, which reduces the computation somewhat.; +#X text 17 135 You can adjust the light with [rotate]. If you are lost use "debug" to display the light source as a small cone.; #X text 33 14 Synopsis: [world_light]; -#X obj 490 134 tgl 20 0 empty \$0-onoff empty 17 7 0 10 -262144 -1 --1 0 1; +#X obj 490 134 tgl 20 0 empty \$0-onoff empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 40 425 see also:; #X obj 145 425 spot_light; #X obj 103 425 light; #X text 44 347 Inlet 1: float: turn light on/off (default:1); #X obj 528 8 declare -lib Gem; -#X connect 12 0 13 0; -#X connect 13 0 12 0; -#X connect 16 0 27 0; -#X connect 21 0 35 1; -#X connect 22 0 23 0; -#X connect 23 0 35 0; -#X connect 26 0 27 2; -#X connect 27 0 35 0; -#X connect 28 0 25 0; -#X connect 30 0 12 1; -#X connect 31 0 30 0; -#X connect 32 0 35 1; -#X connect 39 0 35 0; +#X obj 481 338 _gemwin; +#X connect 13 0 24 0; +#X connect 18 0 32 1; +#X connect 19 0 20 0; +#X connect 20 0 32 0; +#X connect 23 0 24 2; +#X connect 24 0 32 0; +#X connect 25 0 22 0; +#X connect 27 0 42 0; +#X connect 28 0 27 0; +#X connect 29 0 32 1; +#X connect 36 0 32 0; From d813b9bf3f49bc7bba34a28914eebd370f2960bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 1 Mar 2024 09:37:12 +0100 Subject: [PATCH 112/387] Start switching pix-help to [_gemwin] --- help/_pix2rectangle.pd | 26 ++++++++++++++ help/pix_draw-help.pd | 79 +++++++++++------------------------------- 2 files changed, 47 insertions(+), 58 deletions(-) create mode 100644 help/_pix2rectangle.pd diff --git a/help/_pix2rectangle.pd b/help/_pix2rectangle.pd new file mode 100644 index 000000000..6d60e5c64 --- /dev/null +++ b/help/_pix2rectangle.pd @@ -0,0 +1,26 @@ +#N canvas 282 264 450 300 12; +#X obj 72 35 inlet; +#X obj 104 186 pix_info, f 29; +#X obj 104 245 pix_texture; +#X obj 104 270 rectangle; +#X obj 143 222 /; +#X obj 72 73 t a a; +#X obj 104 157 separator; +#X obj 72 98 outlet; +#X obj 104 135 scale; +#X obj 214 35 loadbang; +#X obj 214 60 gemargs; +#X obj 212 87 route bang; +#X connect 0 0 5 0; +#X connect 1 0 2 0; +#X connect 1 1 4 0; +#X connect 1 2 4 1; +#X connect 2 0 3 0; +#X connect 4 0 3 1; +#X connect 5 0 7 0; +#X connect 5 1 8 0; +#X connect 6 0 1 0; +#X connect 8 0 6 0; +#X connect 9 0 10 0; +#X connect 10 1 11 0; +#X connect 11 1 8 1; diff --git a/help/pix_draw-help.pd b/help/pix_draw-help.pd index a977db215..eb06600c4 100644 --- a/help/pix_draw-help.pd +++ b/help/pix_draw-help.pd @@ -1,47 +1,19 @@ #N canvas 106 178 626 382 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 295 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 295 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 298 Inlets:; #X text 34 331 Outlets:; -#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 255 Arguments:; -#X obj 7 76 cnv 15 430 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 200 cnv 15 80 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 200 cnv 15 80 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -63,28 +35,19 @@ #X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_draw]; #X text 29 76 Description: draw pixels on the screen; -#X text 29 94 pix_draw simply draws the pixels on the screen without -doing any texture mapping. Because it is just blasting pixels \, rotations -and translations in the Z dimension won't do anything (except maybe -have the raster point be clicked). See the OpenGL reference manual -under glDrawPixels for more information).; -#X obj 16 180 cnv 15 410 30 empty empty empty 20 12 0 14 -260818 -66577 -0; -#X text 19 181 WARNING: On most PCs with graphics accelerators \, pix_draw -is MUCH SLOWER than [pix_texture]!!; +#X text 29 94 pix_draw simply draws the pixels on the screen without doing any texture mapping. Because it is just blasting pixels \, rotations and translations in the Z dimension won't do anything (except maybe have the raster point be clicked). See the OpenGL reference manual under glDrawPixels for more information).; +#X obj 16 180 cnv 15 410 30 empty empty empty 20 12 0 14 #fcac44 #404040 0; +#X text 19 181 WARNING: On most PCs with graphics accelerators \, pix_draw is MUCH SLOWER than [pix_texture]!!; #X obj 451 171 translateXYZ; -#X floatatom 472 149 5 -4 4 0 - - -; -#X floatatom 519 148 5 -4 4 0 - - -; -#X floatatom 563 149 5 -4 2 0 - - -; -#X text 16 216 [pix_draw] is used in the example patches a lot \, just -because it is one object less (compared to [pix_texture]; +#X floatatom 472 149 5 -4 4 0 - - - 0; +#X floatatom 519 148 5 -4 4 0 - - - 0; +#X floatatom 563 149 5 -4 2 0 - - - 0; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 29 0; -#X connect 29 0 21 0; -#X connect 30 0 29 1; -#X connect 31 0 29 2; -#X connect 32 0 29 3; +#X obj 520 260 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 26 0; +#X connect 26 0 18 0; +#X connect 27 0 26 1; +#X connect 28 0 26 2; +#X connect 29 0 26 3; From 3b6cab12f4d8476915508719cb3219aa25a53415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 1 Mar 2024 09:38:10 +0100 Subject: [PATCH 113/387] Add [_pix2rectangle] helper --- help/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/help/Makefile.am b/help/Makefile.am index 3506453a1..83f0d2307 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -244,4 +244,5 @@ dist_gemhelp_DATA += \ dist_gemhelp_DATA += \ _backendinfo.pd \ _gemwin.pd \ + _pix2rectangle.pd \ $(empty) From ed7367d39239f47de8d77caa68a59d441dfaa94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 1 Mar 2024 11:01:13 +0100 Subject: [PATCH 114/387] rectangle-help: better layout --- help/rectangle-help.pd | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/help/rectangle-help.pd b/help/rectangle-help.pd index b8c979a69..3a9f5fc49 100644 --- a/help/rectangle-help.pd +++ b/help/rectangle-help.pd @@ -1,17 +1,17 @@ -#N canvas 35 433 710 345 10; +#N canvas 35 433 710 405 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; #X obj 499 67 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 8 216 cnv 15 450 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X text 9 221 Inlets:; -#X obj 8 176 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X text 17 175 Arguments:; -#X text 27 247 Inlet 1: message: draw [line|fill|point]; +#X obj 7 65 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 236 cnv 15 450 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 9 241 Inlets:; +#X obj 8 196 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 17 195 Arguments:; +#X text 27 267 Inlet 1: message: draw [line|fill|point]; #X text 522 8 GEM object; -#X text 27 233 Inlet 1: gemlist; -#X text 9 290 Outlets:; -#X text 21 303 Outlet 1: gemlist; +#X text 27 253 Inlet 1: gemlist; +#X text 9 310 Outlets:; +#X text 21 323 Outlet 1: gemlist; #X text 505 49 Example:; #X obj 502 98 cnv 15 150 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 505 105 draw line; @@ -20,14 +20,14 @@ #X obj 548 74 gemhead; #X floatatom 591 118 5 0 0 2 width - - 0; #X floatatom 609 149 5 0 0 2 height - - 0; -#X text 63 186 width & height of the rectangle; +#X text 63 206 width & height of the rectangle; #X text 33 14 Synopsis: [rectangle]; #X text 7 69 Description: Renders a rectangle; #X obj 548 179 rectangle 3 1; -#X text 27 261 Inlet 2: float: width (default to 1); -#X text 27 274 Inlet 3: float: height (default to 1); -#X text 16 86 The [rectangle] object renders a rectangle at the current position with current color. The width and height of the rectangle can be set by the arguments and changed via the second and third inlet.; -#X text 19 133 note for the nitpickers: the rectangle will span from (-width|-height) to (+width|+height) so the actual size is really double the specified size.; +#X text 27 281 Inlet 2: float: width (default to 1); +#X text 27 294 Inlet 3: float: height (default to 1); +#X text 16 86 The [rectangle] object renders a rectangle at the current position with current color. The width and height of the rectangle can be set by the arguments and changed via the second and third inlet., f 72; +#X text 19 133 note for the nitpickers: the rectangle will span from (-width|-height) to (+width|+height) so the actual size is really double the specified size., f 71; #X obj 588 8 declare -lib Gem; #X obj 562 262 _gemwin; #X connect 14 0 23 0; From 2c5c33463fed768d2cd275fe42325ddf0fb0859f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 1 Mar 2024 11:01:43 +0100 Subject: [PATCH 115/387] Update pix-helps to use [_gemwin], [_pix2rectangle] and [pix_test] --- help/_pix2rectangle.pd | 55 +++--- help/pix_2grey-help.pd | 77 ++------- help/pix_a_2grey-help.pd | 78 +++------ help/pix_add-help.pd | 70 ++------ help/pix_aging-help.pd | 124 ++++---------- help/pix_alpha-help.pd | 92 +++------- help/pix_background-help.pd | 83 +++------ help/pix_backlight-help.pd | 80 +++------ help/pix_biquad-help.pd | 126 +++++--------- help/pix_bitmask-help.pd | 83 +++------ help/pix_buf-help.pd | 60 ++----- help/pix_buffer_read-help.pd | 73 ++------ help/pix_buffer_write-help.pd | 82 +++------ help/pix_chroma_key-help.pd | 62 ++----- help/pix_color-help.pd | 82 ++------- help/pix_coloralpha-help.pd | 103 +++-------- help/pix_colorclassify-help.pd | 76 ++------ help/pix_colormatrix-help.pd | 267 ++++++++++++++--------------- help/pix_colorreduce-help.pd | 76 +++----- help/pix_compare-help.pd | 83 +++------ help/pix_composite-help.pd | 71 ++------ help/pix_contrast-help.pd | 73 +++----- help/pix_convert-help.pd | 102 +++-------- help/pix_convolve-help.pd | 150 ++++++---------- help/pix_coordinate-help.pd | 102 +++-------- help/pix_crop-help.pd | 91 +++------- help/pix_curve-help.pd | 103 ++++------- help/pix_data-help.pd | 56 ++---- help/pix_deinterlace-help.pd | 76 ++------ help/pix_delay-help.pd | 73 ++------ help/pix_diff-help.pd | 69 ++------ help/pix_dot-help.pd | 65 ++----- help/pix_dump-help.pd | 87 ++-------- help/pix_duotone-help.pd | 78 +++------ help/pix_equal-help.pd | 84 +++------ help/pix_film-help.pd | 76 +++----- help/pix_flip-help.pd | 60 ++----- help/pix_freeframe-help.pd | 128 ++++---------- help/pix_frei0r-help.pd | 126 ++++---------- help/pix_gain-help.pd | 90 ++-------- help/pix_grey-help.pd | 52 +----- help/pix_halftone-help.pd | 85 +++------ help/pix_histo-help.pd | 86 +++------- help/pix_hsv2rgb-help.pd | 67 ++------ help/pix_image-help.pd | 87 +++------- help/pix_imageInPlace-help.pd | 82 +++------ help/pix_info-help.pd | 74 +++----- help/pix_invert-help.pd | 77 ++------- help/pix_kaleidoscope-help.pd | 167 ++++++------------ help/pix_levels-help.pd | 58 ++----- help/pix_lumaoffset-help.pd | 90 +++------- help/pix_mask-help.pd | 72 ++------ help/pix_mean_color-help.pd | 94 ++++------ help/pix_metaimage-help.pd | 102 ++++------- help/pix_mix-help.pd | 89 +++------- help/pix_motionblur-help.pd | 83 +++------ help/pix_movement-help.pd | 92 +++------- help/pix_movement2-help.pd | 96 +++-------- help/pix_movie-help.pd | 133 +++++--------- help/pix_multiblob-help.pd | 149 ++++++---------- help/pix_multiimage-help.pd | 74 ++------ help/pix_multiply-help.pd | 42 +---- help/pix_multitexture-help.pd | 76 ++------ help/pix_noise-help.pd | 106 ++++-------- help/pix_normalize-help.pd | 66 ++----- help/pix_offset-help.pd | 83 ++------- help/pix_pix2sig~-help.pd | 88 +++------- help/pix_posterize-help.pd | 77 +++------ help/pix_puzzle-help.pd | 87 +++------- help/pix_rds-help.pd | 74 ++------ help/pix_record-help.pd | 71 +++----- help/pix_rectangle-help.pd | 84 ++------- help/pix_refraction-help.pd | 97 ++++------- help/pix_resize-help.pd | 87 +++------- help/pix_rgb2hsv-help.pd | 81 ++------- help/pix_rgba-help.pd | 90 ++-------- help/pix_roi-help.pd | 30 +--- help/pix_roll-help.pd | 90 ++-------- help/pix_rtx-help.pd | 90 +++------- help/pix_scanline-help.pd | 78 +++------ help/pix_set-help.pd | 109 ++++-------- help/pix_share_read-help.pd | 82 +++------ help/pix_share_write-help.pd | 68 ++------ help/pix_sig2pix~-help.pd | 78 ++++----- help/pix_snap-help.pd | 80 +++------ help/pix_snap2tex-help.pd | 112 ++++-------- help/pix_subtract-help.pd | 74 +++----- help/pix_tIIR-help.pd | 120 +++++-------- help/pix_takealpha-help.pd | 73 ++------ help/pix_test-help.pd | 59 ++----- help/pix_texture-help.pd | 212 ++++++++--------------- help/pix_threshold-help.pd | 69 ++------ help/pix_threshold_bernsen-help.pd | 75 +++----- help/pix_video-help.pd | 64 +++---- help/pix_write-help.pd | 107 +++--------- help/pix_writer-help.pd | 91 +++------- help/pix_yuv-help.pd | 88 ++-------- 97 files changed, 2385 insertions(+), 6174 deletions(-) diff --git a/help/_pix2rectangle.pd b/help/_pix2rectangle.pd index 6d60e5c64..abb069300 100644 --- a/help/_pix2rectangle.pd +++ b/help/_pix2rectangle.pd @@ -1,26 +1,29 @@ -#N canvas 282 264 450 300 12; -#X obj 72 35 inlet; -#X obj 104 186 pix_info, f 29; -#X obj 104 245 pix_texture; -#X obj 104 270 rectangle; -#X obj 143 222 /; -#X obj 72 73 t a a; -#X obj 104 157 separator; -#X obj 72 98 outlet; -#X obj 104 135 scale; -#X obj 214 35 loadbang; -#X obj 214 60 gemargs; -#X obj 212 87 route bang; -#X connect 0 0 5 0; -#X connect 1 0 2 0; -#X connect 1 1 4 0; -#X connect 1 2 4 1; -#X connect 2 0 3 0; -#X connect 4 0 3 1; -#X connect 5 0 7 0; -#X connect 5 1 8 0; -#X connect 6 0 1 0; -#X connect 8 0 6 0; -#X connect 9 0 10 0; -#X connect 10 1 11 0; -#X connect 11 1 8 1; +#N canvas 282 264 450 413 12; +#X text 54 25 This is really just a small wrapper to for quickly displaying images in Gem's help-patches; +#X obj 82 330 cnv 20 133 80 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#X obj 72 115 inlet; +#X obj 104 266 pix_info, f 29; +#X obj 104 345 pix_texture; +#X obj 104 370 rectangle; +#X obj 143 302 /; +#X obj 72 153 t a a; +#X obj 104 237 separator; +#X obj 72 178 outlet; +#X obj 104 215 scale; +#X obj 214 115 loadbang; +#X obj 214 140 gemargs; +#X obj 212 167 route bang; +#X connect 2 0 7 0; +#X connect 3 0 4 0; +#X connect 3 1 6 0; +#X connect 3 2 6 1; +#X connect 4 0 5 0; +#X connect 6 0 5 1; +#X connect 7 0 9 0; +#X connect 7 1 10 0; +#X connect 8 0 3 0; +#X connect 10 0 8 0; +#X connect 11 0 12 0; +#X connect 12 0 4 0; +#X connect 12 1 13 0; +#X connect 13 1 10 1; diff --git a/help/pix_2grey-help.pd b/help/pix_2grey-help.pd index 9d4a67ded..71c6bcd2a 100644 --- a/help/pix_2grey-help.pd +++ b/help/pix_2grey-help.pd @@ -1,79 +1,30 @@ #N canvas 404 365 632 342 10; #X declare -lib Gem; #X text 442 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 252 Inlets:; #X text 38 285 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 298 Outlet 1: gemlist; #X text 63 266 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_2grey]; #X text 29 76 Description: convert a pix to greyscale; -#X text 17 151 So \, if you have an RGBA-image \, after [pix_2grey] -the values for R \, G and B will be the same. the chroma-values of -a YUV-image will be set to 127 (no chroma); +#X text 17 151 So \, if you have an RGBA-image \, after [pix_2grey] the values for R \, G and B will be the same. the chroma-values of a YUV-image will be set to 127 (no chroma); #X obj 451 176 pix_2grey; -#X text 17 97 Assuming that you have an image in the gemList (for instance -\, loaded in with pix_image) \, [pix_2grey] will convert the image -into a greyscale \, without changing the actual colorspace.; +#X text 17 97 Assuming that you have an image in the gemList (for instance \, loaded in with pix_image) \, [pix_2grey] will convert the image into a greyscale \, without changing the actual colorspace.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 27 0; -#X connect 27 0 21 0; +#X obj 518 262 _gemwin; +#X obj 451 233 _pix2rectange; +#X obj 451 113 pix_test; +#X connect 11 0 24 0; +#X connect 19 0 23 0; +#X connect 24 0 19 0; diff --git a/help/pix_a_2grey-help.pd b/help/pix_a_2grey-help.pd index cb7d50914..15569f55b 100644 --- a/help/pix_a_2grey-help.pd +++ b/help/pix_a_2grey-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 626 372 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 275 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 275 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 278 Inlets:; #X text 38 325 Outlets:; -#X obj 8 236 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 236 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 235 Arguments:; -#X obj 7 60 cnv 15 430 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 60 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 167 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 167 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,35 +30,29 @@ #X text 63 246 ; #X text 56 338 Outlet 1: gemlist; #X text 63 292 Inlet 1: gemlist; -#X obj 451 263 pix_draw; +#X obj 451 263 _pix2rectangle 3; #X text 516 105 open an image; #X text 50 12 Synopsis: [pix_a_2grey]; -#X text 29 66 Description: convert a pixel to greyscale based on alpha -; -#X text 39 87 Assuming that you have an image in the gemList (for instance -\, loaded in with pix_image) \, pix_a_2grey will convert the image -into a greyscale.; -#X text 39 129 If alphaVal > 0 \, then it will convert to greyscale -where ever the pixel alpha is greater than the alphaVal.; +#X text 29 66 Description: convert a pixel to greyscale based on alpha; +#X text 39 87 Assuming that you have an image in the gemList (for instance \, loaded in with pix_image) \, pix_a_2grey will convert the image into a greyscale.; +#X text 39 129 If alphaVal > 0 \, then it will convert to greyscale where ever the pixel alpha is greater than the alphaVal.; #X text 38 189 If alphaVal = 0 \, then nothing happens.; -#X text 38 159 If alphaVal < 0 \, then it will convert to greyscale -where ever the pixel alpha is less than the -alphaVal.; +#X text 38 159 If alphaVal < 0 \, then it will convert to greyscale where ever the pixel alpha is less than the -alphaVal.; #X text 22 210 Obviously \, this will work for RGBA-images only.; #X obj 451 226 pix_a_2grey; -#X floatatom 523 206 4 -1 1 2 alpha-thresh - -; +#X floatatom 523 206 4 -1 1 2 alpha-thresh - - 0; #X text 63 305 Inlet 2: : alpha-threshold (-1..0..+1); #X text 512 118 (TIFF \, ..); #X msg 523 171 0.5; #X msg 479 170 -0.5; #X obj 451 137 pix_coloralpha; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 36 0; -#X connect 30 0 21 0; -#X connect 31 0 30 1; -#X connect 34 0 31 0; -#X connect 35 0 31 0; -#X connect 36 0 30 0; +#X obj 518 259 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 33 0; +#X connect 27 0 18 0; +#X connect 28 0 27 1; +#X connect 31 0 28 0; +#X connect 32 0 28 0; +#X connect 33 0 27 0; diff --git a/help/pix_add-help.pd b/help/pix_add-help.pd index cca640700..f6364e3c3 100644 --- a/help/pix_add-help.pd +++ b/help/pix_add-help.pd @@ -1,46 +1,18 @@ #N canvas 270 306 683 381 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 39 304 Outlets:; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 67 cnv 15 170 300 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 67 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 50 Example:; -#X obj 514 303 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 342 pd gemwin; -#X msg 519 323 create; -#X text 515 302 Create window:; -#X obj 451 188 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 303 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 188 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 139 gemhead; -#X obj 496 122 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 496 122 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -54,11 +26,9 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 158 pd image; -#X obj 451 276 pix_texture; #X text 63 196 ; #X text 47 318 Outlet 1: gemlist; #X text 53 262 Inlet 1: gemlist; -#X obj 451 298 square 3; #X text 503 88 (JPEG \, TIFF \, ..); #X obj 541 142 gemhead; #N canvas 0 0 587 366 image 0; @@ -74,26 +44,22 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 541 161 pd image; -#X obj 586 123 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 586 123 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X text 53 291 Inlet 2: gemlist; #X text 449 67 open two different images; #X text 50 12 Synopsis: [pix_add]; #X text 71 31 Class: pix mix object; #X text 29 67 Description: add 2 images; -#X text 29 91 [pix_add] simply adds two pixes together. It clamps the -images so that they remain in the range of the image. (In other words -\, it is easy to get a white out).; +#X text 29 91 [pix_add] simply adds two pixes together. It clamps the images so that they remain in the range of the image. (In other words \, it is easy to get a white out).; #X obj 451 218 pix_add; #X text 33 137 The 2 images have to be of the same size.; #X obj 527 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 32 0; -#X connect 17 0 21 0; -#X connect 23 0 24 0; -#X connect 24 0 32 1; -#X connect 25 0 24 1; -#X connect 32 0 17 0; +#X obj 451 276 _pix2rectangle 3; +#X obj 520 310 _gemwin; +#X connect 11 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 27 0; +#X connect 18 0 19 0; +#X connect 19 0 27 1; +#X connect 20 0 19 1; +#X connect 27 0 30 0; diff --git a/help/pix_aging-help.pd b/help/pix_aging-help.pd index 1c24f315f..891c80d5d 100644 --- a/help/pix_aging-help.pd +++ b/help/pix_aging-help.pd @@ -1,117 +1,53 @@ #N canvas 6 61 654 446 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 140 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 140 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 345 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 138 cnv 15 190 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 190 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X obj 77 281 pix_buf; -#X msg 103 257 auto 1; -#X obj 103 236 loadbang; -#X text 156 263 [pix_buf] with auto 1 is important if we want to recalculate -our pix-effect each frame but don't want to reload the image all the -time.; -#X connect 0 0 2 0; -#X connect 2 0 6 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X connect 6 0 1 0; -#X connect 7 0 6 0; -#X connect 8 0 7 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 358 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; #X text 50 12 Synopsis: [pix_color]; -#X obj 451 254 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); +#X obj 451 254 _pix2rectangle 3; #X obj 451 216 pix_aging; #X text 11 77 Description: apply a super8-like aging effect; -#X text 16 92 [pix_aging] is an effect that will make your images (better: -films) have a super8-like look.; -#X text 16 123 There are 4 components (color-aging \, light dusts \, -dark pits and vertical scratches) that can be turned on/off individually. -; -#X text 15 168 The number of scratches can be set via the "scratch" -message.; -#X obj 39 399 cnv 15 450 40 empty empty empty 20 12 0 14 -260818 -66577 -0; -#X text 51 407 acknowledgment: this effect is based on effecTV by Kentarou -Fukuchi (http://effectv.sourceforge.net); +#X text 16 92 [pix_aging] is an effect that will make your images (better: films) have a super8-like look.; +#X text 16 123 There are 4 components (color-aging \, light dusts \, dark pits and vertical scratches) that can be turned on/off individually.; +#X text 15 168 The number of scratches can be set via the "scratch" message.; +#X obj 39 399 cnv 15 450 40 empty empty empty 20 12 0 14 #fcac44 #404040 0; +#X text 51 407 acknowledgment: this effect is based on effecTV by Kentarou Fukuchi (http://effectv.sourceforge.net); #X msg 460 160 dust \$1; -#X obj 460 142 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 580 182 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 460 142 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 580 182 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 580 199 pits \$1; #X msg 480 197 coloraging \$1; -#X obj 481 179 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X floatatom 525 143 5 0 0 0 - - -; +#X obj 481 179 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X floatatom 525 143 5 0 0 0 - - - 0; #X msg 525 161 scratch \$1; #X text 63 275 Inlet 1: dust 0|1: add "dust"; #X text 63 290 Inlet 1: pits 0|1: add "pits"; -#X text 63 324 Inlet 1: scratch : add a maximum of # scratches -; +#X text 63 324 Inlet 1: scratch : add a maximum of # scratches; #X text 63 306 Inlet 1: coloraging 0|1: color-bleaching; #X obj 538 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 25 0; -#X connect 25 0 22 0; -#X connect 32 0 25 0; -#X connect 33 0 32 0; -#X connect 34 0 35 0; -#X connect 35 0 25 0; -#X connect 36 0 25 0; -#X connect 37 0 36 0; -#X connect 38 0 39 0; -#X connect 39 0 25 0; +#X obj 520 262 _gemwin; +#X obj 451 113 pix_test; +#X connect 11 0 39 0; +#X connect 18 0 17 0; +#X connect 25 0 18 0; +#X connect 26 0 25 0; +#X connect 27 0 28 0; +#X connect 28 0 18 0; +#X connect 29 0 18 0; +#X connect 30 0 29 0; +#X connect 31 0 32 0; +#X connect 32 0 18 0; +#X connect 39 0 18 0; diff --git a/help/pix_alpha-help.pd b/help/pix_alpha-help.pd index 9e0e73a87..6162e9070 100644 --- a/help/pix_alpha-help.pd +++ b/help/pix_alpha-help.pd @@ -1,47 +1,19 @@ #N canvas 42 278 631 490 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 345 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 345 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 348 Inlets:; #X text 38 435 Outlets:; -#X obj 8 306 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 306 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 305 Arguments:; -#X obj 7 56 cnv 15 430 240 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 56 cnv 15 430 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 421 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 460 pd gemwin; -#X msg 519 441 create; -#X text 515 420 Create window:; -#X obj 450 158 cnv 15 160 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 504 411 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -62,24 +34,13 @@ #X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_alpha]; #X text 29 56 Description: set the alpha values of an RGBA-pix; -#X text 21 229 It defaults to highThresh = 0 0 0 \, lowThresh = 0 0 -0 \, passVal = 0 \, and otherVal = 1 This makes any black pixels totally -transparent.; -#X text 22 170 pix_alpha compares at the color component level \, so -if you wanted pixels with any red and no green or blue in them to be -set to the passVal \, make highThresh = 1 0 0 and lowThresh = 0 0 0 -; -#X text 21 74 pix_alpha sets the alpha values of a pix based on a simple -thresholding. If a pixel value is between the high and low threshold -RGB values \, then the alpha component of the pixel is set to the pass -value. If the pixel value is below the low threshold or above the high -threshold \, then the pixel alpha is set to the other value.; -#X obj 451 283 pix_texture; -#X obj 451 304 square 3; +#X text 21 229 It defaults to highThresh = 0 0 0 \, lowThresh = 0 0 0 \, passVal = 0 \, and otherVal = 1 This makes any black pixels totally transparent.; +#X text 22 170 pix_alpha compares at the color component level \, so if you wanted pixels with any red and no green or blue in them to be set to the passVal \, make highThresh = 1 0 0 and lowThresh = 0 0 0; +#X text 21 74 pix_alpha sets the alpha values of a pix based on a simple thresholding. If a pixel value is between the high and low threshold RGB values \, then the alpha component of the pixel is set to the pass value. If the pixel value is below the low threshold or above the high threshold \, then the pixel alpha is set to the other value.; #X obj 451 110 alpha; #X text 10 276 This obviously only works with RGBA-images; -#X floatatom 465 162 5 0 1 1 pass - -; -#X floatatom 480 182 5 0 1 1 other - -; +#X floatatom 465 162 5 0 1 1 pass - - 0; +#X floatatom 480 182 5 0 1 1 other - - 0; #X msg 494 207 0.6 0.6 0.6; #X msg 509 231 0.2 0.2 0.2; #X obj 445 336 gemhead 1; @@ -92,18 +53,17 @@ threshold \, then the pixel alpha is set to the other value.; #X text 63 400 Inlet 4: : high-threshold (RGB); #X text 63 413 Inlet 4: : low-threshold (RGB); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 30 0; -#X connect 16 0 17 1; -#X connect 17 0 40 0; -#X connect 28 0 29 0; -#X connect 30 0 17 0; -#X connect 32 0 40 1; -#X connect 33 0 40 2; -#X connect 34 0 40 3; -#X connect 35 0 40 4; -#X connect 36 0 39 0; -#X connect 37 0 38 0; -#X connect 39 0 37 0; -#X connect 40 0 28 0; +#X obj 511 416 _gemwin; +#X obj 451 283 _pix2rectangle 3; +#X connect 11 0 25 0; +#X connect 13 0 14 1; +#X connect 14 0 35 0; +#X connect 25 0 14 0; +#X connect 27 0 35 1; +#X connect 28 0 35 2; +#X connect 29 0 35 3; +#X connect 30 0 35 4; +#X connect 31 0 34 0; +#X connect 32 0 33 0; +#X connect 34 0 32 0; +#X connect 35 0 42 0; diff --git a/help/pix_background-help.pd b/help/pix_background-help.pd index 05df91bd1..34dc11e1e 100644 --- a/help/pix_background-help.pd +++ b/help/pix_background-help.pd @@ -1,75 +1,35 @@ #N canvas 436 61 655 437 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 256 cnv 15 430 170 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 256 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 258 Inlets:; #X text 39 390 Outlets:; -#X obj 8 216 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 216 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 215 Arguments:; -#X obj 8 76 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 451 138 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 138 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#X obj 451 233 pix_texture; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #X text 63 226 ; #X text 27 403 Outlet 1: gemlist; #X text 33 272 Inlet 1: gemlist; -#X obj 451 255 square 3; #X msg 464 154 reset; #X text 50 12 Synopsis: [pix_background]; #X text 537 192 threshold; #X text 29 77 Description: separate an objects from background; #X text 33 309 Inlet 1: bang: alias for reset; -#X text 9 92 [pix_background] 'removes' the background of an image -by comparing a static image in memory to an incoming video stream. -all values withing a given range are turned black. for best effect -\, place a camera on a static scene like a blank wall and hit 'reset'. -then set the range control to cover any variance in the background. -when a new object enters the scene it will be the only thing draw against -a black background. use pix_chroma_key or pix_compare to add in images -in place of the black.; -#X text 33 284 Inlet 1: message: reset : reset the background and capture -a new image; +#X text 9 92 [pix_background] 'removes' the background of an image by comparing a static image in memory to an incoming video stream. all values withing a given range are turned black. for best effect \, place a camera on a static scene like a blank wall and hit 'reset'. then set the range control to cover any variance in the background. when a new object enters the scene it will be the only thing draw against a black background. use pix_chroma_key or pix_compare to add in images in place of the black.; +#X text 33 284 Inlet 1: message: reset : reset the background and capture a new image; #X text 34 375 Inlet 2: float: range ( == ); -#X text 34 322 Inlet 2: list: range \; in RGBA mode this is <+-red> -<+-green> <+-blue> \; in YUV-mode this is <+-luma> <+-Cb> <+-Cr> \; -in Gray-mode only the first value is important <+-gray>; +#X text 34 322 Inlet 2: list: range \; in RGBA mode this is <+-red> <+-green> <+-blue> \; in YUV-mode this is <+-luma> <+-Cb> <+-Cr> \; in Gray-mode only the first value is important <+-gray>; #X obj 451 207 pix_background; #X msg 516 177 \$1 \$1 \$1; #X msg 516 142 0.5; -#X floatatom 516 161 5 0 0 0 - - -; +#X floatatom 516 161 5 0 0 0 - - - 0; #N canvas 0 22 599 378 film 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -96,14 +56,13 @@ in Gray-mode only the first value is important <+-gray>; #X text 516 105 open an movie; #X text 509 118 (AVI \, MPEG \, MOV); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 35 0; -#X connect 16 0 35 1; -#X connect 17 0 21 0; -#X connect 22 0 31 0; -#X connect 31 0 17 0; -#X connect 32 0 31 1; -#X connect 33 0 34 0; -#X connect 34 0 32 0; -#X connect 35 0 31 0; +#X obj 451 233 _pix2rectangle 3; +#X obj 519 259 _gemwin; +#X connect 11 0 30 0; +#X connect 13 0 30 1; +#X connect 17 0 26 0; +#X connect 26 0 34 0; +#X connect 27 0 26 1; +#X connect 28 0 29 0; +#X connect 29 0 27 0; +#X connect 30 0 26 0; diff --git a/help/pix_backlight-help.pd b/help/pix_backlight-help.pd index 4ed1b6166..9b74730fd 100644 --- a/help/pix_backlight-help.pd +++ b/help/pix_backlight-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 651 356 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 310 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 451 138 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 138 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,22 +27,17 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 [ ]; #X text 57 323 Outlet 1: gemlist; #X text 63 232 Inlet 1: gemlist; -#X obj 451 255 square 3; #X text 50 12 Synopsis: [pix_backlight]; -#X floatatom 469 153 5 0 0 2 scale - -; -#X floatatom 509 153 5 0 255 2 floor - -; +#X floatatom 469 153 5 0 0 2 scale - - 0; +#X floatatom 509 153 5 0 255 2 floor - - 0; #X obj 509 171 / 255; -#X floatatom 549 153 5 0 255 2 ceiling - -; +#X floatatom 549 153 5 0 255 2 ceiling - - 0; #X obj 549 171 / 255; #X text 29 77 Description: backlighting effect; -#X text 13 91 [pix_backlight] will radially displace pixels depending -on their luminance value \, thus producing a backlighting effect. You -can set the amount of the displacement as well as floor/ceiling limits -\, to produce displacements only within the specified range.; +#X text 13 91 [pix_backlight] will radially displace pixels depending on their luminance value \, thus producing a backlighting effect. You can set the amount of the displacement as well as floor/ceiling limits \, to produce displacements only within the specified range.; #X obj 451 207 pix_backlight; #X text 64 254 Inlet 2: float: scale-factor (default:0.5); #X text 64 268 Inlet 3: float: floor (default:0); @@ -79,16 +46,15 @@ can set the amount of the displacement as well as floor/ceiling limits #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 31 0; -#X connect 18 0 22 0; -#X connect 24 0 35 0; -#X connect 25 0 26 0; -#X connect 26 0 31 2; -#X connect 27 0 28 0; -#X connect 28 0 31 3; -#X connect 31 0 18 0; -#X connect 35 0 31 1; +#X obj 521 259 _gemwin; +#X obj 451 233 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 26 0; +#X connect 19 0 30 0; +#X connect 20 0 21 0; +#X connect 21 0 26 2; +#X connect 22 0 23 0; +#X connect 23 0 26 3; +#X connect 26 0 35 0; +#X connect 30 0 26 1; diff --git a/help/pix_biquad-help.pd b/help/pix_biquad-help.pd index ae5240641..21519dda5 100644 --- a/help/pix_biquad-help.pd +++ b/help/pix_biquad-help.pd @@ -1,53 +1,23 @@ #N canvas 288 289 658 405 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 267 Inlets:; #X text 39 365 Outlets:; -#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 226 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 540 288 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 545 327 pd gemwin; -#X msg 545 308 create; -#X text 541 287 Create window:; -#X obj 451 172 cnv 15 155 105 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 530 303 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 172 cnv 15 155 105 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 17 379 Outlet 1: gemlist; #X text 24 281 Inlet 1: gemlist; -#X obj 451 302 square 3; -#X obj 451 280 pix_texture; #X text 71 31 Class: pix object (timebased effect); #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -67,11 +37,11 @@ #X text 516 104 MS Windows: *.AVI; #X text 523 124 linux: depends...; #X text 29 57 Description: timebased IIR-filter; -#X floatatom 457 191 3 0 1 2 fb0 - -; -#X floatatom 481 191 3 0 1 2 fb1 - -; -#X floatatom 505 191 3 0 1 2 fb2 - -; -#X floatatom 534 191 3 0 1 2 ff1 - -; -#X floatatom 558 191 3 0 1 2 ff2 - -; +#X floatatom 457 191 3 0 1 2 fb0 - - 0; +#X floatatom 481 191 3 0 1 2 fb1 - - 0; +#X floatatom 505 191 3 0 1 2 fb2 - - 0; +#X floatatom 534 191 3 0 1 2 ff1 - - 0; +#X floatatom 558 191 3 0 1 2 ff2 - - 0; #N canvas 0 0 450 300 init 0; #X msg 175 214 0.3; #X msg 247 215 0.6; @@ -121,54 +91,46 @@ #X connect 19 1 8 0; #X connect 20 0 2 0; #X restore 605 174 pd init; -#X obj 605 157 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 605 157 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 534 238 set; -#X text 23 298 Inlet 1: message: set: overwrites the filter-buffers -with the next incoming image.; +#X text 23 298 Inlet 1: message: set: overwrites the filter-buffers with the next incoming image.; #X text 439 378 see also:; #X obj 509 381 pix_tIIR; -#X text 23 76 basically it works like the Pd-object [biquad~] (except -\, that applies to images instead of samples); +#X text 23 76 basically it works like the Pd-object [biquad~] (except \, that applies to images instead of samples); #X text 39 134 y(n) = ff1 * w(n) + ff2 * w(n-1) + ff3 * w(n-2); #X text 40 149 w(n) = fb0 * x(n) + fb1 * w(n-1) + fb2 * w(n-2); -#X text 32 104 the operation can be described by the following difference-equation: -; -#X text 18 166 x(n) describes the input-image \, y(n) is the output-image. -; -#X text 16 183 You can set all buffer-images w(m) to the next input-image -x(n) with the "set"-command.; +#X text 32 104 the operation can be described by the following difference-equation:; +#X text 18 166 x(n) describes the input-image \, y(n) is the output-image.; +#X text 16 183 You can set all buffer-images w(m) to the next input-image x(n) with the "set"-command.; #X text 64 237 list:; #X obj 572 381 biquad~; #X text 50 12 Synopsis: [pix_biquad]; #X obj 451 258 pix_biquad; -#X floatatom 582 191 3 0 1 2 ff3 - -; +#X floatatom 582 191 3 0 1 2 ff3 - - 0; #X obj 457 209 pack 1 0 0 1 0 0; -#X text 22 327 Inlet 1: : the filter-coefficients "fb0 fb1 fb2 -ff1 ff2 ff3"; +#X text 22 327 Inlet 1: : the filter-coefficients "fb0 fb1 fb2 ff1 ff2 ff3"; #X obj 548 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 20 0; -#X connect 18 0 17 0; -#X connect 20 0 50 0; -#X connect 20 2 21 0; -#X connect 21 0 20 1; -#X connect 22 0 23 0; -#X connect 23 0 20 0; -#X connect 30 0 52 0; -#X connect 31 0 52 1; -#X connect 32 0 52 2; -#X connect 33 0 52 3; -#X connect 34 0 52 4; -#X connect 35 0 30 0; -#X connect 35 1 31 0; -#X connect 35 2 32 0; -#X connect 35 3 33 0; -#X connect 35 4 34 0; -#X connect 35 5 51 0; -#X connect 36 0 35 0; -#X connect 37 0 50 0; -#X connect 50 0 18 0; -#X connect 51 0 52 5; -#X connect 52 0 50 0; +#X obj 538 308 _gemwin; +#X obj 451 280 _pix2rectangle 3; +#X connect 11 0 15 0; +#X connect 15 0 45 0; +#X connect 15 2 16 0; +#X connect 16 0 15 1; +#X connect 17 0 18 0; +#X connect 18 0 15 0; +#X connect 25 0 47 0; +#X connect 26 0 47 1; +#X connect 27 0 47 2; +#X connect 28 0 47 3; +#X connect 29 0 47 4; +#X connect 30 0 25 0; +#X connect 30 1 26 0; +#X connect 30 2 27 0; +#X connect 30 3 28 0; +#X connect 30 4 29 0; +#X connect 30 5 46 0; +#X connect 31 0 30 0; +#X connect 32 0 45 0; +#X connect 45 0 51 0; +#X connect 46 0 47 5; +#X connect 47 0 45 0; diff --git a/help/pix_bitmask-help.pd b/help/pix_bitmask-help.pd index 4c9e6a5c7..c058d0aa7 100644 --- a/help/pix_bitmask-help.pd +++ b/help/pix_bitmask-help.pd @@ -1,47 +1,19 @@ #N canvas 43 367 654 380 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 335 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,37 +30,30 @@ #X text 63 216 ; #X text 16 348 Outlet 1: gemlist; #X text 13 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_bitmask]; #X text 13 78 Description: mask out pixels; -#X text 36 94 pix_bitmask uses a bit masking to change the pixels. -If a single mask is used \, the alpha mask is assumed to be 255 (or -\, pass everything).; -#X text 35 137 The mask is an unsigned char \, which means it can go -from 0-255 \, with 0 not passing any bits.; -#X text 34 169 You may need to use pix_gain either before or after -since low bit values will reduce the luminance of the pix.; +#X text 36 94 pix_bitmask uses a bit masking to change the pixels. If a single mask is used \, the alpha mask is assumed to be 255 (or \, pass everything).; +#X text 35 137 The mask is an unsigned char \, which means it can go from 0-255 \, with 0 not passing any bits.; +#X text 34 169 You may need to use pix_gain either before or after since low bit values will reduce the luminance of the pix.; #X obj 451 196 pix_bitmask; -#X floatatom 487 172 5 0 255 2 single - -; +#X floatatom 487 172 5 0 255 2 single - - 0; #X msg 455 158 127; #X msg 455 176 128; #X msg 540 163 255 0 128; #X msg 547 185 0 128 0; -#X text 13 278 Inlet 2: list: mask value for all channels (0..255) -; -#X text 13 295 Inlet 3: list: 3 (RGB) or 4 (RGBA) mask-values in INTeger -(0..255); +#X text 13 278 Inlet 2: list: mask value for all channels (0..255); +#X text 13 295 Inlet 3: list: 3 (RGB) or 4 (RGBA) mask-values in INTeger (0..255); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 29 0; -#X connect 29 0 21 0; -#X connect 30 0 29 1; -#X connect 31 0 30 0; -#X connect 32 0 30 0; -#X connect 33 0 29 2; -#X connect 34 0 29 2; +#X obj 451 233 _pix2rectangle; +#X obj 520 260 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 25 0; +#X connect 25 0 34 0; +#X connect 26 0 25 1; +#X connect 27 0 26 0; +#X connect 28 0 26 0; +#X connect 29 0 25 2; +#X connect 30 0 25 2; diff --git a/help/pix_buf-help.pd b/help/pix_buf-help.pd index ee74ee062..b7d211d06 100644 --- a/help/pix_buf-help.pd +++ b/help/pix_buf-help.pd @@ -9,50 +9,12 @@ #X obj 7 76 cnv 15 430 200 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; +#X obj 474 374 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 450 136 cnv 15 160 110 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 16 438 Outlet 1: gemlist; #X text 23 346 Inlet 1: gemlist; -#X obj 451 273 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_buf] \, [pix_separator]; #X text 29 76 Description: buffer a pix; #X text 11 94 [pix_buf] buffers pixes. This allows you to do some processing which might require a lot of time (for example \, convolution) and store it. All images use a pull system \, so as long as nothing is modified in the pix "upstream" \, the pix_buf is still valid.; @@ -61,19 +23,17 @@ #X obj 487 145 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X msg 487 190 auto \$1; #X obj 487 168 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#X obj 451 251 pix_rds; #X text 11 238 [pix_buf] can be used to separate two gemlists processing the same image-data. Thus is is also called [pix_separator]; #X text 22 362 Inlet 1: bang: copy of input-data to the output and force all subsequent [pix_]-objects to process.; #X text 22 391 Inlet 1: auto 1|0: force image-processing in subsequent objects each render-cycle (default:0); #X obj 518 8 declare -lib Gem; #X text 63 296 the default value to force processing; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 27 0; -#X connect 27 0 31 0; -#X connect 28 0 27 0; -#X connect 29 0 27 0; -#X connect 30 0 29 0; -#X connect 31 0 20 0; +#X obj 481 380 _gemwin; +#X obj 451 251 _pix2rectangle 3; +#X obj 451 113 pix_test; +#X connect 11 0 30 0; +#X connect 19 0 29 0; +#X connect 20 0 19 0; +#X connect 21 0 19 0; +#X connect 22 0 21 0; +#X connect 30 0 19 0; diff --git a/help/pix_buffer_read-help.pd b/help/pix_buffer_read-help.pd index 2566ed0c0..6d22d689d 100644 --- a/help/pix_buffer_read-help.pd +++ b/help/pix_buffer_read-help.pd @@ -1,48 +1,20 @@ #N canvas 48 174 691 406 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 267 Inlets:; #X text 39 352 Outlets:; -#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 226 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 544 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 549 329 pd gemwin; -#X msg 549 310 create; -#X text 545 289 Create window:; -#X obj 451 109 cnv 15 155 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 544 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 109 cnv 15 155 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 17 366 Outlet 1: gemlist; #X text 24 281 Inlet 1: gemlist; -#X obj 451 242 pix_texture; -#X floatatom 560 142 3 0 9 2 index - -; +#X floatatom 560 142 3 0 9 2 index - - 0; #X text 71 31 Class: pix object; #X text 64 237 list: ; #X text 440 363 see also:; @@ -50,26 +22,17 @@ #X text 50 12 Synopsis: [pix_buffer_read]; #X text 29 57 Description: read from a [pix_buffer]; #X obj 451 168 pix_buffer_read depot; -#X obj 451 271 translate -2 0 1 0; -#X obj 451 292 square 1.9; -#X text 24 295 Inlet 1: message: set : read from another -buffer.; -#X text 24 320 Inlet 2: int: index of the frame in the named pix_buffer -to read.; -#X text 11 79 [pix_buffer_read] reads an image from the named buffer -provided by [pix_buffer]. Specify the frame of the buffer you want -to read via the second inlet. If no frame is stored at the specified -index \, you will get no image. (eg: no texture will be applied). You -can change the buffer to read from on the fly via the [set( message. -; +#X obj 451 221 translate -2 0 1 0; +#X text 24 295 Inlet 1: message: set : read from another buffer.; +#X text 24 320 Inlet 2: int: index of the frame in the named pix_buffer to read.; +#X text 11 79 [pix_buffer_read] reads an image from the named buffer provided by [pix_buffer]. Specify the frame of the buffer you want to read via the second inlet. If no frame is stored at the specified index \, you will get no image. (eg: no texture will be applied). You can change the buffer to read from on the fly via the [set( message.; #X msg 464 138 set depot3; #X obj 508 362 pix_buffer depot3 1; #X obj 548 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 25 0; -#X connect 17 0 26 0; -#X connect 18 0 25 1; -#X connect 25 0 17 0; -#X connect 26 0 27 0; -#X connect 31 0 25 0; +#X obj 548 295 _gemwin; +#X obj 451 242 _pix2rectangle 1.9; +#X connect 11 0 21 0; +#X connect 14 0 21 1; +#X connect 21 0 22 0; +#X connect 22 0 30 0; +#X connect 26 0 21 0; diff --git a/help/pix_buffer_write-help.pd b/help/pix_buffer_write-help.pd index 7e08da48d..ee6ae2cd1 100644 --- a/help/pix_buffer_write-help.pd +++ b/help/pix_buffer_write-help.pd @@ -1,51 +1,22 @@ #N canvas 19 61 654 413 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 267 Inlets:; #X text 39 352 Outlets:; -#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 226 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 536 293 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 541 332 pd gemwin; -#X msg 541 313 create; -#X text 537 292 Create window:; -#X obj 451 179 cnv 15 155 70 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 536 293 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 179 cnv 15 155 70 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 17 366 Outlet 1: gemlist; #X text 24 281 Inlet 1: gemlist; -#X obj 451 252 pix_texture; #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -64,37 +35,30 @@ #X text 523 114 macOS: quicktime; #X text 516 104 MS Windows: *.AVI; #X text 523 124 linux: depends...; -#X floatatom 560 196 3 0 9 2 index - -; +#X floatatom 560 196 3 0 9 2 index - - 0; #X text 50 12 Synopsis: [pix_buffer_write]; #X text 71 31 Class: pix object; #X obj 451 222 pix_buffer_write depot; #X text 24 320 Inlet 2: int: index in the named pix_buffer.; #X msg 464 192 set depot2; -#X text 11 79 [pix_buffer_write] writes an image into a named buffer -created by the [pix_buffer] object. When the index of the frame in -the buffer is passed via the second inlet to [pix_buffer_write] \, -the NEXT incoming image will be written to the buffer \, and the internal -state is reset. You have to re-set the index to write again.; +#X text 11 79 [pix_buffer_write] writes an image into a named buffer created by the [pix_buffer] object. When the index of the frame in the buffer is passed via the second inlet to [pix_buffer_write] \, the NEXT incoming image will be written to the buffer \, and the internal state is reset. You have to re-set the index to write again.; #X text 64 237 list: ; -#X text 24 295 Inlet 1: message: set : write to another -buffer.; +#X text 24 295 Inlet 1: message: set : write to another buffer.; #X text 440 363 see also:; #X obj 508 382 pix_buffer_read; #X obj 507 362 pix_buffer depot2 1; #X text 29 57 Description: write images to a [pix_buffer]; -#X obj 451 272 translate 2 0 1 0; -#X obj 451 292 square 1.9; #X obj 548 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 18 0; -#X connect 17 0 40 0; -#X connect 18 0 30 0; -#X connect 18 2 19 0; -#X connect 19 0 18 1; -#X connect 20 0 21 0; -#X connect 21 0 18 0; -#X connect 27 0 30 1; -#X connect 30 0 17 0; -#X connect 32 0 30 0; -#X connect 40 0 41 0; +#X obj 541 298 _gemwin; +#X obj 451 252 translate 2 0 1 0; +#X obj 451 272 _pix2rectangle 1.9; +#X connect 11 0 14 0; +#X connect 14 0 26 0; +#X connect 14 2 15 0; +#X connect 15 0 14 1; +#X connect 16 0 17 0; +#X connect 17 0 14 0; +#X connect 23 0 26 1; +#X connect 26 0 38 0; +#X connect 28 0 26 0; +#X connect 38 0 39 0; diff --git a/help/pix_chroma_key-help.pd b/help/pix_chroma_key-help.pd index 610f36e33..9daa749d5 100644 --- a/help/pix_chroma_key-help.pd +++ b/help/pix_chroma_key-help.pd @@ -10,35 +10,12 @@ #X obj 449 77 cnv 15 195 345 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 518 430 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 523 469 pd gemwin; -#X msg 523 450 create; -#X text 515 429 Create window:; #X obj 451 185 cnv 15 160 175 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 119 gemhead; #X obj 496 101 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; -#X obj 451 370 pix_texture; #X text 63 302 ; #X text 18 516 Outlet 1: gemlist; #X text 15 342 Inlet 1: gemlist; -#X obj 451 398 square 3; #X obj 580 120 gemhead; #X obj 625 102 bng 15 250 50 0 empty empty empty 20 8 0 8 #fcfcfc #000000 #000000; #X text 16 483 Inlet 2: gemlist; @@ -103,23 +80,22 @@ #X obj 580 162 pix_rgba; #X text 511 155 or [pix_yuv], f 9; #X text 15 215 RGB values are 0-1 \, YUV values are 16/255-239/255. It is strongly advised to convert explicitly to your preferred colorspace before [pix_chroma_key] because the default colorspace is not guaranteed to be the same across operating systems (see [pix_rgba] or [pix_yuv]).; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 41 0; -#X connect 15 0 41 1; -#X connect 16 0 20 0; -#X connect 21 0 43 0; -#X connect 22 0 43 1; -#X connect 27 0 16 0; -#X connect 28 0 27 0; -#X connect 29 0 28 0; -#X connect 31 0 39 0; -#X connect 32 0 40 0; -#X connect 37 0 32 0; -#X connect 38 0 31 0; -#X connect 39 0 27 0; -#X connect 40 0 27 0; -#X connect 41 0 45 0; -#X connect 43 0 46 0; -#X connect 45 0 27 0; -#X connect 46 0 27 1; +#X obj 451 370 _pix2rectangle 3; +#X obj 526 436 _gemwin; +#X connect 11 0 36 0; +#X connect 12 0 36 1; +#X connect 16 0 38 0; +#X connect 17 0 38 1; +#X connect 22 0 44 0; +#X connect 23 0 22 0; +#X connect 24 0 23 0; +#X connect 26 0 34 0; +#X connect 27 0 35 0; +#X connect 32 0 27 0; +#X connect 33 0 26 0; +#X connect 34 0 22 0; +#X connect 35 0 22 0; +#X connect 36 0 40 0; +#X connect 38 0 41 0; +#X connect 40 0 22 0; +#X connect 41 0 22 1; diff --git a/help/pix_color-help.pd b/help/pix_color-help.pd index 75fe4c841..497406277 100644 --- a/help/pix_color-help.pd +++ b/help/pix_color-help.pd @@ -1,60 +1,18 @@ #N canvas 6 61 630 343 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; @@ -62,24 +20,16 @@ #X text 29 76 Description: set the colour-channels of an image; #X msg 527 165 0 0.5 0.8; #X obj 451 196 pix_color; -#X obj 451 233 pix_draw; #X msg 458 164 1 0 0 1; -#X text 42 95 [pix_color] sets each pixel of an image to a certain -RGBA-value. As this is a pix_fx \, you will need an image first \, -to set its pixels to a certain value.; +#X text 42 95 [pix_color] sets each pixel of an image to a certain RGBA-value. As this is a pix_fx \, you will need an image first \, to set its pixels to a certain value.; #X text 63 275 Inlet 2: list: 3 (RGB) or 4 (RGBA) values; -#X text 29 133 Note that this is done by the CPU in the main-memory -of your machine \, while [color] is can be done very fast by your graphics-card. -Generally it is NOT a good idea to use [pix_color] if the same result -can be achieved with the [color] object !; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 23 0 24 1; -#X connect 24 0 25 0; -#X connect 26 0 24 1; +#X obj 524 259 _gemwin; +#X obj 451 113 pix_test; +#X text 29 133 Note that this is done by the CPU in the main-memory of your machine \, while [color] can be done very fast by your graphics-card. Generally it is NOT a good idea to use [pix_color] if the same result can be achieved with the [color] object !; +#X obj 451 233 _pix2rectangle 3; +#X connect 11 0 25 0; +#X connect 18 0 19 1; +#X connect 19 0 27 0; +#X connect 20 0 19 1; +#X connect 25 0 19 0; diff --git a/help/pix_coloralpha-help.pd b/help/pix_coloralpha-help.pd index cb18ac82c..8cd684e7a 100644 --- a/help/pix_coloralpha-help.pd +++ b/help/pix_coloralpha-help.pd @@ -1,91 +1,42 @@ -#N canvas 75 61 633 341 10; +#N canvas 443 230 633 358 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 520 218 cnv 15 90 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 525 257 pd gemwin; -#X msg 525 238 create; -#X text 521 218 Create window:; -#X obj 450 138 cnv 15 160 50 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 520 238 cnv 15 90 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 50 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 162 pix_coloralpha; -#X obj 451 196 pix_texture; -#X obj 451 240 square 3; -#X obj 451 218 alpha; -#X obj 452 265 gemhead 1; -#X obj 452 305 sphere; +#X obj 452 285 gemhead 1; +#X obj 452 325 sphere; #X text 50 12 Synopsis: [pix_coloralpha]; -#X text 19 76 Description: calculate the Alpha-channels from the RGB-data -; -#X text 28 102 [pix_coloralpha] will set the alpha-channel to be the -mean-value of the RGB-triple for each pixel.; -#X text 16 155 This of course \, makes only sense with RGBA-images. -; -#X obj 452 285 translate 2 0 0 -1; +#X text 19 76 Description: calculate the Alpha-channels from the RGB-data; +#X text 28 102 [pix_coloralpha] will set the alpha-channel to be the mean-value of the RGB-triple for each pixel.; +#X text 16 155 This of course \, makes only sense with RGBA-images.; #X text 63 275 Inlet 1: 1|0 : turn on/off (default:1); -#X obj 467 142 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; +#X obj 467 142 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 23 0; -#X connect 23 0 24 0; -#X connect 24 0 26 0; -#X connect 26 0 25 0; -#X connect 27 0 33 0; -#X connect 33 0 28 0; -#X connect 35 0 23 0; +#X obj 522 244 _gemwin; +#X obj 451 113 pix_test; +#X obj 451 196 alpha; +#X obj 451 218 _pix2rectangle 3; +#X obj 452 305 translateXYZ 0 0 -2; +#X floatatom 457 256 5 -4 4 0 - - - 0; +#X connect 11 0 27 0; +#X connect 16 0 28 0; +#X connect 17 0 30 0; +#X connect 24 0 16 0; +#X connect 27 0 16 0; +#X connect 28 0 29 0; +#X connect 30 0 18 0; +#X connect 31 0 30 1; diff --git a/help/pix_colorclassify-help.pd b/help/pix_colorclassify-help.pd index 3e236fbd1..ab38c5e62 100644 --- a/help/pix_colorclassify-help.pd +++ b/help/pix_colorclassify-help.pd @@ -1,47 +1,19 @@ #N canvas 117 177 635 396 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 39 246 Outlets:; -#X obj 8 158 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 158 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 157 Arguments:; -#X obj 8 76 cnv 15 430 75 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 75 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,37 +27,25 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 168 ; -#X obj 451 255 square 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 29 77 Description: detects color classes in an image; -#X obj 8 324 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 324 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 16 323 See Also:; #X text 62 334 examples/04.video/08.color_detection.pd; #X text 56 212 Inlet 1: gemlist \, RGBA image; -#X text 57 232 Inlet 2: whether to output unreliable guesses (todo) -; -#X text 57 259 Outlet 1: gemlist \, RGBA image with encoded color class -representatives for each pixel: red [1 0 0] \, green [0 1 0] \, blue -[0 0 1] \, yellow [1 1 0] \, black [0 0 0] \, white [1 1 1] \, unsure -[154/255 \, 115/255 \, 86/255]; +#X text 57 232 Inlet 2: whether to output unreliable guesses (todo); +#X text 57 259 Outlet 1: gemlist \, RGBA image with encoded color class representatives for each pixel: red [1 0 0] \, green [0 1 0] \, blue [0 0 1] \, yellow [1 1 0] \, black [0 0 0] \, white [1 1 1] \, unsure [154/255 \, 115/255 \, 86/255]; #X obj 451 180 pix_colorclassify; -#X text 16 357 Author: Ricardo Fabbri labmacambira.sf.net rfabbri at -gmail; -#X text 42 95 [pix_colorclassify] will detect colors in a pixImage -\, classifying each pixel into 6 classes: red \, green \, blue \, yellow -\, black \, white \, or 'uncertain'. It will only detect a color if -it is unambiguous.; +#X text 16 357 Author: Ricardo Fabbri labmacambira.sf.net rfabbri at gmail; +#X text 42 95 [pix_colorclassify] will detect colors in a pixImage \, classifying each pixel into 6 classes: red \, green \, blue \, yellow \, black \, white \, or 'uncertain'. It will only detect a color if it is unambiguous.; #X text 50 12 Synopsis: [pix_colorclassify]; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 30 0; -#X connect 18 0 20 0; -#X connect 30 0 18 0; +#X obj 521 258 _gemwin; +#X obj 451 233 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 25 0; +#X connect 25 0 31 0; #X coords 0 0 1 1 85 60 0; diff --git a/help/pix_colormatrix-help.pd b/help/pix_colormatrix-help.pd index d143db80b..f643cc27d 100644 --- a/help/pix_colormatrix-help.pd +++ b/help/pix_colormatrix-help.pd @@ -1,75 +1,26 @@ -#N canvas 76 273 636 411 10; +#N canvas 409 270 636 411 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 295 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 295 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 298 Inlets:; #X text 38 355 Outlets:; -#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 255 Arguments:; -#X obj 7 76 cnv 15 430 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 443 77 cnv 15 180 310 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 443 77 cnv 15 180 310 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 314 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 353 pd gemwin; -#X msg 519 334 create; -#X text 515 313 Create window:; -#X obj 450 138 cnv 15 160 150 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 314 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 150 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 266 ; #X text 56 368 Outlet 1: gemlist; #X text 63 312 Inlet 1: gemlist; -#X obj 451 293 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_colormatrix]; #X text 29 76 Description: transform the pixel values by a matrix; -#X text 63 325 Inlet 2: list: 9 (RGB) or 16 (RGBA) values \, forming -a matrix.; -#X text 12 94 pix_colormatrix transforms the pixel values by a matrix. -The matrix can be either a 3x3 or a 4x4. If the matrix is a 3x3 \, -then the alpha is set to 1; -#X text 12 135 See the HTML file from Paul Haberli for example matrices. -; +#X text 63 325 Inlet 2: list: 9 (RGB) or 16 (RGBA) values \, forming a matrix.; +#X text 12 94 pix_colormatrix transforms the pixel values by a matrix. The matrix can be either a 3x3 or a 4x4. If the matrix is a 3x3 \, then the alpha is set to 1; +#X text 12 135 See the HTML file from Paul Haberli for example matrices.; #X text 135 159 the matrix; #X text 194 226 r g b a; #X text 194 211 r g b a; @@ -79,82 +30,124 @@ then the alpha is set to 1; #X text 93 204 r g b; #X text 94 221 r g b; #X obj 451 266 pix_colormatrix; -#X floatatom 495 165 3 -1 2 0 - - -; -#X floatatom 518 165 3 -1 2 0 - - -; -#X floatatom 541 165 3 -1 2 0 - - -; -#X floatatom 495 189 3 -1 2 0 - - -; -#X floatatom 518 189 3 -1 2 0 - - -; -#X floatatom 541 189 3 -1 2 0 - - -; -#X floatatom 495 213 3 -1 2 0 - - -; -#X floatatom 518 213 3 -1 2 0 - - -; -#X floatatom 541 213 3 -1 2 0 - - -; -#N canvas 0 0 450 300 pack 0; -#X obj 69 169 pack 0 0 0 0 0 0 0 0 0; -#X obj 69 139 t b f; -#X obj 106 139 t b f; -#X obj 143 139 t b f; -#X obj 180 139 t b f; -#X obj 217 139 t b f; -#X obj 254 139 t b f; -#X obj 291 139 t b f; -#X obj 328 139 t b f; -#X obj 32 111 inlet; -#X obj 69 111 inlet; -#X obj 106 111 inlet; -#X obj 143 111 inlet; -#X obj 180 111 inlet; -#X obj 217 111 inlet; -#X obj 254 111 inlet; -#X obj 291 111 inlet; -#X obj 328 111 inlet; -#X obj 69 196 outlet; -#X connect 0 0 18 0; -#X connect 1 0 0 0; -#X connect 1 1 0 1; -#X connect 2 0 0 0; -#X connect 2 1 0 2; -#X connect 3 0 0 0; -#X connect 3 1 0 3; -#X connect 4 0 0 0; -#X connect 4 1 0 4; -#X connect 5 0 0 0; -#X connect 5 1 0 5; -#X connect 6 0 0 0; -#X connect 6 1 0 6; -#X connect 7 0 0 0; -#X connect 7 1 0 7; -#X connect 8 0 0 0; -#X connect 8 1 0 8; -#X connect 9 0 0 0; -#X connect 10 0 1 0; -#X connect 11 0 2 0; -#X connect 12 0 3 0; -#X connect 13 0 4 0; -#X connect 14 0 5 0; -#X connect 15 0 6 0; -#X connect 16 0 7 0; -#X connect 17 0 8 0; -#X restore 474 236 pd pack 9 . . .; -#X msg 471 164 1; -#X obj 471 145 loadbang; +#X floatatom 495 145 3 -1 2 0 - \$0-1/1 \$0-1/1- 0; +#X floatatom 518 145 3 -1 2 0 - \$0-2/1 \$0-2/1- 0; +#X floatatom 541 145 3 -1 2 0 - \$0-3/1 \$0-3/1- 0; +#X floatatom 495 165 3 -1 2 0 - \$0-1/2 \$0-1/2- 0; +#X floatatom 518 165 3 -1 2 0 - \$0-2/2 \$0-2/2- 0; +#X floatatom 541 165 3 -1 2 0 - \$0-3/2 \$0-3/2- 0; +#X floatatom 495 185 3 -1 2 0 - \$0-1/3 \$0-1/3- 0; +#X floatatom 518 185 3 -1 2 0 - \$0-2/3 \$0-2/3- 0; +#X floatatom 541 185 3 -1 2 0 - \$0-3/3 \$0-3/3- 0; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 37 0; -#X connect 37 0 21 0; -#X connect 38 0 47 0; -#X connect 39 0 47 1; -#X connect 40 0 47 2; -#X connect 41 0 47 3; -#X connect 42 0 47 4; -#X connect 43 0 47 5; -#X connect 44 0 47 6; -#X connect 45 0 47 7; -#X connect 46 0 47 8; -#X connect 47 0 37 1; -#X connect 48 0 38 0; -#X connect 48 0 42 0; -#X connect 48 0 46 0; -#X connect 49 0 48 0; +#X obj 520 317 _gemwin; +#X obj 451 293 _pix2rectangle 3; +#X obj 451 113 pix_test; +#N canvas 1221 289 450 576 init 1; +#X obj 76 108 unpack 0 0 0 0 0 0 0 0 0; +#X obj 76 131 s \$0-1/1; +#X obj 76 151 s \$0-1/2; +#X obj 76 171 s \$0-1/3; +#X obj 136 131 s \$0-2/1; +#X obj 136 151 s \$0-2/2; +#X obj 136 171 s \$0-2/3; +#X obj 196 131 s \$0-3/1; +#X obj 196 151 s \$0-3/2; +#X obj 196 171 s \$0-3/3; +#X msg 76 49 1 0 0 0 1 0 0 0 1; +#X obj 19 485 outlet; +#X obj 26 200 r \$0-1/1-; +#X obj 26 252 r \$0-1/2-; +#X obj 26 301 r \$0-1/3-; +#X obj 86 200 r \$0-2/1-; +#X obj 86 251 r \$0-2/2-; +#X obj 86 301 r \$0-2/3-; +#X obj 146 200 r \$0-3/1-; +#X obj 146 251 r \$0-3/2-; +#X obj 146 301 r \$0-3/3-; +#X obj 19 356 t b; +#X obj 26 223 t a a; +#X obj 26 275 t a a; +#X obj 26 324 t a a; +#X obj 86 223 t a a; +#X obj 86 274 t a a; +#X obj 86 324 t a a; +#X obj 146 223 t a a; +#X obj 146 274 t a a; +#X obj 146 324 t a a; +#X obj 270 60 inlet preset; +#X obj 76 27 loadbang; +#X msg 84 74 0 0 1 0 1 0 1 0 0; +#X msg 275 123 1 3; +#X obj 275 146 /; +#X msg 275 169 \$1 \$1 \$1 \$1 \$1 \$1 \$1 \$1 \$1; +#X obj 19 430 route 0; +#X obj 19 407 pack 0 0 0 0 0 0 0 0 0 0; +#X obj 270 83 select 0 1 2 3 4 5; +#X msg 272 196 1 1 1 0 0 0 0 0 0; +#X msg 272 226 0 0 0 1 1 1 0 0 0; +#X msg 273 256 0 0 0 0 0 0 1 1 1; +#X connect 0 0 1 0; +#X connect 0 1 2 0; +#X connect 0 2 3 0; +#X connect 0 3 4 0; +#X connect 0 4 5 0; +#X connect 0 5 6 0; +#X connect 0 6 7 0; +#X connect 0 7 8 0; +#X connect 0 8 9 0; +#X connect 10 0 0 0; +#X connect 12 0 22 0; +#X connect 13 0 23 0; +#X connect 14 0 24 0; +#X connect 15 0 25 0; +#X connect 16 0 26 0; +#X connect 17 0 27 0; +#X connect 18 0 28 0; +#X connect 19 0 29 0; +#X connect 20 0 30 0; +#X connect 21 0 38 0; +#X connect 22 0 21 0; +#X connect 22 1 38 1; +#X connect 23 0 21 0; +#X connect 23 1 38 2; +#X connect 24 0 21 0; +#X connect 24 1 38 3; +#X connect 25 0 21 0; +#X connect 25 1 38 4; +#X connect 26 0 21 0; +#X connect 26 1 38 5; +#X connect 27 0 21 0; +#X connect 27 1 38 6; +#X connect 28 0 21 0; +#X connect 28 1 38 7; +#X connect 29 0 21 0; +#X connect 29 1 38 8; +#X connect 30 0 21 0; +#X connect 30 1 38 9; +#X connect 31 0 39 0; +#X connect 32 0 10 0; +#X connect 33 0 0 0; +#X connect 34 0 35 0; +#X connect 35 0 36 0; +#X connect 36 0 0 0; +#X connect 37 0 11 0; +#X connect 38 0 37 0; +#X connect 39 0 10 0; +#X connect 39 1 33 0; +#X connect 39 2 34 0; +#X connect 39 3 40 0; +#X connect 39 4 41 0; +#X connect 39 5 42 0; +#X connect 40 0 0 0; +#X connect 41 0 0 0; +#X connect 42 0 0 0; +#X restore 456 208 pd init; +#X obj 508 208 hradio 18 1 0 6 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0; +#X listbox 456 231 20 0 0 0 - - - 0; +#X connect 11 0 42 0; +#X connect 29 0 41 0; +#X connect 42 0 29 0; +#X connect 43 0 45 0; +#X connect 44 0 43 0; +#X connect 45 0 29 1; diff --git a/help/pix_colorreduce-help.pd b/help/pix_colorreduce-help.pd index 890b2cf45..14aee84bc 100644 --- a/help/pix_colorreduce-help.pd +++ b/help/pix_colorreduce-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 631 342 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 39 282 Outlets:; -#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 76 cnv 15 430 75 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 75 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,34 +27,28 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 166 ; #X text 57 295 Outlet 1: gemlist; #X text 63 212 Inlet 1: gemlist; #X obj 451 196 pix_colorreduce; #X text 50 12 Synopsis: [pix_colorreduce]; -#X text 29 77 Description: reduce the number of colour in the image -; -#X text 42 95 [pix_colorreduce] will reduce the number of colours in -a pixImage \, based on statistical information of the image.; +#X text 29 77 Description: reduce the number of colour in the image; +#X text 42 95 [pix_colorreduce] will reduce the number of colours in a pixImage \, based on statistical information of the image.; #X text 64 232 Inlet 2: float: number of colours; #X text 64 247 Inlet 3: float: persistency of the palette; #X text 64 262 Inlet 4: float: edge smoothing; -#X floatatom 464 178 5 0 255 2 number - -; -#X floatatom 516 178 5 0 1 2 persist - -; -#X obj 451 255 square 3; -#X obj 569 176 tgl 15 0 empty empty smooth 0 -6 0 8 -262144 -1 -1 0 -1; +#X floatatom 464 178 5 0 255 2 number - - 0; +#X floatatom 516 178 5 0 1 2 persist - - 0; +#X obj 569 176 tgl 15 0 empty empty smooth 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 22 0; -#X connect 18 0 31 0; -#X connect 22 0 18 0; -#X connect 29 0 22 1; -#X connect 30 0 22 2; -#X connect 32 0 22 3; +#X obj 522 258 _gemwin; +#X obj 451 233 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 18 0; +#X connect 18 0 32 0; +#X connect 25 0 18 1; +#X connect 26 0 18 2; +#X connect 27 0 18 3; diff --git a/help/pix_compare-help.pd b/help/pix_compare-help.pd index e1c2f6ae9..789bbfa2c 100644 --- a/help/pix_compare-help.pd +++ b/help/pix_compare-help.pd @@ -1,47 +1,19 @@ #N canvas 69 186 628 389 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 228 Inlets:; #X text 39 294 Outlets:; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 66 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 66 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 49 Example:; -#X obj 514 279 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 318 pd gemwin; -#X msg 519 299 create; -#X text 515 278 Create window:; -#X obj 451 157 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 279 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 157 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 112 gemhead; #X text 71 31 Class: pix object; -#X obj 496 95 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 496 95 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,11 +27,9 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 131 pd image; -#X obj 451 252 pix_texture; #X text 63 196 ; #X text 47 308 Outlet 1: gemlist; #X text 53 242 Inlet 1: gemlist; -#X obj 451 274 square 3; #X text 503 77 (JPEG \, TIFF \, ..); #X obj 541 115 gemhead; #N canvas 0 22 587 366 image 0; @@ -75,37 +45,28 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 541 134 pd image; -#X obj 586 96 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 586 96 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X msg 491 185 direction \$1; -#X obj 491 167 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 491 167 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 50 12 Synopsis: [pix_compare]; #X text 29 67 Description: mix 2 images based on their luminance; #X text 53 281 Inlet 2: gemlist; #X obj 451 215 pix_compare; -#X text 53 254 Inlet 1: message: direction [0|1]: take lower or higher(default) -valued pixel; +#X text 53 254 Inlet 1: message: direction [0|1]: take lower or higher(default) valued pixel; #X text 449 66 open two different images; -#X text 18 81 [pix_compare] compares two images pixel by pixel and -outputs a composite image. [pix_compare] can do a greater than comparison -where a brighter pixel in the right stream will replace the corresponding -pixel in the left stream or the comparison can be reversed and the -dimmer pixel can be replaced. this operation works best using YUV but -can also be effective in RGB.; +#X text 18 81 [pix_compare] compares two images pixel by pixel and outputs a composite image. [pix_compare] can do a greater than comparison where a brighter pixel in the right stream will replace the corresponding pixel in the left stream or the comparison can be reversed and the dimmer pixel can be replaced. this operation works best using YUV but can also be effective in RGB.; #X text 33 354 see also:; #X obj 99 355 pix_diff; #X obj 159 355 pix_subtract; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 32 0; -#X connect 18 0 22 0; -#X connect 24 0 25 0; -#X connect 25 0 32 1; -#X connect 26 0 25 1; -#X connect 27 0 32 0; -#X connect 28 0 27 0; -#X connect 32 0 18 0; +#X obj 451 252 _pix2rectangle 3; +#X obj 521 283 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 27 0; +#X connect 19 0 20 0; +#X connect 20 0 27 1; +#X connect 21 0 20 1; +#X connect 22 0 27 0; +#X connect 23 0 22 0; +#X connect 27 0 35 0; diff --git a/help/pix_composite-help.pd b/help/pix_composite-help.pd index 661d21ce9..4930cd687 100644 --- a/help/pix_composite-help.pd +++ b/help/pix_composite-help.pd @@ -1,46 +1,18 @@ #N canvas 6 252 639 381 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 39 304 Outlets:; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 329 pd gemwin; -#X msg 519 310 create; -#X text 515 289 Create window:; -#X obj 451 208 cnv 15 160 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 208 cnv 15 160 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 122 gemhead; -#X obj 496 105 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 496 105 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -54,11 +26,9 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 141 pd image; -#X obj 451 263 pix_texture; #X text 63 196 ; #X text 47 318 Outlet 1: gemlist; #X text 53 262 Inlet 1: gemlist; -#X obj 451 285 square 3; #X text 503 88 (JPEG \, TIFF \, ..); #X obj 547 122 gemhead; #N canvas 0 0 587 366 image 0; @@ -74,8 +44,7 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 547 141 pd image; -#X obj 592 105 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 592 105 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X text 53 291 Inlet 2: gemlist; #X text 449 77 open two different images; #X text 71 31 Class: pix mix object; @@ -83,18 +52,16 @@ #X obj 451 218 pix_composite; #X text 50 12 Synopsis: [pix_composite]; #X text 29 67 Description: alpha-blend 2 images; -#X text 13 84 [pix_composite] mixes two pixes together based on the -alpha value of the 1st pix.; +#X text 13 84 [pix_composite] mixes two pixes together based on the alpha value of the 1st pix.; #X obj 451 166 pix_coloralpha; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 34 0; -#X connect 17 0 21 0; -#X connect 23 0 24 0; -#X connect 24 0 30 1; -#X connect 25 0 24 1; -#X connect 30 0 17 0; -#X connect 34 0 30 0; +#X obj 519 295 _gemwin; +#X obj 451 263 _pix2rectangle 3; +#X connect 11 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 29 0; +#X connect 18 0 19 0; +#X connect 19 0 25 1; +#X connect 20 0 19 1; +#X connect 25 0 32 0; +#X connect 29 0 25 0; diff --git a/help/pix_contrast-help.pd b/help/pix_contrast-help.pd index f4ee19fb4..bb6eb9e52 100644 --- a/help/pix_contrast-help.pd +++ b/help/pix_contrast-help.pd @@ -1,47 +1,19 @@ #N canvas 59 276 630 345 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 225 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 225 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 232 Inlets:; #X text 38 295 Outlets:; -#X obj 8 184 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 184 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 183 Arguments:; -#X obj 7 76 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 138 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,28 +30,23 @@ #X text 63 194 [ []]; #X text 56 308 Outlet 1: gemlist; #X text 63 246 Inlet 1: gemlist; -#X obj 451 233 pix_draw; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 196 pix_contrast; #X text 50 12 Synopsis: [pix_contrast]; -#X text 29 76 Description: change contrast and saturation of an image -; -#X text 17 97 [pix_contrast] will modify the contrast and saturation -of an image. When processing greyscale images \, only the contrast -can be modified (since there is no hue); -#X floatatom 490 148 5 0 10 1 contrast - -; -#X floatatom 530 175 5 0 0 0 saturation - -; -#X text 21 141 A contrast (or saturation) of "1" will not change the -image. Both contrast and saturation modifiers must be >=0!; +#X text 29 76 Description: change contrast and saturation of an image; +#X text 17 97 [pix_contrast] will modify the contrast and saturation of an image. When processing greyscale images \, only the contrast can be modified (since there is no hue); +#X floatatom 490 148 5 0 10 1 contrast - - 0; +#X floatatom 530 175 5 0 0 0 saturation - - 0; +#X text 21 141 A contrast (or saturation) of "1" will not change the image. Both contrast and saturation modifiers must be >=0!; #X text 63 261 Inlet 2: float: contrast (>=0. default:1); #X text 63 274 Inlet 3: float: saturation (>=0. default:1); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 24 0 21 0; -#X connect 28 0 24 1; -#X connect 29 0 24 2; +#X obj 451 233 _pix2rectangle 3; +#X obj 520 263 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 20 0; +#X connect 20 0 30 0; +#X connect 24 0 20 1; +#X connect 25 0 20 2; diff --git a/help/pix_convert-help.pd b/help/pix_convert-help.pd index 317d82954..941e19676 100644 --- a/help/pix_convert-help.pd +++ b/help/pix_convert-help.pd @@ -1,80 +1,27 @@ #N canvas 473 61 629 372 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 135 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 135 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X obj 77 290 pix_buf; -#X msg 99 267 auto 1; -#X obj 99 246 loadbang; -#X connect 0 0 2 0; -#X connect 2 0 6 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X connect 6 0 1 0; -#X connect 7 0 6 0; -#X connect 8 0 7 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X text 22 93 Images can be stored in various formats/color-spaces. -; +#X text 22 93 Images can be stored in various formats/color-spaces.; #X text 62 339 see also:; #X obj 205 338 pix_yuv; #X obj 138 338 pix_grey; -#X text 22 107 GREY-scale images have no color-component \, while YUV -is missing the Alpha-channel.; -#X text 19 133 Traditionally \, RGBA is the native colour-space of -Gem \, although it is quite CPU-consumptive.; +#X text 22 107 GREY-scale images have no color-component \, while YUV is missing the Alpha-channel.; +#X text 19 133 Traditionally \, RGBA is the native colour-space of Gem \, although it is quite CPU-consumptive.; #X obj 451 206 pix_convert; #X msg 477 183 color \$1; #X obj 477 163 symbol; @@ -84,22 +31,17 @@ Gem \, although it is quite CPU-consumptive.; #X text 50 12 Synopsis: [pix_convert]; #X text 15 77 Description: convert the colorspace of an image; #X obj 265 338 pix_rgba; -#X text 63 276 Inlet 1: color :: colorspace to convert to -; -#X text 19 159 You can use [pix_convert] to convert images of any format -into a format you can choose.; -#X obj 451 233 pix_texture; -#X obj 451 256 square 3; +#X text 63 276 Inlet 1: color :: colorspace to convert to; +#X text 19 159 You can use [pix_convert] to convert images of any format into a format you can choose.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 29 0; -#X connect 29 0 40 0; -#X connect 30 0 29 0; -#X connect 31 0 30 0; -#X connect 32 0 31 0; -#X connect 33 0 31 0; -#X connect 34 0 31 0; -#X connect 40 0 41 0; +#X obj 451 233 _pix2rectangle 3; +#X obj 451 113 pix_test; +#X obj 521 260 _gemwin; +#X connect 11 0 35 0; +#X connect 22 0 34 0; +#X connect 23 0 22 0; +#X connect 24 0 23 0; +#X connect 25 0 24 0; +#X connect 26 0 24 0; +#X connect 27 0 24 0; +#X connect 35 0 22 0; diff --git a/help/pix_convolve-help.pd b/help/pix_convolve-help.pd index 3ad2fbfd0..94812f13b 100644 --- a/help/pix_convolve-help.pd +++ b/help/pix_convolve-help.pd @@ -1,81 +1,33 @@ #N canvas 105 476 635 410 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 295 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 295 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 298 Inlets:; #X text 38 355 Outlets:; -#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 255 Arguments:; -#X obj 7 76 cnv 15 430 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 443 77 cnv 15 180 310 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 443 77 cnv 15 180 310 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 314 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 353 pd gemwin; -#X msg 519 334 create; -#X text 515 313 Create window:; -#X obj 450 138 cnv 15 160 150 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 314 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 150 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 71 31 Class: pix object; #X text 56 368 Outlet 1: gemlist; #X text 63 312 Inlet 1: gemlist; #X text 50 12 Synopsis: [pix_convolve]; #X text 29 76 Description: apply a convolution kernel; -#X text 20 95 pix_convolve accepts a convolution kernel to apply to -a pix. The scale is a divisor for the result (to normal the matrix). -The default is 1.0.; -#X obj 489 183 cnv 15 100 40 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X text 20 95 pix_convolve accepts a convolution kernel to apply to a pix. The scale is a divisor for the result (to normal the matrix). The default is 1.0.; +#X obj 489 183 cnv 15 100 40 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 451 84 gemhead; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; -#X obj 451 293 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X floatatom 505 182 3 -1 2 0 - - -; -#X floatatom 528 182 3 -1 2 0 - - -; -#X floatatom 551 182 3 -1 2 0 - - -; -#X floatatom 505 196 3 -1 2 0 - - -; -#X floatatom 528 196 3 -1 2 0 - - -; -#X floatatom 551 196 3 -1 2 0 - - -; -#X floatatom 505 210 3 -1 2 0 - - -; -#X floatatom 528 210 3 -1 2 0 - - -; -#X floatatom 551 210 3 -1 2 0 - - -; +#X floatatom 505 182 3 -1 2 0 - - - 0; +#X floatatom 528 182 3 -1 2 0 - - - 0; +#X floatatom 551 182 3 -1 2 0 - - - 0; +#X floatatom 505 196 3 -1 2 0 - - - 0; +#X floatatom 528 196 3 -1 2 0 - - - 0; +#X floatatom 551 196 3 -1 2 0 - - - 0; +#X floatatom 505 210 3 -1 2 0 - - - 0; +#X floatatom 528 210 3 -1 2 0 - - - 0; +#X floatatom 551 210 3 -1 2 0 - - - 0; #N canvas 0 0 450 469 pack 0; #X obj 69 169 pack 0 0 0 0 0 0 0 0 0; #X obj 69 139 t b f; @@ -163,7 +115,7 @@ The default is 1.0.; #X connect 33 0 32 0; #X restore 484 224 pd pack 9 . . .; #X obj 451 266 pix_convolve 3 3; -#X floatatom 484 249 5 0 0 1 scale - -; +#X floatatom 484 249 5 0 0 1 scale - - 0; #N canvas 411 476 605 305 unpack 0; #X obj 60 270 outlet; #X obj 111 270 outlet; @@ -206,40 +158,38 @@ The default is 1.0.; #X msg 493 142 smooth; #X text 63 325 Inlet 2: : scale-factor; #X text 63 338 Inlet 2: list: the convolution-kernel; -#X text 20 144 The matrix must have the same size as the arguments -(in this instance \, a 3 x 3 matrix) \, and is given as a single list -of the matrix-values row after row.; +#X text 20 144 The matrix must have the same size as the arguments (in this instance \, a 3 x 3 matrix) \, and is given as a single list of the matrix-values row after row.; #X text 63 266 : matrix dimensions; #X text 28 190 Currently \, only square matrices are supported.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 21 0 23 0; -#X connect 22 0 23 1; -#X connect 23 0 37 0; -#X connect 27 0 36 0; -#X connect 28 0 36 1; -#X connect 29 0 36 2; -#X connect 30 0 36 3; -#X connect 31 0 36 4; -#X connect 32 0 36 5; -#X connect 33 0 36 6; -#X connect 34 0 36 7; -#X connect 35 0 36 8; -#X connect 36 0 38 0; -#X connect 36 1 37 2; -#X connect 37 0 24 0; -#X connect 38 0 37 1; -#X connect 39 0 27 0; -#X connect 39 1 28 0; -#X connect 39 2 29 0; -#X connect 39 3 30 0; -#X connect 39 4 31 0; -#X connect 39 5 32 0; -#X connect 39 6 33 0; -#X connect 39 7 34 0; -#X connect 39 8 35 0; -#X connect 40 0 39 0; -#X connect 41 0 39 0; -#X connect 42 0 39 0; -#X connect 43 0 39 0; +#X obj 523 318 _gemwin; +#X obj 451 293 _pix2rectangle 3; +#X obj 451 113 pix_test; +#X connect 18 0 44 0; +#X connect 19 0 28 0; +#X connect 20 0 28 1; +#X connect 21 0 28 2; +#X connect 22 0 28 3; +#X connect 23 0 28 4; +#X connect 24 0 28 5; +#X connect 25 0 28 6; +#X connect 26 0 28 7; +#X connect 27 0 28 8; +#X connect 28 0 30 0; +#X connect 28 1 29 2; +#X connect 29 0 43 0; +#X connect 30 0 29 1; +#X connect 31 0 19 0; +#X connect 31 1 20 0; +#X connect 31 2 21 0; +#X connect 31 3 22 0; +#X connect 31 4 23 0; +#X connect 31 5 24 0; +#X connect 31 6 25 0; +#X connect 31 7 26 0; +#X connect 31 8 27 0; +#X connect 32 0 31 0; +#X connect 33 0 31 0; +#X connect 34 0 31 0; +#X connect 35 0 31 0; +#X connect 44 0 29 0; diff --git a/help/pix_coordinate-help.pd b/help/pix_coordinate-help.pd index ad5af861c..2f77e3783 100644 --- a/help/pix_coordinate-help.pd +++ b/help/pix_coordinate-help.pd @@ -1,100 +1,42 @@ #N canvas 395 396 626 458 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 335 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 335 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 338 Inlets:; #X text 38 385 Outlets:; -#X obj 8 296 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 296 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 295 Arguments:; -#X obj 7 76 cnv 15 430 210 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 474 344 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 479 383 pd gemwin; -#X msg 479 364 create; -#X text 475 343 Create window:; -#X obj 450 188 cnv 15 160 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 474 344 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 188 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 22 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 306 ; #X text 56 398 Outlet 1: gemlist; #X text 63 352 Inlet 1: gemlist; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 296 square 3; #X text 50 12 Synopsis: [pix_coordinate]; #X text 13 76 Description: set the texture-coordinates for a pix; -#X text 34 94 pix_coordinate remaps the S \, T texture values from -the default values. For instance \, a texture could repeat by increasing -the texture S \, T values from 1 \, 1 to 2 \, 2 (See the examples). -; +#X text 34 94 pix_coordinate remaps the S \, T texture values from the default values. For instance \, a texture could repeat by increasing the texture S \, T values from 1 \, 1 to 2 \, 2 (See the examples).; #X text 63 367 Inlet 2: list: 8 values (4 (s \, t)-pairs); -#X obj 538 144 loadbang; #X msg 461 237 \$1 \$1 0 \$1 0 0 \$1 0; -#X floatatom 461 220 3 0 256 0 - - -; -#X obj 451 136 pix_texture; -#X text 14 159 IMPORTANT NOTE-1: [pix_texture] sets the texture-coordinates -to "appropriate" values \, so you probably want to use [pix_coordinate] -afterwards; -#X obj 10 201 cnv 15 420 45 empty empty empty 20 12 0 14 -225280 -66577 -0; +#X floatatom 461 220 3 0 256 0 - - - 0; +#X text 14 159 IMPORTANT NOTE-1: [pix_texture] sets the texture-coordinates to "appropriate" values \, so you probably want to use [pix_coordinate] afterwards; +#X obj 10 201 cnv 15 420 45 empty empty empty 20 12 0 14 #d8fcfc #404040 0; #X obj 451 266 pix_coordinate; #X msg 459 193 0 0 1 0 1 1 0 1; -#X msg 468 167 rectangle 0 \, repeat 1; -#X text 14 248 IMPORTANT NOTE-3: Images with dimensions that are not -powers-of-2 \, will not "repeat" properly in any case., f 60; -#X text 14 203 IMPORTANT NOTE-2: if your hardware supports it \, Gem -tries to use "rectangle-texturing"\\\, which does not support "repeat" -mode. This is an OpenGL limitation; +#X text 14 248 IMPORTANT NOTE-3: Images with dimensions that are not powers-of-2 \, will not "repeat" properly in any case., f 60; +#X text 14 203 IMPORTANT NOTE-2: if your hardware supports it \, Gem tries to use "rectangle-texturing"\\\, which does not support "repeat" mode. This is an OpenGL limitation; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 31 0; -#X connect 28 0 36 0; -#X connect 29 0 34 1; -#X connect 30 0 29 0; -#X connect 31 0 34 0; -#X connect 34 0 23 0; -#X connect 35 0 34 1; -#X connect 36 0 31 0; +#X obj 451 113 pix_test; +#X obj 451 136 pix_texture \; rectangle 0 \; repeat 1; +#X obj 479 350 _gemwin; +#X connect 11 0 30 0; +#X connect 21 0 25 1; +#X connect 22 0 21 0; +#X connect 25 0 16 0; +#X connect 26 0 25 1; +#X connect 30 0 31 0; +#X connect 31 0 25 0; diff --git a/help/pix_crop-help.pd b/help/pix_crop-help.pd index 83cd98d51..c83a6818b 100644 --- a/help/pix_crop-help.pd +++ b/help/pix_crop-help.pd @@ -1,90 +1,41 @@ #N canvas 6 61 624 360 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 310 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 146 cnv 15 165 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 146 cnv 15 165 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 ; #X text 57 323 Outlet 1: gemlist; #X text 63 232 Inlet 1: gemlist; -#X obj 451 255 square 3; #X obj 451 196 pix_crop; #X text 63 245 Inlet 2: float: dimenX; #X text 63 258 Inlet 3: float: dimenY; #X text 63 273 Inlet 4: float: offsetX; #X text 63 284 Inlet 5: float: offsetY; #X text 50 12 Synopsis: [pix_crop]; -#X floatatom 463 160 5 0 0 1 dimX - -; -#X floatatom 476 177 5 0 0 1 dimY - -; -#X floatatom 543 160 5 0 0 1 offX - -; -#X floatatom 556 177 5 0 0 1 offY - -; +#X floatatom 463 160 5 0 0 1 dimX - - 0; +#X floatatom 476 177 5 0 0 1 dimY - - 0; +#X floatatom 543 160 5 0 0 1 offX - - 0; +#X floatatom 556 177 5 0 0 1 offY - - 0; #X text 29 77 Description: get a subimage of an image; -#X text 12 91 [pix_crop]: only passes the selected rectangle further -on. The selection is made by the dimension of the subimage in pixels -and the offset (in pixels) from the lower left corner.; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); +#X text 12 91 [pix_crop]: only passes the selected rectangle further on. The selection is made by the dimension of the subimage in pixels and the offset (in pixels) from the lower left corner.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 23 0; -#X connect 18 0 22 0; -#X connect 23 0 18 0; -#X connect 29 0 23 1; -#X connect 30 0 23 2; -#X connect 31 0 23 3; -#X connect 32 0 23 4; +#X obj 451 233 _pix2rectangle 3; +#X obj 521 261 _gemwin; +#X obj 451 113 pix_test; +#X connect 11 0 31 0; +#X connect 16 0 29 0; +#X connect 22 0 16 1; +#X connect 23 0 16 2; +#X connect 24 0 16 3; +#X connect 25 0 16 4; +#X connect 31 0 16 0; diff --git a/help/pix_curve-help.pd b/help/pix_curve-help.pd index 2c1227c3f..20b312434 100644 --- a/help/pix_curve-help.pd +++ b/help/pix_curve-help.pd @@ -1,47 +1,19 @@ #N canvas 6 321 733 553 10; #X declare -lib Gem; #X text 542 8 GEM object; -#X obj 8 386 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 386 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 388 Inlets:; #X text 38 495 Outlets:; -#X obj 8 306 cnv 15 430 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 306 cnv 15 430 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 47 305 Arguments:; -#X obj 7 76 cnv 15 430 220 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 270 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 270 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 451 138 cnv 15 260 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 584 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 138 cnv 15 260 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -49,9 +21,7 @@ #X obj 223 55 inlet; #X msg 223 123 open \$1; #X obj 223 100 openpanel; -#X text 156 263 [pix_buf] with "auto 1" is important if we want to -recalculate our pix-effect each frame but don't want to reload the -image all the time.; +#X text 156 263 [pix_buf] with "auto 1" is important if we want to recalculate our pix-effect each frame but don't want to reload the image all the time.; #X obj 77 281 pix_buf; #X obj 102 229 loadbang; #X msg 102 250 auto 1; @@ -66,30 +36,20 @@ image all the time.; #X restore 451 113 pd image; #X text 16 511 Outlet 1: gemlist; #X text 23 402 Inlet 1: gemlist; -#X obj 451 253 pix_draw; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_curve]; #X text 29 76 Description: apply color curves to an image; -#X text 13 96 [pix_curve] applies color-curves (that are stored in -arrays) to an image.; -#X text 14 125 You can specify one table for all 4 (RGBA) channels -or one for each channel. If you do not specify a table for the Alpha-channel -\, it will not be touched.; -#X text 17 175 You can specify the tables with creation-arguments and -(re)set them with the "set"-message.; -#X text 15 204 The length of the used table does not matter. The table -will be stretched/squeezed to (virtually) hold 256 items. If it is -stretched \, no interpolation is done!; -#X text 17 257 The values of the table-items have range between 0 and -255 !; +#X text 13 96 [pix_curve] applies color-curves (that are stored in arrays) to an image.; +#X text 14 125 You can specify one table for all 4 (RGBA) channels or one for each channel. If you do not specify a table for the Alpha-channel \, it will not be touched.; +#X text 17 175 You can specify the tables with creation-arguments and (re)set them with the "set"-message.; +#X text 15 204 The length of the used table does not matter. The table will be stretched/squeezed to (virtually) hold 256 items. If it is stretched \, no interpolation is done!; +#X text 17 257 The values of the table-items have range between 0 and 255 !; #X msg 469 142 set tab-rgba; #X msg 469 162 set tab-red tab-green tab-blue; #N canvas 46 428 568 342 table-init 0; -#X msg 26 171 \; tab-red cosinesum 128 1 0.6 -0.2 0.2 \; tab-red normalize -256; -#X msg 26 222 \; tab-blue cosinesum 8 0.5 -0.4 0.3 \; tab-blue normalize -256; +#X msg 26 171 \; tab-red cosinesum 128 1 0.6 -0.2 0.2 \; tab-red normalize 256; +#X msg 26 222 \; tab-blue cosinesum 8 0.5 -0.4 0.3 \; tab-blue normalize 256; #X obj 352 120 until; #X msg 353 49 100; #X obj 352 167 i; @@ -105,8 +65,7 @@ stretched \, no interpolation is done!; #X obj 352 71 t f b; #X obj 381 239 + 100; #X obj 200 39 t b b b; -#X msg 148 103 \; tab-green normalize 256 \; tab-rgba normalize 256 -; +#X msg 148 103 \; tab-green normalize 256 \; tab-rgba normalize 256; #X obj 37 125 t b b; #X connect 2 0 4 0; #X connect 3 0 14 0; @@ -137,22 +96,18 @@ stretched \, no interpolation is done!; #X obj 451 215 pix_curve tab-rgba; #X msg 469 183 set tab-green tab-blue tab-red tab-rgba; #X text 13 336 3 args: separate s for all channels; -#X text 13 350 4 args: separate s for all channels (incl. -alpha); +#X text 13 350 4 args: separate s for all channels (incl. alpha); #X text 13 322 1 arg:: common for all channels; -#X text 23 415 Inlet 1: set : common table for all channels -; -#X text 23 432 Inlet 1: set : separate tables -for all channels; -#X text 23 461 Inlet 1: set : separate -tables for all channels (incl. Alpha); +#X text 23 415 Inlet 1: set : common table for all channels; +#X text 23 432 Inlet 1: set : separate tables for all channels; +#X text 23 461 Inlet 1: set : separate tables for all channels (incl. Alpha); #X obj 618 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 37 0; -#X connect 30 0 37 0; -#X connect 31 0 37 0; -#X connect 37 0 20 0; -#X connect 38 0 37 0; +#X obj 590 262 _gemwin; +#X obj 451 253 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 33 0; +#X connect 26 0 33 0; +#X connect 27 0 33 0; +#X connect 33 0 43 0; +#X connect 34 0 33 0; diff --git a/help/pix_data-help.pd b/help/pix_data-help.pd index e77c9877a..953fbd719 100644 --- a/help/pix_data-help.pd +++ b/help/pix_data-help.pd @@ -17,33 +17,8 @@ #X floatatom 492 170 5 0 0 1 x-pos - - 0; #X floatatom 507 193 5 0 0 1 y-pos - - 0; #X obj 477 94 gemhead; -#X obj 477 138 pix_image; -#X obj 562 68 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 562 86 openpanel; -#X msg 562 109 open \$1; #X text 453 15 GEM object; #X obj 500 413 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 505 452 pd gemwin; -#X msg 505 433 create; -#X text 501 412 Create window:; #X obj 568 8 declare -lib Gem; #X text 21 271 Inlets:; #X text 23 239 Arguments:; @@ -70,24 +45,21 @@ #X text 42 453 Outlet 3: float: grey value (normalized 0..1); #X obj 484 353 unpack 0 0 0 0; #X floatatom 626 376 5 0 0 0 A - - 0; -#X connect 7 1 50 0; +#X obj 506 420 _gemwin; +#X obj 477 138 pix_test; +#X connect 7 1 43 0; #X connect 7 2 9 0; #X connect 8 0 7 0; #X connect 14 0 7 2; #X connect 15 0 7 3; -#X connect 16 0 17 0; -#X connect 17 0 7 1; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 17 0; -#X connect 23 0 24 0; -#X connect 24 0 23 0; -#X connect 41 0 42 0; -#X connect 42 0 7 0; -#X connect 43 0 44 0; -#X connect 44 0 7 0; -#X connect 45 0 7 0; -#X connect 50 0 12 0; -#X connect 50 1 11 0; -#X connect 50 2 10 0; -#X connect 50 3 51 0; +#X connect 16 0 46 0; +#X connect 34 0 35 0; +#X connect 35 0 7 0; +#X connect 36 0 37 0; +#X connect 37 0 7 0; +#X connect 38 0 7 0; +#X connect 43 0 12 0; +#X connect 43 1 11 0; +#X connect 43 2 10 0; +#X connect 43 3 44 0; +#X connect 46 0 7 1; diff --git a/help/pix_deinterlace-help.pd b/help/pix_deinterlace-help.pd index 345087b90..20b106864 100644 --- a/help/pix_deinterlace-help.pd +++ b/help/pix_deinterlace-help.pd @@ -1,47 +1,19 @@ #N canvas 392 297 654 372 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 252 Inlets:; #X text 38 315 Outlets:; -#X obj 8 204 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 204 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 203 Arguments:; -#X obj 7 76 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 138 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -68,28 +40,18 @@ #X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 196 pix_deinterlace; #X msg 477 168 mode \$1; -#X obj 477 150 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 451 223 pix_texture; -#X obj 451 244 square 5; +#X obj 477 150 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 50 12 Synopsis: [pix_deinterlace]; #X text 29 76 Description: deinterlace an image; -#X text 17 97 [pix_deinterlace] will apply a deinterlacing algorithm -on the incoming image. This is done by getting the average of neighbouring -rows.; -#X text 21 141 When mode is set to "0" \, only those pixels are de-interlaced -if they appear to be interlaced (this is detected by thresholding the -difference between adjacent pixels). In mode "1" de-interlacing is -always enforced.; -#X text 63 282 Inlet 1: mode : enforce(1) or not(0) (default:1) -; +#X text 17 97 [pix_deinterlace] will apply a deinterlacing algorithm on the incoming image. This is done by getting the average of neighbouring rows.; +#X text 21 141 When mode is set to "0" \, only those pixels are de-interlaced if they appear to be interlaced (this is detected by thresholding the difference between adjacent pixels). In mode "1" de-interlacing is always enforced.; +#X text 63 282 Inlet 1: mode : enforce(1) or not(0) (default:1); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 23 0; -#X connect 23 0 26 0; -#X connect 24 0 23 0; -#X connect 25 0 24 0; -#X connect 26 0 27 0; +#X obj 451 223 _pix2rectangle 3; +#X obj 521 261 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 20 0; +#X connect 20 0 29 0; +#X connect 21 0 20 0; +#X connect 22 0 21 0; diff --git a/help/pix_delay-help.pd b/help/pix_delay-help.pd index 3c3d4606a..1fc71b220 100644 --- a/help/pix_delay-help.pd +++ b/help/pix_delay-help.pd @@ -1,56 +1,26 @@ #N canvas 230 61 629 377 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 225 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 225 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 227 Inlets:; #X text 40 322 Outlets:; -#X obj 9 185 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 185 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 184 Arguments:; -#X obj 8 56 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 519 329 pd gemwin; -#X msg 519 310 create; -#X text 515 289 Create window:; -#X obj 451 198 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 198 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 18 336 Outlet 1: gemlist; #X text 24 241 Inlet 1: gemlist; -#X obj 451 292 square 3; -#X obj 451 270 pix_texture; #X obj 451 232 pix_delay 100; #X text 50 12 Synopsis: [pix_delay]; #X text 71 31 Class: pix object (timebased effect); #X text 29 57 Description: delay a series of images; #X obj 451 162 pix_film; #X obj 515 162 t f; -#X obj 464 105 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 105 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -64,7 +34,7 @@ #X connect 4 0 1 0; #X connect 5 0 4 0; #X restore 464 134 pd open; -#X floatatom 537 213 5 0 0 0 - - -; +#X floatatom 537 213 5 0 0 0 - - - 0; #X text 505 77 open a supported; #X text 506 88 movie-clip; #X text 505 109 macOS: quicktime; @@ -73,20 +43,15 @@ #X text 528 198 scrub me!; #X text 64 195 int: max.number of delayed frames; #X text 24 254 Inlet 1: int: delay (in frames); -#X text 11 79 [pix_delay] is a frame-based delay-line. All frames stored -in the delay-line have to have the same dimensions and colour-space. -You can specify the length of the entire delay-line (==maximum delay) -as an argument to the [pix_delay] object. The delay in frames defaults -to 0 (route through) and can be changed via the second inlet.; +#X text 11 79 [pix_delay] is a frame-based delay-line. All frames stored in the delay-line have to have the same dimensions and colour-space. You can specify the length of the entire delay-line (==maximum delay) as an argument to the [pix_delay] object. The delay in frames defaults to 0 (route through) and can be changed via the second inlet.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 23 0; -#X connect 18 0 17 0; -#X connect 19 0 18 0; -#X connect 23 0 19 0; -#X connect 23 2 24 0; -#X connect 24 0 23 1; -#X connect 25 0 26 0; -#X connect 26 0 23 0; -#X connect 27 0 19 1; +#X obj 451 270 _pix2rectangle 3; +#X obj 521 297 _gemwin; +#X connect 11 0 18 0; +#X connect 14 0 33 0; +#X connect 18 0 14 0; +#X connect 18 2 19 0; +#X connect 19 0 18 1; +#X connect 20 0 21 0; +#X connect 21 0 18 0; +#X connect 22 0 14 1; diff --git a/help/pix_diff-help.pd b/help/pix_diff-help.pd index e09f4bb29..9d1b6b758 100644 --- a/help/pix_diff-help.pd +++ b/help/pix_diff-help.pd @@ -1,46 +1,18 @@ #N canvas 6 320 629 381 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 34 236 Inlets:; #X text 34 292 Outlets:; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 448 66 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 448 66 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 452 49 Example:; -#X obj 513 279 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 518 318 pd gemwin; -#X msg 518 299 create; -#X text 514 278 Create window:; -#X obj 450 157 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 513 279 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 157 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 450 118 gemhead; -#X obj 495 101 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 495 101 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -54,11 +26,9 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 450 137 pd image; -#X obj 450 252 pix_texture; #X text 63 196 ; #X text 42 306 Outlet 1: gemlist; #X text 48 250 Inlet 1: gemlist; -#X obj 450 274 square 3; #X text 502 77 (JPEG \, TIFF \, ..); #X obj 540 118 gemhead; #N canvas 0 22 587 366 image 0; @@ -74,28 +44,25 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 540 137 pd image; -#X obj 585 101 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 585 101 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X text 48 279 Inlet 2: gemlist; #X text 448 66 open two different images; #X text 71 31 Class: pix mix object; #X text 33 150 The 2 images have to be of the same size.; #X text 50 12 Synopsis: [pix_diff]; #X text 29 67 Description: get the difference between 2 pixes; -#X text 24 94 [pix_diff] will get the absolute value of the difference -between 2 images (in contrast to [pix_subtract]); +#X text 24 94 [pix_diff] will get the absolute value of the difference between 2 images (in contrast to [pix_subtract]); #X obj 450 187 pix_diff; #X text 32 353 see also:; #X obj 100 353 pix_subtract; #X obj 180 353 pix_compare; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 33 0; -#X connect 17 0 21 0; -#X connect 23 0 24 0; -#X connect 24 0 33 1; -#X connect 25 0 24 1; -#X connect 33 0 17 0; +#X obj 450 252 _pix2rectangle; +#X obj 520 285 _gemwin; +#X connect 11 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 28 0; +#X connect 18 0 19 0; +#X connect 19 0 28 1; +#X connect 20 0 19 1; +#X connect 28 0 33 0; diff --git a/help/pix_dot-help.pd b/help/pix_dot-help.pd index cb85338f2..af84e282b 100644 --- a/help/pix_dot-help.pd +++ b/help/pix_dot-help.pd @@ -1,49 +1,21 @@ #N canvas 6 61 633 352 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 39 282 Outlets:; -#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 76 cnv 15 430 75 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 75 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 50 12 Synopsis: [pix_dot]; #X text 71 31 Class: pix object; #X obj 451 180 pix_dot; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -57,25 +29,20 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X floatatom 524 181 5 0 100 2 size - -; -#X obj 451 233 pix_texture; +#X floatatom 524 181 5 0 100 2 size - - 0; #X text 57 295 Outlet 1: gemlist; #X text 63 212 Inlet 1: gemlist; #X text 29 77 Description: make dotty images; #X text 64 232 Inlet 2: float: size of the dots; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X text 34 94 [pix_dot] will simplify an image \, as the image will -be segmented and each segment will be represented by a white dot \, -whose size is relative to the luminance of the original segment.; -#X obj 451 255 square 3; +#X text 34 94 [pix_dot] will simplify an image \, as the image will be segmented and each segment will be represented by a white dot \, whose size is relative to the luminance of the original segment.; #X text 63 166 ; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 19 0; -#X connect 17 0 21 0; -#X connect 18 0 19 1; -#X connect 19 0 17 0; -#X connect 20 0 17 1; -#X connect 21 0 29 0; +#X obj 523 260 _gemwin; +#X obj 451 233 _pix2rectangle 3; +#X connect 11 0 16 0; +#X connect 14 0 28 0; +#X connect 15 0 16 1; +#X connect 16 0 14 0; +#X connect 17 0 14 1; diff --git a/help/pix_dump-help.pd b/help/pix_dump-help.pd index c48e2d8d2..e3d42fe07 100644 --- a/help/pix_dump-help.pd +++ b/help/pix_dump-help.pd @@ -1,93 +1,42 @@ #N canvas 207 155 629 372 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 305 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 304 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 343 pd gemwin; -#X msg 519 324 create; -#X text 515 303 Create window:; -#X obj 448 158 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 304 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 448 158 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 272 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 318 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 186 pix_dump; #X obj 502 213 print DATA; #X msg 487 162 bang; #X text 29 76 Description: dump all the pixel-data of an image; -#X text 21 111 [pix_dump] will output one long list of (m*n) pixel-tuples. -; +#X text 21 111 [pix_dump] will output one long list of (m*n) pixel-tuples.; #X text 22 142 For a RGBA-image the list will have the form:; #X text 42 162 R1 G1 B1 A1 R2 G2 B2 A2 R3 G3 ... B(m*n) A(m*n); #X text 63 274 Inlet 1: bang: do dump; #X text 56 332 Outlet 2: list: dumped pixel data; #X text 50 12 Synopsis: [pix_dump]; -#X obj 530 168 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 451 135 pix_resize 20 20; -#X obj 451 245 pix_texture; -#X obj 451 267 rectangle 3 3; +#X obj 530 168 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 530 186 bytemode \$1; #X text 63 286 Inlet 1: bytemode: set normalization on or off; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 34 0; -#X connect 23 0 35 0; -#X connect 23 1 24 0; -#X connect 25 0 23 0; -#X connect 33 0 37 0; -#X connect 34 0 23 0; -#X connect 35 0 36 0; -#X connect 37 0 23 0; +#X obj 451 245 _pix2rectangle 3; +#X obj 522 310 _gemwin; +#X obj 451 113 pix_test 20 20; +#X connect 11 0 32 0; +#X connect 16 0 30 0; +#X connect 16 1 17 0; +#X connect 18 0 16 0; +#X connect 26 0 27 0; +#X connect 27 0 16 0; +#X connect 32 0 16 0; diff --git a/help/pix_duotone-help.pd b/help/pix_duotone-help.pd index 5bb857fcf..62bc7f828 100644 --- a/help/pix_duotone-help.pd +++ b/help/pix_duotone-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 651 353 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 310 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,23 +27,14 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 ; #X text 57 323 Outlet 1: gemlist; #X text 63 232 Inlet 1: gemlist; -#X obj 451 255 square 3; -#X text 64 258 Inlet 3: list: color if original pixel-value is below -threshold; -#X text 64 283 Inlet 4: list: color if original pixel-value is above -threshold; +#X text 64 258 Inlet 3: list: color if original pixel-value is below threshold; +#X text 64 283 Inlet 4: list: color if original pixel-value is above threshold; #X text 50 12 Synopsis: [pix_duotone]; -#X text 29 77 Description: reduce the number of colours by thresholding -; -#X text 13 91 [pix_duotone] will reduce the number of colours in a -pixImage \, based on thresholding. If the pixel has a greater value -than the threshold (on all channels) \, the pixel will be set to color1 -\, else color2 will be used. The same goes for green and blue. In YUV-space -the values are not RGB but YCrCb.; +#X text 29 77 Description: reduce the number of colours by thresholding; +#X text 13 91 [pix_duotone] will reduce the number of colours in a pixImage \, based on thresholding. If the pixel has a greater value than the threshold (on all channels) \, the pixel will be set to color1 \, else color2 will be used. The same goes for green and blue. In YUV-space the values are not RGB but YCrCb.; #X obj 451 196 pix_duotone; #X msg 465 166 0.2 0.1 0.2; #X msg 562 164 1 0 0; @@ -80,13 +43,12 @@ the values are not RGB but YCrCb.; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 28 0; -#X connect 18 0 22 0; -#X connect 28 0 18 0; -#X connect 29 0 28 1; -#X connect 30 0 28 2; -#X connect 31 0 28 3; +#X obj 521 261 _gemwin; +#X obj 451 233 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 23 0; +#X connect 23 0 32 0; +#X connect 24 0 23 1; +#X connect 25 0 23 2; +#X connect 26 0 23 3; diff --git a/help/pix_equal-help.pd b/help/pix_equal-help.pd index 16969b6e2..37f447efa 100644 --- a/help/pix_equal-help.pd +++ b/help/pix_equal-help.pd @@ -1,47 +1,19 @@ #N canvas 176 166 639 504 10; #X declare -lib Gem; #X text 462 18 GEM object; -#X obj 18 206 cnv 15 430 210 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 18 206 cnv 15 430 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 49 208 Inlets:; #X text 49 301 Outlets:; -#X obj 18 168 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 18 168 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 27 167 Arguments:; -#X obj 18 86 cnv 15 430 75 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 459 87 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 18 86 cnv 15 430 75 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 459 87 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 463 70 Example:; -#X obj 524 271 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 529 310 pd gemwin; -#X msg 529 291 create; -#X text 525 270 Create window:; -#X obj 460 151 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 524 271 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 460 151 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 461 94 gemhead; #X text 81 41 Class: pix object; -#X obj 520 95 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 520 95 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 4 49 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,32 +27,19 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 461 123 pd image; -#X obj 461 250 pix_texture; #X text 73 178 ; -#X obj 461 272 square 3; #X text 526 115 open an image; #X text 519 128 (JPEG \, TIFF \, ..); -#X obj 18 424 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 18 424 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 26 425 See Also:; #X text 83 424 examples/04.video/08.color_detection.pd; #X text 66 229 Inlet 1: gemlist \, RGBA image; -#X text 26 459 Author: Ricardo Fabbri labmacambira.sf.net rfabbri at -gmail; +#X text 26 459 Author: Ricardo Fabbri labmacambira.sf.net rfabbri at gmail; #X text 60 22 Synopsis: [pix_equal]; -#X text 38 107 [pix_equal] outputs a binary image where 'white' marks -those pixels that are equal to a given value (within given closed bounds) -\, and 'black' marks the remaining ones.; -#X text 67 248 Inlet 2(resp.3): list of lower(resp.upper) bounds [R -G B A( \, with each value ranging from 0 to 1 \, and A being optional -and equal to 0(resp.1) by default.; -#X text 67 319 Outlet 1: gemlist \, a binary RGBA image with white -pixels marking only those pixels that are within the specified (closed) -RGBA ranges simultaneously on all four channels. This can be used \, -for instance \, in separating color blobs from [pix_colorclassify]. -; -#X text 39 87 Description: marks the pixels nearly equal to a given -color; +#X text 38 107 [pix_equal] outputs a binary image where 'white' marks those pixels that are equal to a given value (within given closed bounds) \, and 'black' marks the remaining ones.; +#X text 67 248 Inlet 2(resp.3): list of lower(resp.upper) bounds [R G B A( \, with each value ranging from 0 to 1 \, and A being optional and equal to 0(resp.1) by default.; +#X text 67 319 Outlet 1: gemlist \, a binary RGBA image with white pixels marking only those pixels that are within the specified (closed) RGBA ranges simultaneously on all four channels. This can be used \, for instance \, in separating color blobs from [pix_colorclassify].; +#X text 39 87 Description: marks the pixels nearly equal to a given color; #X obj 461 209 pix_equal; #X msg 528 172 0.8 0.7 0 0; #X text 524 156 lower bound; @@ -90,12 +49,11 @@ color; #X text 457 342 e.g. marks whatever is within; #X text 456 358 a certain bright yellow range; #X obj 528 18 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 33 0; -#X connect 18 0 20 0; -#X connect 33 0 18 0; -#X connect 34 0 33 1; -#X connect 37 0 33 2; +#X obj 531 280 _gemwin; +#X obj 461 250 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 28 0; +#X connect 28 0 38 0; +#X connect 29 0 28 1; +#X connect 32 0 28 2; diff --git a/help/pix_film-help.pd b/help/pix_film-help.pd index 56032ff1f..c771e5442 100644 --- a/help/pix_film-help.pd +++ b/help/pix_film-help.pd @@ -9,33 +9,11 @@ #X obj 8 56 cnv 15 430 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 449 57 cnv 15 250 450 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 40 Example:; -#X obj 594 440 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 599 479 pd gemwin; -#X msg 599 460 create; -#X text 595 439 Create window:; +#X obj 574 440 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 451 88 cnv 15 215 300 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 63 gemhead; #X text 17 503 Outlet 1: gemlist; #X text 18 288 Inlet 1: gemlist, f 68; -#X obj 451 410 pix_texture; #X obj 463 90 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 505 57 open a supported; #X text 506 68 movie-clip; @@ -46,7 +24,6 @@ #X text 71 31 Class: pix object (pix source); #X text 29 57 Description: load in a movie-file; #X obj 463 117 openpanel; -#X obj 451 432 rectangle 4 3; #X text 50 12 Synopsis: [pix_film]; #X text 15 78 [pix_film] loads in a preproduced digital-video to be used as a texture \, bitblit or something else., f 69; #X text 64 249 symbol: file to load initially; @@ -105,7 +82,7 @@ #X obj 451 281 pix_film; #X msg 489 217 bang; #X text 17 418 Inlet 1: message : bang: (re)send the l/w/h/fps info to the 2nd outlet, f 69; -#X text 14 144 Normally \, you will only get one specified (via the second inlet) frame of the film. To play back a complete film \, you have to change the frame accordingly \, OR use the "auto" message \, to automatically proceed to the next frame each rendering-cycle. In auto-mode \, the film is NOT looped. Instead you can reset the current-frame to zero when the end of the film is reached., f 69; +#X text 14 151 Normally \, you will only get one specified (via the second inlet) frame of the film. To play back a complete film \, you have to change the frame accordingly \, OR use the "auto" message \, to automatically proceed to the next frame each rendering-cycle. In auto-mode \, the film is NOT looped. Instead you can reset the current-frame to zero when the end of the film is reached., f 69; #X text 16 445 Inlet 2: float: changes the frame to be decoded on rendering (starting with 0), f 69; #X text 17 391 Inlet 1: message : backend : open the film using only the specified backend(s), f 70; #X obj 578 8 declare -lib Gem; @@ -113,8 +90,8 @@ #X text 35 220 If a specific colorspace is required \, it is strongly recommended to convert using [pix_rgba] \, [pix_yuv] \, [pix_grey] etc. This is the only way to guarantee a colorspace., f 60; #X text 35 33 Note that the default colorspace may vary on different operating systems \, even for the same patch and same video file. For instance \, [pix_film] may output YUV images in macOS \, while the same patch and same video file may obtain RGB images in Linux. While most downstream [pix] objects can adapt automatically to the incoming format \, there are some (e.g. [pix_chroma_key]) which take a user-specified color as an input. Such objects are sensitive to the image's colorspace \, and patches using them may exhibit variable behavior on different OSes.; #X text 35 172 Note also that codecs may choose to disregard the colorspace passed to pix_film -- you may or may not get the requested colorspace.; -#X restore 211 130 pd :: COLORSPACES; -#X text 13 104 You can open a specified film via the "open" message \, which takes an optional argument for the colorspace \, to which the movie should be decoded (RGBA \, YUV or Grey). See, f 70; +#X restore 217 133 pd :: COLORSPACES; +#X text 14 104 You can open a specified film via the "open" message \, which takes an optional argument for the colorspace \, to which the movie should be decoded (RGBA \, YUV or Grey). See, f 70; #X msg 463 136 open \$1 RGBA; #X text 546 129 Recommended to specify colorspace!, f 20; #X obj 457 584 _backendinfo \$0 film; @@ -132,26 +109,25 @@ #X connect 0 0 1 0; #X connect 2 0 3 0; #X restore 583 282 pd print; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 43 0; -#X connect 17 0 28 0; -#X connect 18 0 27 0; -#X connect 24 0 43 1; -#X connect 27 0 52 0; -#X connect 36 0 56 0; -#X connect 37 0 36 0; -#X connect 38 0 56 0; -#X connect 41 0 21 0; -#X connect 41 1 22 0; -#X connect 41 2 23 0; -#X connect 41 3 42 0; -#X connect 43 0 17 0; -#X connect 43 1 41 0; -#X connect 43 2 57 0; -#X connect 44 0 56 0; -#X connect 52 0 56 0; -#X connect 55 0 56 0; -#X connect 56 0 43 0; -#X connect 57 0 58 0; -#X connect 57 1 59 0; +#X obj 451 410 _pix2rectangle 3; +#X obj 582 445 _gemwin; +#X connect 11 0 38 0; +#X connect 14 0 23 0; +#X connect 20 0 38 1; +#X connect 23 0 47 0; +#X connect 31 0 51 0; +#X connect 32 0 31 0; +#X connect 33 0 51 0; +#X connect 36 0 17 0; +#X connect 36 1 18 0; +#X connect 36 2 19 0; +#X connect 36 3 37 0; +#X connect 38 0 55 0; +#X connect 38 1 36 0; +#X connect 38 2 52 0; +#X connect 39 0 51 0; +#X connect 47 0 51 0; +#X connect 50 0 51 0; +#X connect 51 0 38 0; +#X connect 52 0 53 0; +#X connect 52 1 54 0; diff --git a/help/pix_flip-help.pd b/help/pix_flip-help.pd index 1abb82140..45a39d584 100644 --- a/help/pix_flip-help.pd +++ b/help/pix_flip-help.pd @@ -10,50 +10,13 @@ #X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 514 284 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 323 pd gemwin; -#X msg 519 304 create; -#X text 515 283 Create window:; #X obj 450 138 cnv 15 160 110 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; -#N canvas 0 22 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; #X text 50 12 Synopsis: [pix_color]; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X msg 514 146 none; #X msg 514 166 horizontal; #X msg 514 186 vertical; @@ -63,17 +26,14 @@ #X text 20 153 It defaults to none; #X text 63 275 Inlet 1: none|horizontal|vertical|both; #X obj 451 226 pix_flip; -#X obj 451 253 pix_texture; -#X obj 451 274 square; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 32 0; -#X connect 24 0 32 0; -#X connect 25 0 32 0; -#X connect 26 0 32 0; -#X connect 27 0 32 0; -#X connect 32 0 33 0; -#X connect 33 0 34 0; +#X obj 520 292 _gemwin; +#X obj 451 253 _pix2rectangle 3; +#X obj 451 113 pix_test; +#X connect 11 0 29 0; +#X connect 17 0 25 0; +#X connect 18 0 25 0; +#X connect 19 0 25 0; +#X connect 20 0 25 0; +#X connect 25 0 28 0; +#X connect 29 0 25 0; diff --git a/help/pix_freeframe-help.pd b/help/pix_freeframe-help.pd index 3766111b9..f47a25b9d 100644 --- a/help/pix_freeframe-help.pd +++ b/help/pix_freeframe-help.pd @@ -1,57 +1,24 @@ #N canvas 346 61 665 552 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 340 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 340 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 342 Arguments:; -#X obj 8 56 cnv 15 430 280 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 56 cnv 15 430 280 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 451 58 Example:; #X text 71 31 Class: pix object; -#X obj 13 512 cnv 15 410 30 empty empty empty 20 12 0 14 -260818 -66577 -0; +#X obj 13 512 cnv 15 410 30 empty empty empty 20 12 0 14 #fcac44 #404040 0; #X text 50 12 Synopsis: [pix_freeframe]; #X text 63 353 : the plugin to load; -#X text 13 72 This object allows you to load any FreeFrame video-effect. -FreeFrame is an open \, cross-platform (osX \, linux \, w32) standard -for realtime video effects.; -#X text 15 513 You can get more information as well as links to public -domain and commercial plugin-packs at http://freeframe.org; -#X msg 455 330 gemList; +#X text 13 72 This object allows you to load any FreeFrame video-effect. FreeFrame is an open \, cross-platform (osX \, linux \, w32) standard for realtime video effects.; +#X text 15 513 You can get more information as well as links to public domain and commercial plugin-packs at http://freeframe.org; #X text 28 56 Description: run a FreeFrame effect; #X obj 449 113 gemhead; -#X obj 448 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 514 340 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 519 379 pd gemwin; -#X msg 519 360 create; -#X text 515 339 Create window:; +#X obj 448 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 514 350 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 451 83 gemhead; -#X obj 451 342 square 3; -#X obj 451 320 pix_texture; #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -70,15 +37,12 @@ domain and commercial plugin-packs at http://freeframe.org; #X text 523 114 macOS: quicktime; #X text 516 104 MS Windows: *.AVI; #X text 523 124 linux: depends...; -#X obj 450 227 cnv 15 160 85 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X floatatom 567 241 5 0 0 0 - - -; -#X obj 463 241 hsl 100 15 0 1 0 0 empty empty friction -2 -6 0 10 -262144 --1 -1 0 1; +#X obj 450 227 cnv 15 160 85 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X floatatom 567 241 5 0 0 0 - - - 0; +#X obj 463 241 hsl 100 15 0 1 0 0 empty empty friction -2 -6 0 10 #fcfcfc #000000 #000000 0 1; #X obj 451 289 pix_freeframe WaveVFX; -#X floatatom 567 270 5 0 0 0 - - -; -#X obj 463 270 hsl 100 15 0 1 0 0 empty empty speed -2 -6 0 10 -262144 --1 -1 0 1; +#X floatatom 567 270 5 0 0 0 - - - 0; +#X obj 463 270 hsl 100 15 0 1 0 0 empty empty speed -2 -6 0 10 #fcfcfc #000000 #000000 0 1; #X text 442 431 This example relies on; #X text 442 446 finding the "WaveVFX" plugin; #X text 443 461 (which is part of PeteWarden's; @@ -86,50 +50,32 @@ domain and commercial plugin-packs at http://freeframe.org; #X obj 451 179 pix_rgba; #X text 513 176 FreeFrame plugins; #X text 515 190 need RGBA images!; -#X text 12 109 If you specify the plugin when creating the object (e.g -[pix_freeframe WaveVFX] or [pix_WaveVFX] \, the plugin is fixed and -you cannot change it (apart from deleting the object and creating a -new one); -#X text 13 154 However \, if you only create an object [pix_freeframe] -(without specifying the plugin \, you will get a dynamic version \, -where you can load in a plugin using the "load" message.; -#X text 12 308 Plugins are searched in all the paths that Pd searches -for abstractions \, ...!; -#X text 13 284 FreeFrame numerical parameters are supposed to be in -the range 0..1.; -#X text 12 202 Most plugins have a number of parameters which you can -use to change the behaviour of the effect while it runs. For each parameter -exposed \, the [pix_freeframe] object will get one additional inlet -\, which can be used to modify the given parameter. Alternatively (e.g. -when using dynamic plugin instances) you can also use the parametername -or "#" (starting from 1).; -#X obj 7 376 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X text 12 109 If you specify the plugin when creating the object (e.g [pix_freeframe WaveVFX] or [pix_WaveVFX] \, the plugin is fixed and you cannot change it (apart from deleting the object and creating a new one); +#X text 13 154 However \, if you only create an object [pix_freeframe] (without specifying the plugin \, you will get a dynamic version \, where you can load in a plugin using the "load" message.; +#X text 12 308 Plugins are searched in all the paths that Pd searches for abstractions \, ...!; +#X text 13 284 FreeFrame numerical parameters are supposed to be in the range 0..1.; +#X text 12 202 Most plugins have a number of parameters which you can use to change the behaviour of the effect while it runs. For each parameter exposed \, the [pix_freeframe] object will get one additional inlet \, which can be used to modify the given parameter. Alternatively (e.g. when using dynamic plugin instances) you can also use the parametername or "#" (starting from 1).; +#X obj 7 376 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 378 Inlets:; #X text 11 478 Outlets:; #X text 29 491 Outlet 1: gemlist; #X text 22 392 Inlet 1: gemlist; -#X text 21 453 Inlet 2..N (if applicable): : depending on the -settable parameter; -#X text 22 406 Inlet 1: open : load another plugin (if applicable) -; -#X text 22 419 Inlet 1: # : set parameter # (starting -from 1); -#X text 22 441 Inlet 1: : set parameter given by -; +#X text 21 453 Inlet 2..N (if applicable): : depending on the settable parameter; +#X text 22 406 Inlet 1: open : load another plugin (if applicable); +#X text 22 419 Inlet 1: # : set parameter # (starting from 1); +#X text 22 441 Inlet 1: : set parameter given by ; #X obj 538 8 declare -lib Gem; -#X connect 16 0 17 0; -#X connect 17 0 16 0; -#X connect 19 0 22 0; -#X connect 21 0 20 0; -#X connect 22 0 41 0; -#X connect 22 2 23 0; -#X connect 23 0 22 1; -#X connect 24 0 25 0; -#X connect 25 0 22 0; -#X connect 32 0 34 1; -#X connect 33 0 32 0; -#X connect 34 0 21 0; -#X connect 35 0 34 2; -#X connect 36 0 35 0; -#X connect 41 0 34 0; +#X obj 451 320 _pix2rectangle 3; +#X obj 521 356 _gemwin; +#X connect 15 0 16 0; +#X connect 16 0 35 0; +#X connect 16 2 17 0; +#X connect 17 0 16 1; +#X connect 18 0 19 0; +#X connect 19 0 16 0; +#X connect 26 0 28 1; +#X connect 27 0 26 0; +#X connect 28 0 53 0; +#X connect 29 0 28 2; +#X connect 30 0 29 0; +#X connect 35 0 28 0; diff --git a/help/pix_frei0r-help.pd b/help/pix_frei0r-help.pd index 245ffd7bc..5e8cad70e 100644 --- a/help/pix_frei0r-help.pd +++ b/help/pix_frei0r-help.pd @@ -1,64 +1,30 @@ #N canvas 19 86 676 556 10; #X declare -lib Gem; #X text 482 18 GEM object; -#X obj 7 376 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 376 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 378 Inlets:; #X text 11 478 Outlets:; -#X obj 8 340 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 340 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 342 Arguments:; -#X obj 8 56 cnv 15 430 280 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 56 cnv 15 430 280 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 451 58 Example:; #X text 71 31 Class: pix object; #X text 29 491 Outlet 1: gemlist; #X text 22 392 Inlet 1: gemlist; -#X obj 13 512 cnv 15 410 30 empty empty empty 20 12 0 14 -260818 -66577 -0; +#X obj 13 512 cnv 15 410 30 empty empty empty 20 12 0 14 #fcac44 #404040 0; #X text 50 12 Synopsis: [pix_frei0r]; #X text 63 353 : the plugin to load; -#X text 13 72 This object allows you to load any Frei0r video-effect. -Frei0r is a minimalistic plugin API for realtime video effects.; -#X text 15 513 You can get more information as well as links to downloadable -plugin-packs at http://piksel.org/frei0r; -#X msg 455 330 gemList; -#X text 12 308 Plugins are searched in all the paths that Pd searches -for abstractions \, ...!; +#X text 13 72 This object allows you to load any Frei0r video-effect. Frei0r is a minimalistic plugin API for realtime video effects.; +#X text 15 513 You can get more information as well as links to downloadable plugin-packs at http://piksel.org/frei0r; +#X text 12 308 Plugins are searched in all the paths that Pd searches for abstractions \, ...!; #X text 28 56 Description: run a Frei0r effect; #X obj 449 113 gemhead; -#X obj 448 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 514 340 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 519 379 pd gemwin; -#X msg 519 360 create; -#X text 515 339 Create window:; +#X obj 448 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 514 344 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 451 83 gemhead; -#X obj 451 342 square 3; -#X obj 451 320 pix_texture; #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -77,14 +43,11 @@ for abstractions \, ...!; #X text 523 114 macOS: quicktime; #X text 516 104 MS Windows: *.AVI; #X text 523 124 linux: depends...; -#X obj 450 227 cnv 15 160 85 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X floatatom 567 241 5 0 0 0 - - -; -#X obj 463 241 hsl 100 15 0 1 0 0 empty empty xSize -2 -6 0 10 -262144 --1 -1 0 1; -#X floatatom 567 270 5 0 0 0 - - -; -#X obj 463 270 hsl 100 15 0 1 0 0 empty empty ySize -2 -6 0 10 -262144 --1 -1 0 1; +#X obj 450 227 cnv 15 160 85 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X floatatom 567 241 5 0 0 0 - - - 0; +#X obj 463 241 hsl 100 15 0 1 0 0 empty empty xSize -2 -6 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 567 270 5 0 0 0 - - - 0; +#X obj 463 270 hsl 100 15 0 1 0 0 empty empty ySize -2 -6 0 10 #fcfcfc #000000 #000000 0 1; #X text 442 411 This example relies on; #X obj 451 180 pix_rgba; #X text 513 176 Frei0r plugins; @@ -93,41 +56,26 @@ for abstractions \, ...!; #X text 442 426 finding the "pixeliz0r" plugin; #X text 445 457 plugin set) in Pd's search path; #X text 443 441 (which is part of the official frei0r; -#X text 12 112 If you specify the plugin when creating the object (e.g -[pix_frei0r bw0r] or [pix_bw0r] \, the plugin is fixed and you cannot -change it (apart from deleting the object and creating a new one); -#X text 13 163 However \, if you only create an object [pix_frei0r] -(without specifying the plugin \, you will get a dynamic version \, -where you can load in a plugin using the "load" message.; -#X text 12 202 Most plugins have a number of parameters which you can -use to change the behaviour of the effect while it runs. For each parameter -exposed \, the [pix_frei0r] object will get one additional inlet \, -which can be used to modify the given parameter. Alternatively (e.g. -when using dynamic plugin instances) you can also use the parametername -or "#" (starting from 1).; -#X text 13 284 Frei0r numerical parameters are supposed to be in the -range 0..1.; -#X text 21 453 Inlet 2..N (if applicable): : depending on the -settable parameter; -#X text 22 419 Inlet 1: # : set parameter # (starting -from 1); -#X text 22 441 Inlet 1: : set parameter given by -; +#X text 12 112 If you specify the plugin when creating the object (e.g [pix_frei0r bw0r] or [pix_bw0r] \, the plugin is fixed and you cannot change it (apart from deleting the object and creating a new one); +#X text 13 163 However \, if you only create an object [pix_frei0r] (without specifying the plugin \, you will get a dynamic version \, where you can load in a plugin using the "load" message.; +#X text 12 202 Most plugins have a number of parameters which you can use to change the behaviour of the effect while it runs. For each parameter exposed \, the [pix_frei0r] object will get one additional inlet \, which can be used to modify the given parameter. Alternatively (e.g. when using dynamic plugin instances) you can also use the parametername or "#" (starting from 1).; +#X text 13 284 Frei0r numerical parameters are supposed to be in the range 0..1.; +#X text 21 453 Inlet 2..N (if applicable): : depending on the settable parameter; +#X text 22 419 Inlet 1: # : set parameter # (starting from 1); +#X text 22 441 Inlet 1: : set parameter given by ; #X obj 548 18 declare -lib Gem; -#X text 22 406 Inlet 1: load : load another plugin (if applicable) -; -#X connect 22 0 23 0; -#X connect 23 0 22 0; -#X connect 25 0 28 0; -#X connect 27 0 26 0; -#X connect 28 0 43 0; -#X connect 28 2 29 0; -#X connect 29 0 28 1; -#X connect 30 0 31 0; -#X connect 31 0 28 0; -#X connect 38 0 46 1; -#X connect 39 0 38 0; -#X connect 40 0 46 2; -#X connect 41 0 40 0; -#X connect 43 0 46 0; -#X connect 46 0 27 0; +#X text 22 406 Inlet 1: load : load another plugin (if applicable); +#X obj 521 350 _gemwin; +#X obj 451 320 _pix2rectangle 3; +#X connect 21 0 22 0; +#X connect 22 0 37 0; +#X connect 22 2 23 0; +#X connect 23 0 22 1; +#X connect 24 0 25 0; +#X connect 25 0 22 0; +#X connect 32 0 40 1; +#X connect 33 0 32 0; +#X connect 34 0 40 2; +#X connect 35 0 34 0; +#X connect 37 0 40 0; +#X connect 40 0 54 0; diff --git a/help/pix_gain-help.pd b/help/pix_gain-help.pd index d02a6bc1b..74030b81e 100644 --- a/help/pix_gain-help.pd +++ b/help/pix_gain-help.pd @@ -1,90 +1,38 @@ #N canvas 394 120 624 402 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 275 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 275 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 278 Inlets:; #X text 38 355 Outlets:; -#X obj 8 236 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 236 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 235 Arguments:; -#X obj 7 76 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 148 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 148 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 246 ; #X text 56 368 Outlet 1: gemlist; #X text 23 292 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); +#X obj 451 233 _pix2rectangle 3; #X obj 451 206 pix_gain; #X text 50 12 Synopsis: [pix_gain]; #X text 29 76 Description: multiply pixel-values; -#X floatatom 476 151 5 0 0 1 common - -; +#X floatatom 476 151 5 0 0 1 common - - 0; #X msg 527 179 1 0.5 0; #X msg 528 201 0 0.4 0.8 1; -#X text 10 93 pix_gain applies a gain multiplier to each pixel in a -pix. The float is a constant modifier applied to all color components. -If you use just R G B \, it assumes an alpha of 1.0.; -#X text 13 152 NOTE: while you can use this \, remember that you can -often achieve the very same thing using the [color]-object for coloring -the Geo onto which the image data is textured \, which could be done -on the gfx-card (very efficient!) \, while [pix_gain] is always(!) -done on the CPU!!!; +#X text 10 93 pix_gain applies a gain multiplier to each pixel in a pix. The float is a constant modifier applied to all color components. If you use just R G B \, it assumes an alpha of 1.0.; +#X text 13 152 NOTE: while you can use this \, remember that you can often achieve the very same thing using the [color]-object for coloring the Geo onto which the image data is textured \, which could be done on the gfx-card (very efficient!) \, while [pix_gain] is always(!) done on the CPU!!!; #X text 23 305 Inlet 1: : multiplier for all channels; -#X text 23 321 Inlet 2: list: 3 (RGB) or 4 (RGBA) values as multipliers -for each channels; +#X text 23 321 Inlet 2: list: 3 (RGB) or 4 (RGBA) values as multipliers for each channels; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 24 0 21 0; -#X connect 27 0 24 1; -#X connect 28 0 24 2; -#X connect 29 0 24 2; +#X obj 523 260 _gemwin; +#X obj 451 113 pix_test; +#X connect 11 0 29 0; +#X connect 17 0 16 0; +#X connect 20 0 17 1; +#X connect 21 0 17 2; +#X connect 22 0 17 2; +#X connect 29 0 17 0; diff --git a/help/pix_grey-help.pd b/help/pix_grey-help.pd index a2adac138..f898ed035 100644 --- a/help/pix_grey-help.pd +++ b/help/pix_grey-help.pd @@ -10,50 +10,13 @@ #X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; #X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; -#N canvas 0 22 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); +#X obj 451 233 _pix2rectangle 3; #X text 50 12 Synopsis: [pix_grey]; #X text 15 77 Description: convert the colorspace of an image to GREY; #X text 22 93 Images can be stored in various formats/color-spaces.; @@ -68,10 +31,9 @@ #X obj 24 390 pix_2grey; #X text 97 384 produces similar ("grey") results \, but does NO colourspace-conversion!!; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 29 0; -#X connect 29 0 21 0; -#X connect 30 0 29 0; +#X obj 451 113 pix_test; +#X obj 523 259 _gemwin; +#X connect 11 0 31 0; +#X connect 22 0 16 0; +#X connect 23 0 22 0; +#X connect 31 0 22 0; diff --git a/help/pix_halftone-help.pd b/help/pix_halftone-help.pd index c89903302..64b2a16f8 100644 --- a/help/pix_halftone-help.pd +++ b/help/pix_halftone-help.pd @@ -1,46 +1,18 @@ #N canvas 318 61 628 469 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 335 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 261 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 300 pd gemwin; -#X msg 519 281 create; -#X text 515 260 Create window:; -#X obj 450 133 cnv 15 160 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 261 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 133 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -62,21 +34,15 @@ #X text 50 13 Synopsis: [pix_halftone]; #X text 71 31 Class: pix object (fx); #X obj 451 206 pix_halftone; -#X obj 451 237 pix_texture; -#X obj 451 261 square 3; -#X floatatom 467 150 5 1 32 2 size - -; -#X floatatom 515 150 5 0 0 2 angle - -; -#X floatatom 560 150 5 0 1 2 smooth - -; -#X obj 536 187 hradio 15 1 0 5 empty empty style 40 -6 0 8 -262144 --1 -1 0; -#X msg 539 205 style \$1; +#X floatatom 467 150 5 1 32 2 size - - 0; +#X floatatom 515 150 5 0 0 2 angle - - 0; +#X floatatom 560 150 5 0 1 2 smooth - - 0; +#X obj 536 187 hradio 15 1 0 5 empty empty style 40 -6 0 8 #fcfcfc #000000 #000000 0; +#X msg 536 206 style \$1; #X text 29 76 Description: make halftone-patterns; -#X text 19 97 [pix_halftone] draws the input using the patterns of -dots or diamonds that are found in newspaper photographs.; -#X text 20 132 You can set the type of pattern \, the size and orientation -of the patterns and how blurry they are on-screen.; -#X text 63 275 Inlet 1: message: style [0|1|2|3|4]:: select a style -; +#X text 19 97 [pix_halftone] draws the input using the patterns of dots or diamonds that are found in newspaper photographs.; +#X text 20 132 You can set the type of pattern \, the size and orientation of the patterns and how blurry they are on-screen.; +#X text 63 275 Inlet 1: message: style [0|1|2|3|4]:: select a style; #X text 62 291 Inlet 2: float: pattern-size (1..32. default 8); #X text 62 306 Inlet 3: float: orientation in degree (0..360); #X text 62 321 Inlet 4: float: smoothness (0..1. default 0.5); @@ -86,15 +52,14 @@ of the patterns and how blurry they are on-screen.; #X text 111 418 3...'euclidean' dots; #X text 111 431 4...postscript diamond dots; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 24 0; -#X connect 24 0 25 0; +#X obj 451 237 _pix2rectangle 3; +#X obj 521 268 _gemwin; +#X connect 11 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 21 0; +#X connect 21 0 40 0; +#X connect 22 0 21 1; +#X connect 23 0 21 2; +#X connect 24 0 21 3; #X connect 25 0 26 0; -#X connect 27 0 24 1; -#X connect 28 0 24 2; -#X connect 29 0 24 3; -#X connect 30 0 31 0; -#X connect 31 0 24 0; +#X connect 26 0 21 0; diff --git a/help/pix_histo-help.pd b/help/pix_histo-help.pd index 892aa3eae..d536f8471 100644 --- a/help/pix_histo-help.pd +++ b/help/pix_histo-help.pd @@ -1,47 +1,19 @@ #N canvas 230 118 660 604 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 405 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 405 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 408 Inlets:; #X text 38 505 Outlets:; -#X obj 8 336 cnv 15 430 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 336 cnv 15 430 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 335 Arguments:; -#X obj 7 76 cnv 15 430 250 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 250 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 143 cnv 15 180 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 264 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 143 cnv 15 180 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,21 +30,13 @@ #X text 56 518 Outlet 1: gemlist; #X text 63 422 Inlet 1: gemlist; #X text 50 12 Synopsis: [pix_color]; -#X obj 451 253 pix_draw; +#X obj 451 243 _pix2rectangle 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X text 20 101 [pix_histo] will get the histogram (density function) -of an image.; -#X text 21 140 The histogram will be stored in tables. If you specify -(via creation-arguments or via the "set"-command) only one table \, -a histogram of the greyscaled-image will be made. If you provide 3 -tables \, the Alpha channel will be ignored.; -#X text 21 200 The length of the used table does not matter. The first -element of the table will always hold the density of the "0"(min) value -\, the last element will hold the density of the "255"(max) value. -; -#X text 23 259 The histogram will be scaled \, so that all densities -sum up to 1.0f; +#X text 20 101 [pix_histo] will get the histogram (density function) of an image.; +#X text 21 140 The histogram will be stored in tables. If you specify (via creation-arguments or via the "set"-command) only one table \, a histogram of the greyscaled-image will be made. If you provide 3 tables \, the Alpha channel will be ignored.; +#X text 21 200 The length of the used table does not matter. The first element of the table will always hold the density of the "0"(min) value \, the last element will hold the density of the "255"(max) value.; +#X text 23 259 The histogram will be scaled \, so that all densities sum up to 1.0f; #X text 29 75 Description: excerpt histograms of an image; #X obj 158 543 table tab-1; #X obj 242 544 table tab-2; @@ -88,19 +52,15 @@ sum up to 1.0f; #X text 63 346 1 arg:: to store grey-histogram; #X text 62 363 3 args: s to store RGB-histograms; #X text 62 378 4 args: s to store RGBA-histograms; -#X text 63 435 Inlet 1: set : table to store grey-histogram -; -#X text 63 449 Inlet 1: set : tables to store -RGB-histograms; -#X text 63 474 Inlet 1: set : tables -to store RGBA-histograms; +#X text 63 435 Inlet 1: set
: table to store grey-histogram; +#X text 63 449 Inlet 1: set : tables to store RGB-histograms; +#X text 63 474 Inlet 1: set : tables to store RGBA-histograms; #X obj 528 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 34 0; -#X connect 32 0 34 0; -#X connect 34 0 21 0; -#X connect 35 0 34 0; -#X connect 36 0 34 0; +#X obj 522 271 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 31 0; +#X connect 29 0 31 0; +#X connect 31 0 18 0; +#X connect 32 0 31 0; +#X connect 33 0 31 0; diff --git a/help/pix_hsv2rgb-help.pd b/help/pix_hsv2rgb-help.pd index 1cb35b02a..d6311e18b 100644 --- a/help/pix_hsv2rgb-help.pd +++ b/help/pix_hsv2rgb-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 626 365 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,27 +30,22 @@ #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; +#X obj 451 233 _pix2rectangle 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 451 186 pix_hsv2rgb; -#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; +#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X text 63 275 Inlet 1: 1|0 : apply/don't apply (default:1); #X text 50 12 Synopsis: [pix_hsv2rgb]; #X text 29 76 Description: convert HSV into RGB; -#X text 25 104 [pix_hsv2rgb] will (virtually) transform an HSV(hue -\, saturation \, value)images into RGB(red \, green \, blue) color-space. -; -#X text 24 156 On the technical (internal) side \, the image is always -RGBA. The Red-channel is interpreted as Hue-values....; +#X text 25 104 [pix_hsv2rgb] will (virtually) transform an HSV(hue \, saturation \, value)images into RGB(red \, green \, blue) color-space.; +#X text 24 156 On the technical (internal) side \, the image is always RGBA. The Red-channel is interpreted as Hue-values....; #X text 94 340 see also:; #X obj 187 338 pix_rgb2hsv; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 24 0 21 0; -#X connect 25 0 24 0; +#X obj 519 258 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 21 0; +#X connect 21 0 18 0; +#X connect 22 0 21 0; diff --git a/help/pix_image-help.pd b/help/pix_image-help.pd index 247c80b68..2805287ca 100644 --- a/help/pix_image-help.pd +++ b/help/pix_image-help.pd @@ -1,49 +1,21 @@ #N canvas 265 101 690 395 10; #X declare -lib Gem; #X text 502 8 GEM object; -#X obj 8 295 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 295 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 298 Inlets:; #X text 38 355 Outlets:; -#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 256 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 255 Arguments:; -#X obj 7 76 cnv 15 430 175 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 230 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 175 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 230 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 451 148 cnv 15 220 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 564 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 148 cnv 15 220 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 56 368 Outlet 1: gemlist; #X text 63 312 Inlet 1: gemlist; -#X obj 451 263 pix_draw; -#X obj 467 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 451 263 _pix2rectangle 3; +#X obj 467 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 openpanel 0; #X obj 114 62 inlet; #X obj 121 254 outlet; @@ -61,38 +33,27 @@ #X text 29 76 Description: loads in an image file; #X text 50 12 Synopsis: [pix_image]; #X text 71 31 Class: pix source; -#X text 16 93 [pix_image] loads in an image to be used a texture \, -bitblit \, or something else. If you don't give it a default image -file \, you can send the open message with a filename.; +#X text 16 93 [pix_image] loads in an image to be used a texture \, bitblit \, or something else. If you don't give it a default image file \, you can send the open message with a filename.; #X text 63 266 ; -#X text 15 202 The image can be either drawn directly using [pix_draw] -(VERY slow) or applied as a texture onto a Geo ([pix_texture]); #X text 63 338 Inlet 1: thread <1|0>; #X text 237 339 see; #N canvas 747 482 552 300 threaded 0; -#X text 53 58 on some systems (namely: linux) \, [pix_image] will usually -be compiled with threaded image-loading.; -#X text 52 90 this will make loading of images more smooth \, as chances -are low that it will block the entire Pd-process.; -#X text 56 130 caveat: some users have reported problems when using -large numbers of [pix_image]s (e.g. 300) which will create 300 helper-threads. -this might eventually slow down your machine.; -#X text 57 197 you can turn off thread-loading by sending a [thread -0( message to [pix_image] _before_ loading an image.; +#X text 53 58 on some systems (namely: linux) \, [pix_image] will usually be compiled with threaded image-loading.; +#X text 52 90 this will make loading of images more smooth \, as chances are low that it will block the entire Pd-process.; +#X text 56 130 caveat: some users have reported problems when using large numbers of [pix_image]s (e.g. 300) which will create 300 helper-threads. this might eventually slow down your machine.; +#X text 57 197 you can turn off thread-loading by sending a [thread 0( message to [pix_image] _before_ loading an image.; #X restore 272 340 pd threaded loading; #X msg 521 196 thread \$1; -#X obj 521 177 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X text 15 138 [pix_image] loads in TIFFs \, JPEGs and probably more -(depending on your platform and how Gem was compiled); +#X obj 521 177 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 15 138 [pix_image] loads in TIFFs \, JPEGs and probably more (depending on your platform and how Gem was compiled); #X obj 451 226 pix_image examples/data/fractal.JPG; #X obj 578 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 34 0; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 34 0; -#X connect 31 0 34 0; -#X connect 32 0 31 0; -#X connect 34 0 17 0; +#X text 14 202 The image can be either drawn directly using [pix_draw] (VERY slow) or applied as a texture onto a Geo ([pix_texture]), f 68; +#X obj 569 257 _gemwin; +#X connect 11 0 30 0; +#X connect 15 0 16 0; +#X connect 16 0 17 0; +#X connect 17 0 30 0; +#X connect 27 0 30 0; +#X connect 28 0 27 0; +#X connect 30 0 14 0; diff --git a/help/pix_imageInPlace-help.pd b/help/pix_imageInPlace-help.pd index e2d72fa8d..122bceecd 100644 --- a/help/pix_imageInPlace-help.pd +++ b/help/pix_imageInPlace-help.pd @@ -1,85 +1,45 @@ #N canvas 6 61 629 507 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 335 cnv 15 430 160 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 335 cnv 15 430 160 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 341 Inlets:; #X text 38 465 Outlets:; -#X obj 8 300 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 300 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 299 Arguments:; -#X obj 7 76 cnv 15 430 220 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 128 cnv 15 160 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 128 cnv 15 160 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 16 478 Outlet 1: gemlist; #X text 23 355 Inlet 1: gemlist; #X text 71 31 Class: pix source; #X obj 451 256 square; -#X floatatom 544 203 3 0 5 0 image# - -; +#X floatatom 544 203 3 0 5 0 image$ - - 0; #X text 29 76 Description: loads in multiple image files; #X text 63 311 (with wildcard *) for images to load; #X text 23 448 Inlet 2: : select image (starting at 0); #X obj 451 226 pix_imageInPlace; #X text 456 376 see also:; #X obj 522 376 pix_multiimage; -#X text 25 158 This is potentially slow if you are trying to change -between a lot of images \, but it doesn't use a lot of texture ram. -; -#X text 25 199 [pix_imageInPlace] sends all of the image data to texture -RAM when the preload message is received. This means that you cannot -process any of the pixel data \, but it is extremely quick to change -between the various images.; -#X text 20 257 Additionally \, you do not need a [pix_texture] object. -; -#X text 34 277 [pix_imageInPlace] loads TIFF \, JPEG and PNG images. -; +#X text 25 158 This is potentially slow if you are trying to change between a lot of images \, but it doesn't use a lot of texture ram.; +#X text 25 199 [pix_imageInPlace] sends all of the image data to texture RAM when the preload message is received. This means that you cannot process any of the pixel data \, but it is extremely quick to change between the various images.; +#X text 20 257 Additionally \, you do not need a [pix_texture] object.; +#X text 34 277 [pix_imageInPlace] loads TIFF \, JPEG and PNG images.; #X text 50 12 Synopsis: [pix_imageInPlace]; #X msg 474 161 download; #X msg 475 188 purge; #X msg 460 135 preload myFiles*.tif 5; -#X text 23 368 Inlet 1: preload <#> : open images (the wildcard -in the filename is expanded with integer 0..#); -#X text 23 397 Inlet 1: download : load the "preload"ed images into -texture-RAM; +#X text 23 368 Inlet 1: preload <#> : open images (the wildcard in the filename is expanded with integer 0..#); +#X text 23 397 Inlet 1: download : load the "preload"ed images into texture-RAM; #X text 24 427 Inlet 1: purge: delete images from texture-RAM; -#X text 24 100 [pix_imageInPlace] is slightly different than [pix_multiimage]. -When you select an image to display with [pix_multiimage] \, it copies -over the image data to the pix-buffer \, which is then used by [pix_texture]. -; +#X text 24 100 [pix_imageInPlace] is slightly different than [pix_multiimage]. When you select an image to display with [pix_multiimage] \, it copies over the image data to the pix-buffer \, which is then used by [pix_texture].; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 23 0; -#X connect 19 0 23 1; -#X connect 23 0 18 0; -#X connect 31 0 23 0; -#X connect 32 0 23 0; -#X connect 33 0 23 0; +#X obj 522 260 _gemwin; +#X connect 11 0 20 0; +#X connect 16 0 20 1; +#X connect 20 0 15 0; +#X connect 28 0 20 0; +#X connect 29 0 20 0; +#X connect 30 0 20 0; diff --git a/help/pix_info-help.pd b/help/pix_info-help.pd index 4b56532ce..5d5e6abe8 100644 --- a/help/pix_info-help.pd +++ b/help/pix_info-help.pd @@ -9,27 +9,6 @@ #X obj 449 77 cnv 15 170 520 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 514 530 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 569 pd gemwin; -#X msg 519 550 create; -#X text 515 529 Create window:; #X obj 451 158 cnv 15 160 330 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; @@ -47,10 +26,8 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 503 pix_texture; #X text 57 393 Outlet 1: gemlist; #X text 63 332 Inlet 1: gemlist; -#X obj 451 525 square 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X floatatom 461 240 4 0 0 1 width - - 0; @@ -93,29 +70,28 @@ #X obj 461 291 route dimen bytes/pixel format; #X obj 460 421 route dimen bytes/pixel format; #X obj 544 444 symbol; -#X connect 9 0 10 0; -#X connect 10 0 9 0; -#X connect 13 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 38 0; -#X connect 17 0 20 0; -#X connect 37 0 49 0; -#X connect 37 1 60 0; -#X connect 38 0 37 0; -#X connect 38 1 23 0; -#X connect 38 2 24 0; -#X connect 38 3 25 0; -#X connect 38 4 26 0; -#X connect 39 0 40 0; -#X connect 39 1 41 0; -#X connect 45 0 46 0; -#X connect 45 1 47 0; -#X connect 49 0 17 0; -#X connect 49 1 61 0; -#X connect 60 0 39 0; -#X connect 60 1 42 0; -#X connect 60 2 43 0; -#X connect 61 0 45 0; -#X connect 61 1 48 0; -#X connect 61 2 62 0; -#X connect 62 0 50 0; +#X obj 520 538 _gemwin; +#X obj 451 496 _pix2rectangle 3; +#X connect 10 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 33 0; +#X connect 32 0 44 0; +#X connect 32 1 55 0; +#X connect 33 0 32 0; +#X connect 33 1 18 0; +#X connect 33 2 19 0; +#X connect 33 3 20 0; +#X connect 33 4 21 0; +#X connect 34 0 35 0; +#X connect 34 1 36 0; +#X connect 40 0 41 0; +#X connect 40 1 42 0; +#X connect 44 0 59 0; +#X connect 44 1 56 0; +#X connect 55 0 34 0; +#X connect 55 1 37 0; +#X connect 55 2 38 0; +#X connect 56 0 40 0; +#X connect 56 1 43 0; +#X connect 56 2 57 0; +#X connect 57 0 45 0; diff --git a/help/pix_invert-help.pd b/help/pix_invert-help.pd index 04ecb0748..b6960fc30 100644 --- a/help/pix_invert-help.pd +++ b/help/pix_invert-help.pd @@ -1,79 +1,32 @@ #N canvas 6 61 626 337 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; +#X obj 451 233 _pix2rectangle 3; +#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X text 63 275 Inlet 1: 1|0 : apply/don't apply (default:1); #X obj 451 186 pix_invert; #X text 29 76 Description: invert an image; -#X text 16 126 [pix_invert] will invert your image. Thus all black -pixels will become white and vice-versa.; +#X text 16 126 [pix_invert] will invert your image. Thus all black pixels will become white and vice-versa.; #X text 50 12 Synopsis: [pix_invert]; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 26 0; -#X connect 24 0 26 0; -#X connect 26 0 21 0; +#X obj 519 258 _gemwin; +#X obj 451 113 pix_test; +#X connect 11 0 25 0; +#X connect 17 0 19 0; +#X connect 19 0 16 0; +#X connect 25 0 19 0; diff --git a/help/pix_kaleidoscope-help.pd b/help/pix_kaleidoscope-help.pd index c38d193b3..c7c7f7a5d 100644 --- a/help/pix_kaleidoscope-help.pd +++ b/help/pix_kaleidoscope-help.pd @@ -1,140 +1,75 @@ #N canvas 102 92 647 538 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 7 206 cnv 15 430 280 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 7 206 cnv 15 430 280 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 11 208 Inlets:; #X text 11 458 Outlets:; -#X obj 8 166 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 166 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 168 Arguments:; -#X obj 8 56 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 447 85 cnv 15 190 400 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 447 85 cnv 15 190 400 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 451 68 Example:; -#X obj 531 420 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 536 459 pd gemwin; -#X msg 536 440 create; -#X text 532 419 Create window:; -#X obj 456 146 cnv 15 175 215 empty empty empty 20 12 0 14 -106138 --66577 0; +#X obj 531 420 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 456 146 cnv 15 175 215 empty empty empty 20 12 0 14 #64e864 #404040 0; #X text 71 31 Class: pix object; #X text 63 179 ; #X text 29 471 Outlet 1: gemlist; #X text 22 226 Inlet 1: gemlist; #X text 50 12 Synopsis: [pix_kaleidoscope]; #X text 28 56 Description: kaleidoscope effect; -#X text 13 72 This effect is similar to a traditional kaleidoscope -\, and allows you to reflect a part of the image multiple times around -a centre point. You can set how many segments you want the image reflected -as \, how the mirrors are rotated \, where the center of the output -images is \, and what part of the source image is used as the source. -; -#X obj 446 364 cnv 15 120 25 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X text 13 72 This effect is similar to a traditional kaleidoscope \, and allows you to reflect a part of the image multiple times around a centre point. You can set how many segments you want the image reflected as \, how the mirrors are rotated \, where the center of the output images is \, and what part of the source image is used as the source.; +#X obj 446 364 cnv 15 120 25 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 449 92 gemhead; -#X obj 508 93 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 181 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 449 121 pd image; -#X obj 449 391 pix_texture; -#X obj 449 413 square 3; -#X floatatom 464 149 5 0 64 1 segments - -; -#X floatatom 479 169 5 0 0 1 sourceAngle - -; -#X text 514 113 open an image; -#X text 507 126 (JPEG \, TIFF \, ..); +#X floatatom 464 149 5 0 64 1 segments - - 0; +#X floatatom 479 169 5 0 0 1 sourceAngle - - 0; #X obj 449 369 pix_kaleidoscope; -#X floatatom 510 245 5 0 0 1 outputAngle - -; -#X floatatom 556 341 5 0.1 10 1 sap - -; -#X floatatom 540 325 5 0 1 1 rlp - -; +#X floatatom 510 245 5 0 0 1 outputAngle - - 0; +#X floatatom 556 341 5 0.1 10 1 sap - - 0; +#X floatatom 540 325 5 0 1 1 rlp - - 0; #X obj 525 304 pack; #X obj 579 304 t b f; -#X floatatom 525 265 4 0 100 0 - - -; -#X floatatom 577 265 4 0 100 0 - - -; -#X text 22 243 Inlet 2: float: number of segments (0..64 \, default: -7); -#X text 22 260 Inlet 3: float: rotation of the input-segment (in degree) -; -#X text 22 277 Inlet 4: list : normalized center-position of -the of the segment of the input image. (0..1 \, default 0.5); -#X text 22 307 Inlet 5: float: rotation of the output-segment (in degree) -; -#X text 22 325 Inlet 6: list : normalized center-position of -the of the segments in the output image. (0..1 \, default 0.5); -#X text 22 353 Inlet 7: float: reflection line proportion \, controls -the relative sizes of each pair of adjacent segments in the output -image (0..1 \, default 0.5); -#X text 22 400 Inlet 8: float: source angle proportion \, sets the -angular size of the source segment \, relative to the size of the output -segment \; altering this value will squash or expand (0.1..10 \, default: -1); -#X obj 71 498 cnv 15 370 20 empty empty empty 20 12 0 14 -260818 -66577 -0; -#X text 80 501 (ported from "pete's_plugins" \, www.petewarden.com) -; +#X floatatom 525 265 4 0 100 0 - - - 0; +#X floatatom 577 265 4 0 100 0 - - - 0; +#X text 22 243 Inlet 2: float: number of segments (0..64 \, default: 7); +#X text 22 260 Inlet 3: float: rotation of the input-segment (in degree); +#X text 22 277 Inlet 4: list : normalized center-position of the of the segment of the input image. (0..1 \, default 0.5); +#X text 22 307 Inlet 5: float: rotation of the output-segment (in degree); +#X text 22 325 Inlet 6: list : normalized center-position of the of the segments in the output image. (0..1 \, default 0.5); +#X text 22 353 Inlet 7: float: reflection line proportion \, controls the relative sizes of each pair of adjacent segments in the output image (0..1 \, default 0.5); +#X text 22 400 Inlet 8: float: source angle proportion \, sets the angular size of the source segment \, relative to the size of the output segment \; altering this value will squash or expand (0.1..10 \, default: 1); +#X obj 71 498 cnv 15 370 20 empty empty empty 20 12 0 14 #fcac44 #404040 0; +#X text 80 501 (ported from "pete's_plugins" \, www.petewarden.com); #X obj 525 284 * 0.01; #X obj 577 284 * 0.01; #X obj 495 226 pack; #X obj 549 226 t b f; -#X floatatom 495 187 4 0 100 0 - - -; -#X floatatom 547 187 4 0 100 0 - - -; +#X floatatom 495 187 4 0 100 0 - - - 0; +#X floatatom 547 187 4 0 100 0 - - - 0; #X obj 495 206 * 0.01; #X obj 547 206 * 0.01; #X obj 538 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 22 0 24 0; -#X connect 23 0 24 1; -#X connect 24 0 31 0; -#X connect 25 0 26 0; -#X connect 27 0 31 1; -#X connect 28 0 31 2; -#X connect 31 0 25 0; -#X connect 32 0 31 4; -#X connect 33 0 31 7; -#X connect 34 0 31 6; -#X connect 35 0 31 5; -#X connect 36 0 35 0; -#X connect 36 1 35 1; -#X connect 37 0 48 0; -#X connect 38 0 49 0; -#X connect 48 0 35 0; -#X connect 49 0 36 0; -#X connect 50 0 31 3; -#X connect 51 0 50 0; -#X connect 51 1 50 1; -#X connect 52 0 54 0; -#X connect 53 0 55 0; -#X connect 54 0 50 0; -#X connect 55 0 51 0; +#X obj 540 425 _gemwin; +#X obj 449 121 pix_test; +#X obj 449 391 _pix2rectangle 3; +#X connect 19 0 49 0; +#X connect 20 0 22 1; +#X connect 21 0 22 2; +#X connect 22 0 50 0; +#X connect 23 0 22 4; +#X connect 24 0 22 7; +#X connect 25 0 22 6; +#X connect 26 0 22 5; +#X connect 27 0 26 0; +#X connect 27 1 26 1; +#X connect 28 0 39 0; +#X connect 29 0 40 0; +#X connect 39 0 26 0; +#X connect 40 0 27 0; +#X connect 41 0 22 3; +#X connect 42 0 41 0; +#X connect 42 1 41 1; +#X connect 43 0 45 0; +#X connect 44 0 46 0; +#X connect 45 0 41 0; +#X connect 46 0 42 0; +#X connect 49 0 22 0; diff --git a/help/pix_levels-help.pd b/help/pix_levels-help.pd index d4b297122..4205dabad 100644 --- a/help/pix_levels-help.pd +++ b/help/pix_levels-help.pd @@ -10,27 +10,6 @@ #X obj 449 77 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 514 314 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 353 pd gemwin; -#X msg 519 334 create; -#X text 515 313 Create window:; #X obj 450 138 cnv 15 160 150 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; @@ -54,11 +33,9 @@ #X connect 7 0 6 0; #X connect 8 0 7 0; #X restore 451 113 pd image; -#X obj 451 293 pix_texture; #X text 63 186 ; #X text 51 497 Outlet 1: gemlist; #X text 33 232 Inlet 1: gemlist; -#X obj 451 315 square 3; #X text 50 12 Synopsis: [pix_levels]; #X floatatom 543 250 5 0 100 1 low - - 0; #X floatatom 543 268 5 0 100 1 high - - 0; @@ -86,21 +63,20 @@ #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X obj 523 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 32 0; -#X connect 18 0 22 0; -#X connect 24 0 32 5; -#X connect 25 0 32 6; -#X connect 26 0 32 0; -#X connect 27 0 26 0; -#X connect 28 0 34 0; -#X connect 29 0 30 0; -#X connect 30 0 32 0; -#X connect 31 0 32 1; -#X connect 32 0 18 0; -#X connect 33 0 32 3; -#X connect 34 0 32 0; -#X connect 46 0 32 2; +#X obj 522 318 _gemwin; +#X obj 451 293 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 27 0; +#X connect 19 0 27 5; +#X connect 20 0 27 6; +#X connect 21 0 27 0; +#X connect 22 0 21 0; +#X connect 23 0 29 0; +#X connect 24 0 25 0; +#X connect 25 0 27 0; +#X connect 26 0 27 1; +#X connect 27 0 46 0; +#X connect 28 0 27 3; +#X connect 29 0 27 0; +#X connect 41 0 27 2; diff --git a/help/pix_lumaoffset-help.pd b/help/pix_lumaoffset-help.pd index 2d1dabef7..0d98dcdd8 100644 --- a/help/pix_lumaoffset-help.pd +++ b/help/pix_lumaoffset-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 629 393 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 310 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 451 138 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 138 cnv 15 160 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,46 +27,36 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 ; #X text 57 323 Outlet 1: gemlist; #X text 63 232 Inlet 1: gemlist; -#X obj 451 255 square 3; #X obj 451 207 pix_lumaoffset; -#X text 29 77 Description: offset pixels depending on the luminance -; -#X floatatom 497 152 5 0 0 2 offset - -; -#X floatatom 544 152 5 0 0 2 gap - -; +#X text 29 77 Description: offset pixels depending on the luminance; +#X floatatom 497 152 5 0 0 2 offset - - 0; +#X floatatom 544 152 5 0 0 2 gap - - 0; #X text 63 275 Inlet 2: float: offset-factor; #X text 64 288 Inlet 3: float: spacing between lines; -#X obj 533 169 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 533 169 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 533 187 smooth \$1; #X msg 465 186 fill \$1; -#X obj 465 168 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 465 168 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 63 259 Inlet 1: message: smooth [0|1] : do smooth fill; #X text 63 245 Inlet 1: message: fill [0|1] : draw filled lines; -#X text 13 91 [pix_lumaoffset] will offset each pixel in the y-direction -according to its luminance value. The amount of offsetting can be specified -as well as a gap between the offsetted lines. The gap can be filled -or left black \, if filled \, the transition can be smoothed.; +#X text 13 91 [pix_lumaoffset] will offset each pixel in the y-direction according to its luminance value. The amount of offsetting can be specified as well as a gap between the offsetted lines. The gap can be filled or left black \, if filled \, the transition can be smoothed.; #X text 50 12 Synopsis: [pix_lumaoffset]; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X text 13 357 NOTE: specifying too high offsets might cause crashes!!! -; +#X text 13 357 NOTE: specifying too high offsets might cause crashes!!!; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 23 0; -#X connect 18 0 22 0; -#X connect 23 0 18 0; -#X connect 25 0 23 1; -#X connect 26 0 23 2; -#X connect 29 0 30 0; -#X connect 30 0 23 0; -#X connect 31 0 23 0; -#X connect 32 0 31 0; +#X obj 522 260 _gemwin; +#X obj 451 233 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 18 0; +#X connect 18 0 37 0; +#X connect 20 0 18 1; +#X connect 21 0 18 2; +#X connect 24 0 25 0; +#X connect 25 0 18 0; +#X connect 26 0 18 0; +#X connect 27 0 26 0; diff --git a/help/pix_mask-help.pd b/help/pix_mask-help.pd index 7b06f7044..80f87dff0 100644 --- a/help/pix_mask-help.pd +++ b/help/pix_mask-help.pd @@ -1,46 +1,17 @@ #N canvas 71 263 665 372 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 33 229 Inlets:; #X text 33 285 Outlets:; -#X obj 8 191 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 191 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 190 Arguments:; -#X obj 8 56 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 56 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 56 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 39 Example:; -#X obj 514 269 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 92 create \, 1 \, color 0.5 0.5 0.5; -#X msg 198 112 destroy \, reset; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 308 pd gemwin; -#X msg 519 289 create; -#X text 515 268 Create window:; -#X obj 451 166 cnv 15 160 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 451 166 cnv 15 160 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 108 gemhead; -#X obj 496 91 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 496 91 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -54,11 +25,9 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 128 pd image; -#X obj 451 242 pix_texture; #X text 63 201 ; #X text 41 299 Outlet 1: gemlist; #X text 47 243 Inlet 1: gemlist; -#X obj 451 264 square 3; #X text 503 67 (JPEG \, TIFF \, ..); #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; @@ -73,19 +42,15 @@ #X connect 4 0 3 0; #X connect 5 0 1 0; #X restore 531 128 pd image; -#X obj 576 89 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 576 89 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X text 47 272 Inlet 2: gemlist; #X text 449 56 open two different images; #X text 71 31 Class: pix mix object; #X text 50 12 Synopsis: [pix_mask]; #X obj 451 177 pix_mask; #X text 29 57 Description: mask out a pix; -#X text 16 75 [pix_mask] uses one pix as a mask against another. Where -ever the mask has a black pixel \, the alpha component of the other -image will be set to 0 (transparent).; -#X text 19 115 Basically \, the luminance-value of the right pix will -become the alpha-value of the left pix.; +#X text 16 75 [pix_mask] uses one pix as a mask against another. Where ever the mask has a black pixel \, the alpha component of the other image will be set to 0 (transparent).; +#X text 19 115 Basically \, the luminance-value of the right pix will become the alpha-value of the left pix.; #X text 12 152 The 2 images have to be of the same size.; #X text 11 168 The left pix has to be in RGBA-space; #X obj 451 218 alpha; @@ -93,14 +58,13 @@ become the alpha-value of the left pix.; #X text 17 340 see also:; #X obj 82 342 pix_takealpha; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 29 0; -#X connect 17 0 21 0; -#X connect 23 0 29 1; -#X connect 24 0 23 1; +#X obj 491 267 _gemwin \; 0 \; 0 \; color 0.5 0.5 0.5; +#X obj 450 242 _pix2rectangle 3; +#X connect 10 0 12 0; +#X connect 11 0 12 1; +#X connect 12 0 23 0; +#X connect 17 0 23 1; +#X connect 18 0 17 1; +#X connect 23 0 29 0; #X connect 29 0 35 0; -#X connect 35 0 17 0; -#X connect 36 0 23 0; +#X connect 30 0 17 0; diff --git a/help/pix_mean_color-help.pd b/help/pix_mean_color-help.pd index 7a4119c83..3c8744db1 100644 --- a/help/pix_mean_color-help.pd +++ b/help/pix_mean_color-help.pd @@ -1,47 +1,19 @@ #N canvas 473 61 654 372 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 185 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 185 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 19 183 Inlets:; #X text 18 210 Outlets:; -#X obj 8 146 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 146 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 145 Arguments:; -#X obj 7 76 cnv 15 430 55 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 55 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 454 294 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 459 333 pd gemwin; -#X msg 459 314 create; -#X text 455 293 Create window:; -#X obj 450 141 cnv 15 160 65 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 454 294 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 141 cnv 15 160 65 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -66,41 +38,35 @@ #X text 43 197 Inlet 1: gemlist; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X obj 451 233 pix_texture; #X obj 451 146 pix_mean_color; #X text 50 12 Synopsis: [pix_mean_color]; -#X text 15 77 Description: get the mean color of the current image -; -#X text 22 93 Calculates the average color of the current image and -outputs it as RGBA values.; +#X text 15 77 Description: get the mean color of the current image; +#X text 22 93 Calculates the average color of the current image and outputs it as RGBA values.; #X obj 476 166 t l l; #X obj 514 166 unpack 0 0 0 0; #X obj 550 269 square 1; -#X obj 451 256 square 1; #X obj 550 231 gemhead; #X obj 550 250 color; -#X floatatom 514 186 3 0 0 0 - - -; -#X floatatom 537 186 3 0 0 0 - - -; -#X floatatom 560 186 3 0 0 0 - - -; -#X floatatom 583 186 3 0 0 0 - - -; +#X floatatom 514 186 3 0 0 0 - - - 0; +#X floatatom 537 186 3 0 0 0 - - - 0; +#X floatatom 560 186 3 0 0 0 - - - 0; +#X floatatom 583 186 3 0 0 0 - - - 0; #X obj 451 208 translateXYZ 0 2 0; -#X text 36 239 Outlet 2: : the -mean color of the image; +#X text 36 239 Outlet 2: : the mean color of the image; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 23 0 31 0; -#X connect 24 0 38 0; -#X connect 24 1 28 0; -#X connect 28 0 33 1; -#X connect 28 1 29 0; -#X connect 29 0 34 0; -#X connect 29 1 35 0; -#X connect 29 2 36 0; -#X connect 29 3 37 0; -#X connect 32 0 33 0; -#X connect 33 0 30 0; -#X connect 38 0 23 0; +#X obj 457 300 _gemwin; +#X obj 451 233 _pix2rectangle; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 20 0; +#X connect 20 0 33 0; +#X connect 20 1 24 0; +#X connect 24 0 28 1; +#X connect 24 1 25 0; +#X connect 25 0 29 0; +#X connect 25 1 30 0; +#X connect 25 2 31 0; +#X connect 25 3 32 0; +#X connect 27 0 28 0; +#X connect 28 0 26 0; +#X connect 33 0 37 0; diff --git a/help/pix_metaimage-help.pd b/help/pix_metaimage-help.pd index 82f939ea2..cb3fa0513 100644 --- a/help/pix_metaimage-help.pd +++ b/help/pix_metaimage-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 634 480 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 305 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 305 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 308 Inlets:; #X text 38 399 Outlets:; -#X obj 8 267 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 267 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 266 Arguments:; -#X obj 7 76 cnv 15 430 185 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 185 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 484 294 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,50 +30,34 @@ #X text 63 277 ; #X text 43 412 Outlet 1: gemlist; #X text 50 322 Inlet 1: gemlist; -#X obj 451 253 pix_draw; +#X obj 451 253 _pix2rectangle 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X text 50 335 Inlet 1: 1|0 : apply/don't apply (default:1), f 45 -; +#X text 50 335 Inlet 1: 1|0 : apply/don't apply (default:1), f 45; #X obj 451 226 pix_metaimage; -#X floatatom 537 159 3 0 1 1 size - -; -#X obj 457 178 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X floatatom 537 159 3 0 1 1 size - - 0; +#X obj 457 178 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 457 196 cheap \$1; -#X obj 521 178 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 521 178 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 521 196 distance \$1; #X text 29 76 Description: display a pix by itself; #X text 49 12 Synopsis: [pix_metaimage]; -#X text 22 103 The output image is composed of many smaller versions -of the input image \, altered to match the colors of the area they -cover in the original image., f 67; -#X text 50 350 Inlet 1: cheap 1|0 : use cheap and nasty algorithm (default:0) -, f 62; -#X text 50 364 Inlet 1: distance 1|0 : use distance-based algorithm -(default:0), f 64; -#X obj 35 447 cnv 15 375 20 empty empty empty 20 12 0 14 -260818 -66577 -0; -#X text 44 450 (ported from "pete's plugins" \, www.petewarden.com) -; +#X text 22 103 The output image is composed of many smaller versions of the input image \, altered to match the colors of the area they cover in the original image., f 67; +#X text 50 350 Inlet 1: cheap 1|0 : use cheap and nasty algorithm (default:0), f 62; +#X text 50 364 Inlet 1: distance 1|0 : use distance-based algorithm (default:0), f 64; +#X obj 35 447 cnv 15 375 20 empty empty empty 20 12 0 14 #fcac44 #404040 0; +#X text 44 450 (ported from "pete's plugins" \, www.petewarden.com); #X text 49 381 Inlet 2: : size; -#X text 22 148 Part of the scaling down process on the images involves -properly smoothing them \; turning the "cheap" parameter ON skips that -step \, giving a more jagged output but speeding up the processing. -, f 67; -#X text 22 205 The "distance" parameter controls how the size of the -images is changed by the 'size' message. If turned on \, then the size -doesn't scale linearly \, but is used as if the images were on a plane -in 3D space \, and controls the distance from the plane., f 67; +#X text 22 148 Part of the scaling down process on the images involves properly smoothing them \; turning the "cheap" parameter ON skips that step \, giving a more jagged output but speeding up the processing., f 67; +#X text 22 205 The "distance" parameter controls how the size of the images is changed by the 'size' message. If turned on \, then the size doesn't scale linearly \, but is used as if the images were on a plane in 3D space \, and controls the distance from the plane., f 67; #X obj 518 9 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 25 0; -#X connect 25 0 21 0; -#X connect 26 0 25 1; -#X connect 27 0 28 0; -#X connect 28 0 25 0; -#X connect 29 0 30 0; -#X connect 30 0 25 0; +#X obj 491 302 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 22 0; +#X connect 22 0 18 0; +#X connect 23 0 22 1; +#X connect 24 0 25 0; +#X connect 25 0 22 0; +#X connect 26 0 27 0; +#X connect 27 0 22 0; diff --git a/help/pix_mix-help.pd b/help/pix_mix-help.pd index 0eca9f8aa..c179a53de 100644 --- a/help/pix_mix-help.pd +++ b/help/pix_mix-help.pd @@ -1,47 +1,19 @@ #N canvas 6 124 683 381 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 196 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 196 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 198 Inlets:; #X text 39 281 Outlets:; -#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 156 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 155 Arguments:; -#X obj 8 66 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 329 pd gemwin; -#X msg 519 310 create; -#X text 515 289 Create window:; -#X obj 451 161 cnv 15 160 100 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 161 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 119 gemhead; #X text 71 31 Class: pix object; -#X obj 496 103 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 496 103 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,10 +27,8 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 138 pd image; -#X obj 451 267 pix_texture; #X text 17 295 Outlet 1: gemlist; #X text 23 212 Inlet 1: gemlist; -#X obj 451 289 square 3; #X text 503 88 (JPEG \, TIFF \, ..); #X obj 541 122 gemhead; #N canvas 0 0 587 366 image 0; @@ -71,9 +41,7 @@ #X obj 77 281 pix_buf; #X msg 103 257 auto 1; #X obj 103 236 loadbang; -#X text 156 263 [pix_buf] with auto 1 is important if we want to recalculate -our pix-effect each frame but don't want to reload the image all the -time.; +#X text 156 263 [pix_buf] with auto 1 is important if we want to recalculate our pix-effect each frame but don't want to reload the image all the time.; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 3 0 5 0; @@ -83,36 +51,29 @@ time.; #X connect 7 0 6 0; #X connect 8 0 7 0; #X restore 541 141 pd image; -#X obj 586 104 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 586 104 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X text 23 227 Inlet 2: gemlist; #X text 449 77 open two different images; #X text 50 12 Synopsis: [pix_mix]; -#X obj 476 177 hsl 128 15 0 1 0 1 empty empty empty -2 -6 0 8 -262144 --1 -1 6300 1; -#X floatatom 473 202 5 0 0 0 - - -; +#X obj 476 177 hsl 128 15 0 1 0 1 empty empty empty -2 -6 0 8 #fcfcfc #000000 #000000 6300 1; +#X floatatom 473 202 5 0 0 0 - - - 0; #X msg 530 201 0.7 0.7; #X text 29 67 Description: mix 2 images based on mixing factors; #X text 23 241 Inlet 3: list: weights for left/right image; #X text 63 166 list: [leftGain [rightGain]] (defaults: 0.5 0.5); #X obj 451 229 pix_mix 0; -#X text 14 81 [pix_mix] will mix 2 images just like a video-mixer. -You can supply mixing factors A and B \, and the result will be out=in1*A+in2*B. -If you supply only one factor A \, the result will be out=in1*(1-A)+in2*A. -; -#X text 22 255 Inlet 3: float: weight for left image. right weight -will be the reciprocal value (for crossfading); +#X text 14 81 [pix_mix] will mix 2 images just like a video-mixer. You can supply mixing factors A and B \, and the result will be out=in1*A+in2*B. If you supply only one factor A \, the result will be out=in1*(1-A)+in2*A.; +#X text 22 255 Inlet 3: float: weight for left image. right weight will be the reciprocal value (for crossfading); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 35 0; -#X connect 18 0 21 0; -#X connect 23 0 24 0; -#X connect 24 0 35 1; -#X connect 25 0 24 1; -#X connect 29 0 30 0; -#X connect 30 0 35 2; -#X connect 31 0 35 2; -#X connect 35 0 18 0; +#X obj 521 296 _gemwin; +#X obj 451 267 _pix2rectangle 3; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 30 0; +#X connect 18 0 19 0; +#X connect 19 0 30 1; +#X connect 20 0 19 1; +#X connect 24 0 25 0; +#X connect 25 0 30 2; +#X connect 26 0 30 2; +#X connect 30 0 35 0; diff --git a/help/pix_motionblur-help.pd b/help/pix_motionblur-help.pd index 5bcc5c802..065dff203 100644 --- a/help/pix_motionblur-help.pd +++ b/help/pix_motionblur-help.pd @@ -1,53 +1,23 @@ #N canvas 230 61 638 376 10; #X declare -lib Gem; #X text 442 8 GEM object; -#X obj 9 225 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 225 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 227 Inlets:; #X text 40 289 Outlets:; -#X obj 9 185 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 185 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 184 Arguments:; -#X obj 8 56 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 519 329 pd gemwin; -#X msg 519 310 create; -#X text 515 289 Create window:; -#X obj 451 199 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 199 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 18 303 Outlet 1: gemlist; #X text 24 241 Inlet 1: gemlist; -#X obj 451 292 square 3; -#X obj 451 270 pix_texture; #X text 71 31 Class: pix object (timebased effect); #X obj 451 162 pix_film; #X obj 515 162 t f; -#X obj 464 105 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 105 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -61,7 +31,7 @@ #X connect 4 0 1 0; #X connect 5 0 4 0; #X restore 464 134 pd open; -#X floatatom 544 202 5 0 100 0 blur - -; +#X floatatom 544 202 5 0 100 0 blur - - 0; #X text 505 77 open a supported; #X text 506 88 movie-clip; #X text 505 109 macOS: quicktime; @@ -69,29 +39,20 @@ #X text 505 119 linux: depends...; #X obj 451 238 pix_motionblur; #X text 50 12 Synopsis: [pix_motionblur]; -#X text 29 57 Description: apply motionbluring on a series of images -; +#X text 29 57 Description: apply motionbluring on a series of images; #X obj 544 219 / 100; #X text 64 195 ; -#X text 24 254 Inlet 2: float: blur-factor (0..no blurring \, 1..only -blurring); -#X text 14 73 [pix_motionblur] applies a very simple and fast motion -blur to an image stream. the method used involves blending the current -image with a 'history' image and saving the result back to the 'history'. -the blending is the same as pix_mix output = (stream * gain) + (history -* 1 - gain) applying a higher blur factor will mix in more of the history -image and thus more of the history will be saved resulting in heavier -blurring.; +#X text 24 254 Inlet 2: float: blur-factor (0..no blurring \, 1..only blurring); +#X text 14 73 [pix_motionblur] applies a very simple and fast motion blur to an image stream. the method used involves blending the current image with a 'history' image and saving the result back to the 'history'. the blending is the same as pix_mix output = (stream * gain) + (history * 1 - gain) applying a higher blur factor will mix in more of the history image and thus more of the history will be saved resulting in heavier blurring.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 20 0; -#X connect 18 0 17 0; -#X connect 20 0 30 0; -#X connect 20 2 21 0; -#X connect 21 0 20 1; -#X connect 22 0 23 0; -#X connect 23 0 20 0; -#X connect 24 0 33 0; -#X connect 30 0 18 0; -#X connect 33 0 30 1; +#X obj 518 295 _gemwin; +#X obj 451 267 _pix2rectangle 3; +#X connect 11 0 15 0; +#X connect 15 0 25 0; +#X connect 15 2 16 0; +#X connect 16 0 15 1; +#X connect 17 0 18 0; +#X connect 18 0 15 0; +#X connect 19 0 28 0; +#X connect 25 0 34 0; +#X connect 28 0 25 1; diff --git a/help/pix_movement-help.pd b/help/pix_movement-help.pd index 5f142fbd6..1f385a1a5 100644 --- a/help/pix_movement-help.pd +++ b/help/pix_movement-help.pd @@ -1,53 +1,23 @@ #N canvas 6 198 683 405 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 267 Inlets:; #X text 39 332 Outlets:; -#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 226 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 544 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 549 329 pd gemwin; -#X msg 549 310 create; -#X text 545 289 Create window:; -#X obj 451 173 cnv 15 155 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 534 261 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 173 cnv 15 155 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 17 346 Outlet 1: gemlist; #X text 24 281 Inlet 1: gemlist; -#X obj 451 322 square 3; -#X obj 451 300 pix_texture; #X text 71 31 Class: pix object (timebased effect); #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -67,40 +37,32 @@ #X text 516 104 MS Windows: *.AVI; #X text 523 124 linux: depends...; #X text 29 57 Description: timebased IIR-filter; -#X floatatom 527 191 3 0 100 2 threshold - -; +#X floatatom 527 191 3 0 100 2 threshold - - 0; #X obj 451 232 pix_movement 0.5; #X obj 526 207 / 100; #X obj 451 279 alpha; -#X obj 481 258 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; -#X text 17 125 since image-noise can disturb this processing \, changes -between two corresponding pixels that are smaller than -are ignored.; -#X text 19 163 For a movement detector you might get the center-of-movement -with a [pix_blob] that listens to the Alpha-channel afterwards.; -#X text 15 78 [pix_movement] detects movement between two subsequent -frames and stores it into the alpha-channel for RGBA-images and into -the luminance-channels for YUV-&Grayscale-images.; +#X obj 481 258 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; +#X text 17 125 since image-noise can disturb this processing \, changes between two corresponding pixels that are smaller than are ignored.; +#X text 19 163 For a movement detector you might get the center-of-movement with a [pix_blob] that listens to the Alpha-channel afterwards.; +#X text 15 78 [pix_movement] detects movement between two subsequent frames and stores it into the alpha-channel for RGBA-images and into the luminance-channels for YUV-&Grayscale-images.; #X text 64 237 float: (0..1); -#X text 24 303 Inlet 2: float: changes in the image that -are smaller then are ignored; +#X text 24 303 Inlet 2: float: changes in the image that are smaller then are ignored; #X text 50 12 Synopsis: [pix_movement]; #X obj 451 172 pix_rgba; #X text 457 370 see also:; #X obj 519 370 pix_movement2; #X obj 548 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 20 0; -#X connect 18 0 17 0; -#X connect 20 0 41 0; -#X connect 20 2 21 0; -#X connect 21 0 20 1; -#X connect 22 0 23 0; -#X connect 23 0 20 0; -#X connect 30 0 32 0; -#X connect 31 0 33 0; -#X connect 32 0 31 1; -#X connect 33 0 18 0; -#X connect 34 0 33 0; -#X connect 41 0 31 0; +#X obj 451 330 _pix2rectangle 3; +#X obj 541 267 _gemwin; +#X connect 11 0 15 0; +#X connect 15 0 36 0; +#X connect 15 2 16 0; +#X connect 16 0 15 1; +#X connect 17 0 18 0; +#X connect 18 0 15 0; +#X connect 25 0 27 0; +#X connect 26 0 28 0; +#X connect 27 0 26 1; +#X connect 28 0 40 0; +#X connect 29 0 28 0; +#X connect 36 0 26 0; diff --git a/help/pix_movement2-help.pd b/help/pix_movement2-help.pd index 4cc225565..aa8ead26e 100644 --- a/help/pix_movement2-help.pd +++ b/help/pix_movement2-help.pd @@ -1,53 +1,23 @@ #N canvas 315 171 666 422 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 270 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 270 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 277 Inlets:; #X text 39 369 Outlets:; -#X obj 9 227 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 226 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 544 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 549 329 pd gemwin; -#X msg 549 310 create; -#X text 545 289 Create window:; -#X obj 451 173 cnv 15 155 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 544 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 173 cnv 15 155 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 17 383 Outlet 1: gemlist; #X text 24 291 Inlet 1: gemlist; -#X obj 451 322 square 3; -#X obj 451 300 pix_texture; #X text 71 31 Class: pix object (timebased effect); #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -66,45 +36,35 @@ #X text 523 114 macOS: quicktime; #X text 516 104 MS Windows: *.AVI; #X text 523 124 linux: depends...; -#X floatatom 495 190 3 0 100 2 lo_threshold - -; +#X floatatom 495 190 3 0 100 2 lo_threshold - - 0; #X obj 494 206 / 100; #X text 50 12 Synopsis: [pix_movement2]; #X obj 451 232 pix_movement2; -#X floatatom 549 211 3 0 100 2 threshold - -; +#X floatatom 549 211 3 0 100 2 threshold - - 0; #X obj 548 227 / 100; #X msg 456 194 bang; -#X text 29 57 Description: timebase IIR-filter for motion detection -; -#X text 14 130 since image-noise can disturb this processing \, changes -between two corresponding pixels that are smaller than "threshold" -are ignored. The "threshold" is initially set to and adjusts -itself dynamically downwards towards (which is the absolute -minimum); +#X text 29 57 Description: timebase IIR-filter for motion detection; +#X text 14 130 since image-noise can disturb this processing \, changes between two corresponding pixels that are smaller than "threshold" are ignored. The "threshold" is initially set to and adjusts itself dynamically downwards towards (which is the absolute minimum); #X text 64 237 float: (0..1); #X text 66 252 float: (0..1); -#X text 24 306 Inlet 1: bang: set the current frame as "background" -; -#X text 24 323 Inlet 2: float: changes in the image -that are smaller then are ignored; +#X text 24 306 Inlet 1: bang: set the current frame as "background"; +#X text 24 323 Inlet 2: float: changes in the image that are smaller then are ignored; #X text 24 348 Inlet 3: float: ; #X text 457 368 see also:; #X obj 521 370 pix_movement; -#X text 15 78 [pix_movement2] detects movement in a frame with respect -to the 2 previous frames and a "background"-image and stores it as -a b/w-image (greyscale).; +#X text 15 78 [pix_movement2] detects movement in a frame with respect to the 2 previous frames and a "background"-image and stores it as a b/w-image (greyscale).; #X obj 548 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 20 0; -#X connect 18 0 17 0; -#X connect 20 0 32 0; -#X connect 20 2 21 0; -#X connect 21 0 20 1; -#X connect 22 0 23 0; -#X connect 23 0 20 0; -#X connect 29 0 30 0; -#X connect 30 0 32 1; -#X connect 32 0 18 0; -#X connect 33 0 34 0; -#X connect 34 0 32 2; -#X connect 35 0 32 0; +#X obj 451 261 _pix2rectangle 3; +#X obj 550 296 _gemwin; +#X connect 11 0 15 0; +#X connect 15 0 27 0; +#X connect 15 2 16 0; +#X connect 16 0 15 1; +#X connect 17 0 18 0; +#X connect 18 0 15 0; +#X connect 24 0 25 0; +#X connect 25 0 27 1; +#X connect 27 0 42 0; +#X connect 28 0 29 0; +#X connect 29 0 27 2; +#X connect 30 0 27 0; diff --git a/help/pix_movie-help.pd b/help/pix_movie-help.pd index 21d856b27..bae87c65e 100644 --- a/help/pix_movie-help.pd +++ b/help/pix_movie-help.pd @@ -1,88 +1,52 @@ #N canvas 469 90 719 552 10; #X declare -lib Gem; #X text 502 8 GEM object; -#X obj 8 315 cnv 15 430 220 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 315 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 327 Inlets:; #X text 9 397 Outlets:; -#X obj 8 282 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 282 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 281 Arguments:; -#X obj 8 56 cnv 15 430 180 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 57 cnv 15 250 450 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 57 cnv 15 250 450 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 40 Example:; -#X obj 594 440 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 599 479 pd gemwin; -#X msg 599 460 create; -#X text 595 439 Create window:; -#X obj 451 88 cnv 15 155 200 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 594 440 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 88 cnv 15 155 200 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 63 gemhead; #X text 17 411 Outlet 1: gemlist; #X text 23 341 Inlet 1: gemlist; -#X obj 462 93 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 462 93 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 505 57 open a supported; #X text 506 68 movie-clip; #X obj 471 377 unpack 0 0 0 0; -#X floatatom 466 400 5 0 0 3 length - -; -#X floatatom 515 400 5 0 0 3 width - -; -#X floatatom 565 400 5 0 0 3 height - -; -#X obj 530 358 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 --1 -1; +#X floatatom 466 400 5 0 0 3 length - - 0; +#X floatatom 515 400 5 0 0 3 width - - 0; +#X floatatom 565 400 5 0 0 3 height - - 0; +#X obj 530 358 bng 15 250 50 0 empty empty end_reached 20 7 0 10 #fcfcfc #000000 #000000; #X text 71 31 Class: pix object (pix source); #X text 29 57 Description: load in a movie-file; #X obj 462 122 openpanel; #X msg 462 142 open \$1; #X obj 451 482 rectangle 4 3; -#X text 15 78 [pix_movie] loads in a preproduced digital-video to be -used as a texture \, bitblit or something else.; +#X text 15 78 [pix_movie] loads in a preproduced digital-video to be used as a texture \, bitblit or something else.; #X text 63 292 symbol: file to load initially; #X msg 490 199 auto \$1; -#X obj 490 181 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 490 181 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 501 223 colorspace Grey; -#X obj 8 239 cnv 15 430 40 empty empty empty 20 12 0 14 -260818 -66577 -0; +#X obj 8 239 cnv 15 430 40 empty empty empty 20 12 0 14 #fcac44 #404040 0; #X obj 451 341 pix_movie; #X text 459 515 see also:; #X obj 536 515 pix_film; #X text 50 12 Synopsis: [pix_movie]; -#X obj 513 247 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 505 300 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 --1 -1 0 1; -#X floatatom 502 320 5 0 0 1 frame_number - -; +#X obj 513 247 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 505 300 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 502 320 5 0 0 1 frame_number - - 0; #N canvas 830 50 450 300 demo 0; #X obj 23 26 inlet; #X text 126 127 win32:; #X text 116 190 linux \, OSX:; #X obj 79 257 outlet; -#X obj 20 50 bng 17 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; -#X obj 38 51 cnv 15 81 15 empty empty demo_movie 4 8 0 10 -262144 -1 -0; +#X obj 20 50 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 38 51 cnv 15 81 15 empty empty demo_movie 4 8 0 10 #fcfcfc #000000 0; #X msg 29 102 open examples/data/alea.mpg; #X msg 151 147 open examples/data/homer.avi; #X msg 144 210 open examples/data/anim-1.mov; @@ -93,42 +57,35 @@ used as a texture \, bitblit or something else.; #X connect 8 0 3 0; #X coords 0 -1 1 1 100 17 1 20 50; #X restore 474 162 pd demo movie; -#X text 22 373 Inlet 2: float: sets the frame to output -; +#X text 22 373 Inlet 2: float: sets the frame to output; #X obj 616 515 pix_texture; -#X text 14 241 You don't need [pix_texture] to texture the image. [pix_movie] -is a combination of [pix_film] and [pix_texture]; -#X text 17 470 Outlet 4: list: the texture id \, same as Outlet 2 of -[pix_texture]; +#X text 14 241 You don't need [pix_texture] to texture the image. [pix_movie] is a combination of [pix_film] and [pix_texture]; +#X text 17 470 Outlet 4: list: the texture id \, same as Outlet 2 of [pix_texture]; #X msg 513 266 rectangle \$1; -#X floatatom 615 400 5 0 0 3 fps - -; -#X text 17 117 This object accepts the same set of messages as [pix_film]. -In addition \, it will immediately download the frames to the gfx-card -and make them available as a texture.; +#X floatatom 615 400 5 0 0 3 fps - - 0; +#X text 17 117 This object accepts the same set of messages as [pix_film]. In addition \, it will immediately download the frames to the gfx-card and make them available as a texture.; #X text 23 356 Inlet 1: see [pix_film]; #X text 17 427 Outlet 2: see [pix_film]; #X text 17 450 Outlet 3: see [pix_film]; -#X text 21 161 Think of this object as a hybrid between [pix_film] -and [pix_texture]...; +#X text 21 161 Think of this object as a hybrid between [pix_film] and [pix_texture]...; #X obj 578 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 36 0; -#X connect 17 0 27 0; -#X connect 20 0 21 0; -#X connect 20 1 22 0; -#X connect 20 2 23 0; -#X connect 20 3 49 0; -#X connect 27 0 28 0; -#X connect 28 0 36 0; -#X connect 32 0 36 0; -#X connect 33 0 32 0; -#X connect 34 0 36 0; -#X connect 36 0 29 0; -#X connect 36 1 20 0; -#X connect 36 2 24 0; -#X connect 40 0 48 0; -#X connect 41 0 42 0; -#X connect 42 0 36 1; -#X connect 43 0 36 0; -#X connect 48 0 36 0; +#X obj 599 447 _gemwin; +#X connect 11 0 33 0; +#X connect 14 0 24 0; +#X connect 17 0 18 0; +#X connect 17 1 19 0; +#X connect 17 2 20 0; +#X connect 17 3 46 0; +#X connect 24 0 25 0; +#X connect 25 0 33 0; +#X connect 29 0 33 0; +#X connect 30 0 29 0; +#X connect 31 0 33 0; +#X connect 33 0 26 0; +#X connect 33 1 17 0; +#X connect 33 2 21 0; +#X connect 37 0 45 0; +#X connect 38 0 39 0; +#X connect 39 0 33 1; +#X connect 40 0 33 0; +#X connect 45 0 33 0; diff --git a/help/pix_multiblob-help.pd b/help/pix_multiblob-help.pd index a7b40c24d..8d7aeecee 100644 --- a/help/pix_multiblob-help.pd +++ b/help/pix_multiblob-help.pd @@ -1,66 +1,33 @@ #N canvas 93 136 663 540 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 323 cnv 15 430 145 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 323 cnv 15 430 145 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 325 Inlets:; #X text 39 410 Outlets:; -#X obj 9 286 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 286 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 284 Arguments:; #X text 453 39 Example:; #X text 17 424 Outlet 1: gemlist; #X text 24 339 Inlet 1: gemlist; #X text 71 31 Class: pix object (analysis); -#X text 24 354 Inlet 1: threshold : minimum luminance of a pixel -to be considered part of a blob. (default:0.04); -#X text 24 383 Inlet 1: blobSize : minimum relative size of -a blob. (default:0.1); +#X text 24 354 Inlet 1: threshold : minimum luminance of a pixel to be considered part of a blob. (default:0.04); +#X text 24 383 Inlet 1: blobSize : minimum relative size of a blob. (default:0.1); #X text 50 12 Synopsis: [pix_multiblob]; #X text 64 295 int: max number N of blobs to detect; #X text 20 484 for motion-tracking you will also need; #X obj 304 484 pix_movement; -#X obj 9 56 cnv 15 430 223 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 56 cnv 15 430 223 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 31 53 Description: blob detector (for multiple blobs); -#X text 17 68 [pix_multiblob] is able to detect multiple blobs within -an image.; -#X text 18 98 a "blob" is a number of adjacent(!) pixels with a luminance -that is bigger than the value defined by "threshold". you can set the -minimum size of a blob that is needed to be detected.; -#X obj 452 57 cnv 15 200 450 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 453 356 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 461 395 pd gemwin; -#X msg 461 376 create; -#X text 457 355 Create window:; -#X obj 453 152 cnv 15 185 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X text 17 68 [pix_multiblob] is able to detect multiple blobs within an image.; +#X text 18 98 a "blob" is a number of adjacent(!) pixels with a luminance that is bigger than the value defined by "threshold". you can set the minimum size of a blob that is needed to be detected.; +#X obj 452 57 cnv 15 200 450 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 453 356 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 453 152 cnv 15 185 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 457 62 gemhead; #X obj 457 279 pix_texture; #X obj 457 130 pix_film; #X obj 521 130 t f; -#X obj 470 82 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 470 82 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -79,21 +46,21 @@ minimum size of a blob that is needed to be detected.; #X text 529 93 macOS: quicktime; #X text 522 83 MS Windows: *.AVI; #X text 529 103 linux: depends...; -#X floatatom 469 169 3 0 100 2 threshold - -; +#X floatatom 469 169 3 0 100 2 threshold - - 0; #X obj 469 186 / 100; #X obj 457 301 square 4; #X msg 469 207 threshold \$1; -#X floatatom 559 169 3 0 100 2 blobsize - -; +#X floatatom 559 169 3 0 100 2 blobsize - - 0; #X obj 559 186 / 100; #X msg 559 207 blobSize \$1; -#X floatatom 569 305 5 0 0 1 x - -; -#X floatatom 570 321 5 0 0 1 y - -; -#X floatatom 570 337 5 0 0 1 size - -; -#X floatatom 571 353 5 0 0 1 minX - -; -#X floatatom 571 369 5 0 0 1 minY - -; -#X floatatom 572 385 5 0 0 1 maxX - -; -#X floatatom 572 401 5 0 0 1 maxY - -; -#X floatatom 573 417 5 0 0 1 area - -; +#X floatatom 569 305 5 0 0 1 x - - 0; +#X floatatom 570 321 5 0 0 1 y - - 0; +#X floatatom 570 337 5 0 0 1 size - - 0; +#X floatatom 571 353 5 0 0 1 minX - - 0; +#X floatatom 571 369 5 0 0 1 minY - - 0; +#X floatatom 572 385 5 0 0 1 maxX - - 0; +#X floatatom 572 401 5 0 0 1 maxY - - 0; +#X floatatom 573 417 5 0 0 1 area - - 0; #N canvas 279 450 687 354 showblob 0; #X obj 67 86 inlet blobinformation; #X obj 67 167 outlet weightedX; @@ -170,47 +137,37 @@ minimum size of a blob that is needed to be detected.; #X connect 16 8 17 0; #X restore 547 280 pd showblob 1; #X msg 549 131 auto \$1; -#X obj 604 133 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 604 133 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 457 241 pix_multiblob 6; -#X floatatom 573 433 5 0 0 1 angle* - -; -#X text 17 439 Outlet 2: (k \, 9) matrix: describing k detected blobs -(with 0<=k (with wildcard *) for images to load; -#X text 23 335 Inlet 1: open <#> : open images (the wildcard -in the filename is expanded with integer 0..#); +#X text 23 335 Inlet 1: open <#> : open images (the wildcard in the filename is expanded with integer 0..#); #X text 23 365 Inlet 2: : select image (starting at 0); -#X text 14 221 The image can be either drawn directly using [pix_draw] -(VERY slow) or applied as a texture onto a Geo ([pix_texture]); #X text 456 336 see also:; #X obj 465 359 pix_buffer; #X obj 465 379 pix_image; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 20 0; -#X connect 18 0 19 0; -#X connect 20 0 18 0; -#X connect 21 0 20 0; -#X connect 22 0 20 1; +#X text 14 221 The image can be either drawn directly using [pix_draw] (VERY slow) or applied as a texture onto a Geo ([pix_texture]), f 67; +#X obj 451 233 _pix2rectangle 3; +#X obj 521 260 _gemwin; +#X connect 11 0 15 0; +#X connect 15 0 31 0; +#X connect 16 0 15 0; +#X connect 17 0 15 1; diff --git a/help/pix_multiply-help.pd b/help/pix_multiply-help.pd index 4c0e0d17f..9a609f69f 100644 --- a/help/pix_multiply-help.pd +++ b/help/pix_multiply-help.pd @@ -10,27 +10,6 @@ #X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 329 pd gemwin; -#X msg 519 310 create; -#X text 515 289 Create window:; #X obj 451 168 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 126 gemhead; #X obj 496 109 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; @@ -47,11 +26,9 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 145 pd image; -#X obj 451 263 pix_texture; #X text 63 196 ; #X text 47 318 Outlet 1: gemlist; #X text 53 262 Inlet 1: gemlist; -#X obj 451 285 square 3; #X text 503 88 (JPEG \, TIFF \, ..); #X obj 541 129 gemhead; #N canvas 0 22 587 366 image 0; @@ -77,13 +54,12 @@ #X obj 451 198 pix_multiply; #X text 29 91 [pix_multiply] simply multiplies two pixes together. E.g: where either of the pixels is black \, the resulting image will be black too. Thus it is simple to get black images.; #X obj 508 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 32 0; -#X connect 17 0 21 0; -#X connect 23 0 24 0; -#X connect 24 0 32 1; -#X connect 25 0 24 1; -#X connect 32 0 17 0; +#X obj 524 296 _gemwin; +#X obj 451 253 _pix2rectangle 3; +#X connect 11 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 27 0; +#X connect 18 0 19 0; +#X connect 19 0 27 1; +#X connect 20 0 19 1; +#X connect 27 0 31 0; diff --git a/help/pix_multitexture-help.pd b/help/pix_multitexture-help.pd index b4dd12793..a87d13ba2 100644 --- a/help/pix_multitexture-help.pd +++ b/help/pix_multitexture-help.pd @@ -7,27 +7,18 @@ #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 524 560 pd Gem.init; -#X obj 8 52 cnv 15 430 285 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 52 cnv 15 430 285 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 71 27 Class: pix object; #X text 50 8 Synopsis: [pix_multitexture]; -#X text 29 53 Description: apply multiple texture mappings to the current -network; -#X text 13 86 [pix_multitexture] uses different texture information -\, and attaches them to the current chain. This is most useful when -working with shaders.; -#X obj 8 388 cnv 15 430 235 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 8 348 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X text 29 53 Description: apply multiple texture mappings to the current network; +#X text 13 86 [pix_multitexture] uses different texture information \, and attaches them to the current chain. This is most useful when working with shaders.; +#X obj 8 388 cnv 15 430 235 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 348 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 347 Arguments:; -#X obj 449 73 cnv 15 170 450 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X obj 515 558 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 449 73 cnv 15 170 450 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 515 558 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 514 536 Create window:; -#X obj 455 442 cnv 15 160 50 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 455 442 cnv 15 160 50 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 452 9 GEM object; #X text 453 56 Example:; #X obj 463 88 gemhead; @@ -46,8 +37,7 @@ working with shaders.; #X obj 520 311 gemhead 11; #N canvas 190 611 450 300 pix_image 0; #X obj 78 124 openpanel; -#X obj 78 103 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 78 103 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 78 147 set open \$1 \, bang; #X msg 64 171 open img3.jpg; #X obj 47 54 inlet; @@ -62,8 +52,7 @@ working with shaders.; #X restore 520 330 pd pix_image; #N canvas 1 105 450 300 pix_image 0; #X obj 78 124 openpanel; -#X obj 78 103 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 78 103 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 78 147 set open \$1 \, bang; #X msg 64 171 open img3.jpg; #X obj 47 54 inlet; @@ -78,8 +67,7 @@ working with shaders.; #X restore 489 227 pd pix_image; #N canvas 569 166 450 300 pix_image 0; #X obj 78 124 openpanel; -#X obj 78 103 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 78 103 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 78 147 set open \$1 \, bang; #X obj 48 54 inlet; #X obj 48 233 outlet; @@ -99,48 +87,8 @@ working with shaders.; #X text 50 474 Outlet 1: gemlist; #X text 33 404 Inlet 1: gemlist; #X text 33 424 Inlet 2..n : texture Id; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 522 576 pd gemwin; #X obj 518 8 declare -lib Gem; -#X connect 0 0 39 0; +#X obj 520 564 _gemwin; #X connect 15 0 19 0; #X connect 16 0 30 0; #X connect 17 0 22 0; diff --git a/help/pix_noise-help.pd b/help/pix_noise-help.pd index 3e7870683..e8f3c7027 100644 --- a/help/pix_noise-help.pd +++ b/help/pix_noise-help.pd @@ -1,103 +1,55 @@ #N canvas 509 61 641 529 10; #X declare -lib Gem; #X text 442 10 GEM object; -#X obj 18 324 cnv 15 430 190 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 18 291 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 18 324 cnv 15 430 190 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 18 291 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 27 290 Arguments:; -#X obj 17 68 cnv 15 430 220 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 453 68 cnv 15 170 350 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 17 68 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 453 68 cnv 15 170 350 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 457 51 Example:; -#X obj 523 453 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy \, reset; -#X msg 132 94 create \, 1 \, color 0.5 0.5 0.5; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 528 492 pd gemwin; -#X msg 528 473 create; -#X text 524 452 Create window:; -#X obj 454 105 cnv 15 160 200 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 454 105 cnv 15 160 200 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 455 75 gemhead; #X text 81 43 Class: pix object; -#X obj 455 364 pix_texture; #X msg 545 247 RGBA; #X msg 480 247 GREY; #X msg 515 247 RGB; #X text 43 303 ; -#X obj 473 112 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X obj 455 386 square 4; -#X msg 467 341 quality \$1; -#X obj 466 323 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 473 112 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 24 70 Description: generate a noise image; #X text 60 24 Synopsis: [pix_noise]; #X msg 474 160 auto \$1; -#X obj 474 138 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 474 138 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 28 327 Inlet 1:; #X text 42 343 gemlist; #X text 42 382 bang : generate new image; -#X text 42 402 auto 1|0 : generate new image for each frame on/off -(default:0), f 64; +#X text 42 402 auto 1|0 : generate new image for each frame on/off (default:0), f 64; #X text 28 482 Outlet 1:; #X text 44 495 gemlist; -#X text 42 360 RGBA|RGB|GREY : set format of input-data (default : -RGBA); -#X text 41 251 You might want to deactivate the interpolation of the -texture by sending [quality 0( to pix_texture.; +#X text 42 360 RGBA|RGB|GREY : set format of input-data (default : RGBA); +#X text 41 251 You might want to deactivate the interpolation of the texture by sending [quality 0( to pix_texture.; #X text 494 111 new noise; #X text 492 137 new noise each frame; #X text 474 181 change size of image; -#X text 42 206 You can set the number of channels of the generated -noise using message : RGBA / RGB / GREY. The output image will still -be in RGBA-color-space.; +#X text 42 206 You can set the number of channels of the generated noise using message : RGBA / RGB / GREY. The output image will still be in RGBA-color-space.; #X text 478 228 change colorspace; #X obj 455 285 pix_noise 50 50; #X msg 475 199 set 250 250; -#X text 40 89 [pix_noise] will allow you to generate a uniform noise -image.; -#X text 41 119 The size of the image can be set with creation-arguments. -It defaults to 64*64. It can be dynamically changed by the set message. -; -#X text 41 163 Each time you send a bang \, a new noise is generated. -You can send an [auto 1( message to generate a noise for each render -frame.; -#X text 42 447 seed : change the initialization of the random -function, f 62; -#X text 42 425 set : change size of the image (default -: 64*64), f 66; +#X text 40 89 [pix_noise] will allow you to generate a uniform noise image.; +#X text 41 119 The size of the image can be set with creation-arguments. It defaults to 64*64. It can be dynamically changed by the set message.; +#X text 41 163 Each time you send a bang \, a new noise is generated. You can send an [auto 1( message to generate a noise for each render frame.; +#X text 42 447 seed : change the initialization of the random function, f 62; +#X text 42 425 set : change size of the image (default : 64*64), f 66; #X obj 518 8 declare -lib Gem; -#X connect 8 0 9 0; -#X connect 9 0 8 0; -#X connect 12 0 40 0; -#X connect 14 0 20 0; -#X connect 15 0 40 0; -#X connect 16 0 40 0; -#X connect 17 0 40 0; -#X connect 19 0 40 0; -#X connect 21 0 14 0; -#X connect 22 0 21 0; -#X connect 25 0 40 0; -#X connect 26 0 25 0; -#X connect 40 0 14 0; -#X connect 41 0 40 0; +#X text 457 474 see also:; +#X obj 525 473 pix_test; +#X obj 529 360 _gemwin \; 0 \; 0 \;; +#X obj 455 314 _pix2rectangle 4 \; quality 0; +#X connect 8 0 32 0; +#X connect 10 0 32 0; +#X connect 11 0 32 0; +#X connect 12 0 32 0; +#X connect 14 0 32 0; +#X connect 17 0 32 0; +#X connect 18 0 17 0; +#X connect 32 0 43 0; +#X connect 33 0 32 0; diff --git a/help/pix_normalize-help.pd b/help/pix_normalize-help.pd index 946af5edb..3e24ae6fd 100644 --- a/help/pix_normalize-help.pd +++ b/help/pix_normalize-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 654 335 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -52,8 +24,7 @@ #X obj 102 225 loadbang; #X obj 77 274 pix_gain; #X msg 102 249 0.5; -#X text 145 257 we do this \, to make "normalize" do something more... -; +#X text 145 257 we do this \, to make "normalize" do something more...; #X connect 0 0 2 0; #X connect 2 0 7 0; #X connect 3 0 5 0; @@ -66,22 +37,19 @@ #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; +#X obj 451 233 _pix2rectangle 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; +#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X text 63 275 Inlet 1: 1|0 : apply/don't apply (default:1); #X obj 451 186 pix_normalize; #X text 29 76 Description: normalize an image; -#X text 29 123 [pix_normalize] will normalize your image \, so that -contrasts will appear sharper.; +#X text 29 123 [pix_normalize] will normalize your image \, so that contrasts will appear sharper.; #X text 50 12 Synopsis: [pix_normalize]; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 26 0; -#X connect 24 0 26 0; -#X connect 26 0 21 0; +#X obj 520 261 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 23 0; +#X connect 21 0 23 0; +#X connect 23 0 18 0; diff --git a/help/pix_offset-help.pd b/help/pix_offset-help.pd index b9980ab28..2f54f25b9 100644 --- a/help/pix_offset-help.pd +++ b/help/pix_offset-help.pd @@ -1,86 +1,39 @@ #N canvas 6 61 654 375 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 335 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 348 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); +#X obj 451 233 _pix2rectangle 3; #X text 63 275 Inlet 1: 1|0 : apply/don't apply (default:1); #X obj 451 196 pix_offset; -#X floatatom 483 171 5 0 1 0 - - -; +#X floatatom 483 171 5 0 1 0 - - - 0; #X msg 531 166 0.5 -0.5 0; #X msg 534 193 0.2 1 0 1; #X text 50 12 Synopsis: [pix_offset]; #X text 29 76 Description: add an offset to the color; -#X text 15 113 When adding an offset to each color-channel \, no clipping -is done. Thus you can wrap around the color-space.; -#X text 19 157 (adding "1 0 0" to "0.5 1 1" will result in "0.5 1 1" -instead of "1 1 1"); +#X text 15 113 When adding an offset to each color-channel \, no clipping is done. Thus you can wrap around the color-space.; +#X text 19 157 (adding "1 0 0" to "0.5 1 1" will result in "0.5 1 1" instead of "1 1 1"); #X text 63 295 Inlet 2: : offset for all channels; #X text 63 311 Inlet 3: list : offset for each channels; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 25 0; -#X connect 25 0 21 0; -#X connect 26 0 25 1; -#X connect 27 0 25 2; -#X connect 28 0 25 2; +#X obj 521 262 _gemwin; +#X obj 451 113 pix_test; +#X connect 11 0 30 0; +#X connect 18 0 16 0; +#X connect 19 0 18 1; +#X connect 20 0 18 2; +#X connect 21 0 18 2; +#X connect 30 0 18 0; diff --git a/help/pix_pix2sig~-help.pd b/help/pix_pix2sig~-help.pd index 5fc5fb86d..3cab43cda 100644 --- a/help/pix_pix2sig~-help.pd +++ b/help/pix_pix2sig~-help.pd @@ -1,4 +1,4 @@ -#N canvas 420 190 689 457 10; +#N canvas 420 190 689 458 10; #X declare -lib Gem; #X text 452 8 GEM object; #X obj 8 295 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -10,49 +10,12 @@ #X obj 449 85 cnv 15 200 360 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 68 Example:; #X obj 534 342 cnv 15 100 100 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 539 381 pd gemwin; -#X msg 539 362 create; -#X text 535 341 Create window:; #X obj 450 242 cnv 15 180 90 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 92 gemhead; #X text 71 31 Class: pix object; -#X obj 510 118 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; -#N canvas 0 22 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 141 pd image; #X text 63 266 ; #X text 56 357 Outlet 1: gemlist; #X text 63 312 Inlet 1: gemlist; -#X text 516 133 open an image; -#X text 509 146 (JPEG \, TIFF \, ..); #X text 23 92 [pix_sig2pix~] will write the data it gets from images as signals for each color-channel.; #X text 56 373 Outlet 2: signal~ : red-channel (or Yuv- \, or grey-); #X text 56 403 Outlet 3: signal~ : blue-channel (or yuV- \, or 0); @@ -65,15 +28,13 @@ #X floatatom 533 301 3 0 0 3 b - - 0; #X floatatom 502 301 3 0 0 3 g - - 0; #X floatatom 471 301 3 0 0 3 r - - 0; -#X msg 547 408 \; pd dsp 1; +#X msg 567 348 \; pd dsp 1; #X obj 471 278 env~ 65536; #X obj 564 278 env~ 65536; #X obj 533 278 env~ 65536; #X obj 502 278 env~ 65536; #X obj 528 8 declare -lib Gem; #X text 25 124 In 'clear' mode (the default) \, each audio block will start reading at the beginning of the current image (so if you want to read the entire image \, you need large blocksizes). In 'fill' mode \, the object will remember where we stopped reading \, and continue there (so you can incrementally read the image). In 'line' mode only a single line is read (consecutively \, so the entire image is scanned) \, with zero-padding or data truncating as required. The similar 'waterfall' mode \, reads the same line for each signal block.; -#X obj 451 351 pix_texture; -#X obj 451 374 square 3; #X obj 576 92 block~ 4096; #N canvas 265 521 450 300 scope 0; #N canvas 0 50 450 250 (subpatch) 0; @@ -98,26 +59,25 @@ #X msg 494 216 mode waterfall \$1; #X floatatom 606 217 5 -256 256 0 - - - 0; #X text 63 325 Inlet 1: mode clear|fill|line|waterfall []; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 30 0; -#X connect 30 0 42 0; -#X connect 30 1 36 0; -#X connect 30 1 45 0; -#X connect 30 2 39 0; -#X connect 30 3 38 0; -#X connect 30 4 37 0; -#X connect 36 0 34 0; -#X connect 37 0 31 0; -#X connect 38 0 32 0; -#X connect 39 0 33 0; -#X connect 42 0 43 0; -#X connect 46 0 50 0; -#X connect 47 0 50 0; -#X connect 48 0 50 0; -#X connect 49 0 50 0; -#X connect 50 0 30 0; -#X connect 51 0 50 0; -#X connect 52 0 51 0; +#X obj 542 390 _gemwin; +#X obj 451 341 _pix2rectangle 3; +#X obj 451 121 pix_test; +#X connect 11 0 47 0; +#X connect 23 0 46 0; +#X connect 23 1 29 0; +#X connect 23 1 36 0; +#X connect 23 2 32 0; +#X connect 23 3 31 0; +#X connect 23 4 30 0; +#X connect 29 0 27 0; +#X connect 30 0 24 0; +#X connect 31 0 25 0; +#X connect 32 0 26 0; +#X connect 37 0 41 0; +#X connect 38 0 41 0; +#X connect 39 0 41 0; +#X connect 40 0 41 0; +#X connect 41 0 23 0; +#X connect 42 0 41 0; +#X connect 43 0 42 0; +#X connect 47 0 23 0; diff --git a/help/pix_posterize-help.pd b/help/pix_posterize-help.pd index a82ddc691..27670db87 100644 --- a/help/pix_posterize-help.pd +++ b/help/pix_posterize-help.pd @@ -1,47 +1,19 @@ #N canvas 6 254 651 350 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 280 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 143 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 143 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -50,8 +22,7 @@ #X msg 223 123 open \$1; #X obj 223 100 openpanel; #X obj 77 245 pix_yuv; -#X text 133 234 pix_posterize doesn't like RGBA. For now we do a rgba2yuv -conversion. LATER make pix_posterize eat RGBA too...; +#X text 133 234 pix_posterize doesn't like RGBA. For now we do a rgba2yuv conversion. LATER make pix_posterize eat RGBA too...; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 3 0 5 0; @@ -59,34 +30,28 @@ conversion. LATER make pix_posterize eat RGBA too...; #X connect 5 0 4 0; #X connect 6 0 1 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 ; #X text 57 293 Outlet 1: gemlist; #X text 63 232 Inlet 1: gemlist; -#X obj 451 255 square 3; #X text 50 12 Synopsis: [pix_posterize]; #X obj 451 196 pix_posterize; -#X floatatom 473 160 5 0 255 2 factor - -; -#X obj 527 179 hradio 15 1 0 5 empty empty limit 0 -6 0 8 -262144 -1 --1 0; +#X floatatom 473 160 5 0 255 2 factor - - 0; +#X obj 527 179 hradio 15 1 0 5 empty empty limit 0 -6 0 8 #fcfcfc #000000 #000000 0; #X obj 473 176 / 255; #X text 63 245 Inlet 2: float: posterization factor; #X text 64 258 Inlet 3: int: limit-mode; #X text 29 77 Description: posterization effect; -#X text 13 91 [pix_posterize] will produce a posterization effect. -; +#X text 13 91 [pix_posterize] will produce a posterization effect.; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X text 20 121 currently only YUV images are supported. use [pix_yuv] -to make sure that you are in the correct colorspace.; +#X text 20 121 currently only YUV images are supported. use [pix_yuv] to make sure that you are in the correct colorspace.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 18 0 22 0; -#X connect 24 0 18 0; -#X connect 25 0 27 0; -#X connect 26 0 24 2; -#X connect 27 0 24 1; +#X obj 451 233 _pix2rectangle 3; +#X obj 517 258 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 19 0; +#X connect 19 0 31 0; +#X connect 20 0 22 0; +#X connect 21 0 19 2; +#X connect 22 0 19 1; diff --git a/help/pix_puzzle-help.pd b/help/pix_puzzle-help.pd index ade7a6177..d8036c25e 100644 --- a/help/pix_puzzle-help.pd +++ b/help/pix_puzzle-help.pd @@ -1,47 +1,19 @@ #N canvas 18 198 626 548 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 345 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 345 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 348 Inlets:; #X text 38 465 Outlets:; -#X obj 8 306 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 306 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 305 Arguments:; -#X obj 7 76 cnv 15 430 225 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 225 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 138 cnv 15 160 110 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 504 294 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 110 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,38 +30,32 @@ #X text 63 316 ; #X text 56 478 Outlet 1: gemlist; #X text 63 362 Inlet 1: gemlist; -#X obj 451 263 pix_draw; +#X obj 451 263 _pix2rectangle 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 63 375 Inlet 1: 1|0 : apply/don't apply (default:1); #X msg 463 146 bang; #X text 50 12 Synopsis: [pix_puzzle]; #X text 63 77 Description: shuffle an image; -#X text 16 97 [pix_puzzle] is an effect that will cut your image into -rectangular pieces and shuffle these.; -#X text 17 128 You can change the number of pieces per row/column with -the "size" message. "bang" triggers a re-shuffling of the pieces.; -#X obj 29 505 cnv 15 423 30 empty empty empty 20 12 0 14 -260818 -66577 -0; -#X text 34 505 acknowledgment: this effect is based on effecTV by Kentarou -Fukuchi (http://effectv.sourceforge.net); +#X text 16 97 [pix_puzzle] is an effect that will cut your image into rectangular pieces and shuffle these.; +#X text 17 128 You can change the number of pieces per row/column with the "size" message. "bang" triggers a re-shuffling of the pieces.; +#X obj 29 505 cnv 15 423 30 empty empty empty 20 12 0 14 #fcac44 #404040 0; +#X text 34 505 acknowledgment: this effect is based on effecTV by Kentarou Fukuchi (http://effectv.sourceforge.net); #X obj 451 223 pix_puzzle; #X text 64 390 Inlet 1: bang: reshuffle; #X msg 509 145 size 4 3; #X msg 551 212 move \$1; -#X floatatom 551 193 5 0 0 0 - - -; +#X floatatom 551 193 5 0 0 0 - - - 0; #X text 63 433 Inlet 1: move : move the empty field; #X text 192 238 8; #X text 175 253 4; #X text 209 254 6; #X text 192 271 2; #X text 44 204 "move 5" will en/disable an empty field; -#X text 16 171 There is a little game hidden in the [pix_puzzle]. Go -and find it:; +#X text 16 171 There is a little game hidden in the [pix_puzzle]. Go and find it:; #X text 46 221 Moving can be done according to the number-pad; #X msg 551 171 5; -#X text 63 405 Inlet 1: size : number of elements in x/y -(default: 8 8); +#X text 63 405 Inlet 1: size : number of elements in x/y (default: 8 8); #N canvas 0 0 243 214 numkeys 0; #X obj 63 16 key; #X obj 63 181 outlet; @@ -113,15 +79,14 @@ and find it:; #X restore 475 176 pd numkeys; #X text 12 285 (i admit this is not very intuitive...); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 32 0; -#X connect 25 0 32 0; -#X connect 32 0 21 0; -#X connect 34 0 32 0; -#X connect 35 0 32 0; -#X connect 36 0 35 0; -#X connect 45 0 36 0; -#X connect 47 0 36 0; +#X obj 510 298 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 29 0; +#X connect 22 0 29 0; +#X connect 29 0 18 0; +#X connect 31 0 29 0; +#X connect 32 0 29 0; +#X connect 33 0 32 0; +#X connect 42 0 33 0; +#X connect 44 0 33 0; diff --git a/help/pix_rds-help.pd b/help/pix_rds-help.pd index a271f1240..8c16ede47 100644 --- a/help/pix_rds-help.pd +++ b/help/pix_rds-help.pd @@ -1,51 +1,19 @@ #N canvas 22 61 638 358 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 310 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 234 221 dimen 500 500; -#X msg 279 189 dimen 1024 768; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X connect 9 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 136 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 136 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -61,33 +29,27 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 ; #X text 57 323 Outlet 1: gemlist; #X text 63 232 Inlet 1: gemlist; -#X obj 460 158 tgl 15 0 empty empty mode 20 8 0 8 -262144 -1 -1 0 1 -; +#X obj 460 158 tgl 15 0 empty empty mode 20 8 0 8 #fcfcfc #000000 #000000 0 1; #X text 29 77 Description: random dot stereogram for luminance; -#X obj 451 255 square 3; -#X text 34 96 [pix_rds] produces b/w random dot stereograms (aka: the -magic eye (tm)) for either cross-eyed and wall-eyed viewers. Wall-eyed -is basically an invertation (front becomes back) of cross-eyed.; +#X text 34 96 [pix_rds] produces b/w random dot stereograms (aka: the magic eye (tm)) for either cross-eyed and wall-eyed viewers. Wall-eyed is basically an invertation (front becomes back) of cross-eyed.; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_rds]; #X msg 460 177 method \$1; #X obj 451 196 pix_rds; -#X floatatom 495 139 5 10 100 1 stride - -; +#X floatatom 495 139 5 10 100 1 stride - - 0; #X text 63 245 Inlet 1: method [0|1] (crosseyed|walleyed); #X text 63 259 Inlet 1: stride distance (default:40); #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 30 0; +#X obj 451 223 _pix2rectangle 3; +#X obj 519 261 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 25 0; #X connect 18 0 24 0; -#X connect 22 0 29 0; -#X connect 29 0 30 0; -#X connect 30 0 18 0; -#X connect 31 0 30 1; +#X connect 24 0 25 0; +#X connect 25 0 30 0; +#X connect 26 0 25 1; diff --git a/help/pix_record-help.pd b/help/pix_record-help.pd index bd745470c..e286524c3 100644 --- a/help/pix_record-help.pd +++ b/help/pix_record-help.pd @@ -7,27 +7,6 @@ #X obj 449 53 cnv 15 170 410 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 36 Example:; #X obj 479 419 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 484 458 pd gemwin; -#X msg 484 439 create; -#X text 480 418 Create window:; #X obj 451 166 cnv 15 167 230 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 59 gemhead; #X text 64 425 ; @@ -63,8 +42,7 @@ #X obj 463 287 t a; #X text 18 174 When file and codec are specified \, you can open the writing connection with the message "record 1"., f 69; #X text 18 212 To actually do record a frame into the file \, send the object a "bang" message. If you want to record a consecutive number of frames \, use the "auto" message. This allows you to have full control on which frames are to be recorded., f 69; -#X text 554 80 (do something), f 10; -#X text 525 128 (monitoring); +#X text 525 125 (monitoring); #X obj 8 454 cnv 15 430 30 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #N canvas 6 49 459 361 MESSAGES 0; #X obj 9 15 cnv 15 430 340 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -396,34 +374,31 @@ #X connect 9 0 10 0; #X restore 553 375 pd print; #X obj 518 8 declare -lib Gem; -#X obj 451 120 pix_texture; -#X obj 451 141 square 4; #X text 29 57 Description: output sequences of pixes; #X text 13 73 [pix_record] outputs a series of pixes \, e.g. into a movie file. You can set the file to write to via the "file" message., f 70; #X text 14 331 [pix_record] has a number of output methods \, like movies \, pipes or videodevices. Not all may be available on your system. Check here which backends you can use:, f 70; #X text 17 273 The recording is finished and the file flushed to disk after a "record 0" message is received. You might not be able to access the file for reading before recording has finished., f 69; #X obj 197 366 _backendinfo \$0 record; #X obj 451 87 pix_test 720 468; -#X connect 7 0 8 0; -#X connect 8 0 7 0; -#X connect 11 0 54 0; -#X connect 15 1 38 0; -#X connect 15 2 45 0; -#X connect 18 0 15 0; -#X connect 19 0 15 0; -#X connect 20 0 19 0; -#X connect 22 0 24 0; -#X connect 23 0 24 0; -#X connect 24 0 43 0; -#X connect 26 0 31 0; -#X connect 27 0 28 0; -#X connect 28 0 26 0; -#X connect 29 0 31 0; -#X connect 30 0 29 0; -#X connect 31 0 44 0; -#X connect 39 0 24 0; -#X connect 40 0 24 0; -#X connect 42 0 15 0; -#X connect 47 0 48 0; -#X connect 48 0 15 0; -#X connect 54 0 47 0; +#X obj 451 140 _pix2rectangle 3; +#X text 515 72 (some input); +#X obj 484 425 _gemwin; +#X connect 8 0 48 0; +#X connect 12 1 34 0; +#X connect 12 2 41 0; +#X connect 15 0 12 0; +#X connect 16 0 12 0; +#X connect 17 0 16 0; +#X connect 19 0 21 0; +#X connect 20 0 21 0; +#X connect 21 0 39 0; +#X connect 23 0 28 0; +#X connect 24 0 25 0; +#X connect 25 0 23 0; +#X connect 26 0 28 0; +#X connect 27 0 26 0; +#X connect 28 0 40 0; +#X connect 35 0 21 0; +#X connect 36 0 21 0; +#X connect 38 0 12 0; +#X connect 48 0 49 0; diff --git a/help/pix_rectangle-help.pd b/help/pix_rectangle-help.pd index 494127e0a..0dd6ec0d0 100644 --- a/help/pix_rectangle-help.pd +++ b/help/pix_rectangle-help.pd @@ -1,85 +1,35 @@ #N canvas 6 61 624 377 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 335 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 148 cnv 15 160 70 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 148 cnv 15 160 70 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 8 348 Outlet 1: gemlist; #X text 13 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); +#X obj 451 233 _pix2rectangle 3; #X text 50 12 Synopsis: [pix_rectangle]; #X text 28 76 Description: draw a rectangle into a pix; #X msg 537 175 1 0 0; #X obj 451 197 pix_rectangle; -#X text 13 275 Inlet 2: list : 4 floats defining the 4 corners of the -rectangle: ; +#X text 13 275 Inlet 2: list : 4 floats defining the 4 corners of the rectangle: ; #X msg 494 151 40 10 100 200; -#X text 13 305 Inlet 3: list : 3(RGB) or 4(RGBA) float-values defining -the color of the rectangle (default: 1 1 1 1); -#X text 21 111 pix_rectangle renders a rectangle onto a pix-buffer. -This means that you have to have an image already loaded to render -into. Set the position and size with the two corners of the rectangle. -; +#X text 13 305 Inlet 3: list : 3(RGB) or 4(RGBA) float-values defining the color of the rectangle (default: 1 1 1 1); +#X text 21 111 pix_rectangle renders a rectangle onto a pix-buffer. This means that you have to have an image already loaded to render into. Set the position and size with the two corners of the rectangle.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 27 0; -#X connect 26 0 27 2; -#X connect 27 0 21 0; -#X connect 29 0 27 1; +#X obj 519 259 _gemwin; +#X obj 451 113 pix_noise; +#X connect 11 0 27 0; +#X connect 19 0 20 2; +#X connect 20 0 16 0; +#X connect 22 0 20 1; +#X connect 27 0 20 0; diff --git a/help/pix_refraction-help.pd b/help/pix_refraction-help.pd index ca55e1571..0dcaa2063 100644 --- a/help/pix_refraction-help.pd +++ b/help/pix_refraction-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 625 531 10; #X declare -lib Gem; #X text 447 8 GEM object; -#X obj 8 335 cnv 15 430 130 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 335 cnv 15 430 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 338 Inlets:; #X text 38 435 Outlets:; -#X obj 8 297 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 297 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 296 Arguments:; -#X obj 7 56 cnv 15 430 235 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 56 cnv 15 430 235 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 135 cnv 15 160 115 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 484 284 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 135 cnv 15 160 115 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -58,56 +30,47 @@ #X text 63 307 ; #X text 56 448 Outlet 1: gemlist; #X text 63 352 Inlet 1: gemlist; -#X obj 451 253 pix_draw; +#X obj 451 253 _pix2rectangle 3; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 63 365 Inlet 1: 1|0 : apply/don't apply (default:1); -#X floatatom 464 177 3 0.01 16 1 - - -; -#X obj 35 477 cnv 15 375 20 empty empty empty 20 12 0 14 -260818 -66577 -0; -#X text 44 480 (ported from "pete's plugins" \, www.petewarden.com) -; +#X floatatom 464 177 3 0.01 16 1 - - - 0; +#X obj 35 477 cnv 15 375 20 empty empty empty 20 12 0 14 #fcac44 #404040 0; +#X text 44 480 (ported from "pete's plugins" \, www.petewarden.com); #X msg 464 195 refract \$1; #X msg 544 195 mag \$1; -#X floatatom 464 137 3 0 0 1 - - -; -#X floatatom 544 137 3 0 0 1 - - -; +#X floatatom 464 137 3 0 0 1 - - - 0; +#X floatatom 544 137 3 0 0 1 - - - 0; #X msg 464 155 width \$1; #X msg 544 155 height \$1; #X obj 451 226 pix_refraction; -#X obj 544 176 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 544 176 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 29 56 Description: display a pix through glass bricks; #X text 80 158 range = 0.01 to 16 \, default = 2; #X text 79 198 range = 1 to 255 \, default = 16; #X text 80 230 range = 1 to 255 \, default = 16; #X text 80 273 range = 0 or 1 \, default = 1; -#X text 28 77 The input image is broken up into rectangular cells \, -and scaled up or down within them. The effect is like looking through -a wall of glass bricks \, each acting as a magnifying or shrinking -lens for its part of the image; -#X text 37 138 How much to shrink or expand the input image within -each cell; +#X text 28 77 The input image is broken up into rectangular cells \, and scaled up or down within them. The effect is like looking through a wall of glass bricks \, each acting as a magnifying or shrinking lens for its part of the image; +#X text 37 138 How much to shrink or expand the input image within each cell; #X text 37 182 Width of each cell \, where 1 is the image width; #X text 37 214 Height of each cell \, where 1 is the image height; -#X text 28 244 Turning this off prevents the image from being expanded -to larger than it's original size (within each cell); +#X text 28 244 Turning this off prevents the image from being expanded to larger than it's original size (within each cell); #X text 63 380 Inlet 1: width ; #X text 63 406 Inlet 1: mag 1|0; #X text 63 421 Inlet 1: refract ; #X text 63 392 Inlet 1: height ; #X text 49 12 Synopsis: [pix_refraction]; #X obj 519 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 34 0; -#X connect 25 0 28 0; -#X connect 28 0 34 0; -#X connect 29 0 34 0; -#X connect 30 0 32 0; -#X connect 31 0 33 0; -#X connect 32 0 34 0; -#X connect 33 0 34 0; -#X connect 34 0 21 0; -#X connect 35 0 29 0; +#X obj 489 288 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 31 0; +#X connect 22 0 25 0; +#X connect 25 0 31 0; +#X connect 26 0 31 0; +#X connect 27 0 29 0; +#X connect 28 0 30 0; +#X connect 29 0 31 0; +#X connect 30 0 31 0; +#X connect 31 0 18 0; +#X connect 32 0 26 0; diff --git a/help/pix_resize-help.pd b/help/pix_resize-help.pd index aea015b7c..6194d7446 100644 --- a/help/pix_resize-help.pd +++ b/help/pix_resize-help.pd @@ -1,83 +1,36 @@ #N canvas 6 61 634 347 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 85 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 85 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 267 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 61 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 61 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 146 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 262 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 146 cnv 15 160 70 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 57 280 Outlet 1: gemlist; #X text 63 232 Inlet 1: gemlist; -#X obj 451 255 square 3; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X obj 451 196 pix_resize; #X text 50 12 Synopsis: [pix_resize]; #X text 29 62 Description: resize an image; #X text 63 186 ; #X text 63 245 Inlet 1: dimen ; -#X msg 473 172 dimen 32 9; -#X text 12 76 [pix_resize]: resizes the image \; if you don't specify -any dimensions \, the image will be automatically resized to the next -power of 2 (eg. 320x240 will be resized to 512x256). You can change -the re-size with the "dimen"-message \; a value of "0" defaults to -the next power-of-2 of the original image; +#X msg 463 152 dimen 32 9; #X obj 519 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 18 0 21 0; -#X connect 24 0 18 0; -#X connect 29 0 24 0; +#X text 12 79 if you don't specify any dimensions \, the image will be automatically resized to the next power of 2 (eg. 320x240 will be resized to 512x256). You can change the re-size with the "dimen"-message \; a value of "0" defaults to the next power-of-2 of the original image; +#X obj 522 268 _gemwin; +#X obj 451 186 pix_resize; +#X msg 539 180 dimen 0 0; +#X obj 450 113 pix_test 240 320; +#X obj 451 223 pix_texture \; quality 0; +#X obj 451 259 square 3; +#X connect 11 0 25 0; +#X connect 19 0 23 0; +#X connect 23 0 26 0; +#X connect 24 0 23 0; +#X connect 25 0 23 0; +#X connect 26 0 27 0; diff --git a/help/pix_rgb2hsv-help.pd b/help/pix_rgb2hsv-help.pd index bc829c003..851903a31 100644 --- a/help/pix_rgb2hsv-help.pd +++ b/help/pix_rgb2hsv-help.pd @@ -1,85 +1,36 @@ #N canvas 6 61 633 364 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; +#X obj 451 233 _pix2rectangle 3; +#X obj 468 165 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X text 63 275 Inlet 1: 1|0 : apply/don't apply (default:1); #X text 94 340 see also:; #X obj 186 338 pix_hsv2rgb; #X text 50 12 Synopsis: [pix_rgb2hsv]; #X text 29 76 Description: convert RGB into HSV; -#X text 25 96 [pix_rgb2hsv] will (virtually) transform an RGB(red \, -green \, blue)-Image into the HSV (hue \, saturation \, value) color-space. -; +#X text 25 96 [pix_rgb2hsv] will (virtually) transform an RGB(red \, green \, blue)-Image into the HSV (hue \, saturation \, value) color-space.; #X text 30 140 This might enable simpler colour-detection...; -#X text 29 162 On the technical (internal) side \, the image still -stays RGBA. The Red-channel is filled with Hue-values....; +#X text 29 162 On the technical (internal) side \, the image still stays RGBA. The Red-channel is filled with Hue-values....; #X obj 451 186 pix_rgb2hsv; #X obj 521 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 33 0; -#X connect 24 0 33 0; -#X connect 33 0 21 0; +#X obj 520 261 _gemwin; +#X obj 451 113 pix_test; +#X connect 11 0 29 0; +#X connect 17 0 26 0; +#X connect 26 0 16 0; +#X connect 29 0 26 0; diff --git a/help/pix_rgba-help.pd b/help/pix_rgba-help.pd index 7cd17a01f..a1e1e8b41 100644 --- a/help/pix_rgba-help.pd +++ b/help/pix_rgba-help.pd @@ -1,90 +1,38 @@ #N canvas 6 61 631 372 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 22 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X obj 451 233 pix_draw; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X text 22 93 Images can be stored in various formats/color-spaces. -; -#X obj 468 166 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; +#X obj 451 233 _pix2rectangle 3; +#X text 22 93 Images can be stored in various formats/color-spaces.; +#X obj 468 166 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X text 63 275 Inlet 1: 1|0: turn conversion on/off (default:1); #X text 62 339 see also:; #X obj 155 338 pix_yuv; #X obj 451 196 pix_rgba; #X text 50 12 Synopsis: [pix_rgba]; #X obj 205 338 pix_grey; -#X text 15 77 Description: convert the colorspace of an image to RGBA -; -#X text 22 107 GREY-scale images have no color-component \, while YUV -is missing the Alpha-channel.; -#X text 19 159 You can use [pix_rgba] to convert images of any format -into RGBA-space. If your image already is in RGBA-space \, this will -do nothing.; -#X text 19 133 Traditionally \, RGBA is the native colour-space of -Gem \, although it is quite CPU-consumptive.; +#X text 15 77 Description: convert the colorspace of an image to RGBA; +#X text 22 107 GREY-scale images have no color-component \, while YUV is missing the Alpha-channel.; +#X text 19 159 You can use [pix_rgba] to convert images of any format into RGBA-space. If your image already is in RGBA-space \, this will do nothing.; +#X text 19 133 Traditionally \, RGBA is the native colour-space of Gem \, although it is quite CPU-consumptive.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 29 0; -#X connect 25 0 29 0; -#X connect 29 0 21 0; +#X obj 451 113 pix_test; +#X obj 520 257 _gemwin; +#X connect 11 0 30 0; +#X connect 18 0 22 0; +#X connect 22 0 16 0; +#X connect 30 0 22 0; diff --git a/help/pix_roi-help.pd b/help/pix_roi-help.pd index ad331b7c1..5b0072a6f 100644 --- a/help/pix_roi-help.pd +++ b/help/pix_roi-help.pd @@ -8,27 +8,6 @@ #X obj 7 56 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 459 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 463 60 Example:; -#X obj 524 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 1 98 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy \, reset; -#X msg 132 94 create \, 1 \, color 0.5 0.5 0.5; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 529 293 pd gemwin; -#X msg 529 274 create; #X obj 460 114 cnv 15 170 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 71 31 Class: pix object; #X text 53 342 Inlet 1: gemlist; @@ -37,7 +16,6 @@ #X text 53 355 Inlet 1: roi : set roi; #X text 38 372 Outlets:; #X text 46 385 Outlet 1: gemlist; -#X text 525 253 Create window:; #X msg 461 86 gem_list; #X msg 461 238 gemlist; #X obj 461 186 pix_roi 0.25 0.25 0.75 0.75; @@ -49,8 +27,6 @@ #X text 22 170 (currently only [pix_set] supports ROI \, more will hopefully follow); #X obj 528 8 declare -lib Gem; #X text 442 358 see example/04.pix/27.bitmap_font.pd, f 32; -#X connect 9 0 10 0; -#X connect 10 0 9 0; -#X connect 20 0 22 0; -#X connect 22 0 21 0; -#X connect 23 0 22 0; +#X connect 16 0 18 0; +#X connect 18 0 17 0; +#X connect 19 0 18 0; diff --git a/help/pix_roll-help.pd b/help/pix_roll-help.pd index 5e9c53b35..601bfeca2 100644 --- a/help/pix_roll-help.pd +++ b/help/pix_roll-help.pd @@ -1,90 +1,38 @@ #N canvas 6 61 651 355 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 310 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 140 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 140 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X connect 0 0 5 0; -#X connect 2 0 4 0; -#X connect 3 0 5 0; -#X connect 4 0 3 0; -#X connect 5 0 1 0; -#X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 ; #X text 57 323 Outlet 1: gemlist; #X text 33 232 Inlet 1: gemlist; -#X obj 451 255 square 3; -#X floatatom 530 175 5 0 0 2 roll - -; +#X floatatom 530 175 5 0 0 2 roll - - 0; #X obj 451 196 pix_roll; #X msg 459 168 axis \$1; -#X obj 459 147 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 459 147 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 50 12 Synopsis: [pix_roll]; -#X text 12 90 [pix_roll] will roll/scroll an image (wrap around the -left/right vs. upper/lower edge); +#X text 12 90 [pix_roll] will roll/scroll an image (wrap around the left/right vs. upper/lower edge); #X text 33 278 Inlet 2: int: (sc)roll number of pixels; #X text 29 77 Description: (sc)roll through an image; -#X text 33 245 Inlet 1: message: axis [0|1] scroll(0=default) or roll(1) -; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X text 13 116 [pix_roll] gives an effect similar to vertical and horizontal -hold on a television. the offset is user defined and can be incremented -using a counter object for a looping roll effect.; +#X text 33 245 Inlet 1: message: axis [0|1] scroll(0=default) or roll(1); +#X text 13 116 [pix_roll] gives an effect similar to vertical and horizontal hold on a television. the offset is user defined and can be incremented using a counter object for a looping roll effect.; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; +#X obj 519 260 _gemwin; +#X obj 451 233 _pix2rectangle 3; +#X obj 451 113 pix_test; +#X connect 11 0 29 0; #X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 18 0 22 0; -#X connect 23 0 24 1; -#X connect 24 0 18 0; -#X connect 25 0 24 0; -#X connect 26 0 25 0; +#X connect 17 0 28 0; +#X connect 18 0 17 0; +#X connect 19 0 18 0; +#X connect 29 0 17 0; diff --git a/help/pix_rtx-help.pd b/help/pix_rtx-help.pd index eb300e185..3cba26fd3 100644 --- a/help/pix_rtx-help.pd +++ b/help/pix_rtx-help.pd @@ -1,53 +1,23 @@ #N canvas 20 122 661 405 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 267 Inlets:; #X text 39 362 Outlets:; -#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 231 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 544 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 549 329 pd gemwin; -#X msg 549 310 create; -#X text 545 289 Create window:; -#X obj 451 173 cnv 15 155 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 544 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 173 cnv 15 155 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 17 376 Outlet 1: gemlist; #X text 24 281 Inlet 1: gemlist; -#X obj 451 322 square 3; -#X obj 451 300 pix_texture; #X text 71 31 Class: pix object (timebased effect); #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -68,37 +38,27 @@ #X text 523 124 linux: depends...; #X obj 451 232 pix_rtx; #X text 50 12 Synopsis: [pix_rtx]; -#X text 21 86 [pix_rtx] does something similar to tx-transform. The -main differences are: 1) it is done in realtime \; 2) it is released -under the GnuGPL and hopes to stay free forever.; -#X text 23 142 basically the time-axis (now->later) and the x-axis -(left->right) are swapped. for more information see http://umlaeute.mur.at/rtx -; -#X text 25 183 beware: [pix_rtx] needs a lot of memory:: mem=(width^2)*height*4 -bytes (for a 320x240 movie \, this would be more than 70MByte that -have to stay in RAM); +#X text 21 86 [pix_rtx] does something similar to tx-transform. The main differences are: 1) it is done in realtime \; 2) it is released under the GnuGPL and hopes to stay free forever.; +#X text 23 142 basically the time-axis (now->later) and the x-axis (left->right) are swapped. for more information see http://umlaeute.mur.at/rtx; +#X text 25 183 beware: [pix_rtx] needs a lot of memory:: mem=(width^2)*height*4 bytes (for a 320x240 movie \, this would be more than 70MByte that have to stay in RAM); #X text 29 55 Description: RealTime vs. X transformation; #X text 29 68 Description: Relative Time-X transformation; #X msg 551 205 set; #X msg 468 205 mode \$1; -#X obj 468 185 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 468 185 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 87 240 ; -#X text 23 299 Inlet 1: set : sets the whole internal buffer to the -next incoming frame; -#X text 23 329 Inlet 1: mode 1|0 : clamp the discontinuity to the edge -or not. (default:1); +#X text 23 299 Inlet 1: set : sets the whole internal buffer to the next incoming frame; +#X text 23 329 Inlet 1: mode 1|0 : clamp the discontinuity to the edge or not. (default:1); #X obj 538 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 20 0; -#X connect 18 0 17 0; -#X connect 20 0 29 0; -#X connect 20 2 21 0; -#X connect 21 0 20 1; -#X connect 22 0 23 0; -#X connect 23 0 20 0; -#X connect 29 0 18 0; -#X connect 36 0 29 0; -#X connect 37 0 29 0; -#X connect 38 0 37 0; +#X obj 554 296 _gemwin; +#X obj 451 270 _pix2rectangle 3; +#X connect 11 0 15 0; +#X connect 15 0 24 0; +#X connect 15 2 16 0; +#X connect 16 0 15 1; +#X connect 17 0 18 0; +#X connect 18 0 15 0; +#X connect 24 0 39 0; +#X connect 31 0 24 0; +#X connect 32 0 24 0; +#X connect 33 0 32 0; diff --git a/help/pix_scanline-help.pd b/help/pix_scanline-help.pd index df617d020..f1927319a 100644 --- a/help/pix_scanline-help.pd +++ b/help/pix_scanline-help.pd @@ -1,47 +1,19 @@ #N canvas 6 61 628 355 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 310 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 76 cnv 15 430 90 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 136 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 136 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -55,35 +27,27 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 113 pd image; -#X obj 451 233 pix_texture; #X text 63 186 ; #X text 17 323 Outlet 1: gemlist; #X text 23 232 Inlet 1: gemlist; -#X obj 451 255 square 3; -#X floatatom 530 175 5 0 0 2 interlace - -; +#X floatatom 530 175 5 0 0 2 interlace - - 0; #X obj 451 196 pix_scanline; -#X obj 465 140 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 465 140 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 465 159 mode \$1; #X text 50 12 Synopsis: [pix_scanline]; #X text 29 77 Description: scan lines of an image; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X text 16 103 [pix_scanline] manipulates each row of an image by either -removing or duplicating them. this can be used an image resolution -decimator in mode 0 or as an interlacer in mode 1; -#X text 23 245 Inlet 1: message: mode [0|1] (duplicate(=default) or -draw only); -#X text 23 278 Inlet 2: int: the number of lines to duplicate or the -to skip between drawing; +#X text 16 103 [pix_scanline] manipulates each row of an image by either removing or duplicating them. this can be used an image resolution decimator in mode 0 or as an interlacer in mode 1; +#X text 23 245 Inlet 1: message: mode [0|1] (duplicate(=default) or draw only); +#X text 23 278 Inlet 2: int: the number of lines to duplicate or the to skip between drawing; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 24 0; -#X connect 18 0 22 0; -#X connect 23 0 24 1; -#X connect 24 0 18 0; -#X connect 25 0 26 0; -#X connect 26 0 24 0; +#X obj 451 223 _pix2rectangle 3; +#X obj 519 258 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 19 0; +#X connect 18 0 19 1; +#X connect 19 0 30 0; +#X connect 20 0 21 0; +#X connect 21 0 19 0; diff --git a/help/pix_set-help.pd b/help/pix_set-help.pd index a58eaebaa..923d48430 100644 --- a/help/pix_set-help.pd +++ b/help/pix_set-help.pd @@ -1,80 +1,38 @@ #N canvas 285 331 650 585 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 326 cnv 15 430 240 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 326 cnv 15 430 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 328 Inlets:; #X text 38 462 Outlets:; -#X obj 8 286 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 286 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 285 Arguments:; -#X obj 7 56 cnv 15 430 220 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 300 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 56 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 354 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 1 98 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy \, reset; -#X msg 132 94 create \, 1 \, color 0.5 0.5 0.5; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 393 pd gemwin; -#X msg 519 374 create; -#X text 515 353 Create window:; -#X obj 450 114 cnv 15 160 150 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 450 114 cnv 15 160 150 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; #X text 46 475 Outlet 1: gemlist; #X text 53 342 Inlet 1: gemlist; #X text 50 12 Synopsis: [pix_set]; -#X obj 451 323 pix_texture; -#X obj 450 345 square; #X msg 459 160 RGBA; #X msg 458 119 GREY; #X msg 460 140 RGB; #X text 63 296 ; -#X text 21 79 [pix_set] will allow you to set the image-data of a pixel -with one long list of (m*n) pixel-tuples.; -#X text 22 109 The size of the image can be set with creation-arguments. -It defaults to 64*64.; -#X text 22 143 How the list is interpreted depends on the mode \, [pix_set] -is set to. When in RGBA-Mode (default) you should pass a float-list -of the form "R1 G1 B1 A1 R2 G2 B2 A2 ...". In RGB-Mode the float-list -will be of the form "R1 G1 B1 R2 G2 B2 ...". In GREY-Mode the float-list -is simply "V1 V2 ..."; -#X text 18 220 If the list does not contain enough data \, the rest -of the image will be set to 0 (black).; +#X text 21 79 [pix_set] will allow you to set the image-data of a pixel with one long list of (m*n) pixel-tuples.; +#X text 22 109 The size of the image can be set with creation-arguments. It defaults to 64*64.; +#X text 22 143 How the list is interpreted depends on the mode \, [pix_set] is set to. When in RGBA-Mode (default) you should pass a float-list of the form "R1 G1 B1 A1 R2 G2 B2 A2 ...". In RGB-Mode the float-list will be of the form "R1 G1 B1 R2 G2 B2 ...". In GREY-Mode the float-list is simply "V1 V2 ..."; +#X text 18 220 If the list does not contain enough data \, the rest of the image will be set to 0 (black).; #X text 16 257 The image will always be in RGBA-color-space !; #X text 53 355 Inlet 1: RGBA|RGB|GREY : set format of input-data; -#X text 52 436 Inlet 2: list : interleaved image-data (R1 G1 B1 A1 -R2 B2...) or (R1 B1 G1 R2 B2...) or (L1 L2 L3...); +#X text 52 436 Inlet 2: list : interleaved image-data (R1 G1 B1 A1 R2 B2...) or (R1 B1 G1 R2 B2...) or (L1 L2 L3...); #X text 29 56 Description: set the pixel-data of an image; #X text 460 476 see also; #X obj 530 477 pix_dump; -#X msg 536 323 quality 0; #X obj 451 236 pix_set 4 4; -#X obj 536 303 loadbang; #X msg 512 166 1 0.25 0.5 0.75 1 0 0 0 1 1 1 0 1 0 1 0 1 1, f 12; -#X text 53 370 Inlet 1: bang send image (to update texture for example) -; -#X text 53 385 Inlet 1: fill : set the whole image with value (value -could be G \, RGB or RGBA); +#X text 53 370 Inlet 1: bang send image (to update texture for example); +#X text 53 385 Inlet 1: fill : set the whole image with value (value could be G \, RGB or RGBA); #X text 53 411 Inlet 1: set : set the size of the image; #X obj 502 142 r pix_set_in; #X text 447 511 and example/04.pix/27.bitmap_font.pd, f 32; @@ -83,23 +41,22 @@ could be G \, RGB or RGBA); #X msg 26 210 set 16 16; #X msg 57 238 set 4 4; #X msg 24 93 fill \$1 \, bang; -#X floatatom 24 76 5 0 1 0 - - -; +#X floatatom 24 76 5 0 1 0 - - - 0; #X msg 186 114 fill \$1 \$2 \$3 \$4 \, bang; #X obj 186 92 pack 0 0 0 0; -#X floatatom 186 47 5 0 1 0 - - -; -#X floatatom 226 47 5 0 1 0 - - -; -#X floatatom 266 47 5 0 1 0 - - -; -#X floatatom 312 48 5 0 1 0 - - -; +#X floatatom 186 47 5 0 1 0 - - - 0; +#X floatatom 226 47 5 0 1 0 - - - 0; +#X floatatom 266 47 5 0 1 0 - - - 0; +#X floatatom 312 48 5 0 1 0 - - - 0; #X obj 24 177 s pix_set_in; -#X text 33 30 fill message fill the whole image with the given values -; +#X text 33 30 fill message fill the whole image with the given values; #X text 174 133 in RGBA mode you can set each channel; #X obj 312 64 t b f; #X obj 266 64 t b f; #X obj 226 64 t b f; -#X floatatom 446 47 5 0 1 0 - - -; -#X floatatom 486 47 5 0 1 0 - - -; -#X floatatom 526 47 5 0 1 0 - - -; +#X floatatom 446 47 5 0 1 0 - - - 0; +#X floatatom 486 47 5 0 1 0 - - - 0; +#X floatatom 526 47 5 0 1 0 - - - 0; #X obj 526 64 t b f; #X obj 486 64 t b f; #X text 457 135 in RGB mode you can set each channel; @@ -107,8 +64,7 @@ could be G \, RGB or RGBA); #X obj 446 92 pack 0 0 0; #X obj 26 315 s pix_set_in; #X text 105 210 set the size of the image; -#X obj 154 272 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 154 272 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 176 273 send the image; #X connect 0 0 24 0; #X connect 1 0 24 0; @@ -137,15 +93,12 @@ could be G \, RGB or RGBA); #X connect 23 0 22 0; #X connect 26 0 24 0; #X restore 503 121 pd advanced; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 36 0; -#X connect 19 0 20 0; -#X connect 21 0 36 0; -#X connect 22 0 36 0; -#X connect 23 0 36 0; -#X connect 35 0 19 0; -#X connect 36 0 19 0; -#X connect 37 0 35 0; -#X connect 38 0 36 1; -#X connect 42 0 36 0; +#X obj 472 310 _gemwin \; 0 \; 0 \; color 0.5 0.5 0.5; +#X obj 451 274 _pix2rectangle 3 \; quality 0; +#X connect 10 0 29 0; +#X connect 15 0 29 0; +#X connect 16 0 29 0; +#X connect 17 0 29 0; +#X connect 29 0 39 0; +#X connect 30 0 29 1; +#X connect 34 0 29 0; diff --git a/help/pix_share_read-help.pd b/help/pix_share_read-help.pd index ca796fef3..442bc7673 100644 --- a/help/pix_share_read-help.pd +++ b/help/pix_share_read-help.pd @@ -1,62 +1,25 @@ #N canvas 246 139 904 368 10; #X declare -lib Gem; #X text 701 8 GEM object; -#X obj 8 270 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 270 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 271 Inlets:; #X text 34 306 Outlets:; -#X obj 8 231 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 231 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 230 Arguments:; -#X obj 7 56 cnv 15 430 170 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 57 cnv 15 440 220 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 56 cnv 15 430 170 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 57 cnv 15 440 220 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 40 Example:; -#X obj 484 204 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 489 243 pd gemwin; -#X msg 489 224 create; -#X text 485 203 Create window:; -#X obj 450 84 cnv 15 400 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 484 204 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 84 cnv 15 400 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 64 gemhead; #X text 71 31 Class: pix object; #X text 63 283 Inlet 1: gemlist; #X text 63 241 ; #X text 446 284 see also:; -#X text 18 127 [pix_share_write] and [pix_share_read] need not be in -the same instance of Pd. However all objects need to have access to -the same memory (they probably need to run on the same computer); -#X obj 451 154 pix_texture; -#X obj 451 175 square; -#X text 15 181 [pix_share_read] needs to know the image-dimensions -(and color-space) in advance. The color-space can be given as a symbol -("RGBA" \, "YUV" \, "Grey") or as pixel-width (4 \, 2 \, 1); -#X text 18 72 [pix_share_read] will create (if needed) a portion of -shared memory - identified by a given ID - where it can read pix-data -from. This data needs to be written by a [pix_share_write] object (referencing -to the same ID).; -#X text 29 56 Description: read pixels from a shared memory region -; +#X text 18 127 [pix_share_write] and [pix_share_read] need not be in the same instance of Pd. However all objects need to have access to the same memory (they probably need to run on the same computer); +#X text 15 181 [pix_share_read] needs to know the image-dimensions (and color-space) in advance. The color-space can be given as a symbol ("RGBA" \, "YUV" \, "Grey") or as pixel-width (4 \, 2 \, 1); +#X text 18 72 [pix_share_read] will create (if needed) a portion of shared memory - identified by a given ID - where it can read pix-data from. This data needs to be written by a [pix_share_write] object (referencing to the same ID).; +#X text 29 56 Description: read pixels from a shared memory region; #X text 50 12 Synopsis: [pix_share_read]; #X text 446 313 Run the [pix_share_write] help-patch; #X text 446 327 in a different Pd instance on your; @@ -76,16 +39,15 @@ to the same ID).; #X msg 666 103 set memory_name 256 256 RGBA; #X text 669 86 also work with symbol :; #X obj 778 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 39 0; -#X connect 20 0 21 0; -#X connect 31 0 39 0; -#X connect 32 0 33 0; -#X connect 32 1 34 0; -#X connect 33 0 36 0; -#X connect 34 0 36 0; -#X connect 35 0 32 0; -#X connect 39 0 20 0; -#X connect 39 1 35 0; -#X connect 41 0 39 0; +#X obj 451 154 _pix2rectangle; +#X obj 490 211 _gemwin; +#X connect 11 0 34 0; +#X connect 26 0 34 0; +#X connect 27 0 28 0; +#X connect 27 1 29 0; +#X connect 28 0 31 0; +#X connect 29 0 31 0; +#X connect 30 0 27 0; +#X connect 34 0 39 0; +#X connect 34 1 30 0; +#X connect 36 0 34 0; diff --git a/help/pix_share_write-help.pd b/help/pix_share_write-help.pd index fa42b7500..acfb8b11f 100644 --- a/help/pix_share_write-help.pd +++ b/help/pix_share_write-help.pd @@ -1,4 +1,4 @@ -#N canvas 547 473 901 407 10; +#N canvas 262 307 901 407 10; #X declare -lib Gem; #X text 701 8 GEM object; #X obj 8 270 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -10,52 +10,11 @@ #X obj 449 77 cnv 15 440 200 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 484 204 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 489 243 pd gemwin; -#X msg 489 224 create; -#X text 485 203 Create window:; #X obj 450 140 cnv 15 370 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; -#N canvas 0 50 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X obj 77 279 pix_rgba; -#X obj 77 307 pix_resize 256 256; -#X connect 0 0 2 0; -#X connect 2 0 6 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X connect 6 0 7 0; -#X connect 7 0 1 0; -#X restore 451 113 pd image; #X text 56 324 Outlet 1: gemlist; #X text 63 283 Inlet 1: gemlist; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_share_write]; #X text 29 56 Description: write pixels to a shared memory region; #X text 63 241 ; @@ -80,16 +39,15 @@ #X msg 626 148 set memory_name 256 256 RGBA; #X text 643 128 also work with symbol :; #X obj 778 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 41 0; -#X connect 34 0 41 0; -#X connect 35 0 36 0; -#X connect 35 1 37 0; -#X connect 36 0 39 0; -#X connect 37 0 39 0; -#X connect 38 0 35 0; -#X connect 41 1 38 0; -#X connect 43 0 41 0; +#X obj 490 212 _gemwin; +#X obj 451 113 pix_test; +#X connect 11 0 40 0; +#X connect 27 0 34 0; +#X connect 28 0 29 0; +#X connect 28 1 30 0; +#X connect 29 0 32 0; +#X connect 30 0 32 0; +#X connect 31 0 28 0; +#X connect 34 1 31 0; +#X connect 36 0 34 0; +#X connect 40 0 34 0; diff --git a/help/pix_sig2pix~-help.pd b/help/pix_sig2pix~-help.pd index db6d1314a..541d769ea 100644 --- a/help/pix_sig2pix~-help.pd +++ b/help/pix_sig2pix~-help.pd @@ -10,34 +10,10 @@ #X obj 452 81 cnv 15 170 465 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 459 64 Example:; #X obj 516 480 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create+DSP; -#X obj 67 41 route create+DSP; -#X msg 102 163 \; pd dsp 1; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 0 8 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 521 519 pd gemwin; -#X msg 521 500 create+DSP; -#X text 517 479 Create window:; -#X obj 457 120 cnv 15 160 190 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 457 120 cnv 15 160 320 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 457 94 gemhead; #X text 23 527 Outlet 1: gemlist; #X text 29 406 Inlet 1: gemlist; -#X obj 457 479 square 3; #X text 69 369 list: [ ]; #X obj 532 94 block~ 4096; #X obj 465 210 osc~ 1; @@ -72,27 +48,33 @@ #X msg 475 374 mode waterfall; #X text 18 79 [pix_sig2pix~] will interpret the 4 incoming audio-streams as values for the red \, green \, blue and alpha channel of an image. The default image-size is calculated from the blocksize (eg: 64samples -> 8x8 & 128samples -> 16x8) \, but you can set it either with arguments or the [dimen( message. If your imagesize is bigger than the blocksize \, the rest will be zeroed out. For legacy reasons \, images are upside-down. You can flip them with the 'upsidedown' message., f 69; #X msg 480 285 upsidedown 0; -#X obj 457 445 pix_texture \; quality 0; #X text 29 444 Inlet 1: message: mode clear|fill|line|waterfall; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 40 0; -#X connect 20 0 22 0; -#X connect 21 0 37 0; -#X connect 22 0 21 0; -#X connect 23 0 26 0; -#X connect 24 0 27 0; -#X connect 25 0 26 1; -#X connect 26 0 37 1; -#X connect 27 0 37 2; -#X connect 28 0 20 0; -#X connect 37 0 52 0; -#X connect 40 0 37 0; -#X connect 41 0 40 0; -#X connect 44 0 37 0; -#X connect 45 0 37 0; -#X connect 46 0 37 0; -#X connect 47 0 40 0; -#X connect 49 0 37 0; -#X connect 51 0 37 0; -#X connect 52 0 17 0; +#X obj 524 487 _gemwin; +#N canvas 735 418 450 300 dsp 0; +#X obj 59 45 inlet; +#X obj 59 68 select 1; +#X msg 59 91 \; pd dsp 1; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X restore 524 542 pd dsp; +#X obj 457 445 _pix2rectangle 3 \; quality 0; +#X connect 11 0 36 0; +#X connect 16 0 18 0; +#X connect 17 0 33 0; +#X connect 18 0 17 0; +#X connect 19 0 22 0; +#X connect 20 0 23 0; +#X connect 21 0 22 1; +#X connect 22 0 33 1; +#X connect 23 0 33 2; +#X connect 24 0 16 0; +#X connect 33 0 51 0; +#X connect 36 0 33 0; +#X connect 37 0 36 0; +#X connect 40 0 33 0; +#X connect 41 0 33 0; +#X connect 42 0 33 0; +#X connect 43 0 36 0; +#X connect 45 0 33 0; +#X connect 47 0 33 0; +#X connect 49 0 50 0; diff --git a/help/pix_snap-help.pd b/help/pix_snap-help.pd index 891c6dd47..4a4a194ee 100644 --- a/help/pix_snap-help.pd +++ b/help/pix_snap-help.pd @@ -10,33 +10,11 @@ #X obj 449 67 cnv 15 380 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 50 Example:; #X obj 594 303 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 16 419 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 268 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 599 342 pd gemwin; -#X msg 599 323 create; -#X text 595 302 Create window:; #X obj 452 137 cnv 15 240 140 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 71 31 Class: pix object; #X text 27 423 Outlet 1: gemlist; #X text 33 289 Inlet 1: gemlist; -#X obj 451 335 square 3; -#X obj 706 193 sphere; +#X obj 706 196 sphere; #X obj 451 74 gemhead 50; #X obj 706 75 gemhead 49; #X obj 482 207 spigot; @@ -48,7 +26,7 @@ #X text 63 246 list: [offsetX offsetY [dimX dimY]]; #X floatatom 527 75 5 0 0 0 - - - 0; #X obj 451 114 rotate 0 1 0 0; -#X obj 706 143 translate -1 0 1 0; +#X obj 706 146 translate -1 0 1 0; #X obj 451 94 translate 1 0 1 0; #X obj 451 187 t a b; #X obj 706 124 rotate 0 1 1 1; @@ -73,10 +51,9 @@ #X text 29 67 Description: take a screenshot and convert it to a Pix; #X text 13 91 When banged [pix_snap] will take a snapshot of the current frame buffer which can then be used as a pix. When a snap message (or a bang) is sent to [pix_snap] \, that is the moment that something is captured from the current frame buffer., f 69; #X obj 451 281 pix_invert; -#X obj 451 303 pix_texture; #X text 33 344 Inlet 1: snap: do grab!; #X obj 706 97 t a b; -#X obj 706 165 color 1 0 0; +#X obj 706 168 color 1 0 0; #X obj 482 227 t b b; #X msg 518 227 0; #X obj 451 256 pix_snap 0 0 500 500; @@ -89,29 +66,28 @@ #X text 33 318 Inlet 1: dimen ; #X text 33 330 Inlet 1: offset ; #X msg 518 177 type FLOAT; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 19 0 31 0; -#X connect 20 0 44 0; -#X connect 21 0 46 0; -#X connect 22 0 21 1; -#X connect 23 0 48 2; -#X connect 28 0 29 1; -#X connect 29 0 32 0; -#X connect 30 0 45 0; -#X connect 31 0 29 0; -#X connect 32 0 48 0; -#X connect 32 1 21 0; -#X connect 33 0 30 0; -#X connect 34 0 33 1; -#X connect 41 0 42 0; -#X connect 42 0 17 0; -#X connect 44 0 33 0; -#X connect 44 1 34 0; -#X connect 45 0 18 0; -#X connect 46 0 48 0; -#X connect 46 1 47 0; -#X connect 47 0 22 0; -#X connect 48 0 41 0; -#X connect 49 0 48 1; -#X connect 57 0 48 0; +#X obj 601 307 _gemwin; +#X obj 451 303 _pix2rectangle 3; +#X connect 15 0 27 0; +#X connect 16 0 39 0; +#X connect 17 0 41 0; +#X connect 18 0 17 1; +#X connect 19 0 43 2; +#X connect 24 0 25 1; +#X connect 25 0 28 0; +#X connect 26 0 40 0; +#X connect 27 0 25 0; +#X connect 28 0 43 0; +#X connect 28 1 17 0; +#X connect 29 0 26 0; +#X connect 30 0 29 1; +#X connect 37 0 54 0; +#X connect 39 0 29 0; +#X connect 39 1 30 0; +#X connect 40 0 14 0; +#X connect 41 0 43 0; +#X connect 41 1 42 0; +#X connect 42 0 18 0; +#X connect 43 0 37 0; +#X connect 44 0 43 1; +#X connect 52 0 43 0; diff --git a/help/pix_snap2tex-help.pd b/help/pix_snap2tex-help.pd index d9d290527..f0313da39 100644 --- a/help/pix_snap2tex-help.pd +++ b/help/pix_snap2tex-help.pd @@ -1,43 +1,16 @@ #N canvas 16 226 710 395 10; #X declare -lib Gem; #X text 518 8 GEM object; -#X obj 8 216 cnv 15 430 160 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 216 cnv 15 430 160 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 218 Inlets:; #X text 39 347 Outlets:; -#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 176 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 175 Arguments:; -#X obj 8 66 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 67 cnv 15 250 300 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 67 cnv 15 250 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 50 Example:; -#X obj 514 303 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 15 422 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 268 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 342 pd gemwin; -#X msg 519 323 create; -#X text 515 302 Create window:; -#X obj 452 157 cnv 15 240 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 303 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 452 157 cnv 15 240 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X text 71 31 Class: pix object; #X text 27 360 Outlet 1: gemlist; #X text 33 232 Inlet 1: gemlist; @@ -46,32 +19,23 @@ #X obj 568 133 sphere; #X obj 451 74 gemhead 50; #X obj 568 75 gemhead 49; -#X obj 571 256 tgl 15 1 empty empty texture_on/off 20 7 0 8 -262144 --1 -1 1 1; +#X obj 571 256 tgl 15 1 empty empty texture_on/off 20 7 0 8 #fcfcfc #000000 #000000 1 1; #X obj 482 217 spigot; #X obj 528 217 t b f; -#X obj 514 198 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 514 198 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 570 209 0 0; #X msg 570 233 256 256; #X text 50 12 Synopsis: [pix_snap2tex]; #X text 29 67 Description: take a screenshot and texture it; -#X text 13 81 When banged [pix_snap2tex] will take a snapshot of the -current render buffer and immediately texture it to any geometric object -attached. You can specify the close-up you want to be grabbed via offset/dimension-pairs. -; -#X text 12 135 When grabbing \, be sure that something is in the rendering-buffer -\, else you will get a black texture.; +#X text 13 81 When banged [pix_snap2tex] will take a snapshot of the current render buffer and immediately texture it to any geometric object attached. You can specify the close-up you want to be grabbed via offset/dimension-pairs.; +#X text 12 135 When grabbing \, be sure that something is in the rendering-buffer \, else you will get a black texture.; #X text 33 245 Inlet 1: bang: do grab!; #X text 33 257 Inlet 1: [1|0]: turn texturing on/off (default:1); -#X text 33 269 Inlet 1: message: quality [0|1]: turn texture-resampling -on(default)/off; -#X text 33 295 Inlet 2: list: offsetX offsetY (in pixels \; default: -0 0); -#X text 33 321 Inlet 3: list: dimenX dimenY (in pixels \; default: -window-size); +#X text 33 269 Inlet 1: message: quality [0|1]: turn texture-resampling on(default)/off; +#X text 33 295 Inlet 2: list: offsetX offsetY (in pixels \; default: 0 0); +#X text 33 321 Inlet 3: list: dimenX dimenY (in pixels \; default: window-size); #X text 63 186 list: [offsetX offsetY [dimX dimY]]; -#X floatatom 527 75 5 0 0 0 - - -; +#X floatatom 527 75 5 0 0 0 - - - 0; #X obj 451 114 rotate 0 1 0 0; #X obj 568 113 translate -1 0 1 0; #X obj 451 94 translate 1 0 1 0; @@ -95,30 +59,28 @@ window-size); #X text 624 233 dimension; #X text 598 211 offset; #X text 506 171 drawn but before the square; -#X obj 474 164 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 474 164 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 504 158 SNAP! after the sphere is; #X obj 588 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 18 0 43 0; -#X connect 20 0 41 0; -#X connect 21 0 44 0; -#X connect 21 0 45 0; -#X connect 22 0 18 0; -#X connect 23 0 24 0; -#X connect 24 0 18 0; -#X connect 24 1 25 0; -#X connect 25 0 23 1; -#X connect 26 0 18 1; -#X connect 27 0 18 2; -#X connect 38 0 39 1; -#X connect 39 0 42 0; -#X connect 40 0 19 0; -#X connect 41 0 39 0; -#X connect 42 0 18 0; -#X connect 42 1 23 0; -#X connect 43 0 17 0; -#X connect 44 0 40 0; -#X connect 45 0 44 1; -#X connect 49 0 25 0; +#X obj 519 309 _gemwin; +#X connect 15 0 40 0; +#X connect 17 0 38 0; +#X connect 18 0 41 0; +#X connect 18 0 42 0; +#X connect 19 0 15 0; +#X connect 20 0 21 0; +#X connect 21 0 15 0; +#X connect 21 1 22 0; +#X connect 22 0 20 1; +#X connect 23 0 15 1; +#X connect 24 0 15 2; +#X connect 35 0 36 1; +#X connect 36 0 39 0; +#X connect 37 0 16 0; +#X connect 38 0 36 0; +#X connect 39 0 15 0; +#X connect 39 1 20 0; +#X connect 40 0 14 0; +#X connect 41 0 37 0; +#X connect 42 0 41 1; +#X connect 46 0 22 0; diff --git a/help/pix_subtract-help.pd b/help/pix_subtract-help.pd index 7d6ef4572..4e152e540 100644 --- a/help/pix_subtract-help.pd +++ b/help/pix_subtract-help.pd @@ -1,46 +1,18 @@ #N canvas 103 127 664 397 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 39 304 Outlets:; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 329 pd gemwin; -#X msg 519 310 create; -#X text 515 289 Create window:; -#X obj 451 173 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 173 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 126 gemhead; -#X obj 496 109 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 496 109 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -53,12 +25,10 @@ #X connect 3 0 5 0; #X connect 4 0 2 0; #X connect 5 0 4 0; -#X restore 451 145 pd image; -#X obj 451 268 pix_texture; +#X restore 451 147 pd image; #X text 63 196 ; #X text 47 318 Outlet 1: gemlist; #X text 53 262 Inlet 1: gemlist; -#X obj 451 290 square 3; #X text 503 88 (JPEG \, TIFF \, ..); #X obj 541 129 gemhead; #N canvas 0 22 587 366 image 0; @@ -73,9 +43,8 @@ #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 5 0 1 0; -#X restore 541 148 pd image; -#X obj 586 110 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X restore 541 150 pd image; +#X obj 586 110 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X text 53 291 Inlet 2: gemlist; #X text 449 77 open two different images; #X text 71 31 Class: pix mix object; @@ -83,20 +52,17 @@ #X obj 451 203 pix_subtract; #X text 50 12 Synopsis: [pix_subtract]; #X text 29 67 Description: subtract 2 images; -#X text 19 89 [pix_subtract] simply subtracts two pixes from each other. -It clamps the resultant image so that no pixel values go below zero -(In other words \, it is easy to get a black out).; +#X text 19 89 [pix_subtract] simply subtracts two pixes from each other. It clamps the resultant image so that no pixel values go below zero (In other words \, it is easy to get a black out).; #X text 39 366 see also:; #X obj 101 368 pix_diff; #X obj 164 368 pix_compare; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 30 0; -#X connect 17 0 21 0; -#X connect 23 0 24 0; -#X connect 24 0 30 1; -#X connect 25 0 24 1; -#X connect 30 0 17 0; +#X obj 451 268 _pix2rectangle 3; +#X obj 520 296 _gemwin; +#X connect 11 0 13 0; +#X connect 12 0 13 1; +#X connect 13 0 25 0; +#X connect 18 0 19 0; +#X connect 19 0 25 1; +#X connect 20 0 19 1; +#X connect 25 0 33 0; diff --git a/help/pix_tIIR-help.pd b/help/pix_tIIR-help.pd index c8a6c75e5..dd358ed6b 100644 --- a/help/pix_tIIR-help.pd +++ b/help/pix_tIIR-help.pd @@ -1,53 +1,23 @@ #N canvas 118 61 683 405 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 9 265 cnv 15 430 135 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 40 267 Inlets:; #X text 39 372 Outlets:; -#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 18 226 Arguments:; -#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 210 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 210 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 519 329 pd gemwin; -#X msg 519 310 create; -#X text 515 289 Create window:; -#X obj 451 179 cnv 15 155 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 290 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 451 179 cnv 15 155 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 83 gemhead; #X text 17 386 Outlet 1: gemlist; #X text 24 281 Inlet 1: gemlist; -#X obj 451 292 square 3; -#X obj 451 270 pix_texture; #X text 71 31 Class: pix object (timebased effect); #X obj 451 151 pix_film; #X obj 515 151 t f; -#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 464 103 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 open 0; #X obj 85 49 inlet; #X obj 85 237 outlet; @@ -69,12 +39,12 @@ #X text 50 12 Synopsis: [pix_tIIR]; #X text 29 57 Description: timebased IIR-filter; #X text 64 237 list: ; -#X floatatom 464 218 3 0 1 2 fb0 - -; -#X floatatom 491 218 3 0 1 2 fb1 - -; -#X floatatom 517 218 3 0 1 2 fb2 - -; -#X floatatom 554 218 3 0 1 2 ff0 - -; +#X floatatom 464 218 3 0 1 2 fb0 - - 0; +#X floatatom 491 218 3 0 1 2 fb1 - - 0; +#X floatatom 517 218 3 0 1 2 fb2 - - 0; +#X floatatom 554 218 3 0 1 2 ff0 - - 0; #X obj 451 238 pix_tIIR 2 1; -#X floatatom 581 218 3 0 1 2 ff1 - -; +#X floatatom 581 218 3 0 1 2 ff1 - - 0; #N canvas 0 0 450 300 init 0; #X msg 175 214 0.3; #X msg 247 215 0.6; @@ -113,47 +83,37 @@ #X connect 14 0 3 0; #X connect 15 0 4 0; #X restore 610 201 pd init; -#X obj 610 184 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 610 184 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 477 182 set; -#X text 24 294 Inlet 1: message: set: overwrites the filter-buffers -with the next incoming image.; -#X text 24 323 Inlet 1: message: set 0: blanks the filter-buffers. -; +#X text 24 294 Inlet 1: message: set: overwrites the filter-buffers with the next incoming image.; +#X text 24 323 Inlet 1: message: set 0: blanks the filter-buffers.; #X text 24 343 Inlet 2..(M+2): float: mth feedback-coefficient; -#X text 24 355 Inlet (M+2)..(N+M+2): float: nth feedforward-coefficient -; +#X text 24 355 Inlet (M+2)..(N+M+2): float: nth feedforward-coefficient; #X text 37 189 w(n) = fb0 * x(n) + fb1 * w(n-1) + ... + fbN(n-M); #X text 38 203 y(n) = ff1 * w(n) + ff2 * w(n-1) + ... + ffM(n-N); -#X text 11 161 The output y() will calculate from the input x() at -a time n as follows; +#X text 11 161 The output y() will calculate from the input x() at a time n as follows; #X msg 517 183 set 0; -#X text 11 79 [pix_tIIR] is a time-based filter like [pix_motionblur] -\, [pix_biquad] or Pd's [biquad~]. The filter has a feedback- and a -feedforward-section \, the length of each can be specified as arguments. -The objects will have an inlet for each feedback-coefficient and an -inlet for each feedforward-coefficient.; +#X text 11 79 [pix_tIIR] is a time-based filter like [pix_motionblur] \, [pix_biquad] or Pd's [biquad~]. The filter has a feedback- and a feedforward-section \, the length of each can be specified as arguments. The objects will have an inlet for each feedback-coefficient and an inlet for each feedforward-coefficient.; #X obj 548 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 20 0; -#X connect 18 0 17 0; -#X connect 20 0 36 0; -#X connect 20 2 21 0; -#X connect 21 0 20 1; -#X connect 22 0 23 0; -#X connect 23 0 20 0; -#X connect 32 0 36 1; -#X connect 33 0 36 2; -#X connect 34 0 36 3; -#X connect 35 0 36 4; -#X connect 36 0 18 0; -#X connect 37 0 36 5; -#X connect 38 0 32 0; -#X connect 38 1 33 0; -#X connect 38 2 34 0; -#X connect 38 3 35 0; -#X connect 38 4 37 0; -#X connect 39 0 38 0; -#X connect 40 0 36 0; -#X connect 48 0 36 0; +#X obj 451 270 _pix2rectangle 3; +#X obj 519 295 _gemwin; +#X connect 11 0 15 0; +#X connect 15 0 31 0; +#X connect 15 2 16 0; +#X connect 16 0 15 1; +#X connect 17 0 18 0; +#X connect 18 0 15 0; +#X connect 27 0 31 1; +#X connect 28 0 31 2; +#X connect 29 0 31 3; +#X connect 30 0 31 4; +#X connect 31 0 46 0; +#X connect 32 0 31 5; +#X connect 33 0 27 0; +#X connect 33 1 28 0; +#X connect 33 2 29 0; +#X connect 33 3 30 0; +#X connect 33 4 32 0; +#X connect 34 0 33 0; +#X connect 35 0 31 0; +#X connect 43 0 31 0; diff --git a/help/pix_takealpha-help.pd b/help/pix_takealpha-help.pd index 2a5aa3c19..9a50b0e38 100644 --- a/help/pix_takealpha-help.pd +++ b/help/pix_takealpha-help.pd @@ -1,46 +1,17 @@ #N canvas 6 273 640 398 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 226 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 30 233 Inlets:; #X text 30 289 Outlets:; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 66 cnv 15 170 280 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 8 66 cnv 15 430 110 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 66 cnv 15 170 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 49 Example:; -#X obj 514 279 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy \, reset; -#X msg 132 93 create \, 1 \, color 0.5 0.5 0.5; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 318 pd gemwin; -#X msg 519 299 create; -#X text 515 278 Create window:; -#X obj 451 187 cnv 15 160 40 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 451 187 cnv 15 160 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 118 gemhead; -#X obj 496 101 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 496 101 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -54,11 +25,9 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 451 137 pd image; -#X obj 451 252 pix_texture; #X text 63 196 ; #X text 38 303 Outlet 1: gemlist; #X text 44 247 Inlet 1: gemlist; -#X obj 451 274 square 3; #X text 503 77 (JPEG \, TIFF \, ..); #X obj 519 121 gemhead; #N canvas 0 22 587 366 image 0; @@ -74,8 +43,7 @@ #X connect 4 0 2 0; #X connect 5 0 4 0; #X restore 519 140 pd image; -#X obj 564 102 bng 15 250 50 0 empty empty pix_load -45 8 0 8 -262144 --1 -1; +#X obj 564 102 bng 15 250 50 0 empty empty pix_load -45 8 0 8 #fcfcfc #000000 #000000; #X text 44 276 Inlet 2: gemlist; #X text 449 66 open two different images; #X text 71 31 Class: pix mix object; @@ -84,24 +52,21 @@ #X obj 519 161 pix_coloralpha; #X obj 451 232 alpha; #X text 29 67 Description: transfer the alpha-channel; -#X text 29 84 [pix_takealpha] takes the alpha-channel of the 2nd image -and applies it on the 1st image.; +#X text 29 84 [pix_takealpha] takes the alpha-channel of the 2nd image and applies it on the 1st image.; #X text 28 117 The 1st image has the be in RGBA-colorspace; -#X text 27 130 If the 2nd image is in non-RGBA colorspace \, the luminance -value is taken instead of the Alpha-value.; +#X text 27 130 If the 2nd image is in non-RGBA colorspace \, the luminance value is taken instead of the Alpha-value.; #X text 50 12 Synopsis: [pix_takealpha]; #X text 31 356 see also:; #X obj 96 358 pix_mask; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 16 0; -#X connect 15 0 16 1; -#X connect 16 0 30 0; -#X connect 17 0 21 0; -#X connect 23 0 24 0; -#X connect 24 0 31 0; +#X obj 468 278 _gemwin \; 0 \; 0 \; color 0.5 0.5 0.5; +#X obj 451 252 _pix2rectangle 3; +#X connect 10 0 12 0; +#X connect 11 0 12 1; +#X connect 12 0 24 0; +#X connect 17 0 18 0; +#X connect 18 0 25 0; +#X connect 19 0 18 1; +#X connect 24 0 26 0; #X connect 25 0 24 1; -#X connect 30 0 32 0; -#X connect 31 0 30 1; -#X connect 32 0 17 0; +#X connect 26 0 36 0; diff --git a/help/pix_test-help.pd b/help/pix_test-help.pd index eb8737e15..0c008eaab 100644 --- a/help/pix_test-help.pd +++ b/help/pix_test-help.pd @@ -9,28 +9,6 @@ #X obj 7 56 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 449 77 cnv 15 200 380 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 484 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 1 98 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy \, reset; -#X msg 132 94 create \, 1 \, color 0.5 0.5 0.5; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 523 pd gemwin; -#X msg 519 504 create; -#X text 515 483 Create window:; #X text 71 31 Class: pix object; #X text 46 445 Outlet 1: gemlist; #X text 53 342 Inlet 1: gemlist; @@ -46,8 +24,6 @@ #X text 53 405 Inlet 1: noise <1|0> : with noise (default) or without; #X obj 450 114 cnv 15 160 230 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; -#X obj 451 403 pix_texture; -#X obj 451 425 square 3.5; #X obj 451 355 pix_info, f 25; #X floatatom 471 379 5 0 0 0 - - - 0; #X floatatom 505 379 5 0 0 0 - - - 0; @@ -63,22 +39,21 @@ #X obj 451 251 t a; #X obj 451 316 pix_test; #X msg 476 116 dimen 64 64; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 27 0 38 0; -#X connect 28 0 29 0; -#X connect 30 0 28 0; -#X connect 30 1 31 0; -#X connect 30 2 32 0; -#X connect 30 3 33 0; -#X connect 34 0 38 0; +#X obj 455 488 _gemwin \; 0 \; 0 \; color 0.5 0.5 0.5; +#X obj 451 403 _pix2rectangle 3.5; +#X connect 23 0 32 0; +#X connect 24 0 40 0; +#X connect 24 1 25 0; +#X connect 24 2 26 0; +#X connect 24 3 27 0; +#X connect 28 0 32 0; +#X connect 29 0 30 0; +#X connect 30 0 37 0; +#X connect 31 0 36 0; +#X connect 32 0 36 0; +#X connect 33 0 36 0; +#X connect 34 0 36 0; #X connect 35 0 36 0; -#X connect 36 0 43 0; -#X connect 37 0 42 0; -#X connect 38 0 42 0; -#X connect 39 0 42 0; -#X connect 40 0 42 0; -#X connect 41 0 42 0; -#X connect 42 0 43 0; -#X connect 43 0 30 0; -#X connect 44 0 38 0; +#X connect 36 0 37 0; +#X connect 37 0 24 0; +#X connect 38 0 32 0; diff --git a/help/pix_texture-help.pd b/help/pix_texture-help.pd index 14e945c77..4c0b82512 100644 --- a/help/pix_texture-help.pd +++ b/help/pix_texture-help.pd @@ -1,51 +1,19 @@ -#N canvas 43 61 647 715 10; +#N canvas 43 61 647 834 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 392 cnv 15 430 360 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 392 cnv 15 430 360 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 19 394 Inlets:; #X text 22 665 Outlets:; -#X obj 8 352 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 352 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 351 Arguments:; -#X obj 8 56 cnv 15 430 285 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 600 empty empty empty 20 12 0 14 -228992 -66577 -0; -#X text 453 60 Example:; -#X obj 515 572 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 234 221 dimen 500 500; -#X msg 279 189 dimen 1024 768; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X connect 9 0 0 0; -#X restore 520 611 pd gemwin; -#X msg 520 592 create; -#X text 516 571 Create window:; -#X obj 455 276 cnv 15 160 265 empty empty empty 20 12 0 14 -24198 -66577 -0; -#X obj 451 84 gemhead; +#X obj 8 56 cnv 15 430 285 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 448 77 cnv 15 170 600 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X text 454 60 Example:; +#X obj 514 612 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 454 276 cnv 15 160 300 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 454 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 513 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 50 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -61,119 +29,89 @@ #X connect 3 0 5 0; #X connect 4 0 2 0; #X connect 5 0 4 0; -#X restore 451 113 pd image; +#X restore 454 113 pd image; #X obj 454 547 pix_texture; #X text 63 362 ; #X text 57 682 Outlet 1: gemlist; #X text 29 408 Inlet 1: gemlist; -#X obj 452 571 square 3; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); +#X obj 454 591 square 3; +#X text 519 105 open an image; +#X text 512 118 (JPEG \, TIFF \, ..); #X text 50 12 Synopsis: [pix_texture]; #X text 29 57 Description: apply texture mapping; -#X text 16 79 enables texture mapping with the current pix. Whatever -pix values are in the network currently will be used (ie \, all processing -after the pix_texture will not have any effect).; +#X text 16 79 enables texture mapping with the current pix. Whatever pix values are in the network currently will be used (ie \, all processing after the pix_texture will not have any effect)., f 69; #X msg 461 451 quality \$1; -#X obj 461 432 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 461 432 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 29 423 Inlet 1: 0|1 turn texturing On/off; -#X text 29 437 Inlet 1: quality 0|1 : GL_NEAREST | GL_LINEAR(default) -; -#X text 15 122 Send a quality message to change the quality of the -texture mapping. GL_LINEAR is better than GL_NEAREST (but also more -computationally expensive). However \, on many machines (especially -SGIs) \, there is no speed difference.; -#X text 14 233 [pix_texture] is able to texture images of ANY size -(even non-power of 2); -#X obj 532 472 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X text 29 437 Inlet 1: quality 0|1 : GL_NEAREST | GL_LINEAR(default); +#X text 16 122 Send a quality message to change the quality of the texture mapping. GL_LINEAR is better than GL_NEAREST (but also more computationally expensive). However \, on many machines (especially SGIs) \, there is no speed difference., f 69; +#X text 14 233 [pix_texture] is able to texture images of ANY size (even non-power of 2), f 54; +#X obj 532 472 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 532 491 rectangle \$1; -#X obj 469 497 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 532 432 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 469 497 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 532 432 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 469 516 client_storage \$1; #X msg 532 451 repeat \$1; -#X text 29 453 Inlet 1: repeat 0|1 : CLAMP_TO_EDGE or REPEAT(default) -; -#X text 28 470 Inlet 1: rectangle 0|1 : use rectangle-texturing if -available (default:1); -#X text 28 498 Inlet 1: client_storage 0|1 : use client-storage if -available (default:1); +#X text 29 453 Inlet 1: repeat 0|1 : CLAMP_TO_EDGE or REPEAT(default); +#X text 28 470 Inlet 1: rectangle 0|1 : use rectangle-texturing if available (default:1); +#X text 28 498 Inlet 1: client_storage 0|1 : use client-storage if available (default:1); #X msg 493 407 env \$1; -#X obj 493 387 hradio 15 1 0 6 empty empty empty 0 -6 0 8 -262144 -1 --1 0; -#X obj 472 222 pack 0 0 1; -#X obj 452 243 color 0 0.5 0; -#X obj 498 196 t b f; -#X obj 499 177 nbx 3 14 0 1 0 0 empty empty green 0 -6 0 10 -262144 --1 -1 0 256; -#X obj 540 196 t b f; -#X obj 541 177 nbx 3 14 0 1 0 0 empty empty blue 0 -6 0 10 -262144 --1 -1 0 256; -#X obj 458 196 nbx 3 14 0 1 0 0 empty empty red 0 -6 0 10 -262144 -1 --1 0 256; -#X text 14 262 [pix_texture] tries to use the fastest way to get a -pix onto a texture. This implies using "rectangle"-texturing if available. -This \, in turn \, can lead to some problems with several geos. Try -using "rectangle 0" if you experience problems. Rectangle textures -cannot be REPEATed (they are always clamped-to-edge); -#X text 28 526 Inlet 1: env 0|1|2|3|4|5 : texture environment mode -; -#X text 53 541 0=GL_REPLACE \, 1=GL_DECAL \, 2=GL_BLEND \, 3=GL_ADD -\,; +#X obj 493 387 hradio 15 1 0 6 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0; +#X obj 474 222 pack 0 0 1; +#X obj 454 243 color 0 0.5 0; +#X obj 500 196 t b f; +#X obj 501 177 nbx 3 14 0 1 0 0 empty empty green 0 -6 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 542 196 t b f; +#X obj 543 177 nbx 3 14 0 1 0 0 empty empty blue 0 -6 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 460 196 nbx 3 14 0 1 0 0 empty empty red 0 -6 0 10 #fcfcfc #000000 #000000 0 256; +#X text 16 262 [pix_texture] tries to use the fastest way to get a pix onto a texture. This implies using "rectangle"-texturing if available. This \, in turn \, can lead to some problems with several geos. Try using "rectangle 0" if you experience problems. Rectangle textures cannot be REPEATed (they are always clamped-to-edge), f 69; +#X text 28 526 Inlet 1: env 0|1|2|3|4|5 : texture environment mode; +#X text 53 541 0=GL_REPLACE \, 1=GL_DECAL \, 2=GL_BLEND \, 3=GL_ADD \,; #X text 53 556 4=GL_COMBINE \, >4=GL_MODULATE (default); -#X text 16 176 - env message changes the texture environment mode. -Some modes allow mixing with fragment colors (BLEND \, ADD \, COMBINE -\, MODULATE) \, while REPLACE and DECAL ignore the current fragment/texture -color.; -#X text 457 149 set base fragment color; -#X text 57 700 Outlet 2: texture info : -; +#X text 16 176 - env message changes the texture environment mode. Some modes allow mixing with fragment colors (BLEND \, ADD \, COMBINE \, MODULATE) \, while REPLACE and DECAL ignore the current fragment/texture color., f 69; +#X text 459 149 set base fragment color; +#X text 57 700 Outlet 2: texture info : ; #X text 28 576 Inlet 1: message: texunit ; #X text 108 611 (useful only with shader); #X text 108 594 (change texunit of the texture); -#X floatatom 463 286 5 0 0 0 - - -; +#X floatatom 463 286 5 0 0 0 - - - 0; #X msg 463 305 texunit \$1; -#X obj 473 331 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 473 331 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 473 351 yuv \$1; -#X text 28 646 Inlet 1: message: pbo : change pixel buffer object number -; -#X floatatom 537 332 5 0 0 0 - - -; +#X text 28 646 Inlet 1: message: pbo : change pixel buffer object number; +#X floatatom 537 332 5 0 0 0 - - - 0; #X msg 537 351 pbo \$1; -#X text 28 626 Inlet 1: message: yuv : use native YUV-mode if available -(default:1), f 69; +#X text 28 626 Inlet 1: message: yuv : use native YUV-mode if available (default:1), f 69; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 46 0; -#X connect 18 0 22 0; -#X connect 28 0 18 0; -#X connect 29 0 28 0; -#X connect 34 0 35 0; -#X connect 35 0 18 0; -#X connect 36 0 38 0; -#X connect 37 0 39 0; -#X connect 38 0 18 0; -#X connect 39 0 18 0; -#X connect 43 0 18 0; -#X connect 44 0 43 0; -#X connect 45 0 46 1; -#X connect 46 0 18 0; -#X connect 47 0 45 0; -#X connect 47 1 45 1; -#X connect 48 0 47 0; -#X connect 49 0 45 0; -#X connect 49 1 45 2; -#X connect 50 0 49 0; -#X connect 51 0 45 0; -#X connect 62 0 63 0; -#X connect 63 0 18 0; +#X obj 521 618 _gemwin; +#X obj 257 781 _pix2rectangle; +#X text 43 760 For the sake of brevity \, most Gem-helppatches use a small wrapper abstraction around [pix_texture]+[rectangle]:, f 77; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 43 0; +#X connect 15 0 19 0; +#X connect 25 0 15 0; +#X connect 26 0 25 0; +#X connect 31 0 32 0; +#X connect 32 0 15 0; +#X connect 33 0 35 0; +#X connect 34 0 36 0; +#X connect 35 0 15 0; +#X connect 36 0 15 0; +#X connect 40 0 15 0; +#X connect 41 0 40 0; +#X connect 42 0 43 1; +#X connect 43 0 15 0; +#X connect 44 0 42 0; +#X connect 44 1 42 1; +#X connect 45 0 44 0; +#X connect 46 0 42 0; +#X connect 46 1 42 2; +#X connect 47 0 46 0; +#X connect 48 0 42 0; +#X connect 59 0 60 0; +#X connect 60 0 15 0; +#X connect 61 0 62 0; +#X connect 62 0 15 0; #X connect 64 0 65 0; -#X connect 65 0 18 0; -#X connect 67 0 68 0; -#X connect 68 0 18 0; +#X connect 65 0 15 0; diff --git a/help/pix_threshold-help.pd b/help/pix_threshold-help.pd index 92b4a8e48..da5c61f10 100644 --- a/help/pix_threshold-help.pd +++ b/help/pix_threshold-help.pd @@ -1,47 +1,19 @@ #N canvas 550 226 628 363 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 225 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 225 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 228 Inlets:; #X text 38 315 Outlets:; -#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 7 56 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 56 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 515 295 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 520 334 pd gemwin; -#X msg 520 315 create; -#X text 516 294 Create window:; -#X obj 450 158 cnv 15 160 120 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 515 295 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 5 49 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -60,24 +32,21 @@ #X text 63 242 Inlet 1: gemlist; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X floatatom 465 162 5 0 1 1 pass - -; +#X floatatom 465 162 5 0 1 1 pass - - 0; #X text 50 12 Synopsis: [pix_threshold]; #X text 29 56 Description: apply a threshold to pixes; -#X text 15 101 pix_threshold is a simply threshold filter. Any pixel -above the value is passed. Any pixel below the value is zeroed out. -; +#X text 15 101 pix_threshold is a simply threshold filter. Any pixel above the value is passed. Any pixel below the value is zeroed out.; #X text 15 155 If the float is used \, alpha is assumed to be 1; -#X obj 451 256 pix_threshold; +#X obj 451 226 pix_threshold; #X text 63 255 Inlet 2: : threshold for all channels; #X text 63 280 Inlet 3: : threshold (RGB) or (RGBA); -#X obj 451 283 pix_draw; -#X msg 496 205 0.6 0.1 0.8; +#X obj 451 265 _pix2rectangle 3; +#X msg 496 195 0.6 0.1 0.8; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 28 0; -#X connect 23 0 28 1; -#X connect 28 0 31 0; -#X connect 32 0 28 2; +#X obj 521 301 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 25 0; +#X connect 20 0 25 1; +#X connect 25 0 28 0; +#X connect 29 0 25 2; diff --git a/help/pix_threshold_bernsen-help.pd b/help/pix_threshold_bernsen-help.pd index 14bd23b78..669991a9f 100644 --- a/help/pix_threshold_bernsen-help.pd +++ b/help/pix_threshold_bernsen-help.pd @@ -1,47 +1,19 @@ #N canvas 30 61 629 346 10; #X declare -lib Gem; #X text 452 8 GEM object; -#X obj 8 234 cnv 15 430 100 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 234 cnv 15 430 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 235 Inlets:; #X text 38 307 Outlets:; -#X obj 8 186 cnv 15 430 40 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 186 cnv 15 430 40 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 185 Arguments:; -#X obj 7 56 cnv 15 430 120 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 57 cnv 15 170 200 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 56 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 57 cnv 15 170 200 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 40 Example:; -#X obj 465 265 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 470 304 pd gemwin; -#X msg 470 285 create; -#X text 466 264 Create window:; -#X obj 450 138 cnv 15 160 80 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 465 265 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 64 gemhead; #X text 71 31 Class: pix object; -#X obj 510 65 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; +#X obj 510 65 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000; #N canvas 0 0 587 366 image 0; #X obj 77 48 inlet; #X obj 77 344 outlet; @@ -61,31 +33,24 @@ #X text 53 249 Inlet 1: gemlist; #X text 516 85 open an image; #X text 509 98 (JPEG \, TIFF \, ..); -#X obj 451 225 pix_draw; +#X obj 451 225 _pix2rectangle 3; #X obj 451 191 pix_threshold_bernsen; #X text 50 12 Synopsis: [pix_threshold_bernsen]; -#X text 29 56 Description: apply dynamic thresholds to pixes for binarization -; -#X text 15 89 pix_threshold_bernsen is a dynamic tiled threshold filter. -Each tile's threshold is taken of the mean of the min and max value -of a surrounding (2*tile_size) square tile. If a pixels value is higher -than the threshold \, this pixel is set to 1 else to 0; -#X text 16 159 Currently this object only works on greyscale images. -; -#X floatatom 563 141 5 0 0 0 contrast - -; +#X text 29 56 Description: apply dynamic thresholds to pixes for binarization; +#X text 15 89 pix_threshold_bernsen is a dynamic tiled threshold filter. Each tile's threshold is taken of the mean of the min and max value of a surrounding (2*tile_size) square tile. If a pixels value is higher than the threshold \, this pixel is set to 1 else to 0; +#X text 16 159 Currently this object only works on greyscale images.; +#X floatatom 563 141 5 0 0 0 contrast - - 0; #X msg 522 170 4 4; #X text 53 264 Inlet 2: list : number of tiles; -#X text 52 278 Inlet 3: : contrast. if the (max-min): contrast. if the (max-min) : number of tiles in x- & y-direction; #X text 123 211 default: 16 16; #X text 482 169 tiles; #X obj 518 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 23 0; -#X connect 23 0 22 0; -#X connect 28 0 23 2; -#X connect 29 0 23 1; +#X obj 473 272 _gemwin; +#X connect 11 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 20 0; +#X connect 20 0 19 0; +#X connect 25 0 20 2; +#X connect 26 0 20 1; diff --git a/help/pix_video-help.pd b/help/pix_video-help.pd index 98220de2c..41d6aef1d 100644 --- a/help/pix_video-help.pd +++ b/help/pix_video-help.pd @@ -17,30 +17,7 @@ #X text 33 184 Inlet:; #X text 33 472 Outlet:; #X obj 717 460 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 0 22 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X msg 156 71 set create; -#X obj 67 41 route create; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X connect 5 0 0 0; -#X connect 6 0 1 0; -#X connect 7 0 3 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 7 1 5 0; -#X restore 722 499 pd gemwin; -#X msg 722 477 create; -#X text 718 456 Create window:; #X obj 563 86 cnv 15 230 280 empty empty empty 20 12 0 14 #14e814 #404040 0; -#X obj 567 526 rectangle 4 3; -#X obj 567 502 pix_texture; #X text 17 216 Inlet 1: device : the number or file path to the input device; #X text 16 339 Inlet 1: dimen : set various dimensions for the image (does not work on all capture devices); #X text 15 371 Inlet 1: enumerate: list all devices to the console; @@ -377,25 +354,24 @@ #X msg 625 235 device /dev/fw1; #X obj 738 8 declare -lib Gem; #X obj 156 103 _backendinfo \$0 video; -#X connect 17 0 18 0; -#X connect 18 0 17 0; -#X connect 22 0 21 0; -#X connect 29 0 46 0; -#X connect 30 0 41 0; -#X connect 31 0 41 0; -#X connect 32 0 41 0; -#X connect 33 0 41 0; -#X connect 34 0 41 0; -#X connect 35 0 41 0; +#X obj 724 466 _gemwin; +#X obj 567 502 _pix2rectangle 3; +#X connect 24 0 41 0; +#X connect 25 0 36 0; +#X connect 26 0 36 0; +#X connect 27 0 36 0; +#X connect 28 0 36 0; +#X connect 29 0 36 0; +#X connect 30 0 36 0; +#X connect 31 0 36 0; +#X connect 33 0 34 0; +#X connect 33 1 35 0; #X connect 36 0 41 0; -#X connect 38 0 39 0; -#X connect 38 1 40 0; -#X connect 41 0 46 0; -#X connect 41 1 47 0; -#X connect 42 0 35 0; -#X connect 46 0 22 0; -#X connect 46 1 38 0; -#X connect 48 0 49 0; -#X connect 49 0 41 0; -#X connect 54 0 41 0; -#X connect 56 0 41 0; +#X connect 36 1 42 0; +#X connect 37 0 30 0; +#X connect 41 0 55 0; +#X connect 41 1 33 0; +#X connect 43 0 44 0; +#X connect 44 0 36 0; +#X connect 49 0 36 0; +#X connect 51 0 36 0; diff --git a/help/pix_write-help.pd b/help/pix_write-help.pd index aab997134..c5646af48 100644 --- a/help/pix_write-help.pd +++ b/help/pix_write-help.pd @@ -1,51 +1,21 @@ #N canvas 536 123 739 620 10; #X declare -lib Gem; -#X obj 17 419 cnv 15 430 190 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 17 419 cnv 15 430 190 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 28 422 Inlets:; #X text 28 579 Outlets:; -#X obj 17 384 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 17 384 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 26 383 Arguments:; -#X obj 17 69 cnv 15 430 310 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 17 69 cnv 15 430 310 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 46 592 Outlet 1: gemlist; #X text 52 436 Inlet 1: gemlist; -#X text 27 72 Description: Make a snapshot of the frame-buffer and -write it to a file; -#X text 52 522 Inlet 2: list: offsetX offsetY (in pixels \; default: -0 0); -#X text 52 548 Inlet 3: list: dimenX dimenY (in pixels \; default: -window-size); +#X text 27 72 Description: Make a snapshot of the frame-buffer and write it to a file; +#X text 52 522 Inlet 2: list: offsetX offsetY (in pixels \; default: 0 0); +#X text 52 548 Inlet 3: list: dimenX dimenY (in pixels \; default: window-size); #X text 536 6 GEM object; -#X obj 459 77 cnv 15 250 370 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 459 77 cnv 15 250 370 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 463 60 Example:; -#X obj 604 383 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 16 419 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 268 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 609 422 pd gemwin; -#X msg 609 403 create; -#X text 605 382 Create window:; -#X obj 460 106 cnv 15 240 230 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 604 383 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 460 106 cnv 15 240 230 empty empty empty 20 12 0 14 #14e814 #404040 0; #X msg 584 289 256 256; #X text 638 289 dimension; #X text 637 267 offset; @@ -57,10 +27,8 @@ window-size); #X text 580 151 quality : 99; #X text 580 115 set pix_write to:; #X msg 490 215 auto \$1; -#X obj 490 196 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 491 245 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 490 196 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 491 245 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 510 244 WRITE! one file; #X obj 464 399 gemhead; #X obj 464 424 square; @@ -68,46 +36,27 @@ window-size); #X obj 466 560 pix_snap; #X text 464 539 See also:; #X obj 466 584 pix_writer; -#X text 26 260 BE CAREFUL with the filename \, depending on your OS -\, relative names may be different. It start from the patch in Linux -or from HD (/) in osx for example. DO NOT USE SPACES in the basefilename -; +#X text 26 260 BE CAREFUL with the filename \, depending on your OS \, relative names may be different. It start from the patch in Linux or from HD (/) in osx for example. DO NOT USE SPACES in the basefilename; #X text 81 41 Class: pix object; -#X text 27 207 With the "file" message you can specify a base-filename -and the type of image-files you want to create. The actual name of -the file will be something like: "." (like -"GEM00001.tif"); +#X text 27 207 With the "file" message you can specify a base-filename and the type of image-files you want to create. The actual name of the file will be something like: "." (like "GEM00001.tif"); #X text 60 22 Synopsis: [pix_write]; -#X text 26 319 Supported file-types are TIFF (quality=0) and JPEG (quality>0). -TIFF-writing can be slow due to the large file size of uncompressed -images! JPEG might be faster (but quality will be lower due to compression) -; +#X text 26 319 Supported file-types are TIFF (quality=0) and JPEG (quality>0). TIFF-writing can be slow due to the large file size of uncompressed images! JPEG might be faster (but quality will be lower due to compression); #X text 543 209 activate/deactivate auto snapshot, f 24; -#X text 52 473 Inlet 1: file : set type/quality (quality=0:TIFF -\, quality>0:JPG); -#X text 52 498 Inlet 1: file : set basefilename -and type/quality; -#X text 52 449 Inlet 1: file : set basefilename \, and -type=TIFF; +#X text 52 473 Inlet 1: file : set type/quality (quality=0:TIFF \, quality>0:JPG); +#X text 52 498 Inlet 1: file : set basefilename and type/quality; +#X text 52 449 Inlet 1: file : set basefilename \, and type=TIFF; #X obj 461 312 pix_write 0 0 500 500 3; #X text 71 394 list: [offsetX offsetY [dimX dimY [color_format]]]; -#X text 26 99 When banged [pix_write] will take a snapshot of the current -frame buffer and saves it to a file. When a "bang" message is sent -to [pix_write] \, that is the moment that something is captured from -the current frame buffer. When grabbing \, be sure that something is -in the rendering-buffer \, else you will get a black texture. color_mode -let you grab 1 (only red channel) \, 3 (RGB) or 4 (RGBA) byte per pixel. -RGBA mode is useful with framebuffer.; +#X text 26 99 When banged [pix_write] will take a snapshot of the current frame buffer and saves it to a file. When a "bang" message is sent to [pix_write] \, that is the moment that something is captured from the current frame buffer. When grabbing \, be sure that something is in the rendering-buffer \, else you will get a black texture. color_mode let you grab 1 (only red channel) \, 3 (RGB) or 4 (RGBA) byte per pixel. RGBA mode is useful with framebuffer.; #X msg 480 162 color_format 4; #X obj 608 8 declare -lib Gem; -#X connect 15 0 16 0; -#X connect 16 0 15 0; -#X connect 19 0 48 2; -#X connect 22 0 48 1; -#X connect 23 0 48 0; -#X connect 24 0 48 0; -#X connect 29 0 48 0; -#X connect 30 0 29 0; -#X connect 31 0 48 0; -#X connect 33 0 34 0; -#X connect 51 0 48 0; +#X obj 609 389 _gemwin; +#X connect 16 0 45 2; +#X connect 19 0 45 1; +#X connect 20 0 45 0; +#X connect 21 0 45 0; +#X connect 26 0 45 0; +#X connect 27 0 26 0; +#X connect 28 0 45 0; +#X connect 30 0 31 0; +#X connect 48 0 45 0; diff --git a/help/pix_writer-help.pd b/help/pix_writer-help.pd index 43515b2a9..adc2a08e4 100644 --- a/help/pix_writer-help.pd +++ b/help/pix_writer-help.pd @@ -1,49 +1,20 @@ #N canvas 200 61 755 513 10; #X declare -lib Gem; -#X obj 17 340 cnv 15 430 150 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 17 340 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 28 342 Inlets:; #X text 28 451 Outlets:; -#X obj 17 304 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 17 304 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 26 303 Arguments:; -#X obj 17 69 cnv 15 430 230 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 17 69 cnv 15 430 230 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 46 464 Outlet 1: gemlist; #X text 52 356 Inlet 1: gemlist; -#X text 52 369 Inlet 1: file : set basefilename \, and -type = TIFF; -#X text 52 418 Inlet 1: file : set basefilename -and type; +#X text 52 369 Inlet 1: file : set basefilename \, and type = TIFF; +#X text 52 418 Inlet 1: file : set basefilename and type; #X text 536 17 GEM object; -#X obj 459 77 cnv 15 280 300 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 459 77 cnv 15 280 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 463 60 Example:; -#X obj 604 313 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 16 419 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 268 112 destroy; -#X msg 132 112 create \, 1; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 7 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 609 352 pd gemwin; -#X msg 609 333 create; -#X text 605 312 Create window:; -#X obj 460 132 cnv 15 270 170 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 604 313 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 460 132 cnv 15 270 170 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 461 84 gemhead 51; #X msg 469 139 file pix_test 99; #X text 582 161 type : jpg; @@ -51,46 +22,32 @@ and type; #X text 582 174 quality : 99; #X text 582 138 set pix_write to:; #X msg 470 191 auto \$1; -#X obj 470 172 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 471 215 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 470 172 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 471 215 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 490 214 WRITE! one file; -#X text 52 393 Inlet 1: file : set type (type=0 : TIFF \, type>0 -: JPG \, type = quality); +#X text 52 393 Inlet 1: file : set type (type=0 : TIFF \, type>0 : JPG \, type = quality); #X obj 466 450 pix_snap; #X text 464 429 See also:; -#X text 25 169 BE CAREFUL with the filename \, depending on your OS -\, relative names may be different. It start from the patch in Linux -or from HD (/) in osx for example. DO NOT USE SPACES in the basefilename -; +#X text 25 169 BE CAREFUL with the filename \, depending on your OS \, relative names may be different. It start from the patch in Linux or from HD (/) in osx for example. DO NOT USE SPACES in the basefilename; #X text 81 41 Class: pix object; -#X text 26 116 With the "file" message you can specify a base-filename -and the type of image-files you want to create. The actual name of -the file will be something like: "." (like -"GEM00001.tif"); +#X text 26 116 With the "file" message you can specify a base-filename and the type of image-files you want to create. The actual name of the file will be something like: "." (like "GEM00001.tif"); #X obj 466 474 pix_write; #X obj 461 272 pix_writer; #X text 27 72 Description: write the current texture to a file; #X text 72 314 none; -#X obj 461 106 pix_video; -#X text 26 99 When banged [pix_writer] save current pix to a file. -; +#X text 26 99 When banged [pix_writer] save current pix to a file.; #X text 60 22 Synopsis: [pix_writer]; #X msg 500 245 file /Users/username/pix_test 99; -#X text 26 239 Supported file-types are TIFF (quality=0) and JPEG (quality>0). -TIFF-writing can be slow due to the large file size of uncompressed -images! JPEG might be faster (but quality will be lower due to compression) -; +#X text 26 239 Supported file-types are TIFF (quality=0) and JPEG (quality>0). TIFF-writing can be slow due to the large file size of uncompressed images! JPEG might be faster (but quality will be lower due to compression); #X text 523 190 activate/deactivate auto snapshot; #X obj 608 18 declare -lib Gem; #X text 571 263 OSX format; -#X connect 14 0 15 0; -#X connect 15 0 14 0; -#X connect 18 0 38 0; -#X connect 19 0 35 0; -#X connect 24 0 35 0; -#X connect 25 0 24 0; -#X connect 26 0 35 0; -#X connect 38 0 35 0; -#X connect 41 0 35 0; +#X obj 610 320 _gemwin; +#X obj 461 106 pix_test; +#X connect 15 0 43 0; +#X connect 16 0 32 0; +#X connect 21 0 32 0; +#X connect 22 0 21 0; +#X connect 23 0 32 0; +#X connect 37 0 32 0; +#X connect 43 0 32 0; diff --git a/help/pix_yuv-help.pd b/help/pix_yuv-help.pd index 7789b8d47..5084f15f6 100644 --- a/help/pix_yuv-help.pd +++ b/help/pix_yuv-help.pd @@ -1,90 +1,36 @@ #N canvas 6 61 635 372 10; #X declare -lib Gem; #X text 442 8 GEM object; -#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 -233017 -66577 -0; +#X obj 8 245 cnv 15 430 80 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 248 Inlets:; #X text 38 295 Outlets:; -#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 8 206 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 205 Arguments:; -#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577 -0; +#X obj 7 76 cnv 15 430 125 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; -#N canvas 0 0 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 132 112 create \, 1; -#X msg 198 112 destroy; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X restore 519 293 pd gemwin; -#X msg 519 274 create; -#X text 515 253 Create window:; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 -24198 -66577 -0; +#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; -#X obj 510 85 bng 15 250 50 0 empty empty pix_load 20 8 0 8 -262144 --1 -1; -#N canvas 0 0 587 366 image 0; -#X obj 77 48 inlet; -#X obj 77 344 outlet; -#X obj 77 205 pix_image examples/data/fractal.JPG; -#X obj 223 55 inlet; -#X msg 223 123 open \$1; -#X obj 223 100 openpanel; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 4 0; -#X restore 451 113 pd image; #X text 63 216 ; #X text 56 308 Outlet 1: gemlist; #X text 63 262 Inlet 1: gemlist; -#X text 516 105 open an image; -#X text 509 118 (JPEG \, TIFF \, ..); -#X obj 468 166 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; +#X obj 468 166 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; #X text 63 275 Inlet 1: 1|0: turn conversion on/off (default:1); #X text 62 339 see also:; #X obj 248 338 pix_grey; #X obj 451 196 pix_yuv; -#X text 13 118 While the RGBA-format offers you the possibility to -add alpha-blending on a per-pixel-basis \, the YUV-format needs far -less memory and can be processed faster. You can use [pix_yuv] to convert -images of any format into YUV-space. If your image already is in YUV-space -\, this will do nothing.; -#X text 15 77 Description: convert the colorspace of an image to YUV -; +#X text 13 118 While the RGBA-format offers you the possibility to add alpha-blending on a per-pixel-basis \, the YUV-format needs far less memory and can be processed faster. You can use [pix_yuv] to convert images of any format into YUV-space. If your image already is in YUV-space \, this will do nothing.; +#X text 15 77 Description: convert the colorspace of an image to YUV; #X text 50 12 Synopsis: [pix_yuv]; #X obj 155 338 pix_rgba; -#X text 15 101 Images can be stored in various formats/color-spaces. -; -#X obj 451 233 pix_texture; -#X obj 451 256 square; +#X text 15 101 Images can be stored in various formats/color-spaces.; #X obj 514 8 declare -lib Gem; -#X connect 10 0 11 0; -#X connect 11 0 10 0; -#X connect 14 0 17 0; -#X connect 16 0 17 1; -#X connect 17 0 27 0; -#X connect 23 0 27 0; -#X connect 27 0 33 0; -#X connect 33 0 34 0; +#X obj 451 233 _pix2rectangle 3; +#X obj 451 113 pix_test; +#X obj 521 261 _gemwin; +#X connect 11 0 28 0; +#X connect 16 0 20 0; +#X connect 20 0 27 0; +#X connect 28 0 20 0; From 1c32877acbe4271e2d62724d718e5080a7222078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 8 Mar 2024 09:54:49 +0100 Subject: [PATCH 116/387] [pix_buffer_filmopen] fix initialization Closes: https://github.com/umlaeute/Gem/issues/416 --- abstractions/pix_buffer_filmopen.pd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/abstractions/pix_buffer_filmopen.pd b/abstractions/pix_buffer_filmopen.pd index 28301e159..0209ba00c 100644 --- a/abstractions/pix_buffer_filmopen.pd +++ b/abstractions/pix_buffer_filmopen.pd @@ -1,7 +1,6 @@ #N canvas 1416 206 863 652 10; #X obj 79 77 inlet; #X obj 122 240 gemhead; -#A saved init; #X msg 153 263 open \$1; #X obj 122 288 pix_film; #X obj 180 382 until; @@ -57,10 +56,11 @@ #X connect 5 1 6 0; #X connect 6 0 4 1; #X restore 3 77 pd initbang; -#X obj 3 121 t a; -#X msg 33 121 set \$1; +#X obj 3 221 t a; +#X msg 13 191 set \$1; #X obj 122 503 pix_buffer_write; #X text 414 478 part of GEM \; see LICENSE.txt for license information; +#X obj 13 169 route bang; #X connect 0 0 10 0; #X connect 1 0 3 0; #X connect 2 0 3 0; @@ -98,7 +98,8 @@ #X connect 35 0 30 0; #X connect 35 1 31 0; #X connect 37 0 39 0; -#X connect 37 1 40 0; +#X connect 37 1 43 0; #X connect 38 0 37 0; #X connect 39 0 10 0; #X connect 40 0 39 0; +#X connect 43 1 40 0; From c35757552ae1c83aec52937125e3c65aba433c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 8 Mar 2024 09:48:11 +0100 Subject: [PATCH 117/387] prefix static vars with "s_", not with "m_" --- src/Base/CPPExtern.cpp | 29 +++++++++++++++-------------- src/Base/CPPExtern.h | 6 +++--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Base/CPPExtern.cpp b/src/Base/CPPExtern.cpp index 34261b05d..ae0dcc9d7 100644 --- a/src/Base/CPPExtern.cpp +++ b/src/Base/CPPExtern.cpp @@ -37,8 +37,9 @@ void *Obj_header::operator new(size_t, void *location, void *) return(location); } -t_object * CPPExtern::m_holder=NULL; -const char* CPPExtern::m_holdname=NULL; +t_object * CPPExtern::s_holder=NULL; +const char* CPPExtern::s_holdname=NULL; + ///////////////////////////////////////////////////////// // @@ -49,14 +50,14 @@ const char* CPPExtern::m_holdname=NULL; // ///////////////////////////////////////////////////////// CPPExtern :: CPPExtern() - : x_obj(m_holder), + : x_obj(s_holder), m_objectname(NULL), m_canvas(NULL), m_endpost(true) { m_canvas = canvas_getcurrent(); - if(m_holdname) { - m_objectname=gensym(m_holdname); + if(s_holdname) { + m_objectname=gensym(s_holdname); } else { m_objectname=gensym("unknown Gem object"); } @@ -161,16 +162,16 @@ void CPPExtern :: error(const char*fmt,...) const const char*objname=m_objectname->s_name; if(x_obj) { pd_error(x_obj, "[%s]: %s", objname, buf); - } else if (m_holder) { - pd_error(m_holder, "[%s]: %s", objname, buf); + } else if (s_holder) { + pd_error(s_holder, "[%s]: %s", objname, buf); } else { pd_error(0, "[%s]: %s", objname, buf); } } else { if(x_obj) { pd_error(x_obj, "%s", buf); - } else if (m_holder) { - pd_error(m_holder, "%s", buf); + } else if (s_holder) { + pd_error(s_holder, "%s", buf); } else { pd_error(0, "%s", buf); } @@ -255,8 +256,8 @@ gem::CPPExtern_proxy::CPPExtern_proxy( int argc = realargc; if(!name && s) name=s->s_name; - CPPExtern::m_holder = 0; - CPPExtern::m_holdname = name; + CPPExtern::s_holder = 0; + CPPExtern::s_holdname = name; /* if we want init-messages, check if we have a semi-colon * (that marks the beginning of the init-messages), @@ -279,7 +280,7 @@ gem::CPPExtern_proxy::CPPExtern_proxy( throw(GemException("unknown class")); } - CPPExtern::m_holder = &obj->pd_obj; + CPPExtern::s_holder = &obj->pd_obj; pimpl->obj = obj; pimpl->realargc = realargc; @@ -291,8 +292,8 @@ gem::CPPExtern_proxy::CPPExtern_proxy( gem::CPPExtern_proxy::~CPPExtern_proxy() { delete pimpl; - CPPExtern::m_holder = 0; - CPPExtern::m_holdname = 0; + CPPExtern::s_holder = 0; + CPPExtern::s_holdname = 0; } void gem::CPPExtern_proxy::setObject(CPPExtern*obj) { diff --git a/src/Base/CPPExtern.h b/src/Base/CPPExtern.h index 4eea24892..4f0eb5f9a 100644 --- a/src/Base/CPPExtern.h +++ b/src/Base/CPPExtern.h @@ -130,11 +130,11 @@ class GEM_EXTERN CPPExtern ////////// // This is a holder - don't touch it - static t_object* m_holder; + static t_object* s_holder; ////////// // my name - static const char* m_holdname; + static const char* s_holdname; t_symbol* m_objectname; protected: @@ -333,7 +333,7 @@ static void obj_setupCallback(t_class *classPtr); #define REAL_NEW__CREATE2(NEW_CLASS) \ return proxy.initialize(); \ - } catch (...) {gem::catchGemException(CPPExtern::m_holdname, CPPExtern::m_holder); return NULL;} \ + } catch (...) {gem::catchGemException(CPPExtern::s_holdname, CPPExtern::s_holder); return NULL;} \ } #define REAL_NEW__SETUP(NEW_CLASS, CLASSNAME) \ From bc9eb2101cfe8891f29e27c961047d603dd5ac4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 8 Mar 2024 09:49:08 +0100 Subject: [PATCH 118/387] CPPEXtern: use PIMPL idiom --- src/Base/CPPExtern.cpp | 93 +++++++++++++++++++++++++----------------- src/Base/CPPExtern.h | 9 ++-- 2 files changed, 59 insertions(+), 43 deletions(-) diff --git a/src/Base/CPPExtern.cpp b/src/Base/CPPExtern.cpp index ae0dcc9d7..6534b37d9 100644 --- a/src/Base/CPPExtern.cpp +++ b/src/Base/CPPExtern.cpp @@ -40,6 +40,26 @@ void *Obj_header::operator new(size_t, void *location, void *) t_object * CPPExtern::s_holder=NULL; const char* CPPExtern::s_holdname=NULL; +struct CPPExtern::PIMPL { + t_symbol*objectname; + t_canvas*canvas; + t_class*cls; + mutable bool endpost; /* internal state for startpost/post/endpost */ + PIMPL(const char*name) + : objectname(name?gensym(name):gensym("unknown Gem object")) + , canvas(canvas_getcurrent()) + , cls(0) + , endpost(true) + { } + PIMPL(PIMPL*p) + : objectname(p->objectname) + , canvas(p->canvas) + , cls(p->cls) + , endpost(true) + { } + +}; + ///////////////////////////////////////////////////////// // @@ -50,23 +70,13 @@ const char* CPPExtern::s_holdname=NULL; // ///////////////////////////////////////////////////////// CPPExtern :: CPPExtern() - : x_obj(s_holder), - m_objectname(NULL), - m_canvas(NULL), - m_endpost(true) + : x_obj(s_holder) + , pimpl(new PIMPL(s_holdname)) { - m_canvas = canvas_getcurrent(); - if(s_holdname) { - m_objectname=gensym(s_holdname); - } else { - m_objectname=gensym("unknown Gem object"); - } } -CPPExtern :: CPPExtern(const CPPExtern&org) : - x_obj(org.x_obj), - m_objectname(org.m_objectname), - m_canvas(org.m_canvas), - m_endpost(true) +CPPExtern :: CPPExtern(const CPPExtern&org) + : x_obj(org.x_obj) + , pimpl(new PIMPL(org.pimpl)) { } @@ -75,7 +85,10 @@ CPPExtern :: CPPExtern(const CPPExtern&org) : // ///////////////////////////////////////////////////////// CPPExtern :: ~CPPExtern() -{ } +{ + delete pimpl; + pimpl=0; +} void CPPExtern :: post(const char*fmt,...) const @@ -85,13 +98,13 @@ void CPPExtern :: post(const char*fmt,...) const va_start(ap, fmt); vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); - if(m_endpost && NULL!=m_objectname && NULL!=m_objectname->s_name - && &s_ != m_objectname) { - ::post("[%s]: %s", m_objectname->s_name, buf); + if(pimpl->endpost && NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name + && &s_ != pimpl->objectname) { + ::post("[%s]: %s", pimpl->objectname->s_name, buf); } else { ::post("%s", buf); } - m_endpost=true; + pimpl->endpost=true; } void CPPExtern :: startpost(const char*fmt,...) const { @@ -100,18 +113,18 @@ void CPPExtern :: startpost(const char*fmt,...) const va_start(ap, fmt); vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); - if(m_endpost && NULL!=m_objectname && NULL!=m_objectname->s_name - && &s_ != m_objectname) { - ::startpost("[%s]: %s", m_objectname->s_name, buf); + if(pimpl->endpost && NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name + && &s_ != pimpl->objectname) { + ::startpost("[%s]: %s", pimpl->objectname->s_name, buf); } else { ::startpost("%s", buf); } - m_endpost=false; + pimpl->endpost=false; } void CPPExtern :: endpost(void) const { ::endpost(); - m_endpost=true; + pimpl->endpost=true; } typedef void (*verbose_t)(int level, const char *fmt, ...); @@ -134,16 +147,16 @@ void CPPExtern :: verbose(const int level, const char*fmt,...) const /* only pd>=0.39(?) supports ::verbose() */ if(rte_verbose) { - if(NULL!=m_objectname && NULL!=m_objectname->s_name - && &s_ != m_objectname) { - rte_verbose(level, "[%s]: %s", m_objectname->s_name, buf); + if(NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name + && &s_ != pimpl->objectname) { + rte_verbose(level, "[%s]: %s", pimpl->objectname->s_name, buf); } else { rte_verbose(level, "%s", buf); } } else { - if(NULL!=m_objectname && NULL!=m_objectname->s_name - && &s_ != m_objectname) { - ::post("[%s]: %s", m_objectname->s_name, buf); + if(NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name + && &s_ != pimpl->objectname) { + ::post("[%s]: %s", pimpl->objectname->s_name, buf); } else { ::post("%s", buf); } @@ -157,9 +170,9 @@ void CPPExtern :: error(const char*fmt,...) const va_start(ap, fmt); vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); - if(NULL!=m_objectname && NULL!=m_objectname->s_name - && &s_ != m_objectname) { - const char*objname=m_objectname->s_name; + if(NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name + && &s_ != pimpl->objectname) { + const char*objname=pimpl->objectname->s_name; if(x_obj) { pd_error(x_obj, "[%s]: %s", objname, buf); } else if (s_holder) { @@ -180,6 +193,11 @@ void CPPExtern :: error(const char*fmt,...) const typedef int (*close_t)(int fd); +const t_canvas* CPPExtern::getCanvas(void) const { + return pimpl->canvas; +} + + std::string CPPExtern::findFile(const std::string&f, const std::string&e) const { @@ -211,9 +229,10 @@ bool CPPExtern :: checkGemVersion(const int major, const int minor) CPPExtern&CPPExtern::operator=(const CPPExtern&org) { x_obj=org.x_obj; - m_objectname=org.m_objectname; - m_canvas=org.m_canvas; - m_endpost=true; + pimpl->objectname=org.pimpl->objectname; + pimpl->canvas=org.pimpl->canvas; + pimpl->cls = org.pimpl->cls; + pimpl->endpost = true; return *this; } diff --git a/src/Base/CPPExtern.h b/src/Base/CPPExtern.h index 4f0eb5f9a..c344f4f4e 100644 --- a/src/Base/CPPExtern.h +++ b/src/Base/CPPExtern.h @@ -123,10 +123,7 @@ class GEM_EXTERN CPPExtern ////////// // Get the object's canvas - const t_canvas* getCanvas(void) const - { - return(m_canvas); - } + const t_canvas* getCanvas(void) const; ////////// // This is a holder - don't touch it @@ -135,7 +132,6 @@ class GEM_EXTERN CPPExtern ////////// // my name static const char* s_holdname; - t_symbol* m_objectname; protected: @@ -150,6 +146,8 @@ class GEM_EXTERN CPPExtern virtual void beforeDeletion(); private: + class PIMPL; + PIMPL*pimpl; ////////// // The canvas that the object is in @@ -172,7 +170,6 @@ class GEM_EXTERN CPPExtern std::string findFile(const std::string&filename) const; private: - mutable bool m_endpost; /* internal state for startpost/post/endpost */ static bool checkGemVersion(const int major, const int minor); CPPExtern(const CPPExtern&); virtual CPPExtern&operator=(const CPPExtern&); From d5e3c2b8c812710285231164f1c216e0b9872b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 8 Mar 2024 10:01:59 +0100 Subject: [PATCH 119/387] [gemhead] add 'saved' method (ignored) this is to LATER get compat with a [savestate] using abstraction implementation --- src/Controls/gemhead.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controls/gemhead.cpp b/src/Controls/gemhead.cpp index c1ae4de45..a6d07e09d 100644 --- a/src/Controls/gemhead.cpp +++ b/src/Controls/gemhead.cpp @@ -346,4 +346,7 @@ void gemhead :: obj_setupCallback(t_class *classPtr) CPPEXTERN_MSG1(classPtr, "float", renderOnOff, int); CPPEXTERN_MSG1(classPtr, "set", setMess, float); CPPEXTERN_MSG1(classPtr, "context", setContext, std::string); + + /* compat with [gemhead] abstraction that uses [savestate] */ + class_addmethod(classPtr, reinterpret_cast(::nullfn), gensym("saved"), A_GIMME, A_NULL); } From 7277f5507699f93c6784677c2545f8084ef40d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 8 Mar 2024 10:11:43 +0100 Subject: [PATCH 120/387] bind objects to '#A' --- src/Base/CPPExtern.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Base/CPPExtern.cpp b/src/Base/CPPExtern.cpp index 6534b37d9..503ff4bcc 100644 --- a/src/Base/CPPExtern.cpp +++ b/src/Base/CPPExtern.cpp @@ -40,6 +40,10 @@ void *Obj_header::operator new(size_t, void *location, void *) t_object * CPPExtern::s_holder=NULL; const char* CPPExtern::s_holdname=NULL; +namespace { + static t_class*s_holdclass = NULL; +}; + struct CPPExtern::PIMPL { t_symbol*objectname; t_canvas*canvas; @@ -48,7 +52,7 @@ struct CPPExtern::PIMPL { PIMPL(const char*name) : objectname(name?gensym(name):gensym("unknown Gem object")) , canvas(canvas_getcurrent()) - , cls(0) + , cls(s_holdclass) , endpost(true) { } PIMPL(PIMPL*p) @@ -73,11 +77,27 @@ CPPExtern :: CPPExtern() : x_obj(s_holder) , pimpl(new PIMPL(s_holdname)) { + t_symbol*asym = gensym("#A"); + /* bashily unbind #A -- this would create garbage if #A were + multiply bound but we believe in this context it's at most + bound to whichever textobj or array was created most recently */ + asym->s_thing = 0; + /* and now bind #A to us to receive following messages in the + saved file or copy buffer */ + pd_bind(&x_obj->ob_pd, asym); } CPPExtern :: CPPExtern(const CPPExtern&org) : x_obj(org.x_obj) , pimpl(new PIMPL(org.pimpl)) { + t_symbol*asym = gensym("#A"); + /* bashily unbind #A -- this would create garbage if #A were + multiply bound but we believe in this context it's at most + bound to whichever textobj or array was created most recently */ + asym->s_thing = 0; + /* and now bind #A to us to receive following messages in the + saved file or copy buffer */ + pd_bind(&x_obj->ob_pd, asym); } ///////////////////////////////////////////////////////// @@ -86,6 +106,14 @@ CPPExtern :: CPPExtern(const CPPExtern&org) ///////////////////////////////////////////////////////// CPPExtern :: ~CPPExtern() { + + if(pimpl->cls) { + /* just in case we're still bound to #A from loading... */ + t_pd*x; + while ((x = pd_findbyclass(gensym("#A"), pimpl->cls))) { + pd_unbind(x, gensym("#A")); + } + } delete pimpl; pimpl=0; } @@ -239,6 +267,8 @@ CPPExtern&CPPExtern::operator=(const CPPExtern&org) void CPPExtern::beforeDeletion(void) { //post("CPPExtern to be deleted"); + + } @@ -299,6 +329,7 @@ gem::CPPExtern_proxy::CPPExtern_proxy( throw(GemException("unknown class")); } + s_holdclass = cls; CPPExtern::s_holder = &obj->pd_obj; pimpl->obj = obj; From 00f211b8dd3bef804fb0f711f8e4fa88edca933d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 13 Mar 2024 22:03:29 +0100 Subject: [PATCH 121/387] [pix_offset]/[pix_gain] document "saturate" method Closes: https://github.com/umlaeute/Gem/issues/421 --- help/pix_gain-help.pd | 35 ++++++++++++++++++++--------------- help/pix_offset-help.pd | 27 ++++++++++++++++----------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/help/pix_gain-help.pd b/help/pix_gain-help.pd index 74030b81e..8c426495f 100644 --- a/help/pix_gain-help.pd +++ b/help/pix_gain-help.pd @@ -1,38 +1,43 @@ -#N canvas 394 120 624 402 10; +#N canvas 394 120 624 410 10; #X declare -lib Gem; #X text 452 8 GEM object; #X obj 8 275 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 278 Inlets:; -#X text 38 355 Outlets:; +#X text 38 365 Outlets:; #X obj 8 236 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 235 Arguments:; #X obj 7 76 cnv 15 430 150 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; -#X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X obj 450 148 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 514 274 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 450 138 cnv 15 160 100 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; #X text 63 246 ; -#X text 56 368 Outlet 1: gemlist; +#X text 56 378 Outlet 1: gemlist; #X text 23 292 Inlet 1: gemlist; -#X obj 451 233 _pix2rectangle 3; -#X obj 451 206 pix_gain; +#X obj 451 253 _pix2rectangle 3; +#X obj 451 193 pix_gain; #X text 50 12 Synopsis: [pix_gain]; #X text 29 76 Description: multiply pixel-values; -#X floatatom 476 151 5 0 0 1 common - - 0; -#X msg 527 179 1 0.5 0; -#X msg 528 201 0 0.4 0.8 1; +#X floatatom 473 148 5 0 0 1 common - - 0; +#X msg 527 166 1 0.5 0; +#X msg 528 188 0 0.4 0.8 1; #X text 10 93 pix_gain applies a gain multiplier to each pixel in a pix. The float is a constant modifier applied to all color components. If you use just R G B \, it assumes an alpha of 1.0.; #X text 13 152 NOTE: while you can use this \, remember that you can often achieve the very same thing using the [color]-object for coloring the Geo onto which the image data is textured \, which could be done on the gfx-card (very efficient!) \, while [pix_gain] is always(!) done on the CPU!!!; -#X text 23 305 Inlet 1: : multiplier for all channels; -#X text 23 321 Inlet 2: list: 3 (RGB) or 4 (RGBA) values as multipliers for each channels; #X obj 518 8 declare -lib Gem; -#X obj 523 260 _gemwin; +#X obj 523 280 _gemwin; #X obj 451 113 pix_test; -#X connect 11 0 29 0; +#X msg 480 216 saturate \$1; +#X obj 557 216 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 23 318 Inlet 2: : multiplier for all channels; +#X text 23 331 Inlet 3: list: 3 (RGB) or 4 (RGBA) values as multipliers for each channel., f 68; +#X text 23 302 Inlet 1: saturate 1|0; +#X connect 11 0 27 0; #X connect 17 0 16 0; #X connect 20 0 17 1; #X connect 21 0 17 2; #X connect 22 0 17 2; -#X connect 29 0 17 0; +#X connect 27 0 17 0; +#X connect 28 0 17 0; +#X connect 29 0 28 0; diff --git a/help/pix_offset-help.pd b/help/pix_offset-help.pd index 2f54f25b9..9655589b5 100644 --- a/help/pix_offset-help.pd +++ b/help/pix_offset-help.pd @@ -1,4 +1,4 @@ -#N canvas 6 61 654 375 10; +#N canvas 515 95 654 375 10; #X declare -lib Gem; #X text 452 8 GEM object; #X obj 8 245 cnv 15 430 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -10,7 +10,7 @@ #X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 60 Example:; #X obj 514 254 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X obj 450 158 cnv 15 160 60 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 450 138 cnv 15 160 80 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 84 gemhead; #X text 71 31 Class: pix object; #X text 63 216 ; @@ -18,22 +18,27 @@ #X text 63 262 Inlet 1: gemlist; #X obj 451 233 _pix2rectangle 3; #X text 63 275 Inlet 1: 1|0 : apply/don't apply (default:1); -#X obj 451 196 pix_offset; -#X floatatom 483 171 5 0 1 0 - - - 0; -#X msg 531 166 0.5 -0.5 0; -#X msg 534 193 0.2 1 0 1; +#X obj 451 170 pix_offset; +#X floatatom 483 145 5 0 1 0 - - - 0; +#X msg 531 140 0.5 -0.5 0; +#X msg 534 167 0.2 1 0 1; #X text 50 12 Synopsis: [pix_offset]; #X text 29 76 Description: add an offset to the color; -#X text 15 113 When adding an offset to each color-channel \, no clipping is done. Thus you can wrap around the color-space.; -#X text 19 157 (adding "1 0 0" to "0.5 1 1" will result in "0.5 1 1" instead of "1 1 1"); -#X text 63 295 Inlet 2: : offset for all channels; -#X text 63 311 Inlet 3: list : offset for each channels; +#X text 19 157 (adding "1 0 0" to "0.5 1 1" will result in "0.5 1 1" instead of "1 1 1"), f 68; +#X text 63 305 Inlet 2: : offset for all channels; +#X text 63 321 Inlet 3: list : offset for each channels; #X obj 518 8 declare -lib Gem; #X obj 521 262 _gemwin; #X obj 451 113 pix_test; -#X connect 11 0 30 0; +#X msg 466 197 saturate \$1; +#X obj 544 197 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 15 113 When "saturate" is off (0) \, no clipping is applied when adding an offset to each color-channel. Thus you can wrap around the color-space., f 69; +#X text 63 288 Inlet 1: saturate 1|0; +#X connect 11 0 29 0; #X connect 18 0 16 0; #X connect 19 0 18 1; #X connect 20 0 18 2; #X connect 21 0 18 2; +#X connect 29 0 18 0; #X connect 30 0 18 0; +#X connect 31 0 30 0; From fe310352df36f110a1111a7777f13484d443d669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 13 Mar 2024 22:05:50 +0100 Subject: [PATCH 122/387] yamllint --- .github/ISSUE_TEMPLATE/bug.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 9afa066fd..c238fdf63 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,4 +1,5 @@ -name: Bug Report +--- +name: Bug Report description: We can only fix problems we know about. labels: ["bug"] assignees: From c59c03d8f708337b4b6815490ef327cd61edcc1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 13 Mar 2024 22:06:05 +0100 Subject: [PATCH 123/387] ask people to also give their Pd-flavour --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index c238fdf63..482bd84c9 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -27,7 +27,7 @@ body: id: pdversion attributes: label: Pd Version - description: Which version of Pure Data are you using? + description: Which version of Pure Data are you using? (also include the Pd-flavour, unless it is Pd-vanilla) placeholder: e.g. 0.54-1 - type: dropdown id: OS From f94385a297710e9f8a47b3cbd7f0378bb1cf28bc Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 3 Apr 2024 15:56:52 +0200 Subject: [PATCH 124/387] sanitize rate input --- abstractions/gemwin.pd | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/abstractions/gemwin.pd b/abstractions/gemwin.pd index f43101852..20fd2bf67 100644 --- a/abstractions/gemwin.pd +++ b/abstractions/gemwin.pd @@ -2800,8 +2800,8 @@ #X connect 10 1 9 0; #X restore 258 606 pd CrystalEyeStereo; #X obj 131 836 GEMglReportError; -#X msg 390 149 1000 \$1; -#X obj 390 171 /; +#X msg 505 215 1000 \$1; +#X obj 505 237 /; #X obj 131 202 metro 20; #N canvas 272 224 751 300 GemState 0; #X obj 138 134 gemlist; @@ -2833,7 +2833,7 @@ #X connect 11 1 12 0; #X connect 12 0 5 0; #X restore 131 476 pd GemState; -#X obj 390 126 r \$0-rate; +#X obj 466 113 r \$0-rate; #X obj 131 155 r \$0-render; #X obj 131 563 t a a; #X obj 163 699 t a; @@ -3184,6 +3184,9 @@ #X connect 6 1 7 0; #X connect 7 0 4 1; #X restore 131 795 pd flush; +#X obj 466 134 moses 0; +#X obj 505 157 sel 0; +#X msg 505 187 20; #X connect 0 0 37 0; #X connect 4 0 48 0; #X connect 4 1 39 0; @@ -3205,7 +3208,7 @@ #X connect 18 0 19 1; #X connect 19 0 35 0; #X connect 20 0 28 0; -#X connect 21 0 17 0; +#X connect 21 0 55 0; #X connect 22 0 30 0; #X connect 23 0 54 0; #X connect 23 1 13 0; @@ -3247,3 +3250,8 @@ #X connect 53 0 51 0; #X connect 53 1 48 1; #X connect 54 0 16 0; +#X connect 55 0 57 0; +#X connect 55 1 56 0; +#X connect 56 0 57 0; +#X connect 56 1 17 0; +#X connect 57 0 17 0; From f00dfc6bfad263981972da02e0ab7c4fa393a3c7 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 25 Apr 2024 15:04:26 +0200 Subject: [PATCH 125/387] remove 1 of the 2 [gemwin] --- help/gemvertexbuffer-help.pd | 129 ++++++++++++----------------------- 1 file changed, 45 insertions(+), 84 deletions(-) diff --git a/help/gemvertexbuffer-help.pd b/help/gemvertexbuffer-help.pd index f66ae6573..59669d6bf 100644 --- a/help/gemvertexbuffer-help.pd +++ b/help/gemvertexbuffer-help.pd @@ -17,53 +17,16 @@ #X connect 4 0 3 0; #X connect 6 0 7 0; #X connect 7 0 5 0; -#X restore 466 149 pd fps; -#X floatatom 466 172 5 0 0 1 fps - - 0; +#X restore 470 199 pd fps; +#X floatatom 470 222 5 0 0 1 fps - - 0; #X obj 6 76 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 7 236 cnv 15 450 375 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 7 181 cnv 15 450 50 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 59 27 Class: geometric object; #X text 467 7 GEM object; #X text 61 7 Synopsis: [gemvertexbuffer]; -#X obj 462 76 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#N canvas 1327 265 450 300 gemwin 0; -#X obj 132 246 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X obj 67 41 route create; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 142 destroy; -#X msg 132 142 create \, 1; -#X obj 245 38 loadbang; -#X msg 272 82 reset \, frame 100; -#X obj 245 58 t b b; -#X obj 132 117 t b b; -#X msg 376 135 \; pd dsp 1; -#X obj 349 114 t b b; -#X obj 349 181 del 100; -#X obj 349 201 s \$0-init100; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 11 0; -#X connect 3 1 5 0; -#X connect 3 1 6 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 10 0; -#X connect 9 0 0 0; -#X connect 10 0 5 0; -#X connect 10 1 9 0; -#X connect 11 0 7 0; -#X connect 11 1 13 0; -#X connect 13 0 14 0; -#X connect 13 1 12 0; -#X connect 14 0 15 0; -#X restore 467 115 pd gemwin; -#X msg 467 96 create; -#X text 463 75 Create window:; +#X obj 462 76 cnv 15 100 80 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 465 75 Create window:; #X text 6 80 Description: Renders a vertexbuffer.; #X text 11 179 Arguments:; #X text 9 241 Inlets:; @@ -739,7 +702,7 @@ #X msg 394 316 positionZ Z; #X text 51 453 offset is always optional (default:0) \, and comes after the table names; #X text 50 507 unset table data is initialized to 0.f; -#X restore 464 333 pd tabledata; +#X restore 471 266 pd tabledata; #X text 27 384 Inlet 1: message: resize float : change the number of vertex to use; #X text 23 98 Vertex position \, color etc can be copy from pd table to the vertex buffer (VBO = Vertex Buffer Object). This object can draw lot's of points very efficiently.; #X obj 696 191 t b b b; @@ -821,50 +784,48 @@ #X connect 2 0 3 0; #X connect 2 1 5 0; #X connect 3 0 4 0; -#X restore 469 484 pd startDSP; -#X obj 469 426 _gemwin 100; +#X restore 469 154 pd startDSP; +#X obj 469 96 _gemwin 100; #X obj 579 195 pix_test \; noise 0; #X connect 0 0 1 0; -#X connect 9 0 10 0; -#X connect 10 0 9 0; -#X connect 20 0 65 0; -#X connect 21 0 65 0; -#X connect 22 0 65 0; -#X connect 23 0 22 0; -#X connect 24 0 88 0; -#X connect 25 0 40 0; -#X connect 26 0 42 0; -#X connect 27 0 24 0; -#X connect 28 0 26 0; -#X connect 30 0 31 0; -#X connect 31 0 65 0; -#X connect 32 0 35 0; -#X connect 33 0 34 0; -#X connect 34 0 65 0; -#X connect 35 0 65 0; -#X connect 36 0 65 0; -#X connect 38 0 28 0; -#X connect 40 0 65 0; -#X connect 41 0 42 1; -#X connect 42 0 27 0; -#X connect 43 0 65 0; -#X connect 44 0 65 0; -#X connect 45 0 65 0; -#X connect 46 0 65 0; -#X connect 47 0 63 0; +#X connect 18 0 63 0; +#X connect 19 0 63 0; +#X connect 20 0 63 0; +#X connect 21 0 20 0; +#X connect 22 0 86 0; +#X connect 23 0 38 0; +#X connect 24 0 40 0; +#X connect 25 0 22 0; +#X connect 26 0 24 0; +#X connect 28 0 29 0; +#X connect 29 0 63 0; +#X connect 30 0 33 0; +#X connect 31 0 32 0; +#X connect 32 0 63 0; +#X connect 33 0 63 0; +#X connect 34 0 63 0; +#X connect 36 0 26 0; +#X connect 38 0 63 0; +#X connect 39 0 40 1; +#X connect 40 0 25 0; +#X connect 41 0 63 0; +#X connect 42 0 63 0; +#X connect 43 0 63 0; +#X connect 44 0 63 0; +#X connect 45 0 61 0; +#X connect 48 0 47 0; #X connect 50 0 49 0; #X connect 52 0 51 0; -#X connect 54 0 53 0; -#X connect 63 0 43 0; -#X connect 63 1 44 0; -#X connect 63 2 64 0; +#X connect 61 0 41 0; +#X connect 61 1 42 0; +#X connect 61 2 62 0; +#X connect 64 0 63 0; +#X connect 65 0 64 0; #X connect 66 0 65 0; -#X connect 67 0 66 0; -#X connect 68 0 67 0; -#X connect 69 0 70 0; -#X connect 70 0 67 0; -#X connect 70 1 67 1; -#X connect 75 0 24 1; -#X connect 76 0 27 3; -#X connect 87 0 86 0; -#X connect 88 0 36 0; +#X connect 67 0 68 0; +#X connect 68 0 65 0; +#X connect 68 1 65 1; +#X connect 73 0 22 1; +#X connect 74 0 25 3; +#X connect 85 0 84 0; +#X connect 86 0 34 0; From bdadd25c31d1898e03eb3386bf34c12b671c2624 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 29 Apr 2024 15:46:03 +0200 Subject: [PATCH 126/387] remove (useless) argument so the shader can compile --- examples/10.glsl/GLSL_mix.frag | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/10.glsl/GLSL_mix.frag b/examples/10.glsl/GLSL_mix.frag index ce47bf882..5d1536487 100644 --- a/examples/10.glsl/GLSL_mix.frag +++ b/examples/10.glsl/GLSL_mix.frag @@ -7,9 +7,9 @@ uniform sampler2DRect tex0; uniform float style; uniform float mix_factor; varying vec2 texcoord0; -ivec2 size1 = textureSize2DRect(Ttex1, 0); -ivec2 size2 = textureSize2DRect(Ttex2, 0); -ivec2 size0 = textureSize2DRect(tex0, 0); +ivec2 size1 = textureSize2DRect(Ttex1); +ivec2 size2 = textureSize2DRect(Ttex2); +ivec2 size0 = textureSize2DRect(tex0); void main (void) { From 56ba52962abef6ec7aa3c4c030e0e5b1b97d3643 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 29 Apr 2024 16:01:24 +0200 Subject: [PATCH 127/387] move all shader in a dedicated directory --- examples/10.glsl/01.simple_texture.pd | 94 ++++----- examples/10.glsl/02.primitive_distortion.pd | 29 ++- examples/10.glsl/03.texture_distortion.pd | 72 +++---- examples/10.glsl/04.game_of_life.pd | 60 +++--- examples/10.glsl/05.multitexture.pd | 130 ++++++------ examples/10.glsl/05.multitexture_bis.pd | 131 ++++++------ examples/10.glsl/06.rectangle_multitexture.pd | 84 ++++---- examples/10.glsl/07.framebuffer_and_shader.pd | 76 +++---- examples/10.glsl/08.multi_pass_rendering.pd | 83 ++++---- .../10.glsl/09.vertex_texture_fetching.pd | 67 +++--- examples/10.glsl/10.GPGPU_Physical_model.pd | 197 +++++++----------- examples/10.glsl/11.geometry.pd | 59 +++--- examples/10.glsl/12.tri2fan.pd | 86 ++++---- examples/10.glsl/13.panoramique.pd | 95 ++++----- .../10.glsl/15.bicubic_image_interpolation.pd | 46 ++-- .../10.glsl/16.vertexbuffer_attributes.pd | 86 +++----- examples/10.glsl/{ => shader}/GLSL_mix.frag | 0 examples/10.glsl/{ => shader}/GLSL_mix.vert | 0 examples/10.glsl/{ => shader}/P_distord.frag | 0 examples/10.glsl/{ => shader}/P_distord.vert | 0 examples/10.glsl/{ => shader}/T_distord.frag | 0 examples/10.glsl/{ => shader}/T_distord.vert | 0 .../{ => shader}/bicubic_interpolation.frag | 0 .../{ => shader}/bicubic_interpolation.vert | 0 examples/10.glsl/{ => shader}/blur.frag | 0 examples/10.glsl/{ => shader}/blur.vert | 0 examples/{data => 10.glsl/shader}/brick.frag | 0 examples/{data => 10.glsl/shader}/brick.vert | 0 examples/10.glsl/{ => shader}/fetching.frag | 0 examples/10.glsl/{ => shader}/fetching.vert | 0 examples/10.glsl/{ => shader}/fetching2.frag | 0 examples/10.glsl/{ => shader}/fetching2.vert | 0 examples/10.glsl/{ => shader}/game.frag | 0 examples/10.glsl/{ => shader}/game.vert | 0 examples/10.glsl/{ => shader}/geo.frag | 0 examples/10.glsl/{ => shader}/geo.geom | 0 examples/10.glsl/{ => shader}/geo.vert | 0 examples/10.glsl/{ => shader}/interpol.frag | 0 examples/10.glsl/{ => shader}/link.frag | 0 examples/10.glsl/{ => shader}/link.vert | 0 examples/10.glsl/{ => shader}/mass.frag | 0 examples/10.glsl/{ => shader}/mass.vert | 0 .../10.glsl/{ => shader}/multitexture.frag | 0 .../10.glsl/{ => shader}/multitexture.vert | 0 .../{ => shader}/multitexture_rect.frag | 0 .../{ => shader}/multitexture_rect.vert | 0 examples/10.glsl/{ => shader}/normal.frag | 0 examples/10.glsl/{ => shader}/normal.vert | 0 .../10.glsl/{ => shader}/panoramique.frag | 0 .../10.glsl/{ => shader}/panoramique.vert | 0 examples/10.glsl/{ => shader}/texture.frag | 0 examples/10.glsl/{ => shader}/texture.vert | 0 .../10.glsl/{ => shader}/texture_rect.frag | 0 examples/10.glsl/{ => shader}/tri2fan.frag | 0 examples/10.glsl/{ => shader}/tri2fan.geom | 0 examples/10.glsl/{ => shader}/tri2fan.vert | 0 examples/10.glsl/{ => shader}/vague.frag | 0 examples/10.glsl/{ => shader}/wave.frag | 0 examples/10.glsl/single_blur.pd | 47 ++--- 59 files changed, 636 insertions(+), 806 deletions(-) rename examples/10.glsl/{ => shader}/GLSL_mix.frag (100%) rename examples/10.glsl/{ => shader}/GLSL_mix.vert (100%) rename examples/10.glsl/{ => shader}/P_distord.frag (100%) rename examples/10.glsl/{ => shader}/P_distord.vert (100%) rename examples/10.glsl/{ => shader}/T_distord.frag (100%) rename examples/10.glsl/{ => shader}/T_distord.vert (100%) rename examples/10.glsl/{ => shader}/bicubic_interpolation.frag (100%) rename examples/10.glsl/{ => shader}/bicubic_interpolation.vert (100%) rename examples/10.glsl/{ => shader}/blur.frag (100%) rename examples/10.glsl/{ => shader}/blur.vert (100%) rename examples/{data => 10.glsl/shader}/brick.frag (100%) rename examples/{data => 10.glsl/shader}/brick.vert (100%) rename examples/10.glsl/{ => shader}/fetching.frag (100%) rename examples/10.glsl/{ => shader}/fetching.vert (100%) rename examples/10.glsl/{ => shader}/fetching2.frag (100%) rename examples/10.glsl/{ => shader}/fetching2.vert (100%) rename examples/10.glsl/{ => shader}/game.frag (100%) rename examples/10.glsl/{ => shader}/game.vert (100%) rename examples/10.glsl/{ => shader}/geo.frag (100%) rename examples/10.glsl/{ => shader}/geo.geom (100%) rename examples/10.glsl/{ => shader}/geo.vert (100%) rename examples/10.glsl/{ => shader}/interpol.frag (100%) rename examples/10.glsl/{ => shader}/link.frag (100%) rename examples/10.glsl/{ => shader}/link.vert (100%) rename examples/10.glsl/{ => shader}/mass.frag (100%) rename examples/10.glsl/{ => shader}/mass.vert (100%) rename examples/10.glsl/{ => shader}/multitexture.frag (100%) rename examples/10.glsl/{ => shader}/multitexture.vert (100%) rename examples/10.glsl/{ => shader}/multitexture_rect.frag (100%) rename examples/10.glsl/{ => shader}/multitexture_rect.vert (100%) rename examples/10.glsl/{ => shader}/normal.frag (100%) rename examples/10.glsl/{ => shader}/normal.vert (100%) rename examples/10.glsl/{ => shader}/panoramique.frag (100%) rename examples/10.glsl/{ => shader}/panoramique.vert (100%) rename examples/10.glsl/{ => shader}/texture.frag (100%) rename examples/10.glsl/{ => shader}/texture.vert (100%) rename examples/10.glsl/{ => shader}/texture_rect.frag (100%) rename examples/10.glsl/{ => shader}/tri2fan.frag (100%) rename examples/10.glsl/{ => shader}/tri2fan.geom (100%) rename examples/10.glsl/{ => shader}/tri2fan.vert (100%) rename examples/10.glsl/{ => shader}/vague.frag (100%) rename examples/10.glsl/{ => shader}/wave.frag (100%) diff --git a/examples/10.glsl/01.simple_texture.pd b/examples/10.glsl/01.simple_texture.pd index 7ee3de6f8..3600d5766 100644 --- a/examples/10.glsl/01.simple_texture.pd +++ b/examples/10.glsl/01.simple_texture.pd @@ -4,31 +4,26 @@ #X obj 76 367 glsl_program; #X obj 169 329 print linking; #X obj 76 411 rotateXYZ; -#X floatatom 96 389 5 0 0 0 - - -; -#X floatatom 140 389 5 0 0 0 - - -; -#X floatatom 182 389 5 0 0 0 - - -; +#X floatatom 96 389 5 0 0 0 - - - 0; +#X floatatom 140 389 5 0 0 0 - - - 0; +#X floatatom 182 389 5 0 0 0 - - - 0; #X obj 76 580 pix_texture; #X msg 548 116 color 1 0 0; -#X obj 106 69 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X msg 106 154 open texture.frag; +#X obj 106 69 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 197 glsl_fragment; #X text 215 459 <- load texture; -#X obj 106 535 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 106 535 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 76 489 pix_image img1.jpg; #X msg 103 460 open img2.jpg; -#X msg 243 154 open texture_rect.frag; #X msg 114 114 0; -#X obj 243 72 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X text 275 70 <-load an other shader; -#X text 279 84 (using rectangular texturing); -#X msg 254 113 1; +#X obj 283 72 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X text 315 70 <-load an other shader; +#X text 319 84 (using rectangular texturing); +#X msg 294 113 1; #X msg 351 258 B \$1; #X msg 364 297 C \$1; -#X floatatom 351 241 5 0 0 0 - - -; -#X floatatom 364 280 5 0 0 0 - - -; +#X floatatom 351 241 5 0 0 0 - - - 0; +#X floatatom 364 280 5 0 0 0 - - - 0; #X text 408 280 <- adjust Contrast; #X text 400 240 <- adjust Brightness; #X text 138 67 <- load shader; @@ -41,8 +36,7 @@ #X connect 1 0 2 0; #X restore 566 142 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -81,46 +75,48 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 548 163 pd gemwin; #X msg 106 555 rectangle \$1; -#X obj 254 134 s rectangle; +#X obj 294 134 s rectangle; #X obj 114 135 s rectangle; #X obj 106 512 r rectangle; #X msg 32 167 print; #X msg 39 340 print; -#X floatatom 192 372 0 0 0 0 - - -; +#X floatatom 192 372 0 0 0 0 - - - 0; #X msg 151 308 link \$1; #X obj 151 259 change; #X obj 604 13 declare -lib Gem; -#X connect 0 0 11 0; +#X msg 106 154 open shader/texture.frag; +#X msg 283 154 open shader/texture_rect.frag; +#X connect 0 0 10 0; #X connect 1 0 3 0; -#X connect 1 1 38 0; -#X connect 3 0 14 0; +#X connect 1 1 36 0; +#X connect 3 0 13 0; #X connect 4 0 3 1; #X connect 5 0 3 2; #X connect 6 0 3 3; -#X connect 7 0 29 0; -#X connect 8 0 31 0; -#X connect 9 0 10 0; -#X connect 9 0 17 0; -#X connect 10 0 11 0; -#X connect 11 0 1 0; -#X connect 11 1 40 0; -#X connect 13 0 32 0; -#X connect 14 0 7 0; -#X connect 15 0 14 0; -#X connect 16 0 11 0; -#X connect 17 0 34 0; -#X connect 18 0 16 0; -#X connect 18 0 21 0; -#X connect 21 0 33 0; -#X connect 22 0 1 0; -#X connect 23 0 1 0; -#X connect 24 0 22 0; -#X connect 25 0 23 0; -#X connect 30 0 31 0; -#X connect 32 0 7 0; -#X connect 35 0 13 0; -#X connect 36 0 11 0; +#X connect 7 0 27 0; +#X connect 8 0 29 0; +#X connect 9 0 40 0; +#X connect 9 0 15 0; +#X connect 10 0 1 0; +#X connect 10 1 38 0; +#X connect 12 0 30 0; +#X connect 13 0 7 0; +#X connect 14 0 13 0; +#X connect 15 0 32 0; +#X connect 16 0 41 0; +#X connect 16 0 19 0; +#X connect 19 0 31 0; +#X connect 20 0 1 0; +#X connect 21 0 1 0; +#X connect 22 0 20 0; +#X connect 23 0 21 0; +#X connect 28 0 29 0; +#X connect 30 0 7 0; +#X connect 33 0 12 0; +#X connect 34 0 10 0; +#X connect 35 0 1 0; #X connect 37 0 1 0; -#X connect 39 0 1 0; -#X connect 39 0 2 0; -#X connect 40 0 39 0; +#X connect 37 0 2 0; +#X connect 38 0 37 0; +#X connect 40 0 10 0; +#X connect 41 0 10 0; diff --git a/examples/10.glsl/02.primitive_distortion.pd b/examples/10.glsl/02.primitive_distortion.pd index 07a3180a4..189c4d7cc 100644 --- a/examples/10.glsl/02.primitive_distortion.pd +++ b/examples/10.glsl/02.primitive_distortion.pd @@ -5,14 +5,13 @@ #X obj 74 362 glsl_program; #X obj 215 141 change; #X msg 98 333 print; -#X floatatom 215 164 2 0 0 0 ID - -; +#X floatatom 215 164 2 0 0 0 ID - - 0; #X obj 164 312 print linking; #X obj 74 122 glsl_vertex; #X obj 74 551 pix_texture; #X obj 74 44 alpha; -#X obj 101 497 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X floatatom 292 302 5 0 0 0 - - -; +#X obj 101 497 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 292 302 5 0 0 0 - - - 0; #X msg 101 475 0; #X msg 292 323 K \$1; #X obj 74 594 sphere 2 30; @@ -41,8 +40,7 @@ #X obj 74 571 rotateXYZ -90 0 0; #X msg 292 277 0.1; #X obj 74 428 pix_image img3.jpg; -#X text 69 627 this shader create a dirty pseudo random value \, and -move all vertices separately; +#X text 69 627 this shader create a dirty pseudo random value \, and move all vertices separately; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -51,8 +49,7 @@ move all vertices separately; #X connect 1 0 2 0; #X restore 389 61 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -93,15 +90,15 @@ move all vertices separately; #X msg 101 517 rectangle \$1; #X obj 74 180 glsl_fragment; #X obj 162 202 change; -#X floatatom 162 225 2 0 0 0 ID - -; +#X floatatom 162 225 2 0 0 0 ID - - 0; #X obj 162 244 pack 0 0; #X msg 162 291 link \$1 \$2; #X msg 198 100 open \$1.frag; -#X msg 166 43 symbol P_distord; #X obj 166 63 t s s; -#X msg 88 100 open \$1.vert; #X text 423 651 ch 2007; #X obj 389 43 declare -lib Gem; +#X msg 88 100 open \$1.vert; +#X msg 166 43 symbol shader/P_distord; #X connect 0 0 9 0; #X connect 1 0 7 0; #X connect 2 0 22 0; @@ -117,7 +114,7 @@ move all vertices separately; #X connect 11 0 13 0; #X connect 12 0 10 0; #X connect 13 0 2 0; -#X connect 15 0 33 0; +#X connect 15 0 37 0; #X connect 16 0 21 0; #X connect 17 0 12 0; #X connect 19 0 22 0; @@ -134,7 +131,7 @@ move all vertices separately; #X connect 31 0 2 0; #X connect 31 0 6 0; #X connect 32 0 27 0; -#X connect 33 0 34 0; -#X connect 34 0 35 0; -#X connect 34 1 32 0; -#X connect 35 0 7 0; +#X connect 33 0 36 0; +#X connect 33 1 32 0; +#X connect 36 0 7 0; +#X connect 37 0 33 0; diff --git a/examples/10.glsl/03.texture_distortion.pd b/examples/10.glsl/03.texture_distortion.pd index 33e3c6422..52cf69d25 100644 --- a/examples/10.glsl/03.texture_distortion.pd +++ b/examples/10.glsl/03.texture_distortion.pd @@ -11,19 +11,16 @@ #X obj 146 121 change; #X msg 147 304 link \$1 \$2; #X msg 98 353 print; -#X floatatom 168 242 2 0 0 0 ID - -; -#X floatatom 146 144 2 0 0 0 ID - -; +#X floatatom 168 242 2 0 0 0 ID - - 0; +#X floatatom 146 144 2 0 0 0 ID - - 0; #X obj 165 325 print linking; #X obj 74 196 glsl_fragment; #X obj 74 102 glsl_vertex; #X obj 74 571 pix_texture; -#X obj 124 59 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; #X obj 74 24 alpha; -#X obj 124 522 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X floatatom 361 352 5 0 0 0 - - -; -#X floatatom 476 353 5 0 0 0 - - -; +#X obj 124 522 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 361 352 5 0 0 0 - - - 0; +#X floatatom 476 353 5 0 0 0 - - - 0; #X msg 124 500 0; #N canvas 0 0 450 300 load_shader 0; #X obj 89 99 t b b; @@ -34,7 +31,7 @@ #X connect 0 1 1 0; #X connect 1 0 3 0; #X connect 3 0 0 0; -#X restore 124 38 pd load_shader; +#X restore 146 6 pd load_shader; #N canvas 0 0 450 300 init_shader 0; #X obj 89 154 outlet; #X obj 89 45 inlet; @@ -50,12 +47,9 @@ #X msg 361 373 K1 \$1; #X msg 361 327 1; #X msg 476 375 seed \$1; -#X msg 88 80 open T_distord.vert; -#X msg 85 166 open T_distord.frag; #X obj 74 458 pix_image img3.jpg; #X obj 74 596 rectangle 4 4; -#X text 73 627 This shader compute a dirty pseudo random number \, -and distort the texture this with value; +#X text 73 627 This shader compute a dirty pseudo random number \, and distort the texture this with value; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -64,8 +58,7 @@ and distort the texture this with value; #X connect 1 0 2 0; #X restore 384 41 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -105,10 +98,13 @@ and distort the texture this with value; #X restore 354 58 pd gemwin; #X msg 124 542 rectangle \$1; #X obj 384 23 declare -lib Gem; -#X connect 1 0 18 0; +#X msg 88 80 open \$1.vert; +#X msg 85 166 open \$1.frag; +#X msg 146 32 symbol shader/T_distord; +#X connect 1 0 17 0; #X connect 2 0 15 0; -#X connect 3 0 33 0; -#X connect 3 1 24 0; +#X connect 3 0 30 0; +#X connect 3 1 23 0; #X connect 4 0 9 0; #X connect 5 0 14 0; #X connect 6 0 4 0; @@ -124,23 +120,23 @@ and distort the texture this with value; #X connect 14 1 7 0; #X connect 15 0 14 0; #X connect 15 1 8 0; -#X connect 16 0 34 0; -#X connect 17 0 31 0; -#X connect 17 0 32 0; -#X connect 18 0 15 0; -#X connect 19 0 38 0; -#X connect 20 0 28 0; -#X connect 21 0 30 0; -#X connect 22 0 19 0; -#X connect 23 0 17 0; -#X connect 24 0 29 0; -#X connect 25 0 22 0; -#X connect 27 0 33 0; -#X connect 28 0 3 0; -#X connect 29 0 20 0; -#X connect 30 0 3 0; -#X connect 31 0 15 0; -#X connect 32 0 14 0; -#X connect 33 0 16 0; -#X connect 36 0 37 0; -#X connect 38 0 16 0; +#X connect 16 0 31 0; +#X connect 17 0 15 0; +#X connect 18 0 35 0; +#X connect 19 0 27 0; +#X connect 20 0 29 0; +#X connect 21 0 18 0; +#X connect 22 0 39 0; +#X connect 23 0 28 0; +#X connect 24 0 21 0; +#X connect 26 0 30 0; +#X connect 27 0 3 0; +#X connect 28 0 19 0; +#X connect 29 0 3 0; +#X connect 30 0 16 0; +#X connect 33 0 34 0; +#X connect 35 0 16 0; +#X connect 37 0 15 0; +#X connect 38 0 14 0; +#X connect 39 0 37 0; +#X connect 39 0 38 0; diff --git a/examples/10.glsl/04.game_of_life.pd b/examples/10.glsl/04.game_of_life.pd index 1aced3e96..36df4ba79 100644 --- a/examples/10.glsl/04.game_of_life.pd +++ b/examples/10.glsl/04.game_of_life.pd @@ -1,4 +1,4 @@ -#N canvas 10 61 599 681 10; +#N canvas 713 71 599 681 10; #X declare -lib Gem; #X obj 316 488 pix_snap2tex; #X msg 356 461 0 0; @@ -7,7 +7,7 @@ #X obj 316 513 alpha; #X obj 316 563 square 4; #X msg 52 75 frame \$1; -#X floatatom 52 57 5 0 0 0 - - -; +#X floatatom 52 57 5 0 0 0 - - - 0; #X obj 356 419 loadbang; #X msg 271 95 print; #X obj 316 370 glsl_program; @@ -18,19 +18,15 @@ #X obj 388 136 change; #X msg 389 321 link \$1 \$2; #X msg 272 333 print; -#X floatatom 410 257 2 0 0 0 ID - -; -#X floatatom 388 159 2 0 0 0 ID - -; +#X floatatom 410 257 2 0 0 0 ID - - 0; +#X floatatom 388 159 2 0 0 0 ID - - 0; #X obj 407 342 print linking; #X obj 316 211 glsl_fragment; #X obj 316 117 glsl_vertex; -#X obj 338 68 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 338 68 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 316 37 gemhead -1; #X obj 316 537 colorRGB 1 1 1 1; -#X msg 330 95 open game.vert; -#X msg 327 181 open game.frag; -#X obj 39 259 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 39 259 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 39 281 gemhead 50; #X obj 39 311 translateXYZ 0 0 1; #X obj 39 409 rectangle; @@ -39,12 +35,11 @@ #X text 157 261 <- 3; #X text 375 69 <- 2 : load shader; #X obj 316 392 t b a; -#X floatatom 69 362 5 0 0 0 - - -; -#X floatatom 124 363 5 0 0 0 - - -; +#X floatatom 69 362 5 0 0 0 - - - 0; +#X floatatom 124 363 5 0 0 0 - - - 0; #X obj 69 381 / 100; #X obj 124 384 / 100; -#X text 13 634 This is an example of iterative process : the output -of the shader is used for next frame input; +#X text 13 634 This is an example of iterative process : the output of the shader is used for next frame input; #X text 145 140 <----- 1; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -54,8 +49,7 @@ of the shader is used for next frame input; #X connect 1 0 2 0; #X restore 82 100 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -94,17 +88,19 @@ of the shader is used for next frame input; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 52 117 pd gemwin; #X obj 484 13 declare -lib Gem; +#X msg 330 95 open shader/game.vert; +#X msg 327 181 open shader/game.frag; #X connect 0 0 4 0; #X connect 1 0 0 1; #X connect 2 0 0 2; #X connect 3 0 1 0; #X connect 3 1 2 0; #X connect 4 0 25 0; -#X connect 6 0 44 0; +#X connect 6 0 42 0; #X connect 7 0 6 0; #X connect 8 0 3 0; #X connect 9 0 22 0; -#X connect 10 0 36 0; +#X connect 10 0 34 0; #X connect 11 0 16 0; #X connect 12 0 21 0; #X connect 13 0 11 0; @@ -120,21 +116,21 @@ of the shader is used for next frame input; #X connect 21 1 14 0; #X connect 22 0 21 0; #X connect 22 1 15 0; -#X connect 23 0 26 0; -#X connect 23 0 27 0; +#X connect 23 0 44 0; +#X connect 23 0 45 0; #X connect 24 0 22 0; #X connect 25 0 5 0; -#X connect 26 0 22 0; -#X connect 27 0 21 0; +#X connect 26 0 27 0; +#X connect 27 0 28 0; #X connect 28 0 29 0; -#X connect 29 0 30 0; #X connect 30 0 31 0; -#X connect 32 0 33 0; -#X connect 33 0 28 0; -#X connect 36 0 0 0; -#X connect 36 1 0 0; -#X connect 37 0 39 0; -#X connect 38 0 40 0; -#X connect 39 0 31 1; -#X connect 40 0 31 2; -#X connect 43 0 44 0; +#X connect 31 0 26 0; +#X connect 34 0 0 0; +#X connect 34 1 0 0; +#X connect 35 0 37 0; +#X connect 36 0 38 0; +#X connect 37 0 29 1; +#X connect 38 0 29 2; +#X connect 41 0 42 0; +#X connect 44 0 22 0; +#X connect 45 0 21 0; diff --git a/examples/10.glsl/05.multitexture.pd b/examples/10.glsl/05.multitexture.pd index c329a7de2..312f81cdf 100644 --- a/examples/10.glsl/05.multitexture.pd +++ b/examples/10.glsl/05.multitexture.pd @@ -1,4 +1,4 @@ -#N canvas 10 61 930 667 10; +#N canvas 563 91 925 703 10; #X declare -lib Gem; #X obj 76 5 gemhead; #X obj 75 429 glsl_program; @@ -6,39 +6,31 @@ #X obj 170 248 t b f; #X obj 164 203 change; #X msg 149 294 link \$1 \$2; -#X floatatom 170 229 2 0 0 0 ID - -; -#X floatatom 148 121 2 0 0 0 ID - -; +#X floatatom 170 229 2 0 0 0 ID - - 0; +#X floatatom 148 121 2 0 0 0 ID - - 0; #X obj 167 315 print linking; #X msg 365 23 color 1 0 0; -#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 79 glsl_vertex; #X obj 76 183 glsl_fragment; #X obj 463 464 pix_texture; #X obj 546 271 openpanel; -#X obj 546 248 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X msg 90 57 open multitexture.vert; -#X msg 86 153 open multitexture.frag; +#X obj 546 248 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 463 230 gemhead 11; -#X obj 463 204 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 463 204 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 463 90 1) turn on rendering; #X msg 503 432 texunit 1; #X obj 687 467 pix_texture; #X obj 768 271 openpanel; -#X obj 768 250 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X obj 687 204 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 768 250 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 687 204 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 725 430 texunit 0; #X obj 462 488 translateXYZ -2 0 0; #X obj 685 490 translateXYZ 2 0 0; #X msg 187 406 MyTex 0; #X obj 75 644 pix_texture; #X obj 218 498 openpanel; -#X obj 218 477 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 218 477 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 254 381 MyTex1 1; #X msg 255 406 MyTex 1; #X msg 186 381 MyTex1 0; @@ -81,8 +73,7 @@ #X msg 153 544 open img1.jpg; #X obj 75 613 pix_image img1.jpg; #X obj 148 98 change; -#X text 343 147 This is an example of multitexturing \, this shader -mixes 2 textures; +#X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -91,8 +82,7 @@ mixes 2 textures; #X connect 1 0 2 0; #X restore 395 47 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -137,9 +127,11 @@ mixes 2 textures; #X msg 491 409 texunit 0 \, rectangle 0; #X msg 716 409 texunit 1 \, rectangle 0; #X obj 793 7 declare -lib Gem; +#X msg 90 57 open shader/multitexture.vert; +#X msg 86 153 open shader/multitexture.frag; #X connect 0 0 11 0; -#X connect 1 0 56 0; -#X connect 1 1 39 0; +#X connect 1 0 54 0; +#X connect 1 1 37 0; #X connect 2 0 5 0; #X connect 3 0 2 0; #X connect 3 1 2 1; @@ -148,56 +140,56 @@ mixes 2 textures; #X connect 5 0 8 0; #X connect 6 0 3 0; #X connect 7 0 2 0; -#X connect 9 0 60 0; -#X connect 10 0 16 0; -#X connect 10 0 17 0; +#X connect 9 0 58 0; +#X connect 10 0 66 0; +#X connect 10 0 67 0; #X connect 11 0 12 0; -#X connect 11 1 57 0; +#X connect 11 1 55 0; #X connect 12 0 1 0; #X connect 12 1 4 0; -#X connect 13 0 27 0; -#X connect 14 0 40 0; +#X connect 13 0 25 0; +#X connect 14 0 38 0; #X connect 15 0 14 0; -#X connect 16 0 11 0; -#X connect 17 0 12 0; -#X connect 18 0 52 0; -#X connect 19 0 18 0; -#X connect 21 0 13 0; -#X connect 22 0 28 0; -#X connect 23 0 43 0; -#X connect 24 0 23 0; -#X connect 25 0 49 0; -#X connect 26 0 22 0; -#X connect 29 0 1 0; -#X connect 30 0 61 0; -#X connect 31 0 42 0; -#X connect 32 0 31 0; +#X connect 16 0 50 0; +#X connect 17 0 16 0; +#X connect 19 0 13 0; +#X connect 20 0 26 0; +#X connect 21 0 41 0; +#X connect 22 0 21 0; +#X connect 23 0 47 0; +#X connect 24 0 20 0; +#X connect 27 0 1 0; +#X connect 28 0 59 0; +#X connect 29 0 40 0; +#X connect 30 0 29 0; +#X connect 31 0 1 0; +#X connect 32 0 1 0; #X connect 33 0 1 0; #X connect 34 0 1 0; #X connect 35 0 1 0; -#X connect 36 0 1 0; -#X connect 37 0 1 0; -#X connect 38 0 10 0; -#X connect 39 0 33 0; -#X connect 39 0 29 0; -#X connect 40 0 51 0; -#X connect 41 0 65 0; -#X connect 42 0 55 0; -#X connect 43 0 54 0; -#X connect 44 0 51 0; -#X connect 45 0 55 0; -#X connect 46 0 54 0; -#X connect 47 0 64 0; -#X connect 48 0 66 0; -#X connect 49 0 53 0; -#X connect 51 0 52 0; -#X connect 52 0 13 0; -#X connect 53 0 22 0; -#X connect 54 0 53 0; -#X connect 55 0 56 0; -#X connect 56 0 30 0; -#X connect 57 0 7 0; -#X connect 59 0 60 0; -#X connect 64 0 30 0; -#X connect 65 0 13 0; -#X connect 66 0 22 0; +#X connect 36 0 10 0; +#X connect 37 0 31 0; +#X connect 37 0 27 0; +#X connect 38 0 49 0; +#X connect 39 0 63 0; +#X connect 40 0 53 0; +#X connect 41 0 52 0; +#X connect 42 0 49 0; +#X connect 43 0 53 0; +#X connect 44 0 52 0; +#X connect 45 0 62 0; +#X connect 46 0 64 0; +#X connect 47 0 51 0; +#X connect 49 0 50 0; +#X connect 50 0 13 0; +#X connect 51 0 20 0; +#X connect 52 0 51 0; +#X connect 53 0 54 0; +#X connect 54 0 28 0; +#X connect 55 0 7 0; +#X connect 57 0 58 0; +#X connect 62 0 28 0; +#X connect 63 0 13 0; +#X connect 64 0 20 0; +#X connect 66 0 11 0; +#X connect 67 0 12 0; diff --git a/examples/10.glsl/05.multitexture_bis.pd b/examples/10.glsl/05.multitexture_bis.pd index 2ec6887d6..9d4f7b7c1 100644 --- a/examples/10.glsl/05.multitexture_bis.pd +++ b/examples/10.glsl/05.multitexture_bis.pd @@ -1,4 +1,4 @@ -#N canvas 207 200 1100 637 10; +#N canvas 619 198 1100 637 10; #X declare -lib Gem; #X obj 76 5 gemhead; #X obj 75 429 glsl_program; @@ -6,28 +6,21 @@ #X obj 170 248 t b f; #X obj 164 203 change; #X msg 149 294 link \$1 \$2; -#X floatatom 170 229 2 0 0 0 ID - -; -#X floatatom 148 121 2 0 0 0 ID - -; +#X floatatom 170 229 2 0 0 0 ID - - 0; +#X floatatom 148 121 2 0 0 0 ID - - 0; #X obj 167 315 print linking; #X msg 365 23 color 1 0 0; -#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 79 glsl_vertex; #X obj 76 183 glsl_fragment; #X obj 749 262 openpanel; -#X obj 749 239 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X msg 90 57 open multitexture.vert; -#X msg 86 153 open multitexture.frag; +#X obj 749 239 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 666 221 gemhead 11; -#X obj 666 195 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 666 195 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 463 90 1) turn on rendering; #X obj 971 262 openpanel; -#X obj 971 241 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X obj 890 195 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 971 241 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 890 195 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 187 406 MyTex 0; #X msg 254 381 MyTex1 1; #X msg 255 406 MyTex 1; @@ -66,8 +59,7 @@ #X obj 890 337 pix_image img3.jpg; #X msg 907 309 open img3.jpg; #X obj 148 98 change; -#X text 343 147 This is an example of multitexturing \, this shader -mixes 2 textures; +#X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -76,8 +68,7 @@ mixes 2 textures; #X connect 1 0 2 0; #X restore 395 47 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -122,11 +113,9 @@ mixes 2 textures; #X msg 694 400 rectangle 0; #X msg 919 400 rectangle 0; #X obj 526 264 openpanel; -#X obj 526 241 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 526 241 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 443 223 gemhead 11; -#X obj 443 197 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 443 197 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 526 289 set open \$1 \, bang; #X obj 471 380 loadbang; #X obj 462 288 loadbang; @@ -135,9 +124,11 @@ mixes 2 textures; #X msg 462 313 open img1.jpg; #X obj 443 342 pix_image img1.jpg; #X obj 983 7 declare -lib Gem; +#X msg 90 57 open shader/multitexture.vert; +#X msg 86 153 open shader/multitexture.frag; #X connect 0 0 11 0; -#X connect 1 0 48 0; -#X connect 1 1 30 0; +#X connect 1 0 46 0; +#X connect 1 1 28 0; #X connect 2 0 5 0; #X connect 3 0 2 0; #X connect 3 1 2 1; @@ -146,57 +137,57 @@ mixes 2 textures; #X connect 5 0 8 0; #X connect 6 0 3 0; #X connect 7 0 2 0; -#X connect 9 0 46 0; -#X connect 10 0 15 0; -#X connect 10 0 16 0; +#X connect 9 0 44 0; +#X connect 10 0 63 0; +#X connect 10 0 64 0; #X connect 11 0 12 0; -#X connect 11 1 43 0; +#X connect 11 1 41 0; #X connect 12 0 1 0; #X connect 12 1 4 0; -#X connect 13 0 31 0; +#X connect 13 0 29 0; #X connect 14 0 13 0; -#X connect 15 0 11 0; -#X connect 16 0 12 0; -#X connect 17 0 40 0; -#X connect 18 0 17 0; -#X connect 20 0 33 0; -#X connect 21 0 20 0; -#X connect 22 0 37 0; +#X connect 15 0 38 0; +#X connect 16 0 15 0; +#X connect 18 0 31 0; +#X connect 19 0 18 0; +#X connect 20 0 35 0; +#X connect 21 0 1 0; +#X connect 22 0 1 0; #X connect 23 0 1 0; #X connect 24 0 1 0; #X connect 25 0 1 0; #X connect 26 0 1 0; -#X connect 27 0 1 0; -#X connect 28 0 1 0; -#X connect 29 0 10 0; -#X connect 30 0 24 0; -#X connect 30 0 23 0; -#X connect 31 0 39 0; -#X connect 32 0 51 0; -#X connect 33 0 42 0; -#X connect 34 0 39 0; -#X connect 35 0 42 0; -#X connect 36 0 52 0; -#X connect 37 0 41 0; -#X connect 39 0 40 0; -#X connect 40 0 49 0; -#X connect 41 0 50 0; -#X connect 42 0 41 0; -#X connect 43 0 7 0; -#X connect 45 0 46 0; -#X connect 48 0 47 0; -#X connect 49 1 48 2; -#X connect 50 1 48 3; -#X connect 51 0 49 0; -#X connect 52 0 50 0; -#X connect 53 0 57 0; +#X connect 27 0 10 0; +#X connect 28 0 22 0; +#X connect 28 0 21 0; +#X connect 29 0 37 0; +#X connect 30 0 49 0; +#X connect 31 0 40 0; +#X connect 32 0 37 0; +#X connect 33 0 40 0; +#X connect 34 0 50 0; +#X connect 35 0 39 0; +#X connect 37 0 38 0; +#X connect 38 0 47 0; +#X connect 39 0 48 0; +#X connect 40 0 39 0; +#X connect 41 0 7 0; +#X connect 43 0 44 0; +#X connect 46 0 45 0; +#X connect 47 1 46 2; +#X connect 48 1 46 3; +#X connect 49 0 47 0; +#X connect 50 0 48 0; +#X connect 51 0 55 0; +#X connect 52 0 51 0; +#X connect 53 0 61 0; #X connect 54 0 53 0; -#X connect 55 0 63 0; -#X connect 56 0 55 0; -#X connect 57 0 62 0; -#X connect 58 0 61 0; -#X connect 59 0 62 0; -#X connect 60 1 48 1; -#X connect 61 0 60 0; -#X connect 62 0 63 0; -#X connect 63 0 60 0; +#X connect 55 0 60 0; +#X connect 56 0 59 0; +#X connect 57 0 60 0; +#X connect 58 1 46 1; +#X connect 59 0 58 0; +#X connect 60 0 61 0; +#X connect 61 0 58 0; +#X connect 63 0 11 0; +#X connect 64 0 12 0; diff --git a/examples/10.glsl/06.rectangle_multitexture.pd b/examples/10.glsl/06.rectangle_multitexture.pd index ce2c58b63..4ca4d6d0f 100644 --- a/examples/10.glsl/06.rectangle_multitexture.pd +++ b/examples/10.glsl/06.rectangle_multitexture.pd @@ -1,4 +1,4 @@ -#N canvas 511 97 648 675 10; +#N canvas 684 111 648 675 10; #X declare -lib Gem; #X obj 279 76 gemhead; #X obj 295 208 loadbang; @@ -6,18 +6,15 @@ #X msg 295 231 rectangle 1 \, texunit 1; #X obj 334 97 openpanel; #X msg 334 118 open \$1; -#X obj 334 76 bng 15 250 50 0 empty empty empty 17 7 0 10 -257985 -1 --1; +#X obj 334 76 bng 15 250 50 0 empty empty empty 17 7 0 10 #f8fc00 #000000 #000000; #X obj 459 76 gemhead; #X obj 475 208 loadbang; #X obj 459 251 pix_texture; #X obj 514 97 openpanel; #X msg 514 118 open \$1; -#X obj 514 76 bng 15 250 50 0 empty empty empty 17 7 0 10 -257985 -1 --1; +#X obj 514 76 bng 15 250 50 0 empty empty empty 17 7 0 10 #f8fc00 #000000 #000000; #X msg 475 231 rectangle 1 \, texunit 2; -#X obj 279 275 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 -0; +#X obj 279 275 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 0 0 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; @@ -39,18 +36,16 @@ #X restore 284 314 pd gemwin; #X msg 284 295 create; #X text 280 274 Create window:; -#X obj 101 358 cnv 15 100 120 empty empty empty 20 12 0 14 -4034 -66577 -0; +#X obj 101 358 cnv 15 100 120 empty empty empty 20 12 0 14 #00fc04 #404040 0; #X obj 37 538 glsl_program; #X obj 100 259 pack 0 0; #X obj 118 236 t b f; #X obj 118 194 change; #X msg 100 285 link \$1 \$2; -#X floatatom 118 217 2 0 0 0 ID - -; -#X floatatom 100 133 2 0 0 0 ID - -; +#X floatatom 118 217 2 0 0 0 ID - - 0; +#X floatatom 100 133 2 0 0 0 ID - - 0; #X obj 105 309 print linking; -#X obj 124 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 124 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 37 88 glsl_vertex; #X obj 37 174 glsl_fragment; #N canvas 0 0 450 300 load_shader 0; @@ -97,25 +92,16 @@ #X obj 37 625 pix_texture; #X msg 106 603 rectangle 1 \, texunit 0; #X obj 37 598 pix_set; -#X obj 142 457 hsl 50 10 0 1 0 0 empty empty MIX_FACTOR -2 -4 0 7 -262144 --1 -1 0 1; -#X msg 51 66 open GLSL_mix.vert; -#X msg 51 151 open GLSL_mix.frag; +#X obj 142 457 hsl 50 10 0 1 0 0 empty empty MIX_FACTOR -2 -4 0 7 #fcfcfc #000000 #000000 0 1; #X msg 109 411 diff; #X text 383 295 <- 1 : create GEM window; -#X text 248 375 add : add two texture together (it is easy to get a -white out); +#X text 248 375 add : add two texture together (it is easy to get a white out); #X msg 109 391 subtract; -#X text 277 16 This shader program give you the possibility to mix -two sources of different size. You can add \, subtract \, diff \, multiply -and mix the two sources.; -#X text 248 401 subtract : subtract two texture together (it is easy -to get a black out); -#X text 248 427 diff : subtract two texture together (get absolute -value); +#X text 277 16 This shader program give you the possibility to mix two sources of different size. You can add \, subtract \, diff \, multiply and mix the two sources.; +#X text 248 401 subtract : subtract two texture together (it is easy to get a black out); +#X text 248 427 diff : subtract two texture together (get absolute value); #X text 248 441 multiply : multiply two texture together; -#X text 248 455 mix : mix two texture together (use the mix factor -for crossfading); +#X text 248 455 mix : mix two texture together (use the mix factor for crossfading); #N canvas 242 260 450 300 onebang 0; #X obj 120 71 inlet; #X obj 120 151 outlet; @@ -142,22 +128,24 @@ for crossfading); #X msg 139 507 mix_factor \$1; #X obj 37 646 square 4; #X obj 543 647 declare -lib Gem; -#X connect 0 0 61 0; +#X msg 51 66 open shader/GLSL_mix.vert; +#X msg 51 151 open shader/GLSL_mix.frag; +#X connect 0 0 59 0; #X connect 1 0 3 0; #X connect 3 0 2 0; #X connect 4 0 5 0; -#X connect 5 0 61 0; +#X connect 5 0 59 0; #X connect 6 0 4 0; -#X connect 7 0 62 0; +#X connect 7 0 60 0; #X connect 8 0 13 0; #X connect 10 0 11 0; -#X connect 11 0 62 0; +#X connect 11 0 60 0; #X connect 12 0 10 0; #X connect 13 0 9 0; #X connect 15 0 16 0; #X connect 16 0 15 0; #X connect 19 0 44 0; -#X connect 19 1 57 0; +#X connect 19 1 55 0; #X connect 20 0 23 0; #X connect 21 0 20 0; #X connect 21 1 20 1; @@ -166,8 +154,8 @@ for crossfading); #X connect 23 0 26 0; #X connect 24 0 21 0; #X connect 25 0 20 0; -#X connect 27 0 46 0; -#X connect 27 0 47 0; +#X connect 27 0 65 0; +#X connect 27 0 66 0; #X connect 28 0 29 0; #X connect 28 1 31 0; #X connect 29 0 19 0; @@ -184,18 +172,18 @@ for crossfading); #X connect 39 0 19 0; #X connect 40 0 19 0; #X connect 41 0 34 0; -#X connect 42 0 65 0; +#X connect 42 0 63 0; #X connect 43 0 42 0; #X connect 44 0 42 0; -#X connect 45 0 64 0; -#X connect 46 0 28 0; -#X connect 47 0 29 0; -#X connect 48 0 37 0; -#X connect 51 0 37 0; -#X connect 57 0 38 0; -#X connect 57 0 39 0; -#X connect 59 0 9 0; -#X connect 60 0 2 0; -#X connect 61 0 60 0; -#X connect 62 0 59 0; -#X connect 64 0 19 0; +#X connect 45 0 62 0; +#X connect 46 0 37 0; +#X connect 49 0 37 0; +#X connect 55 0 38 0; +#X connect 55 0 39 0; +#X connect 57 0 9 0; +#X connect 58 0 2 0; +#X connect 59 0 58 0; +#X connect 60 0 57 0; +#X connect 62 0 19 0; +#X connect 65 0 28 0; +#X connect 66 0 29 0; diff --git a/examples/10.glsl/07.framebuffer_and_shader.pd b/examples/10.glsl/07.framebuffer_and_shader.pd index 5a5fa7b69..a08851749 100644 --- a/examples/10.glsl/07.framebuffer_and_shader.pd +++ b/examples/10.glsl/07.framebuffer_and_shader.pd @@ -1,20 +1,20 @@ -#N canvas 30 77 1126 659 10; +#N canvas 472 147 1126 659 10; #X declare -lib Gem; #X obj 9 470 translateXYZ 0 0 -4; #X obj 9 234 ortho; -#X floatatom 83 538 5 0 0 0 - - -; +#X floatatom 83 538 5 0 0 0 - - - 0; #X msg 83 515 \$1; #X obj 9 365 gemframebuffer; #X obj 9 494 pix_texture; #X obj 218 474 translateXYZ 0 0 -4; #X obj 218 501 pix_texture; -#X floatatom 484 153 5 0 0 0 - - -; +#X floatatom 484 153 5 0 0 0 - - - 0; #X msg 484 131 \$1; -#X floatatom 325 550 5 0 0 0 - - -; +#X floatatom 325 550 5 0 0 0 - - - 0; #X msg 325 528 \$1; -#X floatatom 104 412 5 0 0 0 - - -; +#X floatatom 104 412 5 0 0 0 - - - 0; #X msg 104 389 \$1; -#X floatatom 294 411 5 0 0 0 - - -; +#X floatatom 294 411 5 0 0 0 - - - 0; #X msg 294 388 \$1; #X obj 435 58 loadbang; #X obj 199 364 gemframebuffer; @@ -23,9 +23,9 @@ #X obj 126 137 change; #X obj 126 183 print linking; #X obj 32 117 glsl_fragment; -#X floatatom 130 239 5 0 0 0 - - -; -#X floatatom 232 239 5 0 0 0 - - -; -#X floatatom 181 239 5 0 0 0 - - -; +#X floatatom 130 239 5 0 0 0 - - - 0; +#X floatatom 232 239 5 0 0 0 - - - 0; +#X floatatom 181 239 5 0 0 0 - - - 0; #X msg 130 260 K1 \$1; #X msg 181 260 K3 \$1; #X msg 232 260 D1 \$1; @@ -44,8 +44,7 @@ #X obj 32 36 inlet; #X obj 32 363 outlet; #X obj 304 38 inlet; -#X obj 139 343 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 139 343 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 init_shader 0; #X obj 89 154 outlet; #X obj 89 45 inlet; @@ -60,7 +59,7 @@ #X msg 181 213 0; #X msg 232 215 0; #X msg 193 151 text 0; -#X msg 42 93 open wave.frag; +#X msg 42 93 open shader/wave.frag; #X connect 0 0 14 0; #X connect 0 1 17 0; #X connect 1 0 11 0; @@ -92,8 +91,7 @@ #X restore 9 274 pd shader; #X obj 137 289 t a; #X obj 137 197 t b; -#X obj 147 177 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 147 177 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 137 156 loadbang; #X obj 218 421 t a a; #X obj 402 518 separator; @@ -101,10 +99,8 @@ #X obj 218 537 color 1 1 1; #X obj 218 563 rectangle 4 4; #X obj 9 563 rectangle 4 4; -#X obj 66 250 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; -#X obj 93 251 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 66 250 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 93 251 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 390 472 t a; #N canvas 0 0 857 562 border 0; #X obj 14 10 inlet; @@ -141,22 +137,19 @@ #X connect 15 0 5 0; #X connect 16 0 3 0; #X restore 390 569 pd border; -#X obj 774 148 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 774 148 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 774 172 gemhead 40; -#X floatatom 825 519 5 0 0 0 - - -; +#X floatatom 825 519 5 0 0 0 - - - 0; #X obj 774 484 pix_texture; -#X floatatom 876 520 5 0 0 0 - - -; +#X floatatom 876 520 5 0 0 0 - - - 0; #X obj 442 357 pix_texture; -#X floatatom 867 236 5 0 0 0 - - -; -#X obj 653 216 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X floatatom 867 236 5 0 0 0 - - - 0; +#X obj 653 216 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 454 308 loadbang; #X obj 786 442 loadbang; #N canvas 93 153 804 667 _glsl 0; #X obj 80 426 glsl_program; -#X obj 261 238 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 261 238 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #N canvas 0 22 450 300 open 0; #X obj 75 103 openpanel; #X obj 75 173 outlet; @@ -173,7 +166,7 @@ #X obj 166 331 change; #X msg 34 420 print; #X obj 80 310 glsl_fragment; -#X floatatom 166 355 2 0 0 0 ID - -; +#X floatatom 166 355 2 0 0 0 ID - - 0; #X obj 184 400 print linking; #X obj 13 52 inlet; #X obj 80 462 outlet; @@ -181,8 +174,7 @@ #X msg 204 261 open \$1; #X obj 422 77 inlet; #X obj 13 75 route bang; -#X obj 140 83 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 140 83 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 140 109 t b b; #X msg 140 202 symbol \$1/\$2; #X obj 255 11 gemhead 1; @@ -193,7 +185,7 @@ #X obj 159 468 t b; #X obj 159 491 outlet; #X msg 166 379 link \$1; -#X obj 140 133 symbol vague; +#X obj 140 133 symbol shader/vague; #X connect 0 0 10 0; #X connect 0 1 22 0; #X connect 1 0 2 0; @@ -223,8 +215,7 @@ #X connect 25 0 8 0; #X connect 26 0 11 0; #X restore 774 326 pd _glsl; -#X obj 743 302 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 743 302 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 435 82 texunit 3; #X obj 410 108 pix_texture; #X obj 181 299 t a; @@ -257,8 +248,7 @@ #X restore 402 542 pd gouttes; #X msg 244 284 quality 0; #X obj 774 541 rectangle 4 4; -#X obj 9 155 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 -; +#X obj 9 155 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 220 180 delay 1000; #N canvas 0 0 450 300 init 0; #X obj 89 154 outlet; @@ -277,17 +267,12 @@ #X obj 9 177 gemhead 10; #X obj 442 240 pix_image img2.jpg; #X msg 867 215 111; -#X text 33 612 This shader is rendered into a framebuffer \, in order -to use it in the next frame for a simple physical modeling simulation -; -#X text 345 168 This creates a texture (texunit 3) from the shaders' -output; +#X text 33 612 This shader is rendered into a framebuffer \, in order to use it in the next frame for a simple physical modeling simulation; +#X text 345 168 This creates a texture (texunit 3) from the shaders' output; #X text 437 386 this loads a texture (texunit 2); #X text 691 411 not used \, just to set texture coordinate; -#X text 633 594 This uses the two textures (texunit 2 and 3) in order -to render the final images; -#X text 201 9 This is an example of rendering to texture (using framebuffer) -and multitextures; +#X text 633 594 This uses the two textures (texunit 2 and 3) in order to render the final images; +#X text 201 9 This is an example of rendering to texture (using framebuffer) and multitextures; #X obj 402 497 t a a a a a; #X obj 774 393 pix_set 512 512; #N canvas 87 154 452 208 Gem.init 0; @@ -298,8 +283,7 @@ and multitextures; #X connect 2 0 1 0; #X restore 760 47 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; diff --git a/examples/10.glsl/08.multi_pass_rendering.pd b/examples/10.glsl/08.multi_pass_rendering.pd index a0a004f8b..bda4bfb10 100644 --- a/examples/10.glsl/08.multi_pass_rendering.pd +++ b/examples/10.glsl/08.multi_pass_rendering.pd @@ -1,4 +1,4 @@ -#N canvas 208 184 980 477 10; +#N canvas 388 198 980 477 10; #X declare -lib Gem; #X obj 42 315 square 4; #X obj 42 199 translateXYZ 0 0 -4; @@ -19,7 +19,7 @@ #X restore 56 157 pd init; #X obj 650 230 pix_texture; #X obj 650 252 square 4; -#X floatatom 724 255 5 0 0 0 - - -; +#X floatatom 724 255 5 0 0 0 - - - 0; #N canvas 157 111 392 206 init 0; #X obj 93 68 t b; #X obj 93 47 loadbang; @@ -58,20 +58,20 @@ #X obj 94 66 inlet; #X obj 94 530 outlet; #X obj 464 245 inlet; -#X floatatom 182 179 0 0 0 0 - - -; -#X floatatom 234 377 0 0 0 0 - - -; +#X floatatom 182 179 0 0 0 0 - - - 0; +#X floatatom 234 377 0 0 0 0 - - - 0; #X msg 56 472 print; #X msg 246 65 1; #X obj 246 106 t b; #X obj 246 46 gemhead 1; #X obj 175 548 t b; #X obj 175 571 outlet; -#X msg 246 135 open T_distord.vert; -#X msg 289 160 open T_distord.frag; #X obj 246 86 change -1; #X obj 175 524 change; +#X msg 246 135 open shader/T_distord.vert; +#X msg 289 160 open shader/T_distord.frag; #X connect 0 0 10 0; -#X connect 0 1 23 0; +#X connect 0 1 21 0; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 1 1 13 0; @@ -88,15 +88,15 @@ #X connect 9 0 2 0; #X connect 11 0 0 0; #X connect 14 0 0 0; -#X connect 15 0 22 0; -#X connect 16 0 20 0; -#X connect 16 0 21 0; +#X connect 15 0 20 0; +#X connect 16 0 22 0; +#X connect 16 0 23 0; #X connect 17 0 15 0; #X connect 18 0 19 0; -#X connect 20 0 2 0; -#X connect 21 0 1 0; -#X connect 22 0 16 0; -#X connect 23 0 18 0; +#X connect 20 0 16 0; +#X connect 21 0 18 0; +#X connect 22 0 2 0; +#X connect 23 0 1 0; #X restore 42 81 pd shader1; #N canvas 476 68 589 635 shader2 0; #X obj 94 500 glsl_program; @@ -111,20 +111,20 @@ #X obj 94 66 inlet; #X obj 94 530 outlet; #X obj 464 245 inlet; -#X floatatom 182 179 0 0 0 0 - - -; -#X floatatom 234 377 0 0 0 0 - - -; +#X floatatom 182 179 0 0 0 0 - - - 0; +#X floatatom 234 377 0 0 0 0 - - - 0; #X msg 56 472 print; #X msg 246 65 1; #X obj 246 106 t b; #X obj 246 46 gemhead 1; #X obj 175 548 t b; #X obj 175 571 outlet; -#X msg 246 135 open P_distord.vert; -#X msg 289 160 open P_distord.frag; #X obj 246 86 change -1; #X obj 175 524 change; +#X msg 246 135 open shader/P_distord.vert; +#X msg 289 160 open shader/P_distord.frag; #X connect 0 0 10 0; -#X connect 0 1 23 0; +#X connect 0 1 21 0; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 1 1 13 0; @@ -141,15 +141,15 @@ #X connect 9 0 2 0; #X connect 11 0 0 0; #X connect 14 0 0 0; -#X connect 15 0 22 0; -#X connect 16 0 20 0; -#X connect 16 0 21 0; +#X connect 15 0 20 0; +#X connect 16 0 22 0; +#X connect 16 0 23 0; #X connect 17 0 15 0; #X connect 18 0 19 0; -#X connect 20 0 2 0; -#X connect 21 0 1 0; -#X connect 22 0 16 0; -#X connect 23 0 18 0; +#X connect 20 0 16 0; +#X connect 21 0 18 0; +#X connect 22 0 2 0; +#X connect 23 0 1 0; #X restore 353 78 pd shader2; #N canvas 60 91 589 635 shader3 0; #X obj 94 500 glsl_program; @@ -164,8 +164,8 @@ #X obj 94 66 inlet; #X obj 94 530 outlet; #X obj 464 245 inlet; -#X floatatom 182 179 0 0 0 0 - - -; -#X floatatom 234 377 0 0 0 0 - - -; +#X floatatom 182 179 0 0 0 0 - - - 0; +#X floatatom 234 377 0 0 0 0 - - - 0; #X msg 56 472 print; #X msg 246 65 1; #X obj 246 106 t b; @@ -174,12 +174,12 @@ #X obj 175 571 outlet; #X msg 326 429 MyTex 1; #X msg 336 451 MyTex1 2; -#X msg 247 135 open multitexture.vert; -#X msg 291 160 open multitexture.frag; #X obj 246 86 change -1; #X obj 175 524 change; +#X msg 247 135 open shader/multitexture.vert; +#X msg 292 160 open shader/multitexture.frag; #X connect 0 0 10 0; -#X connect 0 1 25 0; +#X connect 0 1 23 0; #X connect 1 0 0 0; #X connect 1 1 5 0; #X connect 1 1 13 0; @@ -196,19 +196,19 @@ #X connect 9 0 2 0; #X connect 11 0 0 0; #X connect 14 0 0 0; -#X connect 15 0 24 0; -#X connect 16 0 22 0; -#X connect 16 0 23 0; +#X connect 15 0 22 0; +#X connect 16 0 24 0; +#X connect 16 0 25 0; #X connect 17 0 15 0; #X connect 18 0 19 0; #X connect 18 0 20 0; #X connect 18 0 21 0; #X connect 20 0 0 0; #X connect 21 0 0 0; -#X connect 22 0 2 0; -#X connect 23 0 1 0; -#X connect 24 0 16 0; -#X connect 25 0 18 0; +#X connect 22 0 16 0; +#X connect 23 0 18 0; +#X connect 24 0 2 0; +#X connect 25 0 1 0; #X restore 650 79 pd shader3; #X obj 650 54 gemhead 31; #X obj 671 314 gemhead 32; @@ -222,7 +222,7 @@ #X obj 366 115 loadbang; #X msg 366 136 texunit 2; #X msg 141 48 1; -#X floatatom 141 69 5 0 0 0 - - -; +#X floatatom 141 69 5 0 0 0 - - - 0; #X msg 141 88 K1 \$1; #X text 183 69 change effect; #X text 347 1 second input : same as 1st.; @@ -231,7 +231,7 @@ #X text 350 31 put framebuffer in texunit 2; #X text 632 8 finally :; #X text 631 23 shader mixing 2 textures in a framebuffer; -#X floatatom 449 79 5 0 0 0 - - -; +#X floatatom 449 79 5 0 0 0 - - - 0; #X text 491 79 change effect; #X msg 449 98 K \$1; #X msg 449 58 0.1; @@ -246,8 +246,7 @@ #X connect 2 0 1 0; #X restore 99 394 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; diff --git a/examples/10.glsl/09.vertex_texture_fetching.pd b/examples/10.glsl/09.vertex_texture_fetching.pd index d03c0f61d..94b0459b9 100644 --- a/examples/10.glsl/09.vertex_texture_fetching.pd +++ b/examples/10.glsl/09.vertex_texture_fetching.pd @@ -4,12 +4,11 @@ #X obj 576 346 pack 0 0; #X obj 597 326 t b f; #X msg 576 369 link \$1 \$2; -#X floatatom 597 307 2 0 0 0 ID - -; -#X floatatom 576 206 2 0 0 0 ID - -; +#X floatatom 597 307 2 0 0 0 ID - - 0; +#X floatatom 576 206 2 0 0 0 ID - - 0; #X obj 594 390 print linking; #X obj 504 480 pix_texture; -#X obj 540 118 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 540 118 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 28 199 gemhead 1; #X obj 28 311 gemframebuffer; #X obj 28 485 pix_texture; @@ -20,7 +19,7 @@ #X obj 576 183 change; #X obj 597 281 change; #X obj 504 409 glsl_program; -#X floatatom 542 505 5 0 0 0 - - -; +#X floatatom 542 505 5 0 0 0 - - - 0; #X obj 49 231 loadbang; #X obj 44 419 loadbang; #X msg 520 456 quality 0; @@ -33,25 +32,17 @@ #X connect 2 0 3 0; #X connect 3 0 1 0; #X restore 540 93 pd load_glsl; -#X msg 514 231 open fetching.frag; -#X msg 518 142 open fetching.vert; #X obj 504 525 rotateXYZ -30 0 0; #X obj 504 551 scaleXYZ 3 3 1; #X obj 28 388 pix_image img1.jpg; #X msg 46 363 open img2.jpg; #X text 137 11 This patch need a glsl 3 compliant hardware; #X text 26 535 draw an image in a framebuffer; -#X text 49 274 this configuration is very important to have full hardware -support for vertex texture fetching; -#X text 306 603 this example uses the framebuffer image in the vertex -shader in the same way you can do in the pixel shader. This is only -possible in this specific configuration (it's a hardware limitation) -; -#X text 137 56 (nvidia 7000 and 8000 series should work \, ati X1000 -series does not \, but later should); +#X text 49 274 this configuration is very important to have full hardware support for vertex texture fetching; +#X text 306 603 this example uses the framebuffer image in the vertex shader in the same way you can do in the pixel shader. This is only possible in this specific configuration (it's a hardware limitation); +#X text 137 56 (nvidia 7000 and 8000 series should work \, ati X1000 series does not \, but later should); #X obj 504 579 mesh_square 200; -#X text 138 28 As in 2007 \, only good (and new) graphic cards are -able to run this patch.; +#X text 138 28 As in 2007 \, only good (and new) graphic cards are able to run this patch.; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -60,8 +51,7 @@ able to run this patch.; #X connect 1 0 2 0; #X restore 56 77 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -99,11 +89,12 @@ able to run this patch.; #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 26 94 pd gemwin; -#X msg 49 255 rectangle 0 \, type BYTE \, format RGB32 \, dimen 1024 -1024; +#X msg 49 255 rectangle 0 \, type BYTE \, format RGB32 \, dimen 1024 1024; #X msg 44 439 rectangle 0 \, quality 0; #X obj 520 437 loadbang; #X obj 563 7 declare -lib Gem; +#X msg 518 142 open shader/fetching.vert; +#X msg 514 231 open shader/fetching.frag; #X connect 0 0 15 0; #X connect 1 0 3 0; #X connect 2 0 1 0; @@ -112,14 +103,14 @@ able to run this patch.; #X connect 3 0 18 0; #X connect 4 0 2 0; #X connect 5 0 1 0; -#X connect 7 0 26 0; -#X connect 8 0 25 0; -#X connect 8 0 24 0; +#X connect 7 0 24 0; +#X connect 8 0 41 0; +#X connect 8 0 42 0; #X connect 9 0 10 0; #X connect 10 0 12 0; #X connect 10 1 7 1; #X connect 11 0 13 0; -#X connect 12 0 28 0; +#X connect 12 0 26 0; #X connect 14 0 18 0; #X connect 14 1 17 0; #X connect 15 0 14 0; @@ -127,18 +118,18 @@ able to run this patch.; #X connect 16 0 5 0; #X connect 17 0 4 0; #X connect 18 0 7 0; -#X connect 19 0 26 1; -#X connect 20 0 39 0; -#X connect 21 0 40 0; +#X connect 19 0 24 1; +#X connect 20 0 37 0; +#X connect 21 0 38 0; #X connect 22 0 7 0; #X connect 23 0 8 0; -#X connect 24 0 14 0; -#X connect 25 0 15 0; -#X connect 26 0 27 0; -#X connect 27 0 35 0; -#X connect 28 0 11 0; -#X connect 29 0 28 0; -#X connect 37 0 38 0; -#X connect 39 0 10 0; -#X connect 40 0 11 0; -#X connect 41 0 22 0; +#X connect 24 0 25 0; +#X connect 25 0 33 0; +#X connect 26 0 11 0; +#X connect 27 0 26 0; +#X connect 35 0 36 0; +#X connect 37 0 10 0; +#X connect 38 0 11 0; +#X connect 39 0 22 0; +#X connect 41 0 15 0; +#X connect 42 0 14 0; diff --git a/examples/10.glsl/10.GPGPU_Physical_model.pd b/examples/10.glsl/10.GPGPU_Physical_model.pd index 04253b1b0..d4322fb71 100644 --- a/examples/10.glsl/10.GPGPU_Physical_model.pd +++ b/examples/10.glsl/10.GPGPU_Physical_model.pd @@ -1,9 +1,8 @@ -#N struct 1071-xy-pad-knob-1 float x0 float y0 float id; -#N canvas 75 218 764 482 10; +#N struct 1019-xy-pad-knob-1 float x0 float y0 float id; +#N canvas 706 259 764 482 10; #X declare -lib Gem; -#X obj 27 380 hradio 15 1 0 5 empty empty empty 0 -8 0 10 -262144 -1 --1 0; -#X floatatom 185 212 5 0 0 0 - - -; +#X obj 27 380 hradio 15 1 0 5 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0; +#X floatatom 185 212 5 0 0 0 - - - 0; #N canvas 4 106 187 219 fps 0; #X obj 22 62 realtime; #X obj 22 41 t b b; @@ -22,7 +21,7 @@ #X connect 6 0 7 0; #X connect 7 0 3 0; #X restore 185 192 pd fps; -#N canvas 93 66 1183 666 shaders_PM 0; +#N canvas 819 114 1183 666 shaders_PM 0; #X obj 718 34 gemhead; #X obj 718 57 route gem_state; #X obj 718 79 route 1 0; @@ -58,35 +57,34 @@ #X restore 113 378 pd init_shader; #X obj 278 25 inlet; #X obj 113 408 outlet; -#X msg 42 203 open mass.frag; #X obj 32 354 glsl_program; #X obj 32 137 glsl_vertex; -#X msg 42 113 open mass.vert; #X obj 94 74 t b b; #X obj 126 272 pack f f; #X msg 126 296 link \$1 \$2; -#X connect 0 0 15 0; -#X connect 2 0 11 0; +#X msg 42 113 open shader/mass.vert; +#X msg 42 202 open shader/mass.frag; +#X connect 0 0 13 0; +#X connect 2 0 10 0; #X connect 2 1 0 0; -#X connect 3 0 14 0; -#X connect 4 0 12 0; -#X connect 6 0 14 0; +#X connect 3 0 12 0; +#X connect 4 0 11 0; +#X connect 6 0 12 0; #X connect 7 0 9 0; -#X connect 8 0 11 0; -#X connect 10 0 2 0; -#X connect 11 0 5 0; -#X connect 11 1 7 0; -#X connect 12 0 2 0; -#X connect 12 1 15 1; -#X connect 13 0 12 0; +#X connect 8 0 10 0; +#X connect 10 0 5 0; +#X connect 10 1 7 0; +#X connect 11 0 2 0; +#X connect 11 1 13 1; +#X connect 12 0 16 0; +#X connect 12 1 15 0; +#X connect 13 0 14 0; +#X connect 14 0 1 0; #X connect 14 0 10 0; -#X connect 14 1 13 0; -#X connect 15 0 16 0; -#X connect 16 0 1 0; -#X connect 16 0 11 0; +#X connect 15 0 11 0; +#X connect 16 0 2 0; #X restore 24 257 pd shader; -#X obj 53 234 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 53 234 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 506 468 translateXYZ 0 0 -4; #X obj 506 610 square 4; #X obj 261 477 translateXYZ 0 0 -4; @@ -124,8 +122,8 @@ #X obj 94 74 t b b; #X obj 126 272 pack f f; #X msg 126 296 link \$1 \$2; -#X msg 42 113 open link.vert; -#X msg 42 203 open link.frag; +#X msg 42 113 open shader/link.vert; +#X msg 42 203 open shader/link.frag; #X connect 0 0 2 0; #X connect 0 1 4 0; #X connect 1 0 11 0; @@ -146,8 +144,7 @@ #X connect 15 0 11 0; #X connect 16 0 9 0; #X restore 261 256 pd shader; -#X obj 292 231 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 292 231 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 280 539 loadbang; #X obj 119 448 s texture_mass; #X obj 359 444 s texture_link; @@ -165,8 +162,7 @@ #X msg 41 561 rectangle 1 \, quality 0; #X msg 280 560 rectangle 1 \, quality 0; #X obj 615 58 t b b; -#X obj 658 36 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 658 36 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 621 113 s init_shader_link; #X obj 84 233 r shader_mass; #X obj 84 281 s init_shader_mass; @@ -175,17 +171,14 @@ #X obj 261 418 gemframebuffer; #X obj 24 588 pix_texture; #X obj 24 425 gemframebuffer; -#X obj 65 310 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 65 310 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 506 418 gemframebuffer; #X obj 524 513 loadbang; #X msg 524 532 rectangle 1 \, quality 0; #X obj 506 588 pix_texture; #X obj 580 565 r texture_mass; -#X obj 103 260 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X obj 341 251 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 103 260 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 341 251 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 616 79 delay 500; #N canvas 0 0 446 324 init_fb 0; #X msg 100 173 type BYTE; @@ -215,8 +208,7 @@ #X connect 10 1 8 0; #X restore 56 337 pd init_fb; #X obj 24 306 t a b; -#X obj 302 300 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 302 300 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 init_fb 0; #X msg 100 153 type BYTE; #X msg 78 131 format RGB32; @@ -245,8 +237,7 @@ #X connect 10 1 8 0; #X restore 293 327 pd init_fb; #X obj 261 296 t a b; -#X obj 547 298 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 547 298 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 0 0 450 300 init_fb 0; #X msg 100 153 type BYTE; #X msg 78 131 format RGB32; @@ -282,27 +273,24 @@ #X obj 32 90 until; #X obj 44 540 loadbang; #X msg 804 378 init \$1; -#X floatatom 804 360 5 0 1 0 - - -; +#X floatatom 804 360 5 0 1 0 - - - 0; #X obj 762 371 t b; -#X obj 762 254 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 762 254 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 762 407 texture_link 3; #X msg 804 338 1; #X msg 950 229 gravite \$1; -#X floatatom 948 189 5 0 0 0 - - -; -#X floatatom 1012 190 5 0 0 0 - - -; +#X floatatom 948 189 5 0 0 0 - - - 0; +#X floatatom 1012 190 5 0 0 0 - - - 0; #X msg 1012 206 D \$1; #X msg 1063 208 K1 \$1; -#X floatatom 1062 189 5 0 0 0 - - -; +#X floatatom 1062 189 5 0 0 0 - - - 0; #X obj 948 207 / 100; #X obj 950 251 t a; #X obj 950 526 s shader_link; -#X obj 952 90 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 952 90 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 952 70 r init_shader_link; #X obj 950 146 t b; -#X obj 952 127 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 952 127 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 1059 168 0.05; #X msg 950 169 -0.0025; #X msg 1009 170 0.004; @@ -312,7 +300,7 @@ #X obj 762 225 r init_shader_mass; #X obj 804 286 t b; #X msg 992 362 init \$1; -#X floatatom 992 344 5 0 1 0 - - -; +#X floatatom 992 344 5 0 1 0 - - - 0; #X msg 992 322 1; #X obj 1030 298 delay 1000; #X msg 1030 321 0; @@ -449,7 +437,7 @@ #X restore 27 323 pd shaders_PM _________________; #N canvas 267 495 450 300 config 0; #X msg 16 75 W \$1; -#X floatatom 225 101 5 0 0 0 - - -; +#X floatatom 225 101 5 0 0 0 - - - 0; #X msg 225 120 f \$1; #X obj 133 155 t a; #X msg 133 83 N \$1; @@ -560,7 +548,7 @@ #X connect 15 0 14 0; #X restore 27 398 pd render _____________________; #X text 288 6 Made by Cyrille Henry 2008 10 24; -#N canvas 452 305 812 549 shader_render 0; +#N canvas 729 308 812 549 shader_render 0; #X obj 315 429 pix_texture; #X obj 67 256 gemframebuffer; #X obj 67 443 pix_texture; @@ -573,8 +561,7 @@ #X obj 14 53 spigot 1; #X obj 31 81 t b; #X msg 67 31 0; -#X msg 14 104 rectangle 1 \, type BYTE \, format RGB32 \, dim 256 256 -; +#X msg 14 104 rectangle 1 \, type BYTE \, format RGB32 \, dim 256 256; #X connect 1 0 2 0; #X connect 2 0 5 0; #X connect 2 0 3 0; @@ -612,8 +599,8 @@ #X restore 113 288 pd init_shader; #X obj 278 25 inlet; #X obj 113 318 outlet; -#X msg 43 143 open interpol.frag; #X msg 135 265 set -1; +#X msg 43 143 open shader/interpol.frag; #X connect 0 0 7 0; #X connect 0 1 9 0; #X connect 1 0 4 0; @@ -621,28 +608,26 @@ #X connect 3 1 1 0; #X connect 4 0 0 0; #X connect 4 0 2 0; -#X connect 5 0 12 0; +#X connect 5 0 13 0; #X connect 6 0 3 0; -#X connect 8 0 12 0; #X connect 8 0 13 0; +#X connect 8 0 12 0; #X connect 9 0 11 0; #X connect 10 0 0 0; -#X connect 12 0 3 0; -#X connect 13 0 9 0; +#X connect 12 0 9 0; +#X connect 13 0 3 0; #X restore 67 175 pd shader; -#X obj 92 156 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 92 156 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 146 134 t b; #X msg 146 155 texture_mass 1; #N canvas 68 405 301 465 shader 0; #X obj 110 298 pack 0 0; #X obj 131 278 t b f; #X msg 110 321 link \$1 \$2; -#X floatatom 131 259 2 0 0 0 ID - -; -#X floatatom 110 158 2 0 0 0 ID - -; +#X floatatom 131 259 2 0 0 0 ID - - 0; +#X floatatom 110 158 2 0 0 0 ID - - 0; #X obj 128 342 print linking; -#X obj 74 70 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 74 70 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 38 213 glsl_fragment; #X obj 38 116 glsl_vertex; #X obj 110 135 change; @@ -671,9 +656,9 @@ #X connect 3 0 0 0; #X restore 107 399 pd init_shader; #X obj 107 429 outlet; -#X msg 52 94 open fetching2.vert; -#X msg 48 183 open fetching2.frag; #X msg 132 373 set -1; +#X msg 52 94 open shader/fetching2.vert; +#X msg 48 183 open shader/fetching2.frag; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 1 1 0 1; @@ -681,8 +666,8 @@ #X connect 2 0 11 0; #X connect 3 0 1 0; #X connect 4 0 0 0; -#X connect 6 0 19 0; #X connect 6 0 20 0; +#X connect 6 0 21 0; #X connect 7 0 11 0; #X connect 7 1 10 0; #X connect 8 0 7 0; @@ -694,20 +679,17 @@ #X connect 12 0 6 0; #X connect 13 0 8 0; #X connect 15 0 6 0; -#X connect 15 0 21 0; +#X connect 15 0 19 0; #X connect 16 0 11 0; #X connect 17 0 18 0; -#X connect 19 0 8 0; -#X connect 20 0 7 0; -#X connect 21 0 17 0; +#X connect 19 0 17 0; +#X connect 20 0 8 0; +#X connect 21 0 7 0; #X restore 315 208 pd shader; -#X obj 345 185 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 345 185 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 387 229 t b; -#X obj 315 116 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 147 114 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 315 116 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 147 114 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 163 278 s texture_interpol; #X obj 315 96 r aff_drapeau; #X obj 67 102 gemhead 31; @@ -722,7 +704,7 @@ #X msg 521 258 draw line; #X msg 521 238 draw default; #X msg 522 279 draw point; -#X floatatom 485 203 5 0 0 0 - - -; +#X floatatom 485 203 5 0 0 0 - - - 0; #X obj 485 28 inlet; #X obj 327 365 loadbang; #X obj 67 198 t a b; @@ -778,7 +760,7 @@ #X connect 37 0 38 0; #X restore 27 304 pd shader_render ______________; #X text 12 6 "Potential Flag" \, by Samuel Bianchini; -#X floatatom 606 304 5 0 0 0 - - -; +#X floatatom 606 304 5 0 0 0 - - - 0; #X obj 606 324 * 10; #N canvas 30 53 450 300 Gem.init 0; #X obj 26 3 loadbang; @@ -796,8 +778,7 @@ #X connect 5 0 2 0; #X restore 66 188 pd Gem.init; #N canvas 341 104 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -839,9 +820,8 @@ #X connect 19 0 17 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 47 209 pd gemwin 30; -#X floatatom 210 282 5 0 0 0 scale-> #0-scale -; -#X obj 6 325 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X floatatom 210 282 5 0 0 0 scale-> \$0-scale - 0; +#X obj 6 325 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 290 239 395 502 shader_normal 0; #X obj 51 233 gemframebuffer; #X obj 51 347 pix_texture; @@ -854,8 +834,7 @@ #X obj 14 55 spigot 1; #X obj 24 76 b; #X msg 67 31 0; -#X msg 14 114 rectangle 1 \, type BYTE \, format RGB32 \, dim 128 128 -; +#X msg 14 114 rectangle 1 \, type BYTE \, format RGB32 \, dim 128 128; #X connect 1 0 2 0; #X connect 2 0 5 0; #X connect 2 0 3 0; @@ -918,11 +897,9 @@ #X connect 15 0 2 0; #X connect 16 0 12 0; #X restore 51 112 pd shader; -#X obj 76 93 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 76 93 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 143 65 t b; -#X obj 146 45 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 146 45 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 157 252 s texture_normal; #X obj 51 39 gemhead 32; #X obj 78 189 loadbang; @@ -950,8 +927,7 @@ #X connect 15 1 5 0; #X connect 16 0 1 0; #X restore 27 342 pd shader_normal ______________; -#X obj 6 304 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 6 304 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 68 153 767 700 \$0-pad 0; #X msg 158 309 clear; #N canvas 6 50 590 367 clear-all 0; @@ -994,7 +970,7 @@ #X obj 384 156 * 90; #X obj 424 112 + 1; #X obj 424 134 / 2; -#X floatatom 173 241 5 0 0 0 - - -; +#X floatatom 173 241 5 0 0 0 - - - 0; #X obj 424 156 * 90; #X connect 0 0 18 2; #X connect 0 0 7 0; @@ -1036,9 +1012,7 @@ #X obj 520 132 symbol pd-\$0-work; #X obj 405 285 append \$0-xy-pad-knob-1 x0 y0 id; #X obj 23 35 struct \$0-xy-pad-knob-1 float x0 float y0 float id; -#X obj 22 81 filledpolygon id 999 1 x0(0:90)(0:90) y0(0:90)(0:90) x0(0:90)(10:100) -y0(0:90)(0:90) x0(0:90)(10:100) y0(0:90)(10:100) x0(0:90)(0:90) y0(0:90)(10:100) -; +#X obj 22 81 filledpolygon id 999 1 x0(0:90)(0:90) y0(0:90)(0:90) x0(0:90)(10:100) y0(0:90)(0:90) x0(0:90)(10:100) y0(0:90)(10:100) x0(0:90)(0:90) y0(0:90)(10:100); #X msg 405 261 45 45 \$1; #X connect 0 0 1 0; #X connect 1 0 6 3; @@ -1049,8 +1023,7 @@ y0(0:90)(0:90) x0(0:90)(10:100) y0(0:90)(10:100) x0(0:90)(0:90) y0(0:90)(10:100) #X connect 6 0 2 0; #X connect 9 0 6 0; #X restore 72 379 pd add-controller; -#X obj 192 391 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; +#X obj 192 391 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 193 370 1; #X obj 72 303 t f b b; #X text 111 233 5/10 red; @@ -1111,10 +1084,9 @@ y0(0:90)(0:90) x0(0:90)(10:100) y0(0:90)(10:100) x0(0:90)(0:90) y0(0:90)(10:100) #X obj 387 412 pack; #X obj 387 204 t f; #X obj 387 226 clip 0 1; -#X obj 304 74 cnv 10 12 12 empty empty empty 20 12 0 14 -99865 -66577 -0; +#X obj 304 74 cnv 10 12 12 empty empty empty 20 12 0 14 #606060 #404040 0; #N canvas 493 264 450 300 \$0-work 0; -#X scalar 1071-xy-pad-knob-1 45 45 900 \;; +#X scalar 1019-xy-pad-knob-1 62 47 900 \;; #X coords 0 100 100 0 100 100 1; #X restore 260 30 pd \$0-work; #X obj 451 532 wrap; @@ -1184,10 +1156,8 @@ y0(0:90)(0:90) x0(0:90)(10:100) y0(0:90)(10:100) x0(0:90)(0:90) y0(0:90)(10:100) #X connect 51 0 16 0; #X coords 0 -1 1 1 100 100 2 260 30; #X restore 445 290 pd \$0-pad; -#X obj 445 151 vsl 15 128 0 1 0 0 empty \$0-force force 0 -9 0 10 -262144 --1 -1 0 1; -#X obj 538 152 vsl 15 128 0 1 0 0 empty \$0-direction direction 0 -9 -0 10 -262144 -1 -1 0 1; +#X obj 445 151 vsl 15 128 0 1 0 0 empty \$0-force force 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 538 152 vsl 15 128 0 1 0 0 empty \$0-direction direction 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #N canvas 424 571 337 368 wind-control. 0; #X obj 41 82 pack f f; #X msg 41 104 wind \$1 \$2; @@ -1225,13 +1195,8 @@ y0(0:90)(0:90) x0(0:90)(10:100) y0(0:90)(10:100) x0(0:90)(0:90) y0(0:90)(10:100) #X connect 15 0 5 0; #X restore 445 397 pd wind-control.; #X text 28 20 Simple version for Gem examples; -#X text 29 34 Did work under Linux \, with Nvidia driver. I don't know -on other OS/hardware.; -#X text 29 72 This patch is quite huge. the GPU compute the position -of 64x92 masses \, and 64x92x12 links at 50x20 Hz. (about 7e+07 links/sec -\, so about 100 time faster than what is currently possible with MSD -on a CPU) (My GPU is old \, this patch performs 10 to 50 times faster -on a good GPU); +#X text 29 34 Did work under Linux \, with Nvidia driver. I don't know on other OS/hardware.; +#X text 29 72 This patch is quite huge. the GPU compute the position of 64x92 masses \, and 64x92x12 links at 50x20 Hz. (about 7e+07 links/sec \, so about 100 time faster than what is currently possible with MSD on a CPU) (My GPU is old \, this patch performs 10 to 50 times faster on a good GPU); #X obj 606 346 s qqt_noise; #X obj 654 13 declare -lib Gem; #X connect 0 0 5 0; diff --git a/examples/10.glsl/11.geometry.pd b/examples/10.glsl/11.geometry.pd index a11d428ac..443df4d27 100644 --- a/examples/10.glsl/11.geometry.pd +++ b/examples/10.glsl/11.geometry.pd @@ -1,40 +1,33 @@ -#N canvas 197 61 552 632 10; +#N canvas 811 124 552 632 10; #X declare -lib Gem; -#X floatatom 132 447 9 0 0 0 ID - -; -#X floatatom 132 279 9 0 0 0 ID - -; +#X floatatom 132 447 9 0 0 0 ID - - 0; +#X floatatom 132 279 9 0 0 0 ID - - 0; #X obj 150 506 print linking; #X obj 132 465 pack 0 0 0; -#X floatatom 126 364 9 0 0 0 ID - -; +#X floatatom 126 364 9 0 0 0 ID - - 0; #X obj 44 139 gemhead; #X msg 132 485 link \$1 \$2 \$3; #X obj 44 319 glsl_vertex; #X obj 44 403 glsl_fragment; #X obj 44 237 glsl_geometry; #X obj 44 158 alpha; -#X floatatom 122 531 5 0 0 0 - - -; -#X floatatom 164 531 5 0 0 0 - - -; -#X floatatom 209 532 5 0 0 0 - - -; +#X floatatom 122 531 5 0 0 0 - - - 0; +#X floatatom 164 531 5 0 0 0 - - - 0; +#X floatatom 209 532 5 0 0 0 - - - 0; #X obj 44 512 glsl_program; -#X obj 182 156 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 182 156 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 132 258 change; #X obj 126 341 change; #X obj 132 426 change; #X obj 44 552 translateXYZ 0 0 0; #X obj 44 197 colorRGB 1 1 1; -#X floatatom 128 174 5 0 0 0 - - -; +#X floatatom 128 174 5 0 0 0 - - - 0; #X obj 44 177 depth 1; #X obj 44 576 circle; #X text 184 7 geometry shader; -#X text 48 28 The geometry shader is useful to create new geometry -; -#X text 51 47 Here is an example where 40 circles are draw with 1 single -primitive.; -#X text 49 87 Be aware that the geometry shader is computed after the -vertex shader. coordinate are in 2d.; -#X msg 58 217 open geo.geom; -#X msg 56 299 open geo.vert; -#X msg 57 384 open geo.frag; +#X text 48 28 The geometry shader is useful to create new geometry; +#X text 51 47 Here is an example where 40 circles are draw with 1 single primitive.; +#X text 49 87 Be aware that the geometry shader is computed after the vertex shader. coordinate are in 2d.; #X obj 182 136 loadbang; #X text 205 155 load shaders; #N canvas 87 154 247 179 Gem.init 0; @@ -45,8 +38,7 @@ vertex shader. coordinate are in 2d.; #X connect 1 0 2 0; #X restore 366 247 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -87,6 +79,9 @@ vertex shader. coordinate are in 2d.; #X msg 233 206 set -1; #X obj 182 176 t b b b b; #X obj 444 13 declare -lib Gem; +#X msg 58 217 open shader/geo.geom; +#X msg 56 299 open shader/geo.vert; +#X msg 57 384 open shader/geo.frag; #X connect 0 0 3 0; #X connect 1 0 3 2; #X connect 3 0 6 0; @@ -105,7 +100,7 @@ vertex shader. coordinate are in 2d.; #X connect 12 0 19 2; #X connect 13 0 19 3; #X connect 14 0 19 0; -#X connect 15 0 36 0; +#X connect 15 0 33 0; #X connect 16 0 1 0; #X connect 17 0 4 0; #X connect 18 0 0 0; @@ -113,13 +108,13 @@ vertex shader. coordinate are in 2d.; #X connect 20 0 9 0; #X connect 21 0 20 2; #X connect 22 0 20 0; -#X connect 28 0 9 0; -#X connect 29 0 7 0; -#X connect 30 0 8 0; -#X connect 31 0 15 0; -#X connect 33 0 34 0; -#X connect 35 0 18 0; -#X connect 36 0 30 0; -#X connect 36 1 28 0; -#X connect 36 2 29 0; -#X connect 36 3 35 0; +#X connect 28 0 15 0; +#X connect 30 0 31 0; +#X connect 32 0 18 0; +#X connect 33 0 37 0; +#X connect 33 1 35 0; +#X connect 33 2 36 0; +#X connect 33 3 32 0; +#X connect 35 0 9 0; +#X connect 36 0 7 0; +#X connect 37 0 8 0; diff --git a/examples/10.glsl/12.tri2fan.pd b/examples/10.glsl/12.tri2fan.pd index 84ccdf40e..021cded8d 100644 --- a/examples/10.glsl/12.tri2fan.pd +++ b/examples/10.glsl/12.tri2fan.pd @@ -1,21 +1,20 @@ -#N canvas 17 61 785 745 10; +#N canvas 427 37 836 790 10; #X declare -lib Gem; -#X floatatom 286 440 9 0 0 0 ID - -; -#X floatatom 249 264 9 0 0 0 ID - -; +#X floatatom 286 440 9 0 0 0 ID - - 0; +#X floatatom 249 264 9 0 0 0 ID - - 0; #X obj 296 500 print linking; #X obj 286 458 pack 0 0 0; -#X floatatom 244 350 9 0 0 0 ID - -; +#X floatatom 244 350 9 0 0 0 ID - - 0; #X obj 161 78 gemhead; #X msg 286 479 link \$1 \$2 \$3; #X obj 161 151 alpha; -#X floatatom 202 578 5 0 0 0 - - -; -#X floatatom 244 578 5 0 0 0 - - -; -#X floatatom 289 579 5 0 0 0 - - -; +#X floatatom 202 578 5 0 0 0 - - - 0; +#X floatatom 244 578 5 0 0 0 - - - 0; +#X floatatom 289 579 5 0 0 0 - - - 0; #X obj 161 526 glsl_program; #X obj 42 117 t b b b b; #X msg 286 157 -1; -#X obj 42 98 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 42 98 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 249 242 change; #X obj 244 329 change; #X obj 286 419 change; @@ -32,31 +31,27 @@ #X obj 402 654 triangle; #X msg 473 202 lighting 1; #X obj 161 627 spigot 1; -#X obj 230 628 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 470 633 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 230 628 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 470 633 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 402 631 spigot 0; #X msg 460 180 perspec -0.1 0.1 -0.1 0.1 1 110; #X obj 422 229 gemwin; #X obj 460 159 loadbang; #N canvas 5 51 877 520 light 0; #X obj 225 45 gemhead 10; -#X floatatom 258 78 5 0 0 0 - - -; -#X floatatom 299 77 5 0 0 0 - - -; -#X floatatom 341 78 5 0 0 0 - - -; +#X floatatom 258 78 5 0 0 0 - - - 0; +#X floatatom 299 77 5 0 0 0 - - - 0; +#X floatatom 341 78 5 0 0 0 - - - 0; #X obj 225 227 world_light; -#X obj 250 151 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 250 151 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 250 172 debug \$1; #X obj 225 103 rotateXYZ 0 30 0; #X obj 27 51 gemhead 10; -#X floatatom 60 84 5 0 0 0 - - -; -#X floatatom 101 83 5 0 0 0 - - -; -#X floatatom 143 84 5 0 0 0 - - -; +#X floatatom 60 84 5 0 0 0 - - - 0; +#X floatatom 101 83 5 0 0 0 - - - 0; +#X floatatom 143 84 5 0 0 0 - - - 0; #X obj 27 233 world_light; -#X obj 48 158 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 48 158 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 48 179 debug \$1; #X obj 27 109 rotateXYZ 0 -90 0; #X msg 297 207 0.8 0.8 0.8; @@ -82,22 +77,21 @@ #X connect 18 0 16 0; #X restore 421 253 pd light; #X obj 161 595 rotateXYZ -55 20 0; -#X floatatom 298 537 5 0 0 0 - - -; -#X text 235 13 replace triangle with 3 triangles the orientations of -which depend on the normal of the original primitive; +#X floatatom 298 537 5 0 0 0 - - - 0; +#X text 235 13 replace triangle with 3 triangles the orientations of which depend on the normal of the original primitive; #X obj 161 554 scaleXYZ 0.2 0.2 0.2; #X msg 172 129 auto 1; #X obj 172 108 loadbang; -#X msg 176 195 open tri2fan.geom; -#X msg 177 286 open tri2fan.vert; -#X msg 178 370 open tri2fan.frag; #X obj 161 724 newWave 25 25; #X msg 209 671 D1 0.01 \, D2 0.1; -#X floatatom 520 593 5 0 25 0 - - -; +#X floatatom 520 593 5 0 25 0 - - - 0; #X obj 552 635 pack f f; #X obj 520 611 t f f; #X msg 552 655 force \$1 \$2 0.3; #X obj 674 13 declare -lib Gem; +#X msg 176 195 open shader/tri2fan.geom; +#X msg 177 286 open shader/tri2fan.vert; +#X msg 178 370 open shader/tri2fan.frag; #X connect 0 0 3 0; #X connect 1 0 3 2; #X connect 3 0 6 0; @@ -110,19 +104,19 @@ which depend on the normal of the original primitive; #X connect 9 0 38 2; #X connect 10 0 38 3; #X connect 11 0 41 0; -#X connect 12 0 46 0; -#X connect 12 1 45 0; -#X connect 12 2 44 0; +#X connect 12 0 53 0; +#X connect 12 1 52 0; +#X connect 12 2 51 0; #X connect 12 3 13 0; #X connect 13 0 17 0; #X connect 14 0 12 0; #X connect 15 0 1 0; #X connect 16 0 4 0; #X connect 17 0 0 0; -#X connect 18 0 47 0; -#X connect 18 1 47 0; -#X connect 19 0 48 0; -#X connect 20 0 47 3; +#X connect 18 0 44 0; +#X connect 18 1 44 0; +#X connect 19 0 45 0; +#X connect 20 0 44 3; #X connect 21 0 22 0; #X connect 21 1 15 0; #X connect 22 0 23 0; @@ -148,12 +142,12 @@ which depend on the normal of the original primitive; #X connect 41 0 38 0; #X connect 42 0 7 0; #X connect 43 0 42 0; -#X connect 44 0 21 0; -#X connect 45 0 22 0; -#X connect 46 0 23 0; -#X connect 48 0 47 0; -#X connect 49 0 51 0; -#X connect 50 0 52 0; -#X connect 51 0 50 1; -#X connect 51 1 50 0; -#X connect 52 0 47 0; +#X connect 45 0 44 0; +#X connect 46 0 48 0; +#X connect 47 0 49 0; +#X connect 48 0 47 1; +#X connect 48 1 47 0; +#X connect 49 0 44 0; +#X connect 51 0 21 0; +#X connect 52 0 22 0; +#X connect 53 0 23 0; diff --git a/examples/10.glsl/13.panoramique.pd b/examples/10.glsl/13.panoramique.pd index 9b1adb29a..b76783bc3 100644 --- a/examples/10.glsl/13.panoramique.pd +++ b/examples/10.glsl/13.panoramique.pd @@ -1,10 +1,9 @@ -#N canvas 189 90 1107 668 10; +#N canvas 443 115 1107 668 10; #X declare -lib Gem; #X msg 17 131 create \, 1; #X msg 30 154 0 \, destroy; #X obj 160 445 pix_texture; -#X obj 169 205 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 169 205 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 38 51 792 790 glsl 0; #X obj 78 339 glsl_vertex; #X msg 32 338 print; @@ -16,8 +15,8 @@ #X msg 163 579 link \$1 \$2; #X msg 32 620 print; #X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - -; -#X floatatom 150 381 2 0 0 0 ID - -; +#X floatatom 163 535 2 0 0 0 ID - - 0; +#X floatatom 150 381 2 0 0 0 ID - - 0; #X obj 181 600 print linking; #X obj 15 21 inlet; #X obj 78 662 outlet; @@ -34,8 +33,8 @@ #X obj 90 401 t b; #X msg 287 598 0; #X obj 15 65 t b b b; -#X msg 118 307 open panoramique.vert; -#X msg 90 453 open panoramique.frag; +#X msg 118 307 open shader/panoramique.vert; +#X msg 90 453 open shader/panoramique.frag; #X connect 0 0 9 0; #X connect 0 1 6 0; #X connect 1 0 0 0; @@ -80,8 +79,7 @@ #X msg 238 188 sizeX \$1; #X msg 253 209 sizeY \$1; #X obj 353 446 pix_texture; -#X obj 362 206 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 362 206 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 38 51 792 790 glsl 0; #X obj 78 339 glsl_vertex; #X msg 32 338 print; @@ -93,8 +91,8 @@ #X msg 163 579 link \$1 \$2; #X msg 32 620 print; #X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - -; -#X floatatom 150 381 2 0 0 0 ID - -; +#X floatatom 163 535 2 0 0 0 ID - - 0; +#X floatatom 150 381 2 0 0 0 ID - - 0; #X obj 181 600 print linking; #X obj 15 21 inlet; #X obj 78 662 outlet; @@ -111,8 +109,8 @@ #X obj 90 401 t b; #X msg 287 598 0; #X obj 15 65 t b b b; -#X msg 118 307 open panoramique.vert; -#X msg 90 453 open panoramique.frag; +#X msg 118 307 open shader/panoramique.vert; +#X msg 90 453 open shader/panoramique.frag; #X connect 0 0 9 0; #X connect 0 1 6 0; #X connect 1 0 0 0; @@ -157,8 +155,7 @@ #X msg 431 184 sizeX \$1; #X msg 446 210 sizeY \$1; #X obj 552 447 pix_texture; -#X obj 561 207 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 561 207 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 38 51 792 790 glsl 0; #X obj 78 339 glsl_vertex; #X msg 32 338 print; @@ -170,8 +167,8 @@ #X msg 163 579 link \$1 \$2; #X msg 32 620 print; #X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - -; -#X floatatom 150 381 2 0 0 0 ID - -; +#X floatatom 163 535 2 0 0 0 ID - - 0; +#X floatatom 150 381 2 0 0 0 ID - - 0; #X obj 181 600 print linking; #X obj 15 21 inlet; #X obj 78 662 outlet; @@ -188,8 +185,8 @@ #X obj 90 401 t b; #X msg 287 598 0; #X obj 15 65 t b b b; -#X msg 118 307 open panoramique.vert; -#X msg 90 453 open panoramique.frag; +#X msg 118 307 open shader/panoramique.vert; +#X msg 90 453 open shader/panoramique.frag; #X connect 0 0 9 0; #X connect 0 1 6 0; #X connect 1 0 0 0; @@ -237,8 +234,7 @@ #X obj 352 466 translateXYZ -1 0 0; #X obj 551 467 translateXYZ 1 0 0; #X obj 747 448 pix_texture; -#X obj 756 208 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; +#X obj 756 208 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #N canvas 38 51 792 790 glsl 0; #X obj 78 339 glsl_vertex; #X msg 32 338 print; @@ -250,8 +246,8 @@ #X msg 163 579 link \$1 \$2; #X msg 32 620 print; #X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - -; -#X floatatom 150 381 2 0 0 0 ID - -; +#X floatatom 163 535 2 0 0 0 ID - - 0; +#X floatatom 150 381 2 0 0 0 ID - - 0; #X obj 181 600 print linking; #X obj 15 21 inlet; #X obj 78 662 outlet; @@ -268,8 +264,8 @@ #X obj 90 401 t b; #X msg 287 598 0; #X obj 15 65 t b b b; -#X msg 118 307 open panoramique.vert; -#X msg 90 452 open panoramique.frag; +#X msg 118 307 open shader/panoramique.vert; +#X msg 90 452 open shader/panoramique.frag; #X connect 0 0 9 0; #X connect 0 1 6 0; #X connect 1 0 0 0; @@ -314,7 +310,7 @@ #X msg 825 186 sizeX \$1; #X msg 840 212 sizeY \$1; #X obj 746 468 translateXYZ 3 0 0; -#X floatatom 199 108 5 0 0 0 - - -; +#X floatatom 199 108 5 0 0 0 - - - 0; #X msg 199 127 dZ \$1; #X obj 17 470 s shaders; #X obj 206 245 s init_shader; @@ -329,25 +325,17 @@ #X obj 551 548 rectangle 1 0.75; #X obj 746 549 rectangle 1 0.75; #X obj 160 503 translateXYZ 0 0 0; -#X obj 201 486 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 0.12 256; -#X obj 259 486 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 -0.06 256; +#X obj 201 486 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0.12 256; +#X obj 259 486 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.06 256; #X obj 352 505 translateXYZ 0 0 0; -#X obj 393 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 0 256; -#X obj 451 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 0 256; +#X obj 393 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 451 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; #X obj 551 506 translateXYZ 0 0 0; -#X obj 592 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 -0.11 256; -#X obj 650 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 -0.03 256; +#X obj 592 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.11 256; +#X obj 650 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.03 256; #X obj 746 505 translateXYZ 0 0 0; -#X obj 787 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 -0.18 256; -#X obj 845 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 -0.05 256; +#X obj 787 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.18 256; +#X obj 845 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.05 256; #X obj 160 10 gemhead 10; #X obj 353 11 gemhead 20; #X obj 552 12 gemhead 30; @@ -358,17 +346,13 @@ #X obj 747 142 alpha; #X msg 256 153 ShadeL \$1; #X obj 199 65 r init_shader; -#X obj 256 132 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 0 256; +#X obj 256 132 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; #X msg 447 133 ShadeL \$1; -#X obj 447 112 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 39 256; +#X obj 447 112 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 39 256; #X msg 634 135 ShadeL \$1; -#X obj 634 114 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 35 256; +#X obj 634 114 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 35 256; #X msg 831 133 ShadeL \$1; -#X obj 831 112 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 --262144 -1 -1 23 256; +#X obj 831 112 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 23 256; #X msg 212 526 -1; #X msg 269 525 -0.75; #X text 163 526 invert; @@ -387,15 +371,12 @@ #X obj 353 32 scaleXYZ 4 4 1; #X obj 552 36 scaleXYZ 4 4 1; #X obj 747 35 scaleXYZ 4 4 1; -#X text 21 588 This patch allow multiples images to be assembled in -order to create a panoramic image.; -#X text 20 615 A shader distord the image to correct distance distortion -\, and allow a fade between 2 images; +#X text 21 588 This patch allow multiples images to be assembled in order to create a panoramic image.; +#X text 20 615 A shader distord the image to correct distance distortion \, and allow a fade between 2 images; #X text 17 642 "dz" depend on the angles between images.; #X text 462 619 copyright cyrille Henry and iem.; -#X text 463 636 This development was supported by the COMEDIA project -; -#X floatatom 18 394 5 0 0 0 - - -; +#X text 463 636 This development was supported by the COMEDIA project; +#X floatatom 18 394 5 0 0 0 - - - 0; #X msg 18 413 dZ \$1; #X obj 18 351 r init_shader; #X msg 18 373 1.62; diff --git a/examples/10.glsl/15.bicubic_image_interpolation.pd b/examples/10.glsl/15.bicubic_image_interpolation.pd index dd0d6de92..bd19553a5 100644 --- a/examples/10.glsl/15.bicubic_image_interpolation.pd +++ b/examples/10.glsl/15.bicubic_image_interpolation.pd @@ -1,4 +1,4 @@ -#N canvas 22 145 681 529 10; +#N canvas 615 231 681 529 10; #X declare -lib Gem; #X obj 232 189 gemhead; #X obj 232 356 pix_noise 5 5; @@ -6,23 +6,19 @@ #X obj 232 465 square 4; #X msg 240 403 rectangle 1; #X obj 240 382 loadbang; -#X obj 242 222 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X floatatom 250 272 5 0 0 0 - - -; +#X obj 242 222 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X floatatom 250 272 5 0 0 0 - - - 0; #X obj 35 196 gemwin; #X msg 250 334 set \$1 \$2; #X obj 250 314 pack f f; #X obj 303 288 t b f; -#X floatatom 303 271 5 0 0 0 - - -; +#X floatatom 303 271 5 0 0 0 - - - 0; #X msg 35 151 create \, 1; #X msg 42 173 0 \, destroy; -#X obj 232 243 _glsl bicubic_interpolation; #X obj 436 191 gemhead; #X msg 358 408 quality \$1; -#X obj 358 389 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; -#X obj 33 246 vradio 15 1 1 3 empty empty empty 0 -8 0 10 -262144 -1 --1 1; +#X obj 358 389 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 33 246 vradio 15 1 1 3 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 1; #X text 53 246 bicubic interpolation; #X text 53 264 bilinear interpolation; #X text 55 276 no interpolation; @@ -33,17 +29,15 @@ #X obj 436 172 != 0; #X obj 358 369 != 2; #X obj 358 349 r sel_interpolation; -#X text 46 16 This example use shader in order to compute a bicubic -image interpolation. Bicubic interpolation offer a smoother surface -than obtain with bilinear interpolation. But since it need 16 sample -to compute the interpolation \, it is quite slow.; +#X text 46 16 This example use shader in order to compute a bicubic image interpolation. Bicubic interpolation offer a smoother surface than obtain with bilinear interpolation. But since it need 16 sample to compute the interpolation \, it is quite slow.; #X obj 563 7 declare -lib Gem; -#X connect 0 0 15 0; +#X obj 232 243 _glsl shader/bicubic_interpolation; +#X connect 0 0 31 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 4 0 2 0; #X connect 5 0 4 0; -#X connect 6 0 15 0; +#X connect 6 0 31 0; #X connect 7 0 10 0; #X connect 9 0 1 0; #X connect 10 0 9 0; @@ -53,13 +47,13 @@ to compute the interpolation \, it is quite slow.; #X connect 13 0 8 0; #X connect 14 0 8 0; #X connect 15 0 1 0; -#X connect 16 0 1 0; -#X connect 17 0 2 0; -#X connect 18 0 17 0; -#X connect 19 0 23 0; -#X connect 24 0 0 0; -#X connect 25 0 24 0; -#X connect 26 0 27 0; -#X connect 27 0 16 0; -#X connect 28 0 18 0; -#X connect 29 0 28 0; +#X connect 16 0 2 0; +#X connect 17 0 16 0; +#X connect 18 0 22 0; +#X connect 23 0 0 0; +#X connect 24 0 23 0; +#X connect 25 0 26 0; +#X connect 26 0 15 0; +#X connect 27 0 17 0; +#X connect 28 0 27 0; +#X connect 31 0 1 0; diff --git a/examples/10.glsl/16.vertexbuffer_attributes.pd b/examples/10.glsl/16.vertexbuffer_attributes.pd index 563d0978d..19d485213 100644 --- a/examples/10.glsl/16.vertexbuffer_attributes.pd +++ b/examples/10.glsl/16.vertexbuffer_attributes.pd @@ -18,7 +18,7 @@ #X connect 6 0 7 0; #X connect 7 0 5 0; #X restore 806 149 pd fps; -#X floatatom 806 172 5 0 0 1 fps - -; +#X floatatom 806 172 5 0 0 1 fps - - 0; #N canvas 5 76 450 300 gemwin 0; #X obj 132 246 gemwin; #X obj 67 89 outlet; @@ -64,28 +64,20 @@ #X obj 154 399 glsl_program; #X obj 154 673 gemvertexbuffer; #X obj 154 116 gemhead; -#X obj 36 403 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; +#X obj 36 403 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #X msg 36 433 position_enable \$1; #X msg 105 366 print; #X msg 101 278 print; #X msg 103 233 print; -#X obj 246 548 cnv 15 90 40 empty empty empty 20 12 0 14 -204786 -66577 -0; +#X obj 246 548 cnv 15 90 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 255 559 program \$1; -#X obj 30 544 cnv 15 120 70 empty empty empty 20 12 0 14 -204786 -66577 -0; +#X obj 30 544 cnv 15 120 70 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 39 583 print_attributes; #X msg 38 556 reset_attributes; -#X obj 27 487 cnv 15 140 40 empty empty empty 20 12 0 14 -204786 -66577 -0; -#X obj 36 465 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; +#X obj 27 487 cnv 15 140 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X obj 36 465 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #X msg 36 498 attribute_enable \$1; -#X msg 223 475 position \$1_position \, attribute LightPosition \$1_LightPosition -\, attribute BrickColor \$1_BrickColor \, attribute MortarColor \$1_MortarColor -\, attribute BrickSize \$1_BrickSize \, attribute BrickPct \$1_BrickPct -; +#X msg 223 475 position \$1_position \, attribute LightPosition \$1_LightPosition \, attribute BrickColor \$1_BrickColor \, attribute MortarColor \$1_MortarColor \, attribute BrickSize \$1_BrickSize \, attribute BrickPct \$1_BrickPct; #X obj 224 612 loadbang; #X msg 224 629 resize 16 \, draw quad; #X text 378 629 4 quads; @@ -99,29 +91,17 @@ #N canvas 359 182 450 300 tables 0; #N canvas 81 49 460 613 load_tables 0; #X obj 39 17 loadbang; -#X msg 39 106 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 -1 0.5 0.5 0 0.5 0.6 0 0.5 0.6 0 0.5 0.6 0 0.5 0.6 1 1 1 1 1 1 1 1 1 -1 1 1; +#X msg 39 106 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 0 0.5 0.6 0 0.5 0.6 0 0.5 0.6 0 0.5 0.6 1 1 1 1 1 1 1 1 1 1 1 1; #X obj 39 149 s \$0_BrickColor; -#X msg 39 170 0 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 -0.92 0.9 0.92 0.9 0.82 0.7 0.82 0.7 0.82 0.7 0.82 0.7 0.92 0.9 0.92 -0.9 0.92 0.9 0.92 0.9; +#X msg 39 170 0 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.82 0.7 0.82 0.7 0.82 0.7 0.82 0.7 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9; #X obj 39 213 s \$0_BrickPct; -#X msg 39 266 0 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 -0.32 0.2 0.32 0.2 0.92 0.45 0.92 0.45 0.92 0.45 0.92 0.45 0.62 0.2 -0.62 0.2 0.62 0.2 0.62 0.2; +#X msg 39 266 0 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.92 0.45 0.92 0.45 0.92 0.45 0.92 0.45 0.62 0.2 0.62 0.2 0.62 0.2 0.62 0.2; #X obj 39 309 s \$0_BrickSize; -#X msg 39 357 0 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 --3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 3.5 -6 -0.4 3.5 -6 -0.4 3.5 -6 -0.4 -3.5 -6 -0.4 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2; +#X msg 39 357 0 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 3.5 -6 -0.4 3.5 -6 -0.4 3.5 -6 -0.4 3.5 -6 -0.4 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2; #X obj 39 400 s \$0_LightPosition; -#X msg 39 505 0 -3.25 3.25 0 -0.75 3.25 0 -0.75 0.75 0 -3.25 0.75 0 -0.75 3.25 0 3.25 3.25 0 3.25 0.75 0 0.75 0.75 0 0.75 -0.75 0 3.25 -0.75 -0 3.25 -3.25 0 0.75 -3.25 0 -3.25 -0.75 0 -0.75 -0.75 0 -0.75 -3.25 -0 -3.25 -3.25 0; +#X msg 39 505 0 -3.25 3.25 0 -0.75 3.25 0 -0.75 0.75 0 -3.25 0.75 0 0.75 3.25 0 3.25 3.25 0 3.25 0.75 0 0.75 0.75 0 0.75 -0.75 0 3.25 -0.75 0 3.25 -3.25 0 0.75 -3.25 0 -3.25 -0.75 0 -0.75 -0.75 0 -0.75 -3.25 0 -3.25 -3.25 0; #X obj 39 561 s \$0_position; -#X msg 39 437 0 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0; +#X msg 39 437 0 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0; #X obj 39 467 s \$0_MortarColor; #X obj 39 39 t b b b b b b; #X msg 133 15 bang; @@ -148,32 +128,22 @@ #X obj 128 169 table \$0_BrickPct 32; #X restore 754 73 pd tables; #X obj 223 443 list prepend \$0; -#X obj 396 298 cnv 15 90 40 empty empty empty 20 12 0 14 -204786 -66577 -0; -#X obj 396 348 cnv 15 90 40 empty empty empty 20 12 0 14 -204786 -66577 -0; +#X obj 396 298 cnv 15 90 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X obj 396 348 cnv 15 90 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 408 310 attribute LightPosition \$1_LightPosition; #N canvas 268 270 483 439 more 0; #X text 66 43 syntax:; #X text 67 95 adds an attribute to gemvertexbuffer; -#X text 67 127 if the attribute already exists in gemvertexbuffer \, -this message updates the attribute with the array data; +#X text 67 127 if the attribute already exists in gemvertexbuffer \, this message updates the attribute with the array data; #X text 66 60 attribute ; #X text 66 281 attribute tables are interleaved only; -#X text 64 177 if the vert or frag files are changed \, the attributes -in gemvertexbuffer can be reset with a "reset_attributes" msg and re-added -; -#X text 65 236 there is no limit for the amount of attributes that -can be added; -#X text 66 321 in order to set 'uniform' type variables once per vertex -or geo \, they must be changed to attribute/varying type in the vert -and frag files; +#X text 64 177 if the vert or frag files are changed \, the attributes in gemvertexbuffer can be reset with a "reset_attributes" msg and re-added; +#X text 65 236 there is no limit for the amount of attributes that can be added; +#X text 66 321 in order to set 'uniform' type variables once per vertex or geo \, they must be changed to attribute/varying type in the vert and frag files; #X restore 407 359 pd more; #X obj 164 646 t a; #X obj 301 663 print vb; #X msg 246 176 bang; -#X msg 168 207 open ../data/brick.vert; -#X msg 195 234 open ../data/brick.frag; #N canvas 1 51 450 300 modulelist 0; #X obj 81 44 inlet; #X obj 248 55 inlet; @@ -192,14 +162,16 @@ and frag files; #X restore 184 330 pd modulelist; #X msg 272 416 bang; #X obj 753 7 declare -lib Gem; +#X msg 168 207 open ../shader/brick.vert; +#X msg 195 234 open ../shader/brick.frag; #X connect 0 0 1 0; #X connect 2 0 3 0; #X connect 3 0 2 0; #X connect 5 0 35 0; #X connect 6 0 7 0; -#X connect 6 1 47 1; +#X connect 6 1 45 1; #X connect 7 0 9 0; -#X connect 7 1 47 0; +#X connect 7 1 45 0; #X connect 8 0 29 0; #X connect 9 0 10 0; #X connect 9 1 30 0; @@ -217,8 +189,8 @@ and frag files; #X connect 25 0 42 0; #X connect 26 0 27 0; #X connect 27 0 42 0; -#X connect 29 0 45 0; -#X connect 29 1 46 0; +#X connect 29 0 48 0; +#X connect 29 1 49 0; #X connect 30 0 37 0; #X connect 30 1 18 0; #X connect 35 0 9 0; @@ -227,7 +199,7 @@ and frag files; #X connect 42 0 10 0; #X connect 42 0 43 0; #X connect 44 0 29 0; -#X connect 45 0 6 0; -#X connect 46 0 7 0; -#X connect 47 0 5 0; -#X connect 48 0 37 0; +#X connect 45 0 5 0; +#X connect 46 0 37 0; +#X connect 48 0 6 0; +#X connect 49 0 7 0; diff --git a/examples/10.glsl/GLSL_mix.frag b/examples/10.glsl/shader/GLSL_mix.frag similarity index 100% rename from examples/10.glsl/GLSL_mix.frag rename to examples/10.glsl/shader/GLSL_mix.frag diff --git a/examples/10.glsl/GLSL_mix.vert b/examples/10.glsl/shader/GLSL_mix.vert similarity index 100% rename from examples/10.glsl/GLSL_mix.vert rename to examples/10.glsl/shader/GLSL_mix.vert diff --git a/examples/10.glsl/P_distord.frag b/examples/10.glsl/shader/P_distord.frag similarity index 100% rename from examples/10.glsl/P_distord.frag rename to examples/10.glsl/shader/P_distord.frag diff --git a/examples/10.glsl/P_distord.vert b/examples/10.glsl/shader/P_distord.vert similarity index 100% rename from examples/10.glsl/P_distord.vert rename to examples/10.glsl/shader/P_distord.vert diff --git a/examples/10.glsl/T_distord.frag b/examples/10.glsl/shader/T_distord.frag similarity index 100% rename from examples/10.glsl/T_distord.frag rename to examples/10.glsl/shader/T_distord.frag diff --git a/examples/10.glsl/T_distord.vert b/examples/10.glsl/shader/T_distord.vert similarity index 100% rename from examples/10.glsl/T_distord.vert rename to examples/10.glsl/shader/T_distord.vert diff --git a/examples/10.glsl/bicubic_interpolation.frag b/examples/10.glsl/shader/bicubic_interpolation.frag similarity index 100% rename from examples/10.glsl/bicubic_interpolation.frag rename to examples/10.glsl/shader/bicubic_interpolation.frag diff --git a/examples/10.glsl/bicubic_interpolation.vert b/examples/10.glsl/shader/bicubic_interpolation.vert similarity index 100% rename from examples/10.glsl/bicubic_interpolation.vert rename to examples/10.glsl/shader/bicubic_interpolation.vert diff --git a/examples/10.glsl/blur.frag b/examples/10.glsl/shader/blur.frag similarity index 100% rename from examples/10.glsl/blur.frag rename to examples/10.glsl/shader/blur.frag diff --git a/examples/10.glsl/blur.vert b/examples/10.glsl/shader/blur.vert similarity index 100% rename from examples/10.glsl/blur.vert rename to examples/10.glsl/shader/blur.vert diff --git a/examples/data/brick.frag b/examples/10.glsl/shader/brick.frag similarity index 100% rename from examples/data/brick.frag rename to examples/10.glsl/shader/brick.frag diff --git a/examples/data/brick.vert b/examples/10.glsl/shader/brick.vert similarity index 100% rename from examples/data/brick.vert rename to examples/10.glsl/shader/brick.vert diff --git a/examples/10.glsl/fetching.frag b/examples/10.glsl/shader/fetching.frag similarity index 100% rename from examples/10.glsl/fetching.frag rename to examples/10.glsl/shader/fetching.frag diff --git a/examples/10.glsl/fetching.vert b/examples/10.glsl/shader/fetching.vert similarity index 100% rename from examples/10.glsl/fetching.vert rename to examples/10.glsl/shader/fetching.vert diff --git a/examples/10.glsl/fetching2.frag b/examples/10.glsl/shader/fetching2.frag similarity index 100% rename from examples/10.glsl/fetching2.frag rename to examples/10.glsl/shader/fetching2.frag diff --git a/examples/10.glsl/fetching2.vert b/examples/10.glsl/shader/fetching2.vert similarity index 100% rename from examples/10.glsl/fetching2.vert rename to examples/10.glsl/shader/fetching2.vert diff --git a/examples/10.glsl/game.frag b/examples/10.glsl/shader/game.frag similarity index 100% rename from examples/10.glsl/game.frag rename to examples/10.glsl/shader/game.frag diff --git a/examples/10.glsl/game.vert b/examples/10.glsl/shader/game.vert similarity index 100% rename from examples/10.glsl/game.vert rename to examples/10.glsl/shader/game.vert diff --git a/examples/10.glsl/geo.frag b/examples/10.glsl/shader/geo.frag similarity index 100% rename from examples/10.glsl/geo.frag rename to examples/10.glsl/shader/geo.frag diff --git a/examples/10.glsl/geo.geom b/examples/10.glsl/shader/geo.geom similarity index 100% rename from examples/10.glsl/geo.geom rename to examples/10.glsl/shader/geo.geom diff --git a/examples/10.glsl/geo.vert b/examples/10.glsl/shader/geo.vert similarity index 100% rename from examples/10.glsl/geo.vert rename to examples/10.glsl/shader/geo.vert diff --git a/examples/10.glsl/interpol.frag b/examples/10.glsl/shader/interpol.frag similarity index 100% rename from examples/10.glsl/interpol.frag rename to examples/10.glsl/shader/interpol.frag diff --git a/examples/10.glsl/link.frag b/examples/10.glsl/shader/link.frag similarity index 100% rename from examples/10.glsl/link.frag rename to examples/10.glsl/shader/link.frag diff --git a/examples/10.glsl/link.vert b/examples/10.glsl/shader/link.vert similarity index 100% rename from examples/10.glsl/link.vert rename to examples/10.glsl/shader/link.vert diff --git a/examples/10.glsl/mass.frag b/examples/10.glsl/shader/mass.frag similarity index 100% rename from examples/10.glsl/mass.frag rename to examples/10.glsl/shader/mass.frag diff --git a/examples/10.glsl/mass.vert b/examples/10.glsl/shader/mass.vert similarity index 100% rename from examples/10.glsl/mass.vert rename to examples/10.glsl/shader/mass.vert diff --git a/examples/10.glsl/multitexture.frag b/examples/10.glsl/shader/multitexture.frag similarity index 100% rename from examples/10.glsl/multitexture.frag rename to examples/10.glsl/shader/multitexture.frag diff --git a/examples/10.glsl/multitexture.vert b/examples/10.glsl/shader/multitexture.vert similarity index 100% rename from examples/10.glsl/multitexture.vert rename to examples/10.glsl/shader/multitexture.vert diff --git a/examples/10.glsl/multitexture_rect.frag b/examples/10.glsl/shader/multitexture_rect.frag similarity index 100% rename from examples/10.glsl/multitexture_rect.frag rename to examples/10.glsl/shader/multitexture_rect.frag diff --git a/examples/10.glsl/multitexture_rect.vert b/examples/10.glsl/shader/multitexture_rect.vert similarity index 100% rename from examples/10.glsl/multitexture_rect.vert rename to examples/10.glsl/shader/multitexture_rect.vert diff --git a/examples/10.glsl/normal.frag b/examples/10.glsl/shader/normal.frag similarity index 100% rename from examples/10.glsl/normal.frag rename to examples/10.glsl/shader/normal.frag diff --git a/examples/10.glsl/normal.vert b/examples/10.glsl/shader/normal.vert similarity index 100% rename from examples/10.glsl/normal.vert rename to examples/10.glsl/shader/normal.vert diff --git a/examples/10.glsl/panoramique.frag b/examples/10.glsl/shader/panoramique.frag similarity index 100% rename from examples/10.glsl/panoramique.frag rename to examples/10.glsl/shader/panoramique.frag diff --git a/examples/10.glsl/panoramique.vert b/examples/10.glsl/shader/panoramique.vert similarity index 100% rename from examples/10.glsl/panoramique.vert rename to examples/10.glsl/shader/panoramique.vert diff --git a/examples/10.glsl/texture.frag b/examples/10.glsl/shader/texture.frag similarity index 100% rename from examples/10.glsl/texture.frag rename to examples/10.glsl/shader/texture.frag diff --git a/examples/10.glsl/texture.vert b/examples/10.glsl/shader/texture.vert similarity index 100% rename from examples/10.glsl/texture.vert rename to examples/10.glsl/shader/texture.vert diff --git a/examples/10.glsl/texture_rect.frag b/examples/10.glsl/shader/texture_rect.frag similarity index 100% rename from examples/10.glsl/texture_rect.frag rename to examples/10.glsl/shader/texture_rect.frag diff --git a/examples/10.glsl/tri2fan.frag b/examples/10.glsl/shader/tri2fan.frag similarity index 100% rename from examples/10.glsl/tri2fan.frag rename to examples/10.glsl/shader/tri2fan.frag diff --git a/examples/10.glsl/tri2fan.geom b/examples/10.glsl/shader/tri2fan.geom similarity index 100% rename from examples/10.glsl/tri2fan.geom rename to examples/10.glsl/shader/tri2fan.geom diff --git a/examples/10.glsl/tri2fan.vert b/examples/10.glsl/shader/tri2fan.vert similarity index 100% rename from examples/10.glsl/tri2fan.vert rename to examples/10.glsl/shader/tri2fan.vert diff --git a/examples/10.glsl/vague.frag b/examples/10.glsl/shader/vague.frag similarity index 100% rename from examples/10.glsl/vague.frag rename to examples/10.glsl/shader/vague.frag diff --git a/examples/10.glsl/wave.frag b/examples/10.glsl/shader/wave.frag similarity index 100% rename from examples/10.glsl/wave.frag rename to examples/10.glsl/shader/wave.frag diff --git a/examples/10.glsl/single_blur.pd b/examples/10.glsl/single_blur.pd index 76088b796..26345ba31 100644 --- a/examples/10.glsl/single_blur.pd +++ b/examples/10.glsl/single_blur.pd @@ -7,9 +7,7 @@ #X msg 43 264 quality 1 \, rectangle 0; #X obj 43 243 loadbang; #X obj 128 431 outlet; -#X obj 26 195 _glsl blur; -#X obj 47 166 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 --1; +#X obj 47 166 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 248 85 t f f; #X obj 248 17 r blur; #X obj 248 133 pack f f; @@ -25,31 +23,32 @@ #X obj 441 65 * \$2; #X obj 441 41 unpack f f; #X obj 508 65 * \$2; +#X obj 26 195 _glsl shader/blur; #X connect 0 0 3 1; -#X connect 1 0 8 0; +#X connect 1 0 24 0; #X connect 1 1 7 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 5 0 3 0; #X connect 6 0 5 0; -#X connect 8 0 2 0; -#X connect 9 0 8 0; -#X connect 10 0 14 0; -#X connect 10 1 15 0; -#X connect 11 0 18 0; -#X connect 12 0 16 0; -#X connect 13 0 1 0; -#X connect 14 0 12 0; -#X connect 15 0 12 1; -#X connect 16 0 8 1; -#X connect 17 0 1 0; -#X connect 18 0 10 0; -#X connect 18 1 19 0; -#X connect 19 0 14 0; -#X connect 19 1 15 0; -#X connect 20 0 23 0; -#X connect 21 0 16 0; +#X connect 8 0 24 0; +#X connect 9 0 13 0; +#X connect 9 1 14 0; +#X connect 10 0 17 0; +#X connect 11 0 15 0; +#X connect 12 0 1 0; +#X connect 13 0 11 0; +#X connect 14 0 11 1; +#X connect 15 0 24 1; +#X connect 16 0 1 0; +#X connect 17 0 9 0; +#X connect 17 1 18 0; +#X connect 18 0 13 0; +#X connect 18 1 14 0; +#X connect 19 0 22 0; +#X connect 20 0 15 0; +#X connect 21 0 20 0; #X connect 22 0 21 0; -#X connect 23 0 22 0; -#X connect 23 1 24 0; -#X connect 24 0 21 1; +#X connect 22 1 23 0; +#X connect 23 0 20 1; +#X connect 24 0 2 0; From aa2b8ea9b855b9760aefb608fd3d548788535689 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 29 Apr 2024 16:02:01 +0200 Subject: [PATCH 128/387] change the default point size, in order to see somthing in the Gem window. --- help/gemvertexbuffer-help.pd | 78 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/help/gemvertexbuffer-help.pd b/help/gemvertexbuffer-help.pd index 59669d6bf..94fdf9532 100644 --- a/help/gemvertexbuffer-help.pd +++ b/help/gemvertexbuffer-help.pd @@ -39,7 +39,6 @@ #X msg 802 614 draw points; #X msg 692 384 color_enable \$1; #X obj 673 384 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 579 134 GEMglPointSize 1; #X obj 816 638 loadbang; #X obj 579 76 translateXYZ 0 0 -2; #X obj 579 114 rotateXYZ -45 0 -50; @@ -787,45 +786,46 @@ #X restore 469 154 pd startDSP; #X obj 469 96 _gemwin 100; #X obj 579 195 pix_test \; noise 0; +#X obj 579 134 GEMglPointSize 10; #X connect 0 0 1 0; -#X connect 18 0 63 0; -#X connect 19 0 63 0; -#X connect 20 0 63 0; +#X connect 18 0 62 0; +#X connect 19 0 62 0; +#X connect 20 0 62 0; #X connect 21 0 20 0; -#X connect 22 0 86 0; -#X connect 23 0 38 0; -#X connect 24 0 40 0; -#X connect 25 0 22 0; -#X connect 26 0 24 0; -#X connect 28 0 29 0; -#X connect 29 0 63 0; -#X connect 30 0 33 0; -#X connect 31 0 32 0; -#X connect 32 0 63 0; -#X connect 33 0 63 0; -#X connect 34 0 63 0; -#X connect 36 0 26 0; -#X connect 38 0 63 0; -#X connect 39 0 40 1; -#X connect 40 0 25 0; -#X connect 41 0 63 0; -#X connect 42 0 63 0; -#X connect 43 0 63 0; -#X connect 44 0 63 0; -#X connect 45 0 61 0; -#X connect 48 0 47 0; -#X connect 50 0 49 0; -#X connect 52 0 51 0; -#X connect 61 0 41 0; -#X connect 61 1 42 0; -#X connect 61 2 62 0; +#X connect 22 0 37 0; +#X connect 23 0 39 0; +#X connect 24 0 86 0; +#X connect 25 0 23 0; +#X connect 27 0 28 0; +#X connect 28 0 62 0; +#X connect 29 0 32 0; +#X connect 30 0 31 0; +#X connect 31 0 62 0; +#X connect 32 0 62 0; +#X connect 33 0 62 0; +#X connect 35 0 25 0; +#X connect 37 0 62 0; +#X connect 38 0 39 1; +#X connect 39 0 24 0; +#X connect 40 0 62 0; +#X connect 41 0 62 0; +#X connect 42 0 62 0; +#X connect 43 0 62 0; +#X connect 44 0 60 0; +#X connect 47 0 46 0; +#X connect 49 0 48 0; +#X connect 51 0 50 0; +#X connect 60 0 40 0; +#X connect 60 1 41 0; +#X connect 60 2 61 0; +#X connect 63 0 62 0; #X connect 64 0 63 0; #X connect 65 0 64 0; -#X connect 66 0 65 0; -#X connect 67 0 68 0; -#X connect 68 0 65 0; -#X connect 68 1 65 1; -#X connect 73 0 22 1; -#X connect 74 0 25 3; -#X connect 85 0 84 0; -#X connect 86 0 34 0; +#X connect 66 0 67 0; +#X connect 67 0 64 0; +#X connect 67 1 64 1; +#X connect 72 0 86 1; +#X connect 73 0 24 3; +#X connect 84 0 83 0; +#X connect 85 0 33 0; +#X connect 86 0 85 0; From 5dc2713cf3de5fe5559e90c240c435dee74bcd00 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 29 Apr 2024 16:11:34 +0200 Subject: [PATCH 129/387] debug the shader path --- examples/10.glsl/10.GPGPU_Physical_model.pd | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/10.glsl/10.GPGPU_Physical_model.pd b/examples/10.glsl/10.GPGPU_Physical_model.pd index d4322fb71..859964da1 100644 --- a/examples/10.glsl/10.GPGPU_Physical_model.pd +++ b/examples/10.glsl/10.GPGPU_Physical_model.pd @@ -1,5 +1,5 @@ -#N struct 1019-xy-pad-knob-1 float x0 float y0 float id; -#N canvas 706 259 764 482 10; +#N struct 1003-xy-pad-knob-1 float x0 float y0 float id; +#N canvas 1044 250 764 482 10; #X declare -lib Gem; #X obj 27 380 hradio 15 1 0 5 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0; #X floatatom 185 212 5 0 0 0 - - - 0; @@ -871,31 +871,31 @@ #X restore 113 498 pd init_shader; #X obj 278 25 inlet; #X obj 113 528 outlet; -#X msg 43 313 open normal.frag; #X obj 32 185 glsl_vertex; #X obj 96 122 t b b; #X obj 126 393 pack f f; #X msg 126 418 link \$1 \$2; -#X msg 42 161 open normal.vert; +#X msg 43 313 open shader/normal.frag; +#X msg 42 161 open shader/normal.vert; #X connect 0 0 6 0; #X connect 0 1 8 0; -#X connect 1 0 14 0; +#X connect 1 0 13 0; #X connect 3 0 0 0; #X connect 3 1 1 0; -#X connect 4 0 13 0; -#X connect 5 0 12 0; -#X connect 7 0 13 0; +#X connect 4 0 12 0; +#X connect 5 0 11 0; +#X connect 7 0 12 0; #X connect 8 0 10 0; #X connect 9 0 0 0; #X connect 11 0 3 0; -#X connect 12 0 3 0; -#X connect 12 1 14 1; -#X connect 13 0 11 0; -#X connect 13 1 16 0; -#X connect 14 0 15 0; -#X connect 15 0 0 0; -#X connect 15 0 2 0; -#X connect 16 0 12 0; +#X connect 11 1 13 1; +#X connect 12 0 15 0; +#X connect 12 1 16 0; +#X connect 13 0 14 0; +#X connect 14 0 0 0; +#X connect 14 0 2 0; +#X connect 15 0 3 0; +#X connect 16 0 11 0; #X restore 51 112 pd shader; #X obj 76 93 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 143 65 t b; @@ -1086,7 +1086,7 @@ #X obj 387 226 clip 0 1; #X obj 304 74 cnv 10 12 12 empty empty empty 20 12 0 14 #606060 #404040 0; #N canvas 493 264 450 300 \$0-work 0; -#X scalar 1019-xy-pad-knob-1 62 47 900 \;; +#X scalar 1003-xy-pad-knob-1 52.0866 45 900 \;; #X coords 0 100 100 0 100 100 1; #X restore 260 30 pd \$0-work; #X obj 451 532 wrap; From 9583e8380b742ce5c57dc28b3458aa6f14a125e6 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 29 Apr 2024 16:11:54 +0200 Subject: [PATCH 130/387] adding new openGL4 examples --- examples/15.GLSL4/01.basic.pd | 148 ++++++++++++++++++++++++++++ examples/15.GLSL4/shader/basic.frag | 15 +++ examples/15.GLSL4/shader/basic.vert | 23 +++++ 3 files changed, 186 insertions(+) create mode 100644 examples/15.GLSL4/01.basic.pd create mode 100644 examples/15.GLSL4/shader/basic.frag create mode 100644 examples/15.GLSL4/shader/basic.vert diff --git a/examples/15.GLSL4/01.basic.pd b/examples/15.GLSL4/01.basic.pd new file mode 100644 index 000000000..13073f681 --- /dev/null +++ b/examples/15.GLSL4/01.basic.pd @@ -0,0 +1,148 @@ +#N canvas 493 260 713 709 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 46 161 pd fps; +#X floatatom 46 184 5 0 0 1 fps - - 0; +#X msg 267 275 link \$1 \$2; +#X obj 187 189 glsl_vertex; +#X obj 187 232 glsl_fragment; +#X obj 201 45 loadbang; +#X obj 187 324 glsl_program; +#X obj 187 638 gemvertexbuffer; +#X obj 187 14 gemhead; +#X msg 283 454 program \$1; +#X obj 293 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 301 490 print_attributes; +#X obj 291 538 loadbang; +#X obj 256 346 t b f; +#X text 367 454 <----- essential for lookup functions; +#X obj 294 320 print linking; +#X obj 267 297 t a a; +#N canvas 740 678 450 300 tables 0; +#N canvas 1004 146 460 613 load_tables 0; +#X obj 39 17 loadbang; +#X msg 133 15 bang; +#X obj 39 89 s \$0_position; +#X obj 54 138 s \$0_color; +#X obj 39 39 t b b; +#X msg 54 115 0 1 0 0 0 1 0 0 0 1; +#X msg 39 66 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; +#X connect 0 0 4 0; +#X connect 1 0 4 0; +#X connect 4 0 6 0; +#X connect 4 1 5 0; +#X connect 5 0 3 0; +#X connect 6 0 2 0; +#X restore 129 244 pd load_tables; +#X obj 129 66 table \$0_position 9; +#X obj 129 87 table \$0_color 9; +#X restore 43 128 pd tables; +#X obj 250 610 print vb; +#X msg 305 341 bang; +#X obj 44 9 declare -lib Gem; +#X obj 267 255 pack f f; +#X msg 291 559 resize 9 \, draw tri; +#X obj 256 368 f \$0; +#X msg 256 400 attribute position \$1_position \, attribute color \$1_color; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X msg 201 72 symbol shader/basic; +#X obj 201 104 t a a; +#X msg 232 130 open \$1.vert; +#X msg 235 159 open \$1.frag; +#X obj 223 586 t a a; +#X connect 0 0 1 0; +#X connect 2 0 16 0; +#X connect 3 0 4 0; +#X connect 3 1 21 1; +#X connect 4 0 6 0; +#X connect 4 1 21 0; +#X connect 5 0 26 0; +#X connect 6 0 7 0; +#X connect 6 1 13 0; +#X connect 8 0 3 0; +#X connect 9 0 30 0; +#X connect 11 0 30 0; +#X connect 12 0 22 0; +#X connect 13 0 23 0; +#X connect 13 1 9 0; +#X connect 16 0 6 0; +#X connect 16 1 15 0; +#X connect 19 0 23 0; +#X connect 21 0 2 0; +#X connect 22 0 30 0; +#X connect 23 0 24 0; +#X connect 24 0 30 0; +#X connect 26 0 27 0; +#X connect 27 0 29 0; +#X connect 27 1 28 0; +#X connect 28 0 3 0; +#X connect 29 0 4 0; +#X connect 30 0 7 0; +#X connect 30 1 18 0; diff --git a/examples/15.GLSL4/shader/basic.frag b/examples/15.GLSL4/shader/basic.frag new file mode 100644 index 000000000..e31928d35 --- /dev/null +++ b/examples/15.GLSL4/shader/basic.frag @@ -0,0 +1,15 @@ +#version 460 + +// This is the fragment shader : it is executed for every pixel to display +// Cyrille Henry 2024 + +in vec3 Color_to_frag; +// the variable commint from the VBO + +out vec4 FragColor; +// The only output of this shader : the color of the pixel + +void main() { + FragColor = vec4(Color_to_frag, 1.0); + // the Color_to_frag variable is already interpolated. +} diff --git a/examples/15.GLSL4/shader/basic.vert b/examples/15.GLSL4/shader/basic.vert new file mode 100644 index 000000000..25aa6b432 --- /dev/null +++ b/examples/15.GLSL4/shader/basic.vert @@ -0,0 +1,23 @@ +#version 460 + +//simple test shader +// Cyrille Henry 2024 +// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. + +layout (location=0) in vec3 position; +layout (location=1) in vec3 color; +// declare the mandatory input : we need 2 attributes named position and color from the VBO +// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) + +out vec3 Color_to_frag; +// the output of this shader is only a color. +// This variable will be interpolated between all vertices + +void main() +{ + Color_to_frag = color; + // initialise the variable to pass to the frag shader with data comming from the VBO + + gl_Position = vec4(position,1.0); // update vertex position from the VBO + // No perspective is apply in this example +} From 963c80dc669171ce30328638315c2e7d5d74b794 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 29 Apr 2024 16:14:32 +0200 Subject: [PATCH 131/387] debug shader path --- examples/10.glsl/16.vertexbuffer_attributes.pd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/10.glsl/16.vertexbuffer_attributes.pd b/examples/10.glsl/16.vertexbuffer_attributes.pd index 19d485213..64e9d58a8 100644 --- a/examples/10.glsl/16.vertexbuffer_attributes.pd +++ b/examples/10.glsl/16.vertexbuffer_attributes.pd @@ -1,4 +1,4 @@ -#N canvas 375 67 860 713 10; +#N canvas 804 152 860 713 10; #X declare -lib Gem; #N canvas 1 89 450 300 fps 0; #X obj 46 -61 gemhead; @@ -55,7 +55,7 @@ #X connect 13 1 12 0; #X connect 14 0 15 0; #X restore 577 115 pd gemwin; -#X msg 577 96 create; +#X msg 577 96 destroy; #X text 573 75 Create window:; #X msg 184 350 link \$1 \$2; #X obj 154 264 glsl_vertex; @@ -162,8 +162,8 @@ #X restore 184 330 pd modulelist; #X msg 272 416 bang; #X obj 753 7 declare -lib Gem; -#X msg 168 207 open ../shader/brick.vert; -#X msg 195 234 open ../shader/brick.frag; +#X msg 168 207 open shader/brick.vert; +#X msg 195 234 open shader/brick.frag; #X connect 0 0 1 0; #X connect 2 0 3 0; #X connect 3 0 2 0; From f0eaac8dc6a2899482a76b4c484c5d694441237f Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 08:42:16 +0200 Subject: [PATCH 132/387] change the error message to reflet the arguments need by atribute message --- src/Geos/gemvertexbuffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Geos/gemvertexbuffer.cpp b/src/Geos/gemvertexbuffer.cpp index dc554065a..9368dc32c 100644 --- a/src/Geos/gemvertexbuffer.cpp +++ b/src/Geos/gemvertexbuffer.cpp @@ -563,7 +563,7 @@ void gemvertexbuffer :: attribute(t_symbol*s, int argc, t_atom *argv) if((argc!=2 && argc!=3) || (argv[0].a_type!=A_SYMBOL || argv[1].a_type!=A_SYMBOL)) { - error("illegal arguments to 'attribute': must be
[]"); + error("illegal arguments to 'attribute': must be
[]"); return; } if(argc==3) { @@ -571,7 +571,7 @@ void gemvertexbuffer :: attribute(t_symbol*s, int argc, t_atom *argv) tab_offset=atom_getfloat(argv+2); resize=false; } else { - error("illegal arguments to 'attribute': must be
[]"); + error("illegal arguments to 'attribute': must be
[]"); return; } } From 55f134c563f93bf0504ce77a382696520c7d4342 Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 09:35:36 +0200 Subject: [PATCH 133/387] add sources --- examples/15.GLSL4/shader/basic.frag | 6 ++++-- examples/15.GLSL4/shader/basic.vert | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/15.GLSL4/shader/basic.frag b/examples/15.GLSL4/shader/basic.frag index e31928d35..eb2e69bb1 100644 --- a/examples/15.GLSL4/shader/basic.frag +++ b/examples/15.GLSL4/shader/basic.frag @@ -1,7 +1,9 @@ #version 460 -// This is the fragment shader : it is executed for every pixel to display // Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the fragment shader : it is executed for every pixel to display in vec3 Color_to_frag; // the variable commint from the VBO @@ -11,5 +13,5 @@ out vec4 FragColor; void main() { FragColor = vec4(Color_to_frag, 1.0); - // the Color_to_frag variable is already interpolated. + // the "Color_to_frag" variable is already interpolated between the 2 shaders. } diff --git a/examples/15.GLSL4/shader/basic.vert b/examples/15.GLSL4/shader/basic.vert index 25aa6b432..547eacee0 100644 --- a/examples/15.GLSL4/shader/basic.vert +++ b/examples/15.GLSL4/shader/basic.vert @@ -2,6 +2,8 @@ //simple test shader // Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + // This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. layout (location=0) in vec3 position; From 1c82b8a239e9ffbc0060fea69d85f5fe3be91676 Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 09:38:30 +0200 Subject: [PATCH 134/387] tidy up --- examples/15.GLSL4/01.basic.pd | 125 ++++++++++++++++------------------ 1 file changed, 59 insertions(+), 66 deletions(-) diff --git a/examples/15.GLSL4/01.basic.pd b/examples/15.GLSL4/01.basic.pd index 13073f681..32613e3e0 100644 --- a/examples/15.GLSL4/01.basic.pd +++ b/examples/15.GLSL4/01.basic.pd @@ -30,49 +30,30 @@ #X connect 6 0 8 0; #X connect 7 0 5 0; #X connect 8 0 7 0; -#X restore 46 161 pd fps; -#X floatatom 46 184 5 0 0 1 fps - - 0; -#X msg 267 275 link \$1 \$2; -#X obj 187 189 glsl_vertex; -#X obj 187 232 glsl_fragment; -#X obj 201 45 loadbang; -#X obj 187 324 glsl_program; -#X obj 187 638 gemvertexbuffer; -#X obj 187 14 gemhead; -#X msg 283 454 program \$1; -#X obj 293 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 301 490 print_attributes; -#X obj 291 538 loadbang; -#X obj 256 346 t b f; -#X text 367 454 <----- essential for lookup functions; -#X obj 294 320 print linking; -#X obj 267 297 t a a; -#N canvas 740 678 450 300 tables 0; -#N canvas 1004 146 460 613 load_tables 0; -#X obj 39 17 loadbang; -#X msg 133 15 bang; -#X obj 39 89 s \$0_position; -#X obj 54 138 s \$0_color; -#X obj 39 39 t b b; -#X msg 54 115 0 1 0 0 0 1 0 0 0 1; -#X msg 39 66 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; -#X connect 0 0 4 0; -#X connect 1 0 4 0; -#X connect 4 0 6 0; -#X connect 4 1 5 0; -#X connect 5 0 3 0; -#X connect 6 0 2 0; -#X restore 129 244 pd load_tables; -#X obj 129 66 table \$0_position 9; -#X obj 129 87 table \$0_color 9; -#X restore 43 128 pd tables; -#X obj 250 610 print vb; -#X msg 305 341 bang; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X msg 347 275 link \$1 \$2; +#X obj 267 189 glsl_vertex; +#X obj 267 232 glsl_fragment; +#X obj 281 45 loadbang; +#X obj 267 324 glsl_program; +#X obj 267 638 gemvertexbuffer; +#X obj 267 14 gemhead; +#X msg 363 454 program \$1; +#X obj 373 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 381 490 print_attributes; +#X obj 371 538 loadbang; +#X obj 336 346 t b f; +#X text 447 454 <----- essential for lookup functions; +#X obj 374 320 print linking; +#X obj 347 297 t a a; +#X obj 330 610 print vb; +#X msg 385 341 bang; #X obj 44 9 declare -lib Gem; -#X obj 267 255 pack f f; -#X msg 291 559 resize 9 \, draw tri; -#X obj 256 368 f \$0; -#X msg 256 400 attribute position \$1_position \, attribute color \$1_color; +#X obj 347 255 pack f f; +#X msg 371 559 resize 9 \, draw tri; +#X obj 336 368 f \$0; +#X msg 336 400 attribute position \$1_position \, attribute color \$1_color; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -112,37 +93,49 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X msg 201 72 symbol shader/basic; -#X obj 201 104 t a a; -#X msg 232 130 open \$1.vert; -#X msg 235 159 open \$1.frag; -#X obj 223 586 t a a; +#X msg 281 72 symbol shader/basic; +#X obj 281 104 t a a; +#X msg 312 130 open \$1.vert; +#X msg 315 159 open \$1.frag; +#X obj 303 586 t a a; +#X obj 40 175 table \$0_position 9; +#X obj 40 196 table \$0_color 9; +#X obj 41 235 loadbang; +#X obj 41 283 s \$0_position; +#X obj 40 364 s \$0_color; +#X msg 40 341 0 1 0 0 0 1 0 0 0 1; +#X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; +#X obj 40 317 loadbang; #X connect 0 0 1 0; #X connect 2 0 16 0; #X connect 3 0 4 0; -#X connect 3 1 21 1; +#X connect 3 1 20 1; #X connect 4 0 6 0; -#X connect 4 1 21 0; -#X connect 5 0 26 0; +#X connect 4 1 20 0; +#X connect 5 0 25 0; #X connect 6 0 7 0; #X connect 6 1 13 0; #X connect 8 0 3 0; -#X connect 9 0 30 0; -#X connect 11 0 30 0; -#X connect 12 0 22 0; -#X connect 13 0 23 0; +#X connect 9 0 29 0; +#X connect 11 0 29 0; +#X connect 12 0 21 0; +#X connect 13 0 22 0; #X connect 13 1 9 0; #X connect 16 0 6 0; #X connect 16 1 15 0; -#X connect 19 0 23 0; -#X connect 21 0 2 0; -#X connect 22 0 30 0; -#X connect 23 0 24 0; -#X connect 24 0 30 0; -#X connect 26 0 27 0; -#X connect 27 0 29 0; -#X connect 27 1 28 0; -#X connect 28 0 3 0; -#X connect 29 0 4 0; -#X connect 30 0 7 0; -#X connect 30 1 18 0; +#X connect 18 0 22 0; +#X connect 20 0 2 0; +#X connect 21 0 29 0; +#X connect 22 0 23 0; +#X connect 23 0 29 0; +#X connect 25 0 26 0; +#X connect 26 0 28 0; +#X connect 26 1 27 0; +#X connect 27 0 3 0; +#X connect 28 0 4 0; +#X connect 29 0 7 0; +#X connect 29 1 17 0; +#X connect 32 0 36 0; +#X connect 35 0 34 0; +#X connect 36 0 33 0; +#X connect 37 0 35 0; From 157d65e4b6e8ae3ccb9a9c13714431412b273fcb Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 10:08:53 +0200 Subject: [PATCH 135/387] rename the shader --- examples/15.GLSL4/01.basic.pd | 34 +++++++++---------- .../shader/{basic.frag => 01.basic.frag} | 0 .../shader/{basic.vert => 01.basic.vert} | 0 3 files changed, 17 insertions(+), 17 deletions(-) rename examples/15.GLSL4/shader/{basic.frag => 01.basic.frag} (100%) rename examples/15.GLSL4/shader/{basic.vert => 01.basic.vert} (100%) diff --git a/examples/15.GLSL4/01.basic.pd b/examples/15.GLSL4/01.basic.pd index 32613e3e0..fd9694e5b 100644 --- a/examples/15.GLSL4/01.basic.pd +++ b/examples/15.GLSL4/01.basic.pd @@ -93,7 +93,6 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X msg 281 72 symbol shader/basic; #X obj 281 104 t a a; #X msg 312 130 open \$1.vert; #X msg 315 159 open \$1.frag; @@ -106,18 +105,19 @@ #X msg 40 341 0 1 0 0 0 1 0 0 0 1; #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; +#X msg 281 72 symbol shader/01.basic; #X connect 0 0 1 0; #X connect 2 0 16 0; #X connect 3 0 4 0; #X connect 3 1 20 1; #X connect 4 0 6 0; #X connect 4 1 20 0; -#X connect 5 0 25 0; +#X connect 5 0 37 0; #X connect 6 0 7 0; #X connect 6 1 13 0; #X connect 8 0 3 0; -#X connect 9 0 29 0; -#X connect 11 0 29 0; +#X connect 9 0 28 0; +#X connect 11 0 28 0; #X connect 12 0 21 0; #X connect 13 0 22 0; #X connect 13 1 9 0; @@ -125,17 +125,17 @@ #X connect 16 1 15 0; #X connect 18 0 22 0; #X connect 20 0 2 0; -#X connect 21 0 29 0; +#X connect 21 0 28 0; #X connect 22 0 23 0; -#X connect 23 0 29 0; -#X connect 25 0 26 0; -#X connect 26 0 28 0; -#X connect 26 1 27 0; -#X connect 27 0 3 0; -#X connect 28 0 4 0; -#X connect 29 0 7 0; -#X connect 29 1 17 0; -#X connect 32 0 36 0; -#X connect 35 0 34 0; -#X connect 36 0 33 0; -#X connect 37 0 35 0; +#X connect 23 0 28 0; +#X connect 25 0 27 0; +#X connect 25 1 26 0; +#X connect 26 0 3 0; +#X connect 27 0 4 0; +#X connect 28 0 7 0; +#X connect 28 1 17 0; +#X connect 31 0 35 0; +#X connect 34 0 33 0; +#X connect 35 0 32 0; +#X connect 36 0 34 0; +#X connect 37 0 25 0; diff --git a/examples/15.GLSL4/shader/basic.frag b/examples/15.GLSL4/shader/01.basic.frag similarity index 100% rename from examples/15.GLSL4/shader/basic.frag rename to examples/15.GLSL4/shader/01.basic.frag diff --git a/examples/15.GLSL4/shader/basic.vert b/examples/15.GLSL4/shader/01.basic.vert similarity index 100% rename from examples/15.GLSL4/shader/basic.vert rename to examples/15.GLSL4/shader/01.basic.vert From 39fd23783029746748a46b24d897c61ff31475ab Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 10:09:12 +0200 Subject: [PATCH 136/387] transformation matrix new axample --- examples/15.GLSL4/02.transformation.pd | 201 ++++++++++++++++++ .../15.GLSL4/shader/02.transformation.frag | 17 ++ .../15.GLSL4/shader/02.transformation.vert | 32 +++ 3 files changed, 250 insertions(+) create mode 100644 examples/15.GLSL4/02.transformation.pd create mode 100644 examples/15.GLSL4/shader/02.transformation.frag create mode 100644 examples/15.GLSL4/shader/02.transformation.vert diff --git a/examples/15.GLSL4/02.transformation.pd b/examples/15.GLSL4/02.transformation.pd new file mode 100644 index 000000000..cd0f93f4e --- /dev/null +++ b/examples/15.GLSL4/02.transformation.pd @@ -0,0 +1,201 @@ +#N canvas 554 237 989 704 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X msg 347 275 link \$1 \$2; +#X obj 267 189 glsl_vertex; +#X obj 267 232 glsl_fragment; +#X obj 281 45 loadbang; +#X obj 267 324 glsl_program; +#X obj 267 638 gemvertexbuffer; +#X obj 267 14 gemhead; +#X msg 363 454 program \$1; +#X obj 373 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 381 490 print_attributes; +#X obj 371 538 loadbang; +#X obj 336 346 t b f; +#X text 447 454 <----- essential for lookup functions; +#X obj 374 320 print linking; +#X obj 347 297 t a a; +#X obj 330 610 print vb; +#X msg 385 341 bang; +#X obj 44 9 declare -lib Gem; +#X obj 347 255 pack f f; +#X msg 371 559 resize 9 \, draw tri; +#X obj 336 368 f \$0; +#X msg 336 400 attribute position \$1_position \, attribute color \$1_color; +#N canvas 171 609 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 281 104 t a a; +#X msg 312 130 open \$1.vert; +#X msg 315 159 open \$1.frag; +#X obj 303 586 t a a; +#X obj 40 175 table \$0_position 9; +#X obj 40 196 table \$0_color 9; +#X obj 41 235 loadbang; +#X obj 41 283 s \$0_position; +#X obj 40 364 s \$0_color; +#X msg 40 341 0 1 0 0 0 1 0 0 0 1; +#X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; +#X obj 40 317 loadbang; +#X msg 281 72 symbol shader/02.transformation; +#X obj 626 18 gemhead; +#X floatatom 661 50 5 0 0 0 - - - 0; +#X floatatom 696 50 5 0 0 0 - - - 0; +#X floatatom 731 50 5 0 0 0 - - - 0; +#X floatatom 642 193 5 0 0 0 - - - 0; +#X floatatom 676 193 5 0 0 0 - - - 0; +#X floatatom 710 193 5 0 0 0 - - - 0; +#X floatatom 640 99 5 0 0 0 - - - 0; +#X floatatom 674 99 5 0 0 0 - - - 0; +#X floatatom 708 99 5 0 0 0 - - - 0; +#N canvas 437 191 753 491 shear 0; +#X obj 25 17 inlet; +#X obj 28 270 outlet; +#X obj 108 21 inlet; +#X obj 205 20 inlet; +#X obj 297 18 inlet; +#X text 117 38 ShearXY; +#X text 217 37 ShearXZ; +#X text 306 36 ShearYZ; +#X obj 27 104 shearXY; +#X obj 26 153 shearXZ; +#X obj 26 212 shearYZ; +#X connect 0 0 8 0; +#X connect 2 0 8 1; +#X connect 3 0 9 1; +#X connect 4 0 10 1; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 1 0; +#X restore 626 166 pd shear; +#X obj 626 214 rotateXYZ; +#X obj 626 118 scaleXYZ; +#X floatatom 640 145 5 0 0 0 - - - 0; +#X floatatom 674 145 5 0 0 0 - - - 0; +#X floatatom 708 145 5 0 0 0 - - - 0; +#X obj 626 239 gemlist_matrix; +#X obj 707 266 list prepend transformation_matrix; +#X obj 707 288 list trim; +#X obj 626 73 translateXYZ 0 0 4; +#X text 565 618 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; +#X connect 0 0 1 0; +#X connect 2 0 16 0; +#X connect 3 0 4 0; +#X connect 3 1 20 1; +#X connect 4 0 6 0; +#X connect 4 1 20 0; +#X connect 5 0 37 0; +#X connect 6 0 7 0; +#X connect 6 1 13 0; +#X connect 8 0 3 0; +#X connect 9 0 28 0; +#X connect 11 0 28 0; +#X connect 12 0 21 0; +#X connect 13 0 22 0; +#X connect 13 1 9 0; +#X connect 16 0 6 0; +#X connect 16 1 15 0; +#X connect 18 0 22 0; +#X connect 20 0 2 0; +#X connect 21 0 28 0; +#X connect 22 0 23 0; +#X connect 23 0 28 0; +#X connect 25 0 27 0; +#X connect 25 1 26 0; +#X connect 26 0 3 0; +#X connect 27 0 4 0; +#X connect 28 0 7 0; +#X connect 28 1 17 0; +#X connect 31 0 35 0; +#X connect 34 0 33 0; +#X connect 35 0 32 0; +#X connect 36 0 34 0; +#X connect 37 0 25 0; +#X connect 38 0 57 0; +#X connect 39 0 57 1; +#X connect 40 0 57 2; +#X connect 41 0 57 3; +#X connect 42 0 49 1; +#X connect 43 0 49 2; +#X connect 44 0 49 3; +#X connect 45 0 50 1; +#X connect 46 0 50 2; +#X connect 47 0 50 3; +#X connect 48 0 49 0; +#X connect 49 0 54 0; +#X connect 50 0 48 0; +#X connect 51 0 48 1; +#X connect 52 0 48 2; +#X connect 53 0 48 3; +#X connect 54 1 55 0; +#X connect 55 0 56 0; +#X connect 56 0 6 0; +#X connect 57 0 50 0; diff --git a/examples/15.GLSL4/shader/02.transformation.frag b/examples/15.GLSL4/shader/02.transformation.frag new file mode 100644 index 000000000..eb2e69bb1 --- /dev/null +++ b/examples/15.GLSL4/shader/02.transformation.frag @@ -0,0 +1,17 @@ +#version 460 + +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the fragment shader : it is executed for every pixel to display + +in vec3 Color_to_frag; +// the variable commint from the VBO + +out vec4 FragColor; +// The only output of this shader : the color of the pixel + +void main() { + FragColor = vec4(Color_to_frag, 1.0); + // the "Color_to_frag" variable is already interpolated between the 2 shaders. +} diff --git a/examples/15.GLSL4/shader/02.transformation.vert b/examples/15.GLSL4/shader/02.transformation.vert new file mode 100644 index 000000000..fd577249c --- /dev/null +++ b/examples/15.GLSL4/shader/02.transformation.vert @@ -0,0 +1,32 @@ +#version 460 + +//simple test shader +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. + +layout (location=0) in vec3 position; +layout (location=1) in vec3 color; +// declare the mandatory input : we need 2 attributes named position and color from the VBO +// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) + +uniform mat4 transformation_matrix; +// The transformation matrix we want to apply to the vertex. +// The shader did not receive the transformation matrix from the pipeline, so we need to creater one and pass it as an argument. +// In this example, we use gemlist_matrix in the patch to get the transformation matrix. +// The perspective matrix (set with the perspec message to gemwin) is not used. + + +out vec3 Color_to_frag; +// the output of this shader is only a color. +// This variable will be interpolated between all vertices + +void main() +{ + Color_to_frag = color; + // initialise the variable to pass to the frag shader with data comming from the VBO + + gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO + // No perspective is apply in this example +} From 356c3290e53cd33d864261d5cbbc1e7b6804cd70 Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 10:09:12 +0200 Subject: [PATCH 137/387] transformation matrix new example --- examples/15.GLSL4/02.transformation.pd | 201 ++++++++++++++++++ .../15.GLSL4/shader/02.transformation.frag | 17 ++ .../15.GLSL4/shader/02.transformation.vert | 32 +++ 3 files changed, 250 insertions(+) create mode 100644 examples/15.GLSL4/02.transformation.pd create mode 100644 examples/15.GLSL4/shader/02.transformation.frag create mode 100644 examples/15.GLSL4/shader/02.transformation.vert diff --git a/examples/15.GLSL4/02.transformation.pd b/examples/15.GLSL4/02.transformation.pd new file mode 100644 index 000000000..cd0f93f4e --- /dev/null +++ b/examples/15.GLSL4/02.transformation.pd @@ -0,0 +1,201 @@ +#N canvas 554 237 989 704 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X msg 347 275 link \$1 \$2; +#X obj 267 189 glsl_vertex; +#X obj 267 232 glsl_fragment; +#X obj 281 45 loadbang; +#X obj 267 324 glsl_program; +#X obj 267 638 gemvertexbuffer; +#X obj 267 14 gemhead; +#X msg 363 454 program \$1; +#X obj 373 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 381 490 print_attributes; +#X obj 371 538 loadbang; +#X obj 336 346 t b f; +#X text 447 454 <----- essential for lookup functions; +#X obj 374 320 print linking; +#X obj 347 297 t a a; +#X obj 330 610 print vb; +#X msg 385 341 bang; +#X obj 44 9 declare -lib Gem; +#X obj 347 255 pack f f; +#X msg 371 559 resize 9 \, draw tri; +#X obj 336 368 f \$0; +#X msg 336 400 attribute position \$1_position \, attribute color \$1_color; +#N canvas 171 609 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 281 104 t a a; +#X msg 312 130 open \$1.vert; +#X msg 315 159 open \$1.frag; +#X obj 303 586 t a a; +#X obj 40 175 table \$0_position 9; +#X obj 40 196 table \$0_color 9; +#X obj 41 235 loadbang; +#X obj 41 283 s \$0_position; +#X obj 40 364 s \$0_color; +#X msg 40 341 0 1 0 0 0 1 0 0 0 1; +#X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; +#X obj 40 317 loadbang; +#X msg 281 72 symbol shader/02.transformation; +#X obj 626 18 gemhead; +#X floatatom 661 50 5 0 0 0 - - - 0; +#X floatatom 696 50 5 0 0 0 - - - 0; +#X floatatom 731 50 5 0 0 0 - - - 0; +#X floatatom 642 193 5 0 0 0 - - - 0; +#X floatatom 676 193 5 0 0 0 - - - 0; +#X floatatom 710 193 5 0 0 0 - - - 0; +#X floatatom 640 99 5 0 0 0 - - - 0; +#X floatatom 674 99 5 0 0 0 - - - 0; +#X floatatom 708 99 5 0 0 0 - - - 0; +#N canvas 437 191 753 491 shear 0; +#X obj 25 17 inlet; +#X obj 28 270 outlet; +#X obj 108 21 inlet; +#X obj 205 20 inlet; +#X obj 297 18 inlet; +#X text 117 38 ShearXY; +#X text 217 37 ShearXZ; +#X text 306 36 ShearYZ; +#X obj 27 104 shearXY; +#X obj 26 153 shearXZ; +#X obj 26 212 shearYZ; +#X connect 0 0 8 0; +#X connect 2 0 8 1; +#X connect 3 0 9 1; +#X connect 4 0 10 1; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 1 0; +#X restore 626 166 pd shear; +#X obj 626 214 rotateXYZ; +#X obj 626 118 scaleXYZ; +#X floatatom 640 145 5 0 0 0 - - - 0; +#X floatatom 674 145 5 0 0 0 - - - 0; +#X floatatom 708 145 5 0 0 0 - - - 0; +#X obj 626 239 gemlist_matrix; +#X obj 707 266 list prepend transformation_matrix; +#X obj 707 288 list trim; +#X obj 626 73 translateXYZ 0 0 4; +#X text 565 618 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; +#X connect 0 0 1 0; +#X connect 2 0 16 0; +#X connect 3 0 4 0; +#X connect 3 1 20 1; +#X connect 4 0 6 0; +#X connect 4 1 20 0; +#X connect 5 0 37 0; +#X connect 6 0 7 0; +#X connect 6 1 13 0; +#X connect 8 0 3 0; +#X connect 9 0 28 0; +#X connect 11 0 28 0; +#X connect 12 0 21 0; +#X connect 13 0 22 0; +#X connect 13 1 9 0; +#X connect 16 0 6 0; +#X connect 16 1 15 0; +#X connect 18 0 22 0; +#X connect 20 0 2 0; +#X connect 21 0 28 0; +#X connect 22 0 23 0; +#X connect 23 0 28 0; +#X connect 25 0 27 0; +#X connect 25 1 26 0; +#X connect 26 0 3 0; +#X connect 27 0 4 0; +#X connect 28 0 7 0; +#X connect 28 1 17 0; +#X connect 31 0 35 0; +#X connect 34 0 33 0; +#X connect 35 0 32 0; +#X connect 36 0 34 0; +#X connect 37 0 25 0; +#X connect 38 0 57 0; +#X connect 39 0 57 1; +#X connect 40 0 57 2; +#X connect 41 0 57 3; +#X connect 42 0 49 1; +#X connect 43 0 49 2; +#X connect 44 0 49 3; +#X connect 45 0 50 1; +#X connect 46 0 50 2; +#X connect 47 0 50 3; +#X connect 48 0 49 0; +#X connect 49 0 54 0; +#X connect 50 0 48 0; +#X connect 51 0 48 1; +#X connect 52 0 48 2; +#X connect 53 0 48 3; +#X connect 54 1 55 0; +#X connect 55 0 56 0; +#X connect 56 0 6 0; +#X connect 57 0 50 0; diff --git a/examples/15.GLSL4/shader/02.transformation.frag b/examples/15.GLSL4/shader/02.transformation.frag new file mode 100644 index 000000000..eb2e69bb1 --- /dev/null +++ b/examples/15.GLSL4/shader/02.transformation.frag @@ -0,0 +1,17 @@ +#version 460 + +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the fragment shader : it is executed for every pixel to display + +in vec3 Color_to_frag; +// the variable commint from the VBO + +out vec4 FragColor; +// The only output of this shader : the color of the pixel + +void main() { + FragColor = vec4(Color_to_frag, 1.0); + // the "Color_to_frag" variable is already interpolated between the 2 shaders. +} diff --git a/examples/15.GLSL4/shader/02.transformation.vert b/examples/15.GLSL4/shader/02.transformation.vert new file mode 100644 index 000000000..fd577249c --- /dev/null +++ b/examples/15.GLSL4/shader/02.transformation.vert @@ -0,0 +1,32 @@ +#version 460 + +//simple test shader +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. + +layout (location=0) in vec3 position; +layout (location=1) in vec3 color; +// declare the mandatory input : we need 2 attributes named position and color from the VBO +// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) + +uniform mat4 transformation_matrix; +// The transformation matrix we want to apply to the vertex. +// The shader did not receive the transformation matrix from the pipeline, so we need to creater one and pass it as an argument. +// In this example, we use gemlist_matrix in the patch to get the transformation matrix. +// The perspective matrix (set with the perspec message to gemwin) is not used. + + +out vec3 Color_to_frag; +// the output of this shader is only a color. +// This variable will be interpolated between all vertices + +void main() +{ + Color_to_frag = color; + // initialise the variable to pass to the frag shader with data comming from the VBO + + gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO + // No perspective is apply in this example +} From 02b6e6929d8bb89883500a3ffa5b61a55817e41c Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 15:28:28 +0200 Subject: [PATCH 138/387] move image to the data folder --- examples/10.glsl/01.simple_texture.pd | 4 ++-- examples/10.glsl/02.primitive_distortion.pd | 2 +- examples/10.glsl/03.texture_distortion.pd | 2 +- examples/10.glsl/05.multitexture.pd | 12 ++++++------ examples/10.glsl/05.multitexture_bis.pd | 12 ++++++------ examples/10.glsl/06.rectangle_multitexture.pd | 4 ++-- examples/10.glsl/07.framebuffer_and_shader.pd | 2 +- examples/10.glsl/08.multi_pass_rendering.pd | 4 ++-- examples/10.glsl/09.vertex_texture_fetching.pd | 4 ++-- examples/10.glsl/13.panoramique.pd | 8 ++++---- examples/{10.glsl => data}/cam1.jpg | Bin examples/{10.glsl => data}/cam2.jpg | Bin examples/{10.glsl => data}/cam3.jpg | Bin examples/{10.glsl => data}/cam4.jpg | Bin examples/{10.glsl => data}/img1.jpg | Bin examples/{10.glsl => data}/img2.jpg | Bin examples/{10.glsl => data}/img3.jpg | Bin 17 files changed, 27 insertions(+), 27 deletions(-) rename examples/{10.glsl => data}/cam1.jpg (100%) rename examples/{10.glsl => data}/cam2.jpg (100%) rename examples/{10.glsl => data}/cam3.jpg (100%) rename examples/{10.glsl => data}/cam4.jpg (100%) rename examples/{10.glsl => data}/img1.jpg (100%) rename examples/{10.glsl => data}/img2.jpg (100%) rename examples/{10.glsl => data}/img3.jpg (100%) diff --git a/examples/10.glsl/01.simple_texture.pd b/examples/10.glsl/01.simple_texture.pd index 3600d5766..782eb7f04 100644 --- a/examples/10.glsl/01.simple_texture.pd +++ b/examples/10.glsl/01.simple_texture.pd @@ -13,8 +13,8 @@ #X obj 76 197 glsl_fragment; #X text 215 459 <- load texture; #X obj 106 535 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 76 489 pix_image img1.jpg; -#X msg 103 460 open img2.jpg; +#X obj 76 489 pix_image ../data/img1.jpg; +#X msg 103 460 open ../data/img2.jpg; #X msg 114 114 0; #X obj 283 72 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 315 70 <-load an other shader; diff --git a/examples/10.glsl/02.primitive_distortion.pd b/examples/10.glsl/02.primitive_distortion.pd index 189c4d7cc..4c7632bf5 100644 --- a/examples/10.glsl/02.primitive_distortion.pd +++ b/examples/10.glsl/02.primitive_distortion.pd @@ -39,7 +39,7 @@ #X msg 103 405 open texture.jpg; #X obj 74 571 rotateXYZ -90 0 0; #X msg 292 277 0.1; -#X obj 74 428 pix_image img3.jpg; +#X obj 74 428 pix_image ../data/img3.jpg; #X text 69 627 this shader create a dirty pseudo random value \, and move all vertices separately; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; diff --git a/examples/10.glsl/03.texture_distortion.pd b/examples/10.glsl/03.texture_distortion.pd index 52cf69d25..c3237b6c8 100644 --- a/examples/10.glsl/03.texture_distortion.pd +++ b/examples/10.glsl/03.texture_distortion.pd @@ -47,7 +47,7 @@ #X msg 361 373 K1 \$1; #X msg 361 327 1; #X msg 476 375 seed \$1; -#X obj 74 458 pix_image img3.jpg; +#X obj 74 458 pix_image ../data/img3.jpg; #X obj 74 596 rectangle 4 4; #X text 73 627 This shader compute a dirty pseudo random number \, and distort the texture this with value; #N canvas 87 154 247 179 Gem.init 0; diff --git a/examples/10.glsl/05.multitexture.pd b/examples/10.glsl/05.multitexture.pd index 312f81cdf..f69ab3073 100644 --- a/examples/10.glsl/05.multitexture.pd +++ b/examples/10.glsl/05.multitexture.pd @@ -66,12 +66,12 @@ #X obj 716 388 loadbang; #X obj 687 229 gemhead 22; #X text 187 360 2) change shader texunit; -#X msg 482 320 open img2.jpg; -#X obj 463 349 pix_image img2.jpg; -#X obj 687 346 pix_image img3.jpg; -#X msg 704 318 open img3.jpg; -#X msg 153 544 open img1.jpg; -#X obj 75 613 pix_image img1.jpg; +#X msg 482 320 open ../data/img2.jpg; +#X obj 463 349 pix_image ../data/img2.jpg; +#X obj 687 346 pix_image ../data/img3.jpg; +#X msg 704 318 open ../data/img3.jpg; +#X msg 153 544 open ../data/img1.jpg; +#X obj 75 613 pix_image ../data/img1.jpg; #X obj 148 98 change; #X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; diff --git a/examples/10.glsl/05.multitexture_bis.pd b/examples/10.glsl/05.multitexture_bis.pd index 9d4f7b7c1..4be10c9e0 100644 --- a/examples/10.glsl/05.multitexture_bis.pd +++ b/examples/10.glsl/05.multitexture_bis.pd @@ -54,10 +54,10 @@ #X obj 919 379 loadbang; #X obj 890 220 gemhead 22; #X text 187 360 2) change shader texunit; -#X msg 685 311 open img2.jpg; -#X obj 666 340 pix_image img2.jpg; -#X obj 890 337 pix_image img3.jpg; -#X msg 907 309 open img3.jpg; +#X msg 685 311 open ../data/img2.jpg; +#X obj 666 340 pix_image ../data/img2.jpg; +#X obj 890 337 pix_image ../data/img3.jpg; +#X msg 907 309 open ../data/img3.jpg; #X obj 148 98 change; #X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; @@ -121,8 +121,8 @@ #X obj 462 288 loadbang; #X obj 443 427 pix_texture; #X msg 471 402 rectangle 0; -#X msg 462 313 open img1.jpg; -#X obj 443 342 pix_image img1.jpg; +#X msg 462 313 open ../data/img1.jpg; +#X obj 443 342 pix_image ../data/img1.jpg; #X obj 983 7 declare -lib Gem; #X msg 90 57 open shader/multitexture.vert; #X msg 86 153 open shader/multitexture.frag; diff --git a/examples/10.glsl/06.rectangle_multitexture.pd b/examples/10.glsl/06.rectangle_multitexture.pd index 4ca4d6d0f..203e54a20 100644 --- a/examples/10.glsl/06.rectangle_multitexture.pd +++ b/examples/10.glsl/06.rectangle_multitexture.pd @@ -122,8 +122,8 @@ #X text 206 357 <- 2 : test different mix; #X obj 459 167 pix_resize 512 512; #X obj 279 167 pix_resize 234 543; -#X obj 279 147 pix_image img3.jpg; -#X obj 459 147 pix_image img2.jpg; +#X obj 279 147 pix_image ../data/img3.jpg; +#X obj 459 147 pix_image ../data/img2.jpg; #X text 292 186 images have different sizes; #X msg 139 507 mix_factor \$1; #X obj 37 646 square 4; diff --git a/examples/10.glsl/07.framebuffer_and_shader.pd b/examples/10.glsl/07.framebuffer_and_shader.pd index a08851749..f02d84ffe 100644 --- a/examples/10.glsl/07.framebuffer_and_shader.pd +++ b/examples/10.glsl/07.framebuffer_and_shader.pd @@ -265,7 +265,7 @@ #X obj 199 342 gemhead 12; #X obj 442 214 gemhead 17; #X obj 9 177 gemhead 10; -#X obj 442 240 pix_image img2.jpg; +#X obj 442 240 pix_image ../data/img2.jpg; #X msg 867 215 111; #X text 33 612 This shader is rendered into a framebuffer \, in order to use it in the next frame for a simple physical modeling simulation; #X text 345 168 This creates a texture (texunit 3) from the shaders' output; diff --git a/examples/10.glsl/08.multi_pass_rendering.pd b/examples/10.glsl/08.multi_pass_rendering.pd index bda4bfb10..2239cd32d 100644 --- a/examples/10.glsl/08.multi_pass_rendering.pd +++ b/examples/10.glsl/08.multi_pass_rendering.pd @@ -39,7 +39,7 @@ #X restore 373 156 pd init; #X text 6 4 first input \, render whatever in a framebuffer; #X obj 691 357 loadbang; -#X obj 42 222 pix_image img1.jpg; +#X obj 42 222 pix_image ../data/img1.jpg; #X obj 42 54 gemhead 11; #X obj 666 187 loadbang; #X obj 650 166 translateXYZ 0 0 -4; @@ -288,7 +288,7 @@ #X obj 353 332 mesh_square 10 10; #X obj 353 311 scaleXYZ 4 4 1; #X obj 353 57 gemhead 21; -#X obj 353 222 pix_image img2.jpg; +#X obj 353 222 pix_image ../data/img2.jpg; #X obj 353 291 pix_texture; #X msg 666 209 rectangle 0; #X msg 691 378 rectangle 0; diff --git a/examples/10.glsl/09.vertex_texture_fetching.pd b/examples/10.glsl/09.vertex_texture_fetching.pd index 94b0459b9..e812da738 100644 --- a/examples/10.glsl/09.vertex_texture_fetching.pd +++ b/examples/10.glsl/09.vertex_texture_fetching.pd @@ -34,8 +34,8 @@ #X restore 540 93 pd load_glsl; #X obj 504 525 rotateXYZ -30 0 0; #X obj 504 551 scaleXYZ 3 3 1; -#X obj 28 388 pix_image img1.jpg; -#X msg 46 363 open img2.jpg; +#X obj 28 388 pix_image ../data/img1.jpg; +#X msg 46 363 open ../data/img2.jpg; #X text 137 11 This patch need a glsl 3 compliant hardware; #X text 26 535 draw an image in a framebuffer; #X text 49 274 this configuration is very important to have full hardware support for vertex texture fetching; diff --git a/examples/10.glsl/13.panoramique.pd b/examples/10.glsl/13.panoramique.pd index b76783bc3..cfe4ced9c 100644 --- a/examples/10.glsl/13.panoramique.pd +++ b/examples/10.glsl/13.panoramique.pd @@ -382,10 +382,10 @@ #X msg 18 373 1.62; #X msg 199 87 1.38; #X msg 37 232 dimen 1024 256; -#X msg 177 304 thread 0 \, open cam1.jpg; -#X msg 370 305 thread 0 \, open cam2.jpg; -#X msg 569 306 thread 0 \, open cam3.jpg; -#X msg 764 307 thread 0 \, open cam4.jpg; +#X msg 177 304 thread 0 \, open ../data/cam1.jpg; +#X msg 370 305 thread 0 \, open ../data/cam2.jpg; +#X msg 569 306 thread 0 \, open ../data/cam3.jpg; +#X msg 764 307 thread 0 \, open ../data/cam4.jpg; #X obj 964 623 declare -lib Gem; #X connect 0 0 101 0; #X connect 1 0 101 0; diff --git a/examples/10.glsl/cam1.jpg b/examples/data/cam1.jpg similarity index 100% rename from examples/10.glsl/cam1.jpg rename to examples/data/cam1.jpg diff --git a/examples/10.glsl/cam2.jpg b/examples/data/cam2.jpg similarity index 100% rename from examples/10.glsl/cam2.jpg rename to examples/data/cam2.jpg diff --git a/examples/10.glsl/cam3.jpg b/examples/data/cam3.jpg similarity index 100% rename from examples/10.glsl/cam3.jpg rename to examples/data/cam3.jpg diff --git a/examples/10.glsl/cam4.jpg b/examples/data/cam4.jpg similarity index 100% rename from examples/10.glsl/cam4.jpg rename to examples/data/cam4.jpg diff --git a/examples/10.glsl/img1.jpg b/examples/data/img1.jpg similarity index 100% rename from examples/10.glsl/img1.jpg rename to examples/data/img1.jpg diff --git a/examples/10.glsl/img2.jpg b/examples/data/img2.jpg similarity index 100% rename from examples/10.glsl/img2.jpg rename to examples/data/img2.jpg diff --git a/examples/10.glsl/img3.jpg b/examples/data/img3.jpg similarity index 100% rename from examples/10.glsl/img3.jpg rename to examples/data/img3.jpg From 6bc589688b71e743d61bdf6d4ab06640f067966d Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 15:59:26 +0200 Subject: [PATCH 139/387] simple texture example --- examples/15.GLSL4/03.texture.pd | 160 +++++++++++++++++++++++ examples/15.GLSL4/shader/03.texture.frag | 19 +++ examples/15.GLSL4/shader/03.texture.vert | 16 +++ 3 files changed, 195 insertions(+) create mode 100644 examples/15.GLSL4/03.texture.pd create mode 100644 examples/15.GLSL4/shader/03.texture.frag create mode 100644 examples/15.GLSL4/shader/03.texture.vert diff --git a/examples/15.GLSL4/03.texture.pd b/examples/15.GLSL4/03.texture.pd new file mode 100644 index 000000000..c047f31aa --- /dev/null +++ b/examples/15.GLSL4/03.texture.pd @@ -0,0 +1,160 @@ +#N canvas 325 157 939 801 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X msg 507 375 link \$1 \$2; +#X obj 427 309 glsl_vertex; +#X obj 427 332 glsl_fragment; +#X obj 441 165 loadbang; +#X obj 427 424 glsl_program; +#X obj 427 738 gemvertexbuffer; +#X obj 427 14 gemhead; +#X msg 523 554 program \$1; +#X obj 523 584 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 531 590 print_attributes; +#X obj 531 638 loadbang; +#X obj 496 446 t b f; +#X text 607 554 <----- essential for lookup functions; +#X obj 534 420 print linking; +#X obj 507 397 t a a; +#X obj 490 710 print vb; +#X msg 545 441 bang; +#X obj 44 9 declare -lib Gem; +#X obj 507 355 pack f f; +#X obj 496 468 f \$0; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 441 224 t a a; +#X msg 472 250 open \$1.vert; +#X msg 475 279 open \$1.frag; +#X obj 463 686 t a a; +#X obj 41 235 loadbang; +#X obj 41 283 s \$0_position; +#X obj 40 317 loadbang; +#X msg 441 192 symbol shader/03.texture; +#X obj 427 42 pix_image ../data/img1.jpg; +#X obj 427 67 pix_texture; +#X msg 41 260 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 0.8 0 0.8 -0.8 0; +#X obj 40 175 table \$0_position 12; +#X obj 40 196 table \$0_texcoord 8; +#X obj 40 364 s \$0_texcoord; +#X msg 496 500 attribute position \$1_position \, attribute texcoord \$1_texcoord, f 63; +#X msg 531 659 draw quad; +#X obj 427 128 pix_texture; +#X msg 625 56 texunit 1; +#X obj 625 31 loadbang; +#X obj 427 103 pix_image ../data/img2.jpg; +#X floatatom 682 333 5 0 1 0 - - - 0; +#X msg 550 471 Texture2 1; +#X msg 682 356 mix_factor \$1; +#X msg 40 341 0 0 1 0 0 1 0 1 1; +#X connect 0 0 1 0; +#X connect 2 0 16 0; +#X connect 3 0 4 0; +#X connect 3 1 20 1; +#X connect 4 0 6 0; +#X connect 4 1 20 0; +#X connect 5 0 30 0; +#X connect 6 0 7 0; +#X connect 6 1 13 0; +#X connect 8 0 31 0; +#X connect 9 0 26 0; +#X connect 11 0 26 0; +#X connect 12 0 38 0; +#X connect 13 0 21 0; +#X connect 13 0 44 0; +#X connect 13 1 9 0; +#X connect 16 0 6 0; +#X connect 16 1 15 0; +#X connect 18 0 21 0; +#X connect 20 0 2 0; +#X connect 21 0 37 0; +#X connect 23 0 25 0; +#X connect 23 1 24 0; +#X connect 24 0 3 0; +#X connect 25 0 4 0; +#X connect 26 0 7 0; +#X connect 26 1 17 0; +#X connect 27 0 33 0; +#X connect 29 0 46 0; +#X connect 30 0 23 0; +#X connect 31 0 32 0; +#X connect 32 0 42 0; +#X connect 33 0 28 0; +#X connect 37 0 26 0; +#X connect 38 0 26 0; +#X connect 39 0 3 0; +#X connect 40 0 39 0; +#X connect 41 0 40 0; +#X connect 42 0 39 0; +#X connect 43 0 45 0; +#X connect 44 0 6 0; +#X connect 45 0 6 0; +#X connect 46 0 36 0; diff --git a/examples/15.GLSL4/shader/03.texture.frag b/examples/15.GLSL4/shader/03.texture.frag new file mode 100644 index 000000000..2f188eb15 --- /dev/null +++ b/examples/15.GLSL4/shader/03.texture.frag @@ -0,0 +1,19 @@ +#version 460 + +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +in vec2 TexCoord; + +uniform sampler2D Texture1; +uniform sampler2D Texture2; +uniform float mix_factor; + +out vec4 FragColor; + +void main() { + vec4 color1 = texture(Texture1, TexCoord); + vec4 color2 = texture(Texture2, TexCoord); + + FragColor = mix(color1, color2, mix_factor); +} diff --git a/examples/15.GLSL4/shader/03.texture.vert b/examples/15.GLSL4/shader/03.texture.vert new file mode 100644 index 000000000..30707d22c --- /dev/null +++ b/examples/15.GLSL4/shader/03.texture.vert @@ -0,0 +1,16 @@ +#version 460 + +//simple test shader +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +in vec3 position; +in vec2 texcoord; + +out vec2 TexCoord; + +void main() +{ + TexCoord = texcoord; // pass the data from VBO to the frag shader + gl_Position = vec4(position,1.0); +} From 7efc9947123ee938f9b284c7874f25c94080e1d7 Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 30 Apr 2024 18:02:04 +0200 Subject: [PATCH 140/387] adapt to the example directory restructuration --- examples/Makefile.am | 98 ++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index f4cb38e0b..ba5ba162f 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -132,55 +132,50 @@ nobase_dist_gemexamples_DATA = \ 10.glsl/14.blur.pd \ 10.glsl/15.bicubic_image_interpolation.pd \ 10.glsl/16.vertexbuffer_attributes.pd \ - 10.glsl/bicubic_interpolation.frag \ - 10.glsl/bicubic_interpolation.vert \ - 10.glsl/blur.frag \ - 10.glsl/blur.vert \ - 10.glsl/cam1.jpg \ - 10.glsl/cam2.jpg \ - 10.glsl/cam3.jpg \ - 10.glsl/cam4.jpg \ - 10.glsl/fetching2.frag \ - 10.glsl/fetching2.vert \ - 10.glsl/fetching.frag \ - 10.glsl/fetching.vert \ - 10.glsl/game.frag \ - 10.glsl/game.vert \ - 10.glsl/geo.frag \ - 10.glsl/geo.geom \ - 10.glsl/geo.vert \ 10.glsl/_glsl.pd \ - 10.glsl/GLSL_mix.frag \ - 10.glsl/GLSL_mix.vert \ - 10.glsl/img1.jpg \ - 10.glsl/img2.jpg \ - 10.glsl/img3.jpg \ - 10.glsl/interpol.frag \ - 10.glsl/link.frag \ - 10.glsl/link.vert \ - 10.glsl/mass.frag \ - 10.glsl/mass.vert \ - 10.glsl/multitexture.frag \ - 10.glsl/multitexture_rect.frag \ - 10.glsl/multitexture_rect.vert \ - 10.glsl/multitexture.vert \ - 10.glsl/normal.frag \ - 10.glsl/normal.vert \ - 10.glsl/panoramique.frag \ - 10.glsl/panoramique.vert \ - 10.glsl/P_distord.frag \ - 10.glsl/P_distord.vert \ 10.glsl/single_blur.pd \ - 10.glsl/T_distord.frag \ - 10.glsl/T_distord.vert \ - 10.glsl/texture.frag \ - 10.glsl/texture_rect.frag \ - 10.glsl/texture.vert \ - 10.glsl/tri2fan.frag \ - 10.glsl/tri2fan.geom \ - 10.glsl/tri2fan.vert \ - 10.glsl/vague.frag \ - 10.glsl/wave.frag \ + 10.glsl/shader/bicubic_interpolation.frag \ + 10.glsl/shader/bicubic_interpolation.vert \ + 10.glsl/shader/blur.frag \ + 10.glsl/shader/blur.vert \ + 10.glsl/shader/fetching2.frag \ + 10.glsl/shader/fetching2.vert \ + 10.glsl/shader/fetching.frag \ + 10.glsl/shader/fetching.vert \ + 10.glsl/shader/game.frag \ + 10.glsl/shader/game.vert \ + 10.glsl/shader/geo.frag \ + 10.glsl/shader/geo.geom \ + 10.glsl/shader/geo.vert \ + 10.glsl/shader/GLSL_mix.frag \ + 10.glsl/shader/GLSL_mix.vert \ + 10.glsl/shader/interpol.frag \ + 10.glsl/shader/link.frag \ + 10.glsl/shader/link.vert \ + 10.glsl/shader/mass.frag \ + 10.glsl/shader/mass.vert \ + 10.glsl/shader/multitexture.frag \ + 10.glsl/shader/multitexture_rect.frag \ + 10.glsl/shader/multitexture_rect.vert \ + 10.glsl/shader/multitexture.vert \ + 10.glsl/shader/normal.frag \ + 10.glsl/shader/normal.vert \ + 10.glsl/shader/panoramique.frag \ + 10.glsl/shader/panoramique.vert \ + 10.glsl/shader/P_distord.frag \ + 10.glsl/shader/P_distord.vert \ + 10.glsl/shader/T_distord.frag \ + 10.glsl/shader/T_distord.vert \ + 10.glsl/shader/texture.frag \ + 10.glsl/shader/texture_rect.frag \ + 10.glsl/shader/texture.vert \ + 10.glsl/shader/tri2fan.frag \ + 10.glsl/shader/tri2fan.geom \ + 10.glsl/shader/tri2fan.vert \ + 10.glsl/shader/vague.frag \ + 10.glsl/shader/wave.frag \ + 10.glsl/shader/brick.frag \ + 10.glsl/shader/brick.vert \ 11.obj-exporter/obj_cube.pd \ 11.obj-exporter/obj_exporter-help.pd \ 11.obj-exporter/obj_exporter.pd \ @@ -222,12 +217,17 @@ nobase_dist_gemexamples_DATA = \ 14.multiple_windows/02.switch_context.pd \ 14.multiple_windows/03.texture_sharing.pd \ 99.games/puzzle.pd \ + data/img1.jpg \ + data/img2.jpg \ + data/img3.jpg \ + data/cam1.jpg \ + data/cam2.jpg \ + data/cam3.jpg \ + data/cam4.jpg \ data/64shade.tif \ data/alea.mpg \ data/anim-1.mov \ data/bitmap_font_6x8.bmp \ - data/brick.frag \ - data/brick.vert \ data/blob0.tif \ data/blob1.tif \ data/blob2.tif \ From 7012797a0dd613df0c4ad3166a002947668ffda4 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 1 May 2024 15:50:35 +0200 Subject: [PATCH 141/387] 1 more example (about lighting) --- examples/10.glsl/17.light.pd | 142 +++++++++++++++++++++++++++++ examples/10.glsl/shader/light.frag | 38 ++++++++ examples/10.glsl/shader/light.vert | 12 +++ 3 files changed, 192 insertions(+) create mode 100644 examples/10.glsl/17.light.pd create mode 100644 examples/10.glsl/shader/light.frag create mode 100644 examples/10.glsl/shader/light.vert diff --git a/examples/10.glsl/17.light.pd b/examples/10.glsl/17.light.pd new file mode 100644 index 000000000..8720bed60 --- /dev/null +++ b/examples/10.glsl/17.light.pd @@ -0,0 +1,142 @@ +#N canvas 1927 311 749 579 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X msg 261 285 link \$1 \$2; +#X obj 195 55 loadbang; +#X obj 181 24 gemhead; +#X obj 288 330 print linking; +#X obj 261 307 t a a; +#X obj 44 9 declare -lib Gem; +#X obj 261 265 pack f f; +#N canvas 899 105 557 405 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 177 215 destroy; +#X obj 102 265 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X msg 102 240 create \, 1 \, lighting 1; +#X text 86 319 Lighting 1 force Gem to compute the object Normals; +#X connect 1 0 2 0; +#X connect 2 0 17 0; +#X connect 2 1 3 0; +#X connect 3 0 4 0; +#X connect 4 0 7 0; +#X connect 5 0 7 0; +#X connect 6 0 8 0; +#X connect 7 0 6 0; +#X connect 7 1 9 0; +#X connect 9 0 10 0; +#X connect 9 1 12 0; +#X connect 10 0 11 0; +#X connect 11 0 14 0; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 0 0; +#X connect 17 0 4 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 195 114 t a a; +#X msg 226 140 open \$1.vert; +#X msg 229 169 open \$1.frag; +#X obj 250 356 t b; +#X obj 181 199 glsl_vertex; +#X obj 181 242 glsl_fragment; +#X obj 181 334 glsl_program; +#X obj 181 457 rotateXYZ -40 10 0; +#X msg 195 82 symbol shader/light; +#X obj 181 484 torus 2 30 0.8; +#X text 350 21 Since shader remplace the standard pipeline \, light are not automatically computed. Lighting effect have to be manually computed in the shader.; +#X floatatom 216 434 5 0 0 0 - - - 0; +#N canvas 1921 61 450 300 pak 0; +#X obj 74 46 inlet; +#X obj 76 110 pack f f f; +#X obj 160 41 inlet; +#X obj 156 65 t b f; +#X obj 216 43 inlet; +#X obj 212 67 t b f; +#X obj 75 158 outlet; +#X connect 0 0 1 0; +#X connect 1 0 6 0; +#X connect 2 0 3 0; +#X connect 3 0 1 0; +#X connect 3 1 1 1; +#X connect 4 0 5 0; +#X connect 5 0 1 0; +#X connect 5 1 1 2; +#X restore 398 326 pd pak f f f; +#X msg 398 351 LightPosition \$1 \$2 \$3 1; +#X floatatom 398 292 5 0 0 0 - - - 0; +#X floatatom 443 292 5 0 0 0 - - - 0; +#X floatatom 485 293 5 0 0 0 - - - 0; +#X msg 250 380 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.1 0.1 0.5 \, MaterialKd 0.8 0.1 0.1 \, MaterialKs 0.1 0.3 0.1 \, MaterialShininess 30; +#X connect 0 0 1 0; +#X connect 2 0 6 0; +#X connect 3 0 18 0; +#X connect 4 0 14 0; +#X connect 6 0 16 0; +#X connect 6 1 5 0; +#X connect 8 0 2 0; +#X connect 10 0 12 0; +#X connect 10 1 11 0; +#X connect 11 0 14 0; +#X connect 12 0 15 0; +#X connect 13 0 27 0; +#X connect 14 0 15 0; +#X connect 14 1 8 1; +#X connect 15 0 16 0; +#X connect 15 1 8 0; +#X connect 16 0 17 0; +#X connect 16 1 13 0; +#X connect 17 0 19 0; +#X connect 18 0 10 0; +#X connect 21 0 17 1; +#X connect 22 0 23 0; +#X connect 23 0 16 0; +#X connect 24 0 22 0; +#X connect 25 0 22 1; +#X connect 26 0 22 2; +#X connect 27 0 16 0; diff --git a/examples/10.glsl/shader/light.frag b/examples/10.glsl/shader/light.frag new file mode 100644 index 000000000..e8f5da2ec --- /dev/null +++ b/examples/10.glsl/shader/light.frag @@ -0,0 +1,38 @@ +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// from vertex shader +varying vec3 Normal; +varying vec3 Position; + +// light description +uniform vec4 LightPosition; // Light position in eye coords. +uniform vec3 LightLa; // Ambient light intensity +uniform vec3 LightL; // Diffuse and specular light intensity + +// material definition +uniform vec3 MaterialKa; // Ambient reflectivity +uniform vec3 MaterialKd; // Diffuse reflectivity +uniform vec3 MaterialKs; // Specular reflectivity +uniform float MaterialShininess; // Specular shininess factor + +// The lighting model +vec3 blinnPhong( vec3 position, vec3 n) { + vec3 ambient = LightLa * MaterialKa; + vec3 s = normalize( LightPosition.xyz - position ); + float sDotN = max( dot(s,n), 0.0 ); + vec3 diffuse = MaterialKd * sDotN; + vec3 spec = vec3(0.0); + if( sDotN > 0.0 ) { + vec3 v = normalize(-position.xyz); + vec3 h = normalize( v + s ); + spec = MaterialKs * pow( max( dot(h,n), 0.0 ), MaterialShininess ); + } + return ambient + LightL * (diffuse + spec); +} + +void main (void) +{ + gl_FragColor = vec4(blinnPhong(Position, normalize(Normal)), 1.0); + //gl_FragColor = vec4(blinnPhong(Position, Normal), 1.0); +} diff --git a/examples/10.glsl/shader/light.vert b/examples/10.glsl/shader/light.vert new file mode 100644 index 000000000..fe2da0557 --- /dev/null +++ b/examples/10.glsl/shader/light.vert @@ -0,0 +1,12 @@ +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +varying vec3 Normal; +varying vec3 Position; + +void main() +{ + Normal = normalize(gl_NormalMatrix * gl_Normal.xyz); + Position = ( gl_ModelViewMatrix * vec4(gl_Vertex.xyz,1.0) ).xyz; + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} From 2ff01f368fa6c79d20e784cf384b6d0fb17e9d83 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 1 May 2024 15:58:04 +0200 Subject: [PATCH 142/387] update makefile to include newest examples --- examples/Makefile.am | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/Makefile.am b/examples/Makefile.am index ba5ba162f..3fbababc1 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -132,6 +132,7 @@ nobase_dist_gemexamples_DATA = \ 10.glsl/14.blur.pd \ 10.glsl/15.bicubic_image_interpolation.pd \ 10.glsl/16.vertexbuffer_attributes.pd \ + 10.glsl/17.light.pd \ 10.glsl/_glsl.pd \ 10.glsl/single_blur.pd \ 10.glsl/shader/bicubic_interpolation.frag \ @@ -150,6 +151,8 @@ nobase_dist_gemexamples_DATA = \ 10.glsl/shader/GLSL_mix.frag \ 10.glsl/shader/GLSL_mix.vert \ 10.glsl/shader/interpol.frag \ + 10.glsl/shader/light.frag \ + 10.glsl/shader/light.vert \ 10.glsl/shader/link.frag \ 10.glsl/shader/link.vert \ 10.glsl/shader/mass.frag \ @@ -216,6 +219,15 @@ nobase_dist_gemexamples_DATA = \ 14.multiple_windows/01.basic_example.pd \ 14.multiple_windows/02.switch_context.pd \ 14.multiple_windows/03.texture_sharing.pd \ + 15.GLSL4/01.basic.pd \ + 15.GLSL4/02.transformation.pd \ + 15.GLSL4/03.texture.pd \ + 15.GLSL4/shader/01.basic.frag \ + 15.GLSL4/shader/01.basic.vert \ + 15.GLSL4/shader/02.transformation.frag \ + 15.GLSL4/shader/02.transformation.vert \ + 15.GLSL4/shader/03.texture.frag \ + 15.GLSL4/shader/03.texture.vert \ 99.games/puzzle.pd \ data/img1.jpg \ data/img2.jpg \ From f4d13ef756059534548b6f8bd76d7b225cc89c9e Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 2 May 2024 10:20:20 +0200 Subject: [PATCH 143/387] replace until loop with the dedicated abstraction "gemrepeat" --- examples/02.advanced/19.pointer.pd | 117 +++++++----------- .../20.double-gemhead_vs_repeat.pd | 52 +++----- examples/02.advanced/22.double-iterative.pd | 116 +++++++---------- 3 files changed, 110 insertions(+), 175 deletions(-) diff --git a/examples/02.advanced/19.pointer.pd b/examples/02.advanced/19.pointer.pd index 25f571309..4058882b6 100644 --- a/examples/02.advanced/19.pointer.pd +++ b/examples/02.advanced/19.pointer.pd @@ -1,4 +1,4 @@ -#N canvas 102 61 864 638 10; +#N canvas 716 191 864 638 10; #X declare -lib Gem; #X obj 209 223 gemhead; #X obj 241 277 t a a a; @@ -17,12 +17,9 @@ #X obj 595 288 gemlist; #X obj 595 223 gemhead; #X obj 595 250 t b b a; -#X obj 37 202 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; -#X obj 209 198 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 595 198 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 37 202 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; +#X obj 209 198 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 595 198 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 37 342 translateXYZ 2 0 0; #X obj 37 449 translateXYZ 2 0 0; #X obj 241 341 translateXYZ 2 0 0; @@ -33,44 +30,31 @@ #X obj 595 410 rotateXYZ 60 30 0; #X obj 595 452 translateXYZ 2 0 0; #X obj 595 431 sphere 1.6 4; -#X text 29 498 example #1 is the usual way to use Gem \, but the technique -shown in example #2 can be more flexible...; -#N canvas 186 321 446 463 more_interating_1 0; +#X text 29 498 example #1 is the usual way to use Gem \, but the technique shown in example #2 can be more flexible...; +#N canvas 952 333 446 463 more_interating_1 0; #X obj 22 64 gemhead; #X obj 22 351 rotateXYZ 0 0 12; #X obj 22 274 scaleXYZ 0.97 0.9 1; #X obj 22 296 translateXYZ 0.5 0 0; #X obj 22 376 circle 0.2; -#X floatatom 131 331 5 0 0 0 - - -; -#X obj 22 226 gemlist; -#X obj 22 204 until; -#X msg 22 180 100; -#X obj 22 158 t b a; +#X floatatom 131 331 5 0 0 0 - - - 0; #X obj 22 111 translateXYZ -3 0 0; -#X obj 22 43 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 -; -#X text 85 198 "repeat" 100 times the same "gemlist"; -#X connect 0 0 10 0; +#X obj 22 43 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 118 201 "repeat" 100 times the same "gemlist"; +#X obj 22 197 gemrepeat 100; +#X connect 0 0 6 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 5 0 1 3; -#X connect 6 0 2 0; -#X connect 7 0 6 0; -#X connect 8 0 7 0; -#X connect 9 0 8 0; -#X connect 9 1 6 1; -#X connect 10 0 9 0; -#X connect 11 0 0 0; +#X connect 6 0 9 0; +#X connect 7 0 0 0; +#X connect 9 0 2 0; #X restore 32 561 pd more_interating_1; -#N canvas 178 159 464 582 more_interating_2 0; +#N canvas 804 223 464 582 more_interating_2 0; #X obj 22 69 gemhead; #X obj 22 377 scaleXYZ 0.97 0.9 1; #X obj 22 505 circle 0.2; -#X obj 22 235 gemlist; -#X obj 22 213 until; -#X msg 22 189 100; -#X obj 22 167 t b a; #X obj 185 322 f; #X obj 277 309 random 1000; #X obj 22 480 rotateXYZ 0 0 0; @@ -79,50 +63,45 @@ shown in example #2 can be more flexible...; #X obj 22 264 t a b b; #X msg 277 283 seed \$1; #X obj 277 256 f; -#X floatatom 295 234 5 0 0 0 - - -; +#X floatatom 295 234 5 0 0 0 - - - 0; #X obj 277 334 - 500; #X obj 185 441 / 1000; #X obj 22 400 translateXYZ -0.5 0 0; #X obj 22 103 translateXYZ 3 0 0; -#X obj 22 42 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 -; +#X obj 22 42 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 343 233 <- change random; #X text 276 356 rotation angle is random; #X text 200 390 amplitude decrease; #X msg 203 296 100; #X obj 222 351 - 1; -#X connect 0 0 19 0; -#X connect 1 0 18 0; -#X connect 3 0 12 0; -#X connect 4 0 3 0; -#X connect 5 0 4 0; -#X connect 6 0 5 0; -#X connect 6 1 3 1; -#X connect 7 0 25 0; -#X connect 7 0 10 0; -#X connect 8 0 16 0; -#X connect 9 0 2 0; -#X connect 10 0 17 0; -#X connect 11 0 6 0; -#X connect 11 1 24 0; -#X connect 11 1 14 0; -#X connect 12 0 1 0; -#X connect 12 1 7 0; -#X connect 12 2 8 0; -#X connect 13 0 8 0; -#X connect 14 0 13 0; -#X connect 15 0 14 1; -#X connect 16 0 10 1; -#X connect 17 0 9 3; -#X connect 18 0 9 0; -#X connect 19 0 11 0; -#X connect 20 0 0 0; -#X connect 24 0 7 1; -#X connect 25 0 7 1; +#X obj 22 190 gemrepeat 100; +#X connect 0 0 15 0; +#X connect 1 0 14 0; +#X connect 3 0 21 0; +#X connect 3 0 6 0; +#X connect 4 0 12 0; +#X connect 5 0 2 0; +#X connect 6 0 13 0; +#X connect 7 0 22 0; +#X connect 7 1 20 0; +#X connect 7 1 10 0; +#X connect 8 0 1 0; +#X connect 8 1 3 0; +#X connect 8 2 4 0; +#X connect 9 0 4 0; +#X connect 10 0 9 0; +#X connect 11 0 10 1; +#X connect 12 0 6 1; +#X connect 13 0 5 3; +#X connect 14 0 5 0; +#X connect 15 0 7 0; +#X connect 16 0 0 0; +#X connect 20 0 3 1; +#X connect 21 0 3 1; +#X connect 22 0 8 0; #X restore 32 581 pd more_interating_2; #X obj 445 223 gemhead; -#X obj 445 198 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; +#X obj 445 198 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 443 178 #3:; #X obj 445 410 rotateXYZ 60 30 0; #X obj 445 452 translateXYZ 2 0 0; @@ -130,15 +109,11 @@ shown in example #2 can be more flexible...; #X text 593 178 #4:; #X text 611 314 [gemlist] stores the current state; #X text 613 330 and outputs it when banged; -#X text 30 528 The example #4 can easily be extended to use many primitives. -; -#X text 31 122 [gemhead]'s output is a special message describing the -"state" of the system. This state is changed by the GEM objects. This -means that the examples below are equivalent:; +#X text 30 528 The example #4 can easily be extended to use many primitives.; +#X text 31 122 [gemhead]'s output is a special message describing the "state" of the system. This state is changed by the GEM objects. This means that the examples below are equivalent:; #X obj 445 431 teapot 1; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; diff --git a/examples/02.advanced/20.double-gemhead_vs_repeat.pd b/examples/02.advanced/20.double-gemhead_vs_repeat.pd index 4b553286c..3f72422f5 100644 --- a/examples/02.advanced/20.double-gemhead_vs_repeat.pd +++ b/examples/02.advanced/20.double-gemhead_vs_repeat.pd @@ -1,9 +1,8 @@ -#N canvas 265 100 742 519 10; +#N canvas 833 124 742 519 10; #X declare -lib Gem; #X obj 93 144 gemhead; #X obj 93 205 b; -#X obj 93 124 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; +#X obj 93 124 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #X obj 93 336 gemhead; #X msg 25 305 0; #X obj 25 285 loadbang; @@ -16,8 +15,7 @@ #X obj 93 426 circle 0.2; #X text 40 25 the "double [gemhead] idiom" vs. [repeat]; #X obj 438 146 gemhead; -#X obj 438 128 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 -1; +#X obj 438 128 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #X obj 479 375 unpack 0 0 0; #X text 525 206 two messages in one; #X obj 438 425 square 0.2; @@ -33,10 +31,8 @@ #X msg 479 328 0 -2 0; #X msg 511 348 0 2 0; #X obj 508 284 + 1; -#X text 258 65 The gemhead object resets the states for OpenGL and -also some pix_ settings. Anything after it is starts as a clean state -similar to combining [separator] and [pix_separator]. (cc); -#N canvas 220 0 701 555 more_on_the_"repeat"_technics 0; +#X text 258 65 The gemhead object resets the states for OpenGL and also some pix_ settings. Anything after it is starts as a clean state similar to combining [separator] and [pix_separator]. (cc); +#N canvas 853 316 701 555 more_on_the_"repeat"_technics 0; #X obj 21 54 gemhead; #X obj 21 281 separator; #X obj 21 128 t a b; @@ -53,24 +49,17 @@ similar to combining [separator] and [pix_separator]. (cc); #X obj 21 310 t a b b; #X obj 118 313 spigot 0; #X obj 199 312 spigot 0; -#X obj 278 276 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X text 311 274 <- if you reset the random at the beginning of each -frame \, then all frames look the same.; +#X obj 278 276 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 311 274 <- if you reset the random at the beginning of each frame \, then all frames look the same.; #X obj 21 101 scaleXYZ 1 1 1; -#X floatatom 52 80 5 0 0 0 - - -; -#X floatatom 95 80 5 0 0 0 - - -; -#X obj 21 230 gemlist; -#X obj 21 208 until; -#X msg 21 184 100; -#X obj 21 162 t b a; -#X text 23 504 This patch shows how to draw the same primitive with -the a single [gemhead] many times; -#X obj 21 35 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 -; +#X floatatom 52 80 5 0 0 0 - - - 0; +#X floatatom 95 80 5 0 0 0 - - - 0; +#X text 23 504 This patch shows how to draw the same primitive with the a single [gemhead] many times; +#X obj 21 35 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 21 200 gemrepeat 100; #X connect 0 0 18 0; #X connect 1 0 13 0; -#X connect 2 0 24 0; +#X connect 2 0 23 0; #X connect 2 1 3 0; #X connect 2 1 12 0; #X connect 3 0 14 0; @@ -92,21 +81,16 @@ the a single [gemhead] many times; #X connect 18 0 2 0; #X connect 19 0 18 1; #X connect 20 0 18 2; -#X connect 21 0 1 0; -#X connect 22 0 21 0; -#X connect 23 0 22 0; -#X connect 24 0 23 0; -#X connect 24 1 21 1; -#X connect 26 0 0 0; +#X connect 22 0 0 0; +#X connect 23 0 1 0; #X restore 370 469 pd more_on_the_"repeat"_technics; #X obj 93 186 translateXYZ; -#X floatatom 120 168 5 0 0 0 - - -; +#X floatatom 120 168 5 0 0 0 - - - 0; #X text 168 167 <- fun!; #X obj 438 187 translateXYZ; -#X floatatom 465 169 5 0 0 0 - - -; +#X floatatom 465 169 5 0 0 0 - - - 0; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; diff --git a/examples/02.advanced/22.double-iterative.pd b/examples/02.advanced/22.double-iterative.pd index fd6a48d47..613781134 100644 --- a/examples/02.advanced/22.double-iterative.pd +++ b/examples/02.advanced/22.double-iterative.pd @@ -1,45 +1,31 @@ -#N canvas 6 61 473 588 10; +#N canvas 778 250 473 588 10; #X declare -lib Gem; -#X obj 32 103 gemhead; -#X obj 106 235 gemlist; -#X msg 106 192 20; -#X obj 106 213 until; -#X obj 32 149 route gem_state; -#X obj 32 171 route float; -#X obj 32 127 t a a; -#X obj 106 259 rotateXYZ 10 20 30; -#X obj 180 413 gemlist; -#X msg 180 370 20; -#X obj 180 391 until; -#X obj 106 327 route gem_state; -#X obj 106 349 route float; -#X obj 106 305 t a a; -#X obj 180 437 rotateXYZ 10 20 30; -#X obj 180 497 cube 0.1; -#X obj 106 280 separator; +#X obj 29 134 gemhead; +#X obj 29 248 rotateXYZ 10 20 30; +#X obj 29 393 rotateXYZ 10 20 30; +#X obj 29 477 cube 0.1; +#X obj 29 271 separator; #N canvas 0 0 450 300 light 0; #X obj 225 45 gemhead 10; -#X floatatom 258 78 5 0 0 0 - - -; -#X floatatom 299 77 5 0 0 0 - - -; -#X floatatom 341 78 5 0 0 0 - - -; +#X floatatom 258 78 5 0 0 0 - - - 0; +#X floatatom 299 77 5 0 0 0 - - - 0; +#X floatatom 341 78 5 0 0 0 - - - 0; #X msg 319 150 1 0 0; #X obj 225 227 world_light; #X msg 333 173 0.4 0.4 0.4; #X msg 309 127 0 0 0; -#X obj 228 160 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 228 160 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 228 181 debug \$1; #X obj 225 103 rotateXYZ 0 30 0; #X obj 27 51 gemhead 10; -#X floatatom 60 84 5 0 0 0 - - -; -#X floatatom 101 83 5 0 0 0 - - -; -#X floatatom 143 84 5 0 0 0 - - -; +#X floatatom 60 84 5 0 0 0 - - - 0; +#X floatatom 101 83 5 0 0 0 - - - 0; +#X floatatom 143 84 5 0 0 0 - - - 0; #X msg 121 156 1 0 0; #X obj 27 233 world_light; #X msg 130 173 0.4 0.4 0.4; #X msg 111 133 0 0 0; -#X obj 30 166 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 30 166 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 30 187 debug \$1; #X obj 27 109 rotateXYZ 0 -90 0; #X msg 362 225 0.8 0.8 0.8; @@ -74,47 +60,37 @@ #X restore 300 152 pd light; #X obj 300 131 gemwin; #X msg 300 104 lighting 1 \, create \, 1; -#X obj 180 477 translateXYZ 0.3 0 0; -#X floatatom 252 414 5 0 0 0 - - -; -#X floatatom 292 415 5 0 0 0 - - -; -#X floatatom 334 415 5 0 0 0 - - -; -#X floatatom 254 456 5 0 0 0 - - -; -#X floatatom 300 456 5 0 0 0 - - -; -#X floatatom 342 457 5 0 0 0 - - -; -#X floatatom 176 236 5 0 0 0 - - -; -#X floatatom 216 237 5 0 0 0 - - -; -#X floatatom 258 237 5 0 0 0 - - -; -#X text 309 238 <- fun 1; -#X text 386 416 <- fun 2; -#X text 389 457 <- fun 3; +#X obj 29 453 translateXYZ 0.3 0 0; +#X floatatom 64 367 5 0 0 0 - - - 0; +#X floatatom 104 368 5 0 0 0 - - - 0; +#X floatatom 146 368 5 0 0 0 - - - 0; +#X floatatom 68 427 5 0 0 0 - - - 0; +#X floatatom 114 427 5 0 0 0 - - - 0; +#X floatatom 156 428 5 0 0 0 - - - 0; +#X floatatom 64 221 5 0 0 0 - - - 0; +#X floatatom 104 222 5 0 0 0 - - - 0; +#X floatatom 146 222 5 0 0 0 - - - 0; +#X text 197 223 <- fun 1; +#X text 198 369 <- fun 2; +#X text 203 428 <- fun 3; #X text 136 30 double iterative process; #X obj 368 8 declare -lib Gem; -#X connect 0 0 6 0; -#X connect 1 0 7 0; -#X connect 2 0 3 0; -#X connect 3 0 1 0; -#X connect 4 0 5 0; -#X connect 5 1 2 0; -#X connect 6 0 4 0; -#X connect 6 1 1 1; -#X connect 7 0 16 0; -#X connect 8 0 14 0; -#X connect 9 0 10 0; -#X connect 10 0 8 0; -#X connect 11 0 12 0; -#X connect 12 1 9 0; -#X connect 13 0 11 0; -#X connect 13 1 8 1; -#X connect 14 0 20 0; -#X connect 16 0 13 0; -#X connect 19 0 18 0; -#X connect 20 0 15 0; -#X connect 21 0 14 1; -#X connect 22 0 14 2; -#X connect 23 0 14 3; -#X connect 24 0 20 1; -#X connect 25 0 20 2; -#X connect 26 0 20 3; -#X connect 27 0 7 1; -#X connect 28 0 7 2; -#X connect 29 0 7 3; +#X obj 29 167 gemrepeat 20; +#X obj 29 328 gemrepeat 20; +#X connect 0 0 23 0; +#X connect 1 0 4 0; +#X connect 2 0 8 0; +#X connect 4 0 24 0; +#X connect 7 0 6 0; +#X connect 8 0 3 0; +#X connect 9 0 2 1; +#X connect 10 0 2 2; +#X connect 11 0 2 3; +#X connect 12 0 8 1; +#X connect 13 0 8 2; +#X connect 14 0 8 3; +#X connect 15 0 1 1; +#X connect 16 0 1 2; +#X connect 17 0 1 3; +#X connect 23 0 1 0; +#X connect 24 0 2 0; From 68c29322adb1dc985f45e45e0c60986e7c71b54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 2 May 2024 12:40:42 +0200 Subject: [PATCH 144/387] remove trailing whitespace --- examples/10.glsl/shader/GLSL_mix.frag | 1 - examples/10.glsl/shader/P_distord.frag | 1 - examples/10.glsl/shader/P_distord.vert | 7 ++-- examples/10.glsl/shader/T_distord.frag | 10 ------ examples/10.glsl/shader/T_distord.vert | 7 ++-- .../10.glsl/shader/bicubic_interpolation.frag | 10 +++--- examples/10.glsl/shader/blur.frag | 8 ++--- examples/10.glsl/shader/brick.frag | 2 +- examples/10.glsl/shader/brick.vert | 4 +-- examples/10.glsl/shader/fetching.frag | 2 -- examples/10.glsl/shader/fetching.vert | 5 ++- examples/10.glsl/shader/fetching2.frag | 10 +++--- examples/10.glsl/shader/fetching2.vert | 9 +++-- examples/10.glsl/shader/game.frag | 4 +-- examples/10.glsl/shader/game.vert | 5 ++- examples/10.glsl/shader/geo.frag | 5 ++- examples/10.glsl/shader/geo.geom | 6 ++-- examples/10.glsl/shader/light.frag | 2 +- examples/10.glsl/shader/link.frag | 34 +++++++++---------- examples/10.glsl/shader/link.vert | 2 +- examples/10.glsl/shader/mass.frag | 4 +-- examples/10.glsl/shader/mass.vert | 2 +- examples/10.glsl/shader/multitexture.frag | 3 +- examples/10.glsl/shader/multitexture.vert | 2 +- .../10.glsl/shader/multitexture_rect.frag | 1 - .../10.glsl/shader/multitexture_rect.vert | 2 +- examples/10.glsl/shader/normal.frag | 2 +- examples/10.glsl/shader/normal.vert | 2 +- examples/10.glsl/shader/tri2fan.frag | 5 ++- examples/10.glsl/shader/tri2fan.geom | 9 +++-- examples/10.glsl/shader/tri2fan.vert | 4 +-- examples/10.glsl/shader/vague.frag | 8 ++--- examples/10.glsl/shader/wave.frag | 4 +-- examples/15.GLSL4/shader/01.basic.frag | 4 +-- examples/15.GLSL4/shader/01.basic.vert | 4 +-- .../15.GLSL4/shader/02.transformation.frag | 4 +-- .../15.GLSL4/shader/02.transformation.vert | 6 ++-- examples/15.GLSL4/shader/03.texture.frag | 4 +-- examples/15.GLSL4/shader/03.texture.vert | 4 +-- 39 files changed, 89 insertions(+), 119 deletions(-) diff --git a/examples/10.glsl/shader/GLSL_mix.frag b/examples/10.glsl/shader/GLSL_mix.frag index 5d1536487..c3a38d305 100644 --- a/examples/10.glsl/shader/GLSL_mix.frag +++ b/examples/10.glsl/shader/GLSL_mix.frag @@ -32,4 +32,3 @@ void main (void) } } - diff --git a/examples/10.glsl/shader/P_distord.frag b/examples/10.glsl/shader/P_distord.frag index 29f3e63f2..9b7c4a28f 100644 --- a/examples/10.glsl/shader/P_distord.frag +++ b/examples/10.glsl/shader/P_distord.frag @@ -7,4 +7,3 @@ void main() vec2 C = (gl_TextureMatrix[0] * gl_TexCoord[0]).st; gl_FragColor = texture2D(tex0, C ) ; } - diff --git a/examples/10.glsl/shader/P_distord.vert b/examples/10.glsl/shader/P_distord.vert index f0db5f367..88ad1e5dd 100644 --- a/examples/10.glsl/shader/P_distord.vert +++ b/examples/10.glsl/shader/P_distord.vert @@ -4,7 +4,7 @@ uniform float K; uniform sampler2D tex0; void main() -{ +{ gl_TexCoord[0] = gl_MultiTexCoord0; float xs1 = sin((1.2 + gl_TexCoord[0].s)*(2.3+gl_TexCoord[0].t)); @@ -14,8 +14,7 @@ void main() float ys1 = sin((2.1 + gl_TexCoord[0].s)*(3.2+gl_TexCoord[0].t)); float ys2 = sin(ys1*5313.); float ys3 = K * sin(ys2*10113.); - + gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex + vec4(xs3,ys3,0.,0.)); - -} +} diff --git a/examples/10.glsl/shader/T_distord.frag b/examples/10.glsl/shader/T_distord.frag index 385f427c8..d837a90cb 100644 --- a/examples/10.glsl/shader/T_distord.frag +++ b/examples/10.glsl/shader/T_distord.frag @@ -19,13 +19,3 @@ void main() gl_FragColor = texture2D(tex0, C + K1 * 0.01 *vec2(xs3,ys3)) ; } - - - - - - - - - - diff --git a/examples/10.glsl/shader/T_distord.vert b/examples/10.glsl/shader/T_distord.vert index 114361517..73e134e68 100644 --- a/examples/10.glsl/shader/T_distord.vert +++ b/examples/10.glsl/shader/T_distord.vert @@ -1,9 +1,8 @@ // Cyrille Henry 2007 void main() -{ +{ gl_TexCoord[0] = gl_MultiTexCoord0; - gl_Position = ftransform(); - -} + gl_Position = ftransform(); +} diff --git a/examples/10.glsl/shader/bicubic_interpolation.frag b/examples/10.glsl/shader/bicubic_interpolation.frag index 9482bc616..44fae4db5 100644 --- a/examples/10.glsl/shader/bicubic_interpolation.frag +++ b/examples/10.glsl/shader/bicubic_interpolation.frag @@ -33,11 +33,11 @@ void main (void) vec4 w1 = C21; vec4 w2 = C12; vec4 w3 = C22; - // x derivative - vec4 x0 = (C21 - C01) / 2.; - vec4 x1 = (C31 - C11) / 2.; - vec4 x2 = (C22 - C02) / 2.; - vec4 x3 = (C32 - C12) / 2.; + // x derivative + vec4 x0 = (C21 - C01) / 2.; + vec4 x1 = (C31 - C11) / 2.; + vec4 x2 = (C22 - C02) / 2.; + vec4 x3 = (C32 - C12) / 2.; // y derivative vec4 y0 = (C12 - C10) / 2.; vec4 y1 = (C22 - C20) / 2.; diff --git a/examples/10.glsl/shader/blur.frag b/examples/10.glsl/shader/blur.frag index f54e03ac0..e40588af8 100644 --- a/examples/10.glsl/shader/blur.frag +++ b/examples/10.glsl/shader/blur.frag @@ -2,8 +2,8 @@ uniform sampler2D tex0; uniform vec2 distance; uniform vec2 TX; -void main (void) -{ +void main (void) +{ vec2 texcoord = (gl_TextureMatrix[0] * gl_TexCoord[0]).st; vec4 sample = 0.5 * texture2D(tex0, texcoord - distance); @@ -13,6 +13,4 @@ void main (void) sample /= 2.; gl_FragColor = sample; -} - - +} diff --git a/examples/10.glsl/shader/brick.frag b/examples/10.glsl/shader/brick.frag index 53e4f1b62..77744099a 100644 --- a/examples/10.glsl/shader/brick.frag +++ b/examples/10.glsl/shader/brick.frag @@ -10,7 +10,7 @@ void main() vec3 color; vec2 position, useBrick; position = MCposition / BrickSize_f; - + if (fract(position.y * 0.5) > 0.5) position.x += 0.5; diff --git a/examples/10.glsl/shader/brick.vert b/examples/10.glsl/shader/brick.vert index 1a54a8bcb..fe8016261 100644 --- a/examples/10.glsl/shader/brick.vert +++ b/examples/10.glsl/shader/brick.vert @@ -1,4 +1,4 @@ -attribute vec3 LightPosition; +attribute vec3 LightPosition; attribute vec3 BrickColor, MortarColor; attribute vec2 BrickSize, BrickPct; @@ -35,7 +35,7 @@ void main() spec = pow(spec, 16.0); } - LightIntensity = DiffuseContribution * diffuse + + LightIntensity = DiffuseContribution * diffuse + SpecularContribution * spec; MCposition = gl_Vertex.xy; diff --git a/examples/10.glsl/shader/fetching.frag b/examples/10.glsl/shader/fetching.frag index 3d1af1f0e..959821306 100644 --- a/examples/10.glsl/shader/fetching.frag +++ b/examples/10.glsl/shader/fetching.frag @@ -4,5 +4,3 @@ void main (void) { gl_FragColor = C; } - - diff --git a/examples/10.glsl/shader/fetching.vert b/examples/10.glsl/shader/fetching.vert index b41cc1620..3e41f7a07 100644 --- a/examples/10.glsl/shader/fetching.vert +++ b/examples/10.glsl/shader/fetching.vert @@ -4,12 +4,11 @@ void main() { vec4 v = vec4(gl_Vertex); vec4 color = texture2D(MyTex, (gl_TextureMatrix[0] * gl_MultiTexCoord0).st); - v.z = color.r; + v.z = color.r; // v.x += (color.b-0.5)/2.; // v.y += (color.g-0.5)/2.; C=color; gl_Position = gl_ModelViewProjectionMatrix * v; - -} +} diff --git a/examples/10.glsl/shader/fetching2.frag b/examples/10.glsl/shader/fetching2.frag index 1b576a50d..20cebf1e8 100644 --- a/examples/10.glsl/shader/fetching2.frag +++ b/examples/10.glsl/shader/fetching2.frag @@ -13,7 +13,7 @@ vec2 pos_(vec2 V, float x, float y) void main (void) { - vec2 pos = gl_TexCoord[0].st * vec2(90.,62.)/256. ; + vec2 pos = gl_TexCoord[0].st * vec2(90.,62.)/256. ; vec4 color1 = texture2DRect(texture,pos_(pos,-1./256.,-1./256.)); vec4 color2 = texture2DRect(texture,pos_(pos, 0./256.,-1./256.)); @@ -26,11 +26,11 @@ void main (void) vec4 color9 = texture2DRect(texture,pos_(pos, 1./256., 1./256.)); vec4 colorBG = color1 + color2 + color4 + color5; - vec4 colorBD = color3 + color2 + color6 + color5; - vec4 colorHG = color4 + color5 + color7 + color8; + vec4 colorBD = color3 + color2 + color6 + color5; + vec4 colorHG = color4 + color5 + color7 + color8; vec4 colorHD = color5 + color6 + color8 + color9; - vec2 fract_pos = (fract(pos)); + vec2 fract_pos = (fract(pos)); vec4 XB = mix(colorBG,colorBD,fract_pos.x); vec4 XH = mix(colorHG,colorHD,fract_pos.x); @@ -52,5 +52,3 @@ void main (void) gl_FragColor = color; } - - diff --git a/examples/10.glsl/shader/fetching2.vert b/examples/10.glsl/shader/fetching2.vert index 01fbf0ab8..a7f48efac 100644 --- a/examples/10.glsl/shader/fetching2.vert +++ b/examples/10.glsl/shader/fetching2.vert @@ -11,11 +11,10 @@ void main() gl_TexCoord[0] = gl_MultiTexCoord0; - v.x = color.r -0.5; - v.y = color.g -0.5; - v.z = color.b -0.5; + v.x = color.r -0.5; + v.y = color.g -0.5; + v.z = color.b -0.5; gl_Position = gl_ModelViewProjectionMatrix * v; - -} +} diff --git a/examples/10.glsl/shader/game.frag b/examples/10.glsl/shader/game.frag index 9b5800d05..9e2673d58 100644 --- a/examples/10.glsl/shader/game.frag +++ b/examples/10.glsl/shader/game.frag @@ -5,12 +5,12 @@ uniform sampler2D texture; const float dx = 1./500.; // change to gemwin dim void main (void) -{ +{ vec2 tmp = (gl_TextureMatrix[0] * gl_TexCoord[0]).st; float x = tmp.s; float y = tmp.t; - + vec4 c; c = texture2D(texture, vec2(x-dx, y-dx)); c += texture2D(texture, vec2(x, y-dx)); diff --git a/examples/10.glsl/shader/game.vert b/examples/10.glsl/shader/game.vert index 64eb4f475..8d9d76de6 100644 --- a/examples/10.glsl/shader/game.vert +++ b/examples/10.glsl/shader/game.vert @@ -7,8 +7,7 @@ uniform float K3; uniform vec2 offset; void main() -{ +{ gl_TexCoord[0] = gl_MultiTexCoord0; - gl_Position = ftransform(); + gl_Position = ftransform(); } - diff --git a/examples/10.glsl/shader/geo.frag b/examples/10.glsl/shader/geo.frag index 7ec0b43c4..557b38edb 100644 --- a/examples/10.glsl/shader/geo.frag +++ b/examples/10.glsl/shader/geo.frag @@ -1,8 +1,7 @@ void main() -{ +{ vec4 tmp = gl_Color; tmp.a /= 10.; - gl_FragColor = tmp; + gl_FragColor = tmp; // set color but alpha is 20 time less } - diff --git a/examples/10.glsl/shader/geo.geom b/examples/10.glsl/shader/geo.geom index 3271c6fc7..5be7ab394 100644 --- a/examples/10.glsl/shader/geo.geom +++ b/examples/10.glsl/shader/geo.geom @@ -1,5 +1,5 @@ -#version 120 -#extension GL_EXT_geometry_shader4: enable +#version 120 +#extension GL_EXT_geometry_shader4: enable void main(void) { @@ -23,6 +23,6 @@ void main(void) // the geometry as already been transform in 2d, so we jut have to move it in X and Y EmitVertex(); } - EndPrimitive(); + EndPrimitive(); } } diff --git a/examples/10.glsl/shader/light.frag b/examples/10.glsl/shader/light.frag index e8f5da2ec..93bff45fb 100644 --- a/examples/10.glsl/shader/light.frag +++ b/examples/10.glsl/shader/light.frag @@ -17,7 +17,7 @@ uniform vec3 MaterialKs; // Specular reflectivity uniform float MaterialShininess; // Specular shininess factor // The lighting model -vec3 blinnPhong( vec3 position, vec3 n) { +vec3 blinnPhong( vec3 position, vec3 n) { vec3 ambient = LightLa * MaterialKa; vec3 s = normalize( LightPosition.xyz - position ); float sDotN = max( dot(s,n), 0.0 ); diff --git a/examples/10.glsl/shader/link.frag b/examples/10.glsl/shader/link.frag index 053cd5ef3..08c703c4a 100644 --- a/examples/10.glsl/shader/link.frag +++ b/examples/10.glsl/shader/link.frag @@ -4,7 +4,7 @@ uniform sampler2DRect texture_mass, texture_mass_old, texture_normal; uniform float init, gravite; uniform vec2 wind; -uniform float D; +uniform float D; uniform float K1; // rigiditée liaison uniform float W,f,N; // amplitude du Wind et frequence; Noise uniform float t; //temps @@ -29,7 +29,7 @@ void main (void) vec4 pos = texture2DRect(texture_mass, coord );// -vec4(0.5); vec4 pos_old = texture2DRect(texture_mass_old,coord );// -vec4(0.5); vec4 posG = texture2DRect(texture_mass, (coord+vec2(-1., 0.)));// -vec4(0.5); - vec4 posD = texture2DRect(texture_mass, (coord+vec2( 1., 0.)));// -vec4(0.5); + vec4 posD = texture2DRect(texture_mass, (coord+vec2( 1., 0.)));// -vec4(0.5); vec4 posH = texture2DRect(texture_mass, (coord+vec2( 0., 1.)));// -vec4(0.5); vec4 posB = texture2DRect(texture_mass, (coord+vec2( 0.,-1.)));// -vec4(0.5); vec4 posHD = texture2DRect(texture_mass, (coord+vec2( 1.,-1.)));// -vec4(0.5); @@ -42,10 +42,10 @@ void main (void) vec4 pos2B = texture2DRect(texture_mass, (coord+vec2( 0.,-2.)));// -vec4(0.5); // lecture des position des masses voisinnes - force = pos-pos_old; + force = pos-pos_old; // ajout de la force d'inertie (conservation de la vitesse) - force *= 1.-D; + force *= 1.-D; // damping relatif a un point fix // ATTENTION, c'est le seul damping du system! @@ -54,64 +54,64 @@ void main (void) // on ajoute une force ssi la taille est > 0 // on limite aussi ds l'espace pour ne prendre en compte que le lien valide (effet de bord) - dist = pos.xyz - posG.xyz ; + dist = pos.xyz - posG.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x > 1.) ) { force.xyz += -K1 * (taille - 1./1000.)* normalize(dist); } - dist = pos.xyz - posD.xyz ; + dist = pos.xyz - posD.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x < 91.) ) { force.xyz += -K1 * (taille - 1./1000.)* normalize(dist); } - dist = pos.xyz - posH.xyz ; + dist = pos.xyz - posH.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.y < 63.) ) { force.xyz += -K1 * (taille - 1./1000.)* normalize(dist); } - dist = pos.xyz - posB.xyz ; + dist = pos.xyz - posB.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.y > 1.) ) { force.xyz += -K1 * (taille - 1./1000.)* normalize(dist); } // 4 liens diagonaux (haut gauche, bas droite, etc) - dist = pos.xyz - posHD.xyz ; + dist = pos.xyz - posHD.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x < 91.) && (coord.y > 1.) ) { force.xyz += -K1 * (taille - 1.4142/1000.)* normalize(dist); } - - dist = pos.xyz - posBG.xyz ; + + dist = pos.xyz - posBG.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x > 1.) && (coord.y < 63.) ) { force.xyz += -K1 * (taille - 1.4142/1000.)* normalize(dist); } - dist = pos.xyz - posHG.xyz ; + dist = pos.xyz - posHG.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x < 91.) && (coord.y < 63.) ) { force.xyz += -K1 * (taille - 1.4142/1000.)* normalize(dist); } - dist = pos.xyz - posBD.xyz ; + dist = pos.xyz - posBD.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x > 1.) && (coord.y > 1.) ) { force.xyz += -K1 * (taille - 1.4142/1000.)* normalize(dist); } // 4 liens double longeur (rigidité de flexion) - dist = pos.xyz - pos2G.xyz ; + dist = pos.xyz - pos2G.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x > 2.) ) { force.xyz += -K1 * (taille - 2./1000.)* normalize(dist); } - dist = pos.xyz - pos2D.xyz ; + dist = pos.xyz - pos2D.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.x < 90.) ) { force.xyz += -K1 * (taille - 2./1000.)* normalize(dist); } - dist = pos.xyz - pos2H.xyz ; + dist = pos.xyz - pos2H.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.y < 62.) ) { force.xyz += -K1 * (taille - 2./1000.)* normalize(dist); } - dist = pos.xyz - pos2B.xyz ; + dist = pos.xyz - pos2B.xyz ; taille = length(dist) ; if ( (taille > 0.) && (coord.y > 2.) ) { force.xyz += -K1 * (taille - 2./1000.)* normalize(dist); } diff --git a/examples/10.glsl/shader/link.vert b/examples/10.glsl/shader/link.vert index fefc3663a..13ffc195b 100644 --- a/examples/10.glsl/shader/link.vert +++ b/examples/10.glsl/shader/link.vert @@ -3,7 +3,7 @@ varying vec2 coord; void main() { - + coord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; gl_Position = ftransform(); diff --git a/examples/10.glsl/shader/mass.frag b/examples/10.glsl/shader/mass.frag index 29a2ef2f8..4dbdd6de4 100644 --- a/examples/10.glsl/shader/mass.frag +++ b/examples/10.glsl/shader/mass.frag @@ -15,9 +15,9 @@ void main (void) force = min(max(force,vec4(-0.5)),vec4(0.5)); // on vire les +inf et -inf qui peuvent poser pb en cas d'instabilités - pos += force; + pos += force; //increment de la position - + float reset = step(coord.x,1.); // reset *= step(mod(coord.y,10.),4.); // les point en x<1 sont tjrs reseté : ils sont dc imobiles diff --git a/examples/10.glsl/shader/mass.vert b/examples/10.glsl/shader/mass.vert index fefc3663a..13ffc195b 100644 --- a/examples/10.glsl/shader/mass.vert +++ b/examples/10.glsl/shader/mass.vert @@ -3,7 +3,7 @@ varying vec2 coord; void main() { - + coord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; gl_Position = ftransform(); diff --git a/examples/10.glsl/shader/multitexture.frag b/examples/10.glsl/shader/multitexture.frag index 9e8ed0ce0..89c8dfcbd 100644 --- a/examples/10.glsl/shader/multitexture.frag +++ b/examples/10.glsl/shader/multitexture.frag @@ -7,7 +7,6 @@ varying vec2 texcoord2; void main (void) { vec4 color = texture2D(MyTex, texcoord1); - vec4 color2 = texture2D(MyTex1, texcoord2); + vec4 color2 = texture2D(MyTex1, texcoord2); gl_FragColor = (color + color2) / 2.; } - diff --git a/examples/10.glsl/shader/multitexture.vert b/examples/10.glsl/shader/multitexture.vert index 2cade19b4..627e4bfe1 100644 --- a/examples/10.glsl/shader/multitexture.vert +++ b/examples/10.glsl/shader/multitexture.vert @@ -3,7 +3,7 @@ varying vec2 texcoord2; void main() { - + texcoord1 = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; texcoord2 = (gl_TextureMatrix[1] * gl_MultiTexCoord1).st; gl_Position = ftransform(); diff --git a/examples/10.glsl/shader/multitexture_rect.frag b/examples/10.glsl/shader/multitexture_rect.frag index 3eb9b2b4c..c77ce199a 100644 --- a/examples/10.glsl/shader/multitexture_rect.frag +++ b/examples/10.glsl/shader/multitexture_rect.frag @@ -12,4 +12,3 @@ void main (void) vec4 color2 = texture2DRect(MyTex1, texcoord1); // texcoord2 does not work. gl_FragColor = (color + color2) / 2.; } - diff --git a/examples/10.glsl/shader/multitexture_rect.vert b/examples/10.glsl/shader/multitexture_rect.vert index 2cade19b4..627e4bfe1 100644 --- a/examples/10.glsl/shader/multitexture_rect.vert +++ b/examples/10.glsl/shader/multitexture_rect.vert @@ -3,7 +3,7 @@ varying vec2 texcoord2; void main() { - + texcoord1 = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; texcoord2 = (gl_TextureMatrix[1] * gl_MultiTexCoord1).st; gl_Position = ftransform(); diff --git a/examples/10.glsl/shader/normal.frag b/examples/10.glsl/shader/normal.frag index eef7f86f6..fa7040c83 100644 --- a/examples/10.glsl/shader/normal.frag +++ b/examples/10.glsl/shader/normal.frag @@ -19,7 +19,7 @@ void main (void) vec4 posD = texture2DRect(texture_mass, test1(coord+vec2( 1., 0.))) ; vec4 posH = texture2DRect(texture_mass, test1(coord+vec2( 0.,-1.))) ; vec4 posB = texture2DRect(texture_mass, test1(coord+vec2( 0., 1.))) ; - + vec3 normal = cross((posG.xyz-posD.xyz),(posH.xyz-posB.xyz)); color.xyz = normalize(normal); color.xyz = normal; diff --git a/examples/10.glsl/shader/normal.vert b/examples/10.glsl/shader/normal.vert index fefc3663a..13ffc195b 100644 --- a/examples/10.glsl/shader/normal.vert +++ b/examples/10.glsl/shader/normal.vert @@ -3,7 +3,7 @@ varying vec2 coord; void main() { - + coord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; gl_Position = ftransform(); diff --git a/examples/10.glsl/shader/tri2fan.frag b/examples/10.glsl/shader/tri2fan.frag index 391dc6893..f0d81281e 100644 --- a/examples/10.glsl/shader/tri2fan.frag +++ b/examples/10.glsl/shader/tri2fan.frag @@ -1,6 +1,5 @@ void main() -{ - gl_FragColor = vec4(1.0,1.0,1.0,0.1); +{ + gl_FragColor = vec4(1.0,1.0,1.0,0.1); // set color } - diff --git a/examples/10.glsl/shader/tri2fan.geom b/examples/10.glsl/shader/tri2fan.geom index 45961e25c..ff98206fc 100644 --- a/examples/10.glsl/shader/tri2fan.geom +++ b/examples/10.glsl/shader/tri2fan.geom @@ -1,11 +1,11 @@ // Cyrille Henry 2010 -#version 120 +#version 120 #extension GL_EXT_geometry_shader4 : enable void main(void) { - + int i; //increment variable vec4 pos1,pos2, pos3, pos4, pos5; // tmp vec3 high; @@ -16,7 +16,7 @@ void main(void) pos3 = gl_PositionIn[i+2]; pos4 = (pos1 + pos2 + pos3) / 3.; // center of the triangle - high = 10.*cross(pos2.xyz-pos1.xyz,pos3.xyz-pos2.xyz); + high = 10.*cross(pos2.xyz-pos1.xyz,pos3.xyz-pos2.xyz); // hight and orientation of the piramide high = normalize(high); @@ -43,9 +43,8 @@ void main(void) gl_Position = gl_ModelViewProjectionMatrix * pos5; EmitVertex(); - EndPrimitive(); + EndPrimitive(); // new primitive } } - diff --git a/examples/10.glsl/shader/tri2fan.vert b/examples/10.glsl/shader/tri2fan.vert index 2d22ff21d..bcc2538d2 100644 --- a/examples/10.glsl/shader/tri2fan.vert +++ b/examples/10.glsl/shader/tri2fan.vert @@ -1,6 +1,4 @@ void main() -{ +{ gl_Position = gl_Vertex; } - - diff --git a/examples/10.glsl/shader/vague.frag b/examples/10.glsl/shader/vague.frag index 7b6a2f36e..41961bd93 100644 --- a/examples/10.glsl/shader/vague.frag +++ b/examples/10.glsl/shader/vague.frag @@ -2,12 +2,12 @@ #extension GL_ARB_texture_rectangle : enable -uniform float K; +uniform float K; uniform sampler2DRect texture, texture1, texture2; -const float dx = 1.; -const float dy = 1.; -const float dp = 1.; +const float dx = 1.; +const float dy = 1.; +const float dp = 1.; void main (void) { diff --git a/examples/10.glsl/shader/wave.frag b/examples/10.glsl/shader/wave.frag index d455f884a..3f0cdbce5 100644 --- a/examples/10.glsl/shader/wave.frag +++ b/examples/10.glsl/shader/wave.frag @@ -5,7 +5,7 @@ uniform float K1,K3,D1,K; uniform sampler2DRect text; -const float dx = 1.; +const float dx = 1.; const float dy = 1.; void main (void) @@ -17,7 +17,7 @@ void main (void) x=texture1.x; y=texture1.y; - C = texture2DRect(text, vec2(x, y)); + C = texture2DRect(text, vec2(x, y)); vec4 color_cote = texture2DRect(text, vec2(x-dx, y-dy)); color_cote += texture2DRect(text, vec2(x+dx, y-dy)); diff --git a/examples/15.GLSL4/shader/01.basic.frag b/examples/15.GLSL4/shader/01.basic.frag index eb2e69bb1..ba695e533 100644 --- a/examples/15.GLSL4/shader/01.basic.frag +++ b/examples/15.GLSL4/shader/01.basic.frag @@ -5,10 +5,10 @@ // This is the fragment shader : it is executed for every pixel to display -in vec3 Color_to_frag; +in vec3 Color_to_frag; // the variable commint from the VBO -out vec4 FragColor; +out vec4 FragColor; // The only output of this shader : the color of the pixel void main() { diff --git a/examples/15.GLSL4/shader/01.basic.vert b/examples/15.GLSL4/shader/01.basic.vert index 547eacee0..fb18ee34b 100644 --- a/examples/15.GLSL4/shader/01.basic.vert +++ b/examples/15.GLSL4/shader/01.basic.vert @@ -17,9 +17,9 @@ out vec3 Color_to_frag; void main() { - Color_to_frag = color; + Color_to_frag = color; // initialise the variable to pass to the frag shader with data comming from the VBO - + gl_Position = vec4(position,1.0); // update vertex position from the VBO // No perspective is apply in this example } diff --git a/examples/15.GLSL4/shader/02.transformation.frag b/examples/15.GLSL4/shader/02.transformation.frag index eb2e69bb1..ba695e533 100644 --- a/examples/15.GLSL4/shader/02.transformation.frag +++ b/examples/15.GLSL4/shader/02.transformation.frag @@ -5,10 +5,10 @@ // This is the fragment shader : it is executed for every pixel to display -in vec3 Color_to_frag; +in vec3 Color_to_frag; // the variable commint from the VBO -out vec4 FragColor; +out vec4 FragColor; // The only output of this shader : the color of the pixel void main() { diff --git a/examples/15.GLSL4/shader/02.transformation.vert b/examples/15.GLSL4/shader/02.transformation.vert index fd577249c..640e3ba80 100644 --- a/examples/15.GLSL4/shader/02.transformation.vert +++ b/examples/15.GLSL4/shader/02.transformation.vert @@ -12,7 +12,7 @@ layout (location=1) in vec3 color; // location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) uniform mat4 transformation_matrix; -// The transformation matrix we want to apply to the vertex. +// The transformation matrix we want to apply to the vertex. // The shader did not receive the transformation matrix from the pipeline, so we need to creater one and pass it as an argument. // In this example, we use gemlist_matrix in the patch to get the transformation matrix. // The perspective matrix (set with the perspec message to gemwin) is not used. @@ -24,9 +24,9 @@ out vec3 Color_to_frag; void main() { - Color_to_frag = color; + Color_to_frag = color; // initialise the variable to pass to the frag shader with data comming from the VBO - + gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO // No perspective is apply in this example } diff --git a/examples/15.GLSL4/shader/03.texture.frag b/examples/15.GLSL4/shader/03.texture.frag index 2f188eb15..affacbbb7 100644 --- a/examples/15.GLSL4/shader/03.texture.frag +++ b/examples/15.GLSL4/shader/03.texture.frag @@ -9,11 +9,11 @@ uniform sampler2D Texture1; uniform sampler2D Texture2; uniform float mix_factor; -out vec4 FragColor; +out vec4 FragColor; void main() { vec4 color1 = texture(Texture1, TexCoord); vec4 color2 = texture(Texture2, TexCoord); - + FragColor = mix(color1, color2, mix_factor); } diff --git a/examples/15.GLSL4/shader/03.texture.vert b/examples/15.GLSL4/shader/03.texture.vert index 30707d22c..37cf6b027 100644 --- a/examples/15.GLSL4/shader/03.texture.vert +++ b/examples/15.GLSL4/shader/03.texture.vert @@ -10,7 +10,7 @@ in vec2 texcoord; out vec2 TexCoord; void main() -{ +{ TexCoord = texcoord; // pass the data from VBO to the frag shader - gl_Position = vec4(position,1.0); + gl_Position = vec4(position,1.0); } From ffc754e1198110a05d066614f62b086c5cd89ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 2 May 2024 13:01:32 +0200 Subject: [PATCH 145/387] Use modern-style initialization --- examples/10.glsl/17.light.pd | 49 +++++---- examples/15.GLSL4/01.basic.pd | 68 ++++++------- examples/15.GLSL4/02.transformation.pd | 131 +++++++++++++------------ examples/15.GLSL4/03.texture.pd | 109 +++++++++----------- 4 files changed, 170 insertions(+), 187 deletions(-) diff --git a/examples/10.glsl/17.light.pd b/examples/10.glsl/17.light.pd index 8720bed60..10e0b084c 100644 --- a/examples/10.glsl/17.light.pd +++ b/examples/10.glsl/17.light.pd @@ -82,15 +82,13 @@ #X obj 195 114 t a a; #X msg 226 140 open \$1.vert; #X msg 229 169 open \$1.frag; -#X obj 250 356 t b; #X obj 181 199 glsl_vertex; #X obj 181 242 glsl_fragment; -#X obj 181 334 glsl_program; -#X obj 181 457 rotateXYZ -40 10 0; +#X obj 181 507 rotateXYZ -40 10 0; #X msg 195 82 symbol shader/light; -#X obj 181 484 torus 2 30 0.8; +#X obj 181 534 torus 2 30 0.8; #X text 350 21 Since shader remplace the standard pipeline \, light are not automatically computed. Lighting effect have to be manually computed in the shader.; -#X floatatom 216 434 5 0 0 0 - - - 0; +#X floatatom 216 484 5 0 0 0 - - - 0; #N canvas 1921 61 450 300 pak 0; #X obj 74 46 inlet; #X obj 76 110 pack f f f; @@ -112,31 +110,28 @@ #X floatatom 398 292 5 0 0 0 - - - 0; #X floatatom 443 292 5 0 0 0 - - - 0; #X floatatom 485 293 5 0 0 0 - - - 0; -#X msg 250 380 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.1 0.1 0.5 \, MaterialKd 0.8 0.1 0.1 \, MaterialKs 0.1 0.3 0.1 \, MaterialShininess 30; +#X obj 181 364 glsl_program \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.1 0.1 0.5 \; MaterialKd 0.8 0.1 0.1 \; MaterialKs 0.1 0.3 0.1 \; MaterialShininess 30; #X connect 0 0 1 0; #X connect 2 0 6 0; -#X connect 3 0 18 0; -#X connect 4 0 14 0; -#X connect 6 0 16 0; +#X connect 3 0 16 0; +#X connect 4 0 13 0; +#X connect 6 0 25 0; #X connect 6 1 5 0; #X connect 8 0 2 0; #X connect 10 0 12 0; #X connect 10 1 11 0; -#X connect 11 0 14 0; -#X connect 12 0 15 0; -#X connect 13 0 27 0; -#X connect 14 0 15 0; -#X connect 14 1 8 1; -#X connect 15 0 16 0; -#X connect 15 1 8 0; -#X connect 16 0 17 0; -#X connect 16 1 13 0; -#X connect 17 0 19 0; -#X connect 18 0 10 0; -#X connect 21 0 17 1; -#X connect 22 0 23 0; -#X connect 23 0 16 0; -#X connect 24 0 22 0; -#X connect 25 0 22 1; -#X connect 26 0 22 2; -#X connect 27 0 16 0; +#X connect 11 0 13 0; +#X connect 12 0 14 0; +#X connect 13 0 14 0; +#X connect 13 1 8 1; +#X connect 14 0 25 0; +#X connect 14 1 8 0; +#X connect 15 0 17 0; +#X connect 16 0 10 0; +#X connect 19 0 15 1; +#X connect 20 0 21 0; +#X connect 21 0 25 0; +#X connect 22 0 20 0; +#X connect 23 0 20 1; +#X connect 24 0 20 2; +#X connect 25 0 15 0; diff --git a/examples/15.GLSL4/01.basic.pd b/examples/15.GLSL4/01.basic.pd index fd9694e5b..9e909d9a9 100644 --- a/examples/15.GLSL4/01.basic.pd +++ b/examples/15.GLSL4/01.basic.pd @@ -37,12 +37,10 @@ #X obj 267 232 glsl_fragment; #X obj 281 45 loadbang; #X obj 267 324 glsl_program; -#X obj 267 638 gemvertexbuffer; #X obj 267 14 gemhead; #X msg 363 454 program \$1; #X obj 373 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 381 490 print_attributes; -#X obj 371 538 loadbang; #X obj 336 346 t b f; #X text 447 454 <----- essential for lookup functions; #X obj 374 320 print linking; @@ -51,7 +49,6 @@ #X msg 385 341 bang; #X obj 44 9 declare -lib Gem; #X obj 347 255 pack f f; -#X msg 371 559 resize 9 \, draw tri; #X obj 336 368 f \$0; #X msg 336 400 attribute position \$1_position \, attribute color \$1_color; #N canvas 340 107 682 322 gemwin 0; @@ -94,8 +91,8 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; #X obj 281 104 t a a; -#X msg 312 130 open \$1.vert; -#X msg 315 159 open \$1.frag; +#X msg 312 130 open shader/\$1.vert; +#X msg 315 159 open shader/\$1.frag; #X obj 303 586 t a a; #X obj 40 175 table \$0_position 9; #X obj 40 196 table \$0_color 9; @@ -105,37 +102,36 @@ #X msg 40 341 0 1 0 0 0 1 0 0 0 1; #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; -#X msg 281 72 symbol shader/01.basic; +#X msg 281 72 symbol 01.basic; +#X obj 267 638 gemvertexbuffer \; resize 9 \; draw tri; #X connect 0 0 1 0; -#X connect 2 0 16 0; +#X connect 2 0 14 0; #X connect 3 0 4 0; -#X connect 3 1 20 1; +#X connect 3 1 18 1; #X connect 4 0 6 0; -#X connect 4 1 20 0; -#X connect 5 0 37 0; -#X connect 6 0 7 0; -#X connect 6 1 13 0; -#X connect 8 0 3 0; -#X connect 9 0 28 0; -#X connect 11 0 28 0; -#X connect 12 0 21 0; -#X connect 13 0 22 0; -#X connect 13 1 9 0; -#X connect 16 0 6 0; -#X connect 16 1 15 0; -#X connect 18 0 22 0; -#X connect 20 0 2 0; -#X connect 21 0 28 0; -#X connect 22 0 23 0; -#X connect 23 0 28 0; -#X connect 25 0 27 0; -#X connect 25 1 26 0; -#X connect 26 0 3 0; -#X connect 27 0 4 0; -#X connect 28 0 7 0; -#X connect 28 1 17 0; -#X connect 31 0 35 0; -#X connect 34 0 33 0; -#X connect 35 0 32 0; -#X connect 36 0 34 0; -#X connect 37 0 25 0; +#X connect 4 1 18 0; +#X connect 5 0 34 0; +#X connect 6 0 35 0; +#X connect 6 1 11 0; +#X connect 7 0 3 0; +#X connect 8 0 25 0; +#X connect 10 0 25 0; +#X connect 11 0 19 0; +#X connect 11 1 8 0; +#X connect 14 0 6 0; +#X connect 14 1 13 0; +#X connect 16 0 19 0; +#X connect 18 0 2 0; +#X connect 19 0 20 0; +#X connect 20 0 25 0; +#X connect 22 0 24 0; +#X connect 22 1 23 0; +#X connect 23 0 3 0; +#X connect 24 0 4 0; +#X connect 25 0 35 0; +#X connect 25 1 15 0; +#X connect 28 0 32 0; +#X connect 31 0 30 0; +#X connect 32 0 29 0; +#X connect 33 0 31 0; +#X connect 34 0 22 0; diff --git a/examples/15.GLSL4/02.transformation.pd b/examples/15.GLSL4/02.transformation.pd index cd0f93f4e..33cf0abbc 100644 --- a/examples/15.GLSL4/02.transformation.pd +++ b/examples/15.GLSL4/02.transformation.pd @@ -1,4 +1,4 @@ -#N canvas 554 237 989 704 10; +#N canvas 554 90 989 704 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -33,16 +33,14 @@ #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; #X msg 347 275 link \$1 \$2; -#X obj 267 189 glsl_vertex; +#X obj 267 199 glsl_vertex; #X obj 267 232 glsl_fragment; -#X obj 281 45 loadbang; +#X obj 318 106 loadbang; #X obj 267 324 glsl_program; -#X obj 267 638 gemvertexbuffer; #X obj 267 14 gemhead; #X msg 363 454 program \$1; #X obj 373 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 381 490 print_attributes; -#X obj 371 538 loadbang; #X obj 336 346 t b f; #X text 447 454 <----- essential for lookup functions; #X obj 374 320 print linking; @@ -51,7 +49,6 @@ #X msg 385 341 bang; #X obj 44 9 declare -lib Gem; #X obj 347 255 pack f f; -#X msg 371 559 resize 9 \, draw tri; #X obj 336 368 f \$0; #X msg 336 400 attribute position \$1_position \, attribute color \$1_color; #N canvas 171 609 682 322 gemwin 0; @@ -93,9 +90,9 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 281 104 t a a; -#X msg 312 130 open \$1.vert; -#X msg 315 159 open \$1.frag; +#X obj 318 149 t a a; +#X msg 345 176 open shader/\$1.vert; +#X msg 345 199 open shader/\$1.frag; #X obj 303 586 t a a; #X obj 40 175 table \$0_position 9; #X obj 40 196 table \$0_color 9; @@ -105,7 +102,7 @@ #X msg 40 341 0 1 0 0 0 1 0 0 0 1; #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; -#X msg 281 72 symbol shader/02.transformation; +#X msg 318 127 symbol 02.transformation; #X obj 626 18 gemhead; #X floatatom 661 50 5 0 0 0 - - - 0; #X floatatom 696 50 5 0 0 0 - - - 0; @@ -118,16 +115,16 @@ #X floatatom 708 99 5 0 0 0 - - - 0; #N canvas 437 191 753 491 shear 0; #X obj 25 17 inlet; -#X obj 28 270 outlet; +#X obj 25 270 outlet; #X obj 108 21 inlet; #X obj 205 20 inlet; #X obj 297 18 inlet; #X text 117 38 ShearXY; #X text 217 37 ShearXZ; #X text 306 36 ShearYZ; -#X obj 27 104 shearXY; -#X obj 26 153 shearXZ; -#X obj 26 212 shearYZ; +#X obj 25 104 shearXY; +#X obj 25 153 shearXZ; +#X obj 25 212 shearYZ; #X connect 0 0 8 0; #X connect 2 0 8 1; #X connect 3 0 9 1; @@ -146,56 +143,62 @@ #X obj 707 288 list trim; #X obj 626 73 translateXYZ 0 0 4; #X text 565 618 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; +#X obj 267 638 gemvertexbuffer \; resize 9 \; draw tri; +#X obj 267 42 translateXYZ; +#X floatatom 330 16 5 0 0 0 - - - 0; +#X text 369 15 this transformation is ignored..., f 19; +#X msg 218 303 print; #X connect 0 0 1 0; -#X connect 2 0 16 0; +#X connect 2 0 14 0; #X connect 3 0 4 0; -#X connect 3 1 20 1; +#X connect 3 1 18 1; #X connect 4 0 6 0; -#X connect 4 1 20 0; -#X connect 5 0 37 0; -#X connect 6 0 7 0; -#X connect 6 1 13 0; -#X connect 8 0 3 0; -#X connect 9 0 28 0; -#X connect 11 0 28 0; -#X connect 12 0 21 0; -#X connect 13 0 22 0; -#X connect 13 1 9 0; -#X connect 16 0 6 0; -#X connect 16 1 15 0; -#X connect 18 0 22 0; -#X connect 20 0 2 0; -#X connect 21 0 28 0; -#X connect 22 0 23 0; -#X connect 23 0 28 0; -#X connect 25 0 27 0; -#X connect 25 1 26 0; -#X connect 26 0 3 0; -#X connect 27 0 4 0; -#X connect 28 0 7 0; -#X connect 28 1 17 0; -#X connect 31 0 35 0; -#X connect 34 0 33 0; -#X connect 35 0 32 0; -#X connect 36 0 34 0; -#X connect 37 0 25 0; -#X connect 38 0 57 0; -#X connect 39 0 57 1; -#X connect 40 0 57 2; -#X connect 41 0 57 3; -#X connect 42 0 49 1; -#X connect 43 0 49 2; -#X connect 44 0 49 3; -#X connect 45 0 50 1; -#X connect 46 0 50 2; -#X connect 47 0 50 3; -#X connect 48 0 49 0; -#X connect 49 0 54 0; -#X connect 50 0 48 0; -#X connect 51 0 48 1; -#X connect 52 0 48 2; -#X connect 53 0 48 3; -#X connect 54 1 55 0; -#X connect 55 0 56 0; -#X connect 56 0 6 0; -#X connect 57 0 50 0; +#X connect 4 1 18 0; +#X connect 5 0 34 0; +#X connect 6 0 56 0; +#X connect 6 1 11 0; +#X connect 7 0 57 0; +#X connect 8 0 25 0; +#X connect 10 0 25 0; +#X connect 11 0 19 0; +#X connect 11 1 8 0; +#X connect 14 0 6 0; +#X connect 14 1 13 0; +#X connect 16 0 19 0; +#X connect 18 0 2 0; +#X connect 19 0 20 0; +#X connect 20 0 25 0; +#X connect 22 0 24 0; +#X connect 22 1 23 0; +#X connect 23 0 3 0; +#X connect 24 0 4 0; +#X connect 25 0 56 0; +#X connect 25 1 15 0; +#X connect 28 0 32 0; +#X connect 31 0 30 0; +#X connect 32 0 29 0; +#X connect 33 0 31 0; +#X connect 34 0 22 0; +#X connect 35 0 54 0; +#X connect 36 0 54 1; +#X connect 37 0 54 2; +#X connect 38 0 54 3; +#X connect 39 0 46 1; +#X connect 40 0 46 2; +#X connect 41 0 46 3; +#X connect 42 0 47 1; +#X connect 43 0 47 2; +#X connect 44 0 47 3; +#X connect 45 0 46 0; +#X connect 46 0 51 0; +#X connect 47 0 45 0; +#X connect 48 0 45 1; +#X connect 49 0 45 2; +#X connect 50 0 45 3; +#X connect 51 1 52 0; +#X connect 52 0 53 0; +#X connect 53 0 6 0; +#X connect 54 0 47 0; +#X connect 57 0 3 0; +#X connect 58 0 57 1; +#X connect 60 0 6 0; diff --git a/examples/15.GLSL4/03.texture.pd b/examples/15.GLSL4/03.texture.pd index c047f31aa..6437a19c2 100644 --- a/examples/15.GLSL4/03.texture.pd +++ b/examples/15.GLSL4/03.texture.pd @@ -1,4 +1,4 @@ -#N canvas 325 157 939 801 10; +#N canvas 608 89 939 801 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -35,23 +35,19 @@ #X msg 507 375 link \$1 \$2; #X obj 427 309 glsl_vertex; #X obj 427 332 glsl_fragment; -#X obj 441 165 loadbang; -#X obj 427 424 glsl_program; -#X obj 427 738 gemvertexbuffer; +#X obj 441 182 loadbang; #X obj 427 14 gemhead; -#X msg 523 554 program \$1; +#X msg 529 554 program \$1; #X obj 523 584 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 531 590 print_attributes; -#X obj 531 638 loadbang; -#X obj 496 446 t b f; +#X obj 502 466 t b f; #X text 607 554 <----- essential for lookup functions; #X obj 534 420 print linking; #X obj 507 397 t a a; -#X obj 490 710 print vb; -#X msg 545 441 bang; +#X obj 490 650 print vb; #X obj 44 9 declare -lib Gem; #X obj 507 355 pack f f; -#X obj 496 468 f \$0; +#X obj 502 488 f \$0; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -92,69 +88,62 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; #X obj 441 224 t a a; -#X msg 472 250 open \$1.vert; -#X msg 475 279 open \$1.frag; -#X obj 463 686 t a a; +#X msg 468 250 open shader/\$1.vert; +#X msg 471 279 open shader/\$1.frag; +#X obj 463 626 t a a; #X obj 41 235 loadbang; #X obj 41 283 s \$0_position; #X obj 40 317 loadbang; -#X msg 441 192 symbol shader/03.texture; +#X msg 441 203 symbol 03.texture; #X obj 427 42 pix_image ../data/img1.jpg; #X obj 427 67 pix_texture; #X msg 41 260 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 0.8 0 0.8 -0.8 0; #X obj 40 175 table \$0_position 12; #X obj 40 196 table \$0_texcoord 8; #X obj 40 364 s \$0_texcoord; -#X msg 496 500 attribute position \$1_position \, attribute texcoord \$1_texcoord, f 63; -#X msg 531 659 draw quad; -#X obj 427 128 pix_texture; -#X msg 625 56 texunit 1; -#X obj 625 31 loadbang; +#X msg 502 510 attribute position \$1_position \, attribute texcoord \$1_texcoord, f 63; #X obj 427 103 pix_image ../data/img2.jpg; #X floatatom 682 333 5 0 1 0 - - - 0; -#X msg 550 471 Texture2 1; #X msg 682 356 mix_factor \$1; #X msg 40 341 0 0 1 0 0 1 0 1 1; +#X obj 427 128 pix_texture \; texunit 1; +#X msg 542 323 bang; +#X obj 427 678 gemvertexbuffer \; draw quad; +#X obj 427 424 glsl_program \; Texture2 1; #X connect 0 0 1 0; -#X connect 2 0 16 0; +#X connect 2 0 13 0; #X connect 3 0 4 0; -#X connect 3 1 20 1; -#X connect 4 0 6 0; -#X connect 4 1 20 0; -#X connect 5 0 30 0; -#X connect 6 0 7 0; -#X connect 6 1 13 0; -#X connect 8 0 31 0; -#X connect 9 0 26 0; -#X connect 11 0 26 0; -#X connect 12 0 38 0; -#X connect 13 0 21 0; -#X connect 13 0 44 0; -#X connect 13 1 9 0; -#X connect 16 0 6 0; -#X connect 16 1 15 0; -#X connect 18 0 21 0; -#X connect 20 0 2 0; -#X connect 21 0 37 0; -#X connect 23 0 25 0; -#X connect 23 1 24 0; -#X connect 24 0 3 0; -#X connect 25 0 4 0; -#X connect 26 0 7 0; -#X connect 26 1 17 0; -#X connect 27 0 33 0; -#X connect 29 0 46 0; -#X connect 30 0 23 0; -#X connect 31 0 32 0; -#X connect 32 0 42 0; -#X connect 33 0 28 0; -#X connect 37 0 26 0; -#X connect 38 0 26 0; -#X connect 39 0 3 0; -#X connect 40 0 39 0; +#X connect 3 1 16 1; +#X connect 4 0 41 0; +#X connect 4 1 16 0; +#X connect 5 0 26 0; +#X connect 6 0 27 0; +#X connect 7 0 22 0; +#X connect 9 0 22 0; +#X connect 10 0 17 0; +#X connect 10 1 7 0; +#X connect 13 0 41 0; +#X connect 13 1 12 0; +#X connect 16 0 2 0; +#X connect 17 0 33 0; +#X connect 19 0 21 0; +#X connect 19 1 20 0; +#X connect 20 0 3 0; +#X connect 21 0 4 0; +#X connect 22 0 40 0; +#X connect 22 1 14 0; +#X connect 23 0 29 0; +#X connect 25 0 37 0; +#X connect 26 0 19 0; +#X connect 27 0 28 0; +#X connect 28 0 34 0; +#X connect 29 0 24 0; +#X connect 33 0 22 0; +#X connect 34 0 38 0; +#X connect 35 0 36 0; +#X connect 36 0 41 0; +#X connect 37 0 32 0; +#X connect 38 0 3 0; +#X connect 39 0 16 0; #X connect 41 0 40 0; -#X connect 42 0 39 0; -#X connect 43 0 45 0; -#X connect 44 0 6 0; -#X connect 45 0 6 0; -#X connect 46 0 36 0; +#X connect 41 1 10 0; From d5a02cdd465d7b906abefde98f36c5e95d8a7c1b Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 2 May 2024 16:00:02 +0200 Subject: [PATCH 146/387] add an example that show how to use modelfiler to load a geometry --- examples/15.GLSL4/04.model.pd | 202 +++++++++++++++++++++++++ examples/15.GLSL4/shader/04.model.frag | 38 +++++ examples/15.GLSL4/shader/04.model.vert | 29 ++++ examples/Makefile.am | 3 + 4 files changed, 272 insertions(+) create mode 100644 examples/15.GLSL4/04.model.pd create mode 100644 examples/15.GLSL4/shader/04.model.frag create mode 100644 examples/15.GLSL4/shader/04.model.vert diff --git a/examples/15.GLSL4/04.model.pd b/examples/15.GLSL4/04.model.pd new file mode 100644 index 000000000..3e858b2a0 --- /dev/null +++ b/examples/15.GLSL4/04.model.pd @@ -0,0 +1,202 @@ +#N canvas 725 113 967 800 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X msg 347 275 link \$1 \$2; +#X obj 267 199 glsl_vertex; +#X obj 267 232 glsl_fragment; +#X obj 318 106 loadbang; +#X obj 267 14 gemhead; +#X msg 428 590 program \$1; +#X obj 373 624 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 381 630 print_attributes; +#X obj 402 467 t b f; +#X obj 374 320 print linking; +#X obj 347 297 t a a; +#X obj 330 690 print vb; +#X obj 44 9 declare -lib Gem; +#X obj 347 255 pack f f; +#N canvas 171 609 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 318 149 t a a; +#X msg 345 176 open shader/\$1.vert; +#X msg 345 199 open shader/\$1.frag; +#X obj 303 666 t a a; +#X obj 582 18 gemhead; +#X floatatom 617 50 5 0 0 0 - - - 0; +#X floatatom 652 50 5 0 0 0 - - - 0; +#X floatatom 687 50 5 0 0 0 - - - 0; +#X floatatom 598 163 5 0 0 0 - - - 0; +#X floatatom 632 163 5 0 0 0 - - - 0; +#X floatatom 666 163 5 0 0 0 - - - 0; +#X obj 582 184 rotateXYZ; +#X obj 582 209 gemlist_matrix; +#X obj 663 236 list prepend transformation_matrix; +#X obj 663 258 list trim; +#X obj 582 73 translateXYZ 0 0 4; +#X obj 267 42 translateXYZ; +#X floatatom 330 16 5 0 0 0 - - - 0; +#X text 369 15 this transformation is ignored..., f 19; +#X msg 285 303 print; +#N canvas 1001 526 302 371 table 0; +#X obj 29 30 table table_posX; +#X obj 29 53 table table_posY; +#X obj 29 76 table table_posZ; +#X obj 27 113 table table_normalX; +#X obj 27 136 table table_normalY; +#X obj 27 159 table table_normalZ; +#X obj 28 195 table table_colorR; +#X obj 28 215 table table_colorG; +#X obj 28 235 table table_colorB; +#X restore 42 175 pd table; +#N canvas 1279 243 543 538 modelfiler 0; +#X obj 81 277 modelfiler; +#X msg 106 132 position table_pos; +#X msg 118 158 color table_color; +#X msg 136 212 normal table_normal; +#X obj 81 25 loadbang; +#X obj 144 24 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X msg 81 95 open ../data/venus.obj; +#X obj 81 303 route vertices; +#X msg 81 332 resize \$1; +#X obj 81 55 t b b b; +#X msg 201 361 sinesum 8192 0.5 0.25 0.25 0 0.2; +#X obj 91 419 s table_colorR; +#X obj 91 449 s table_colorG; +#X obj 91 479 s table_colorB; +#X msg 219 383 sinesum 8192 0.5 -0.25 0.25 0 0.2; +#X msg 235 409 sinesum 8192 0.5 0.25 -0.25 0 0.2; +#X connect 0 0 7 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 4 0 9 0; +#X connect 5 0 9 0; +#X connect 6 0 0 0; +#X connect 7 0 8 0; +#X connect 8 0 11 0; +#X connect 8 0 12 0; +#X connect 8 0 13 0; +#X connect 9 0 6 0; +#X connect 9 1 1 0; +#X connect 9 1 3 0; +#X connect 9 2 10 0; +#X connect 9 2 14 0; +#X connect 9 2 15 0; +#X connect 10 0 11 0; +#X connect 14 0 12 0; +#X connect 15 0 13 0; +#X restore 40 205 pd modelfiler; +#X msg 318 127 symbol 04.model; +#X obj 582 118 scaleXYZ 0.003 0.003 0.003; +#X obj 267 349 glsl_program \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.5 0.5 0.5 \; MaterialKd 0.1 0.1 0.1 \; MaterialKs 0.3 0.3 0.3 \; MaterialShininess 30; +#X msg 402 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; +#X obj 267 718 gemvertexbuffer \; draw tri; +#X connect 0 0 1 0; +#X connect 2 0 12 0; +#X connect 3 0 4 0; +#X connect 3 1 15 1; +#X connect 4 0 41 0; +#X connect 4 1 15 0; +#X connect 5 0 39 0; +#X connect 6 0 33 0; +#X connect 7 0 20 0; +#X connect 9 0 20 0; +#X connect 10 0 42 0; +#X connect 10 1 7 0; +#X connect 12 0 41 0; +#X connect 12 1 11 0; +#X connect 15 0 2 0; +#X connect 17 0 19 0; +#X connect 17 1 18 0; +#X connect 18 0 3 0; +#X connect 19 0 4 0; +#X connect 20 0 43 0; +#X connect 20 1 13 0; +#X connect 21 0 32 0; +#X connect 22 0 32 1; +#X connect 23 0 32 2; +#X connect 24 0 32 3; +#X connect 25 0 28 1; +#X connect 26 0 28 2; +#X connect 27 0 28 3; +#X connect 28 0 29 0; +#X connect 29 1 30 0; +#X connect 30 0 31 0; +#X connect 31 0 41 0; +#X connect 32 0 40 0; +#X connect 33 0 3 0; +#X connect 34 0 33 1; +#X connect 36 0 41 0; +#X connect 39 0 17 0; +#X connect 40 0 28 0; +#X connect 41 0 43 0; +#X connect 41 1 10 0; +#X connect 42 0 20 0; diff --git a/examples/15.GLSL4/shader/04.model.frag b/examples/15.GLSL4/shader/04.model.frag new file mode 100644 index 000000000..b696daa16 --- /dev/null +++ b/examples/15.GLSL4/shader/04.model.frag @@ -0,0 +1,38 @@ +#version 460 +// Cyrille Henry 2024 + +// light description +uniform vec4 LightPosition; // Light position in eye coords. +uniform vec3 LightLa; // Ambient light intensity +uniform vec3 LightL; // Diffuse and specular light intensity + +// material definition +uniform vec3 MaterialKa; // Ambient reflectivity +uniform vec3 MaterialKd; // Diffuse reflectivity +uniform vec3 MaterialKs; // Specular reflectivity +uniform float MaterialShininess; // Specular shininess factor + +in vec4 Color; +in vec3 Normal; +in vec4 Position; + +out vec4 FragColor; +// The only output of this shader : the color of the pixel + +vec3 blinnPhong( vec3 position, vec3 n) { + vec3 ambient = LightLa * MaterialKa; + vec3 s = normalize( LightPosition.xyz - position ); + float sDotN = max( dot(s,n), 0.0 ); + vec3 diffuse = MaterialKd * sDotN; + vec3 spec = vec3(0.0); + if( sDotN > 0.0 ) { + vec3 v = normalize(-position.xyz); + vec3 h = normalize( v + s ); + spec = MaterialKs * pow( max( dot(h,n), 0.0 ), MaterialShininess ); + } + return ambient + LightL * (diffuse + spec); +} + +void main() { + FragColor = Color * vec4(blinnPhong(Position.xyz, normalize(Normal)), 1.); +} diff --git a/examples/15.GLSL4/shader/04.model.vert b/examples/15.GLSL4/shader/04.model.vert new file mode 100644 index 000000000..cc5156fcd --- /dev/null +++ b/examples/15.GLSL4/shader/04.model.vert @@ -0,0 +1,29 @@ +#version 460 + +// Cyrille Henry 2024 + + +layout (location=0) in float positionX; +layout (location=1) in float positionY; +layout (location=2) in float positionZ; +layout (location=3) in float normal_X; +layout (location=4) in float normal_Y; +layout (location=5) in float normal_Z; +layout (location=6) in float colorR; +layout (location=7) in float colorG; +layout (location=8) in float colorB; + +uniform mat4 transformation_matrix; + +out vec4 Color; +out vec3 Normal; +out vec4 Position; + +void main() +{ + Color = vec4(colorR, colorG, colorB, 1.); + Normal = vec3(normal_X, normal_Y, normal_Z); + vec3 pos = vec3(positionX, positionY, positionZ); + Position = transformation_matrix * vec4(pos,1.0); + gl_Position = Position; +} diff --git a/examples/Makefile.am b/examples/Makefile.am index 3fbababc1..9602ae29a 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -228,6 +228,9 @@ nobase_dist_gemexamples_DATA = \ 15.GLSL4/shader/02.transformation.vert \ 15.GLSL4/shader/03.texture.frag \ 15.GLSL4/shader/03.texture.vert \ + 15.GLSL4/04.model.pd \ + 15.GLSL4/shader/04.model.vert \ + 15.GLSL4/shader/04.model.frag \ 99.games/puzzle.pd \ data/img1.jpg \ data/img2.jpg \ From 4b6498809794cf7d37f069c95588c4f2687c3743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 2 May 2024 18:26:27 +0200 Subject: [PATCH 147/387] remove trailing whitespace --- examples/15.GLSL4/shader/04.model.vert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/15.GLSL4/shader/04.model.vert b/examples/15.GLSL4/shader/04.model.vert index cc5156fcd..421b0735d 100644 --- a/examples/15.GLSL4/shader/04.model.vert +++ b/examples/15.GLSL4/shader/04.model.vert @@ -24,6 +24,6 @@ void main() Color = vec4(colorR, colorG, colorB, 1.); Normal = vec3(normal_X, normal_Y, normal_Z); vec3 pos = vec3(positionX, positionY, positionZ); - Position = transformation_matrix * vec4(pos,1.0); + Position = transformation_matrix * vec4(pos,1.0); gl_Position = Position; } From b3b41ec77a8a6499b35220697dc13c54db913001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 3 May 2024 12:43:24 +0200 Subject: [PATCH 148/387] [gemglxwindow] pick *best* framebuffer, rather first matching --- src/Output/gemglxwindow.cpp | 381 +++++++++++++++++++++++++----------- 1 file changed, 270 insertions(+), 111 deletions(-) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index 36e70ac61..7a0b4505c 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -18,14 +18,10 @@ #ifdef HAVE_GL_GLX_H #include "gemglxwindow.h" #include "Gem/GemGL.h" -#include -#include -#include #include "RTE/MessageCallbacks.h" #include "Gem/Exception.h" - #ifdef HAVE_LIBXXF86VM # include #endif @@ -35,8 +31,13 @@ #include #endif -// for printf() debugging -#include +#include +#include + +#include +#include +#include +#include CPPEXTERN_NEW(gemglxwindow); @@ -44,6 +45,11 @@ CPPEXTERN_NEW(gemglxwindow); ExposureMask|StructureNotifyMask|PointerMotionMask|ButtonMotionMask | \ ButtonReleaseMask | ButtonPressMask | KeyPressMask | KeyReleaseMask | DestroyNotify + + +#define GETGLXFUN(type, name) type name##Fn = (type) glXGetProcAddress((const GLubyte*) #name ) + + #ifdef HAVE_LIBXRENDER static int fbDbl32[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, @@ -309,6 +315,185 @@ static Bool WaitForNotify(Display *, XEvent *e, char *arg) } +namespace { + struct glxFB { + Display*dpy; + GLXFBConfig fb; + PFNGLXGETFBCONFIGATTRIBPROC _configattrib; + PFNGLXGETVISUALFROMFBCONFIGPROC _getvisual; + glxFB(Display*_dpy, GLXFBConfig _fb) + : dpy(_dpy) + , fb(_fb) + { + GETGLXFUN(PFNGLXGETFBCONFIGATTRIBPROC, glXGetFBConfigAttrib); + GETGLXFUN(PFNGLXGETVISUALFROMFBCONFIGPROC, glXGetVisualFromFBConfig); + _configattrib = glXGetFBConfigAttribFn; + _getvisual = glXGetVisualFromFBConfigFn; + } + + int ConfigAttrib(int attrib) { + int value = -1; + if(_configattrib) + _configattrib(dpy, fb, attrib, &value); + return value; + } + + XVisualInfo*Visual() { + if(_getvisual) + return (XVisualInfo*) _getvisual(dpy, fb); + return 0; + } + }; + + struct FBconfig { + Display *dpy; + GLXFBConfig fb; + int redBits, greenBits, blueBits, alphaBits; + int depthBits, stencilBits; + int accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; + int auxBuffers; + int samples, depth; + bool stereo, sRGB, doublebuffer, transparency; + int colormode; + int renderType, drawableType; + + FBconfig(int colorBits, int accumBits) + : dpy(0), fb(0) + , redBits(colorBits), greenBits(colorBits), blueBits(colorBits), alphaBits(colorBits) + , depthBits(0), stencilBits(0) + , accumRedBits(accumBits), accumGreenBits(accumBits), accumBlueBits(accumBits), accumAlphaBits(accumBits) + , auxBuffers(0) + , samples(0), depth(0) + , stereo(false), sRGB(false), doublebuffer(true), transparency(false) + , colormode(TrueColor) + , renderType(GLX_RGBA_BIT), drawableType(GLX_WINDOW_BIT) + { } + + FBconfig(Display *_dpy, GLXFBConfig _fb) + : dpy(_dpy), fb(_fb) + , redBits(0), greenBits(0), blueBits(0), alphaBits(0) + , depthBits(0), stencilBits(0) + , accumRedBits(0), accumGreenBits(0), accumBlueBits(0), accumAlphaBits(0) + , auxBuffers(0) + , samples(0), depth(0) + , stereo(false), sRGB(false), doublebuffer(false), transparency(false) + , colormode(0) + , renderType(0), drawableType(0) + { + glxFB gfb (dpy, fb); + redBits = gfb.ConfigAttrib(GLX_RED_SIZE); + greenBits = gfb.ConfigAttrib(GLX_GREEN_SIZE); + blueBits = gfb.ConfigAttrib(GLX_BLUE_SIZE); + alphaBits = gfb.ConfigAttrib(GLX_ALPHA_SIZE); + + depthBits = gfb.ConfigAttrib(GLX_DEPTH_SIZE); + stencilBits = gfb.ConfigAttrib(GLX_STENCIL_SIZE); + + accumRedBits = gfb.ConfigAttrib(GLX_ACCUM_RED_SIZE); + accumGreenBits = gfb.ConfigAttrib(GLX_ACCUM_GREEN_SIZE); + accumBlueBits = gfb.ConfigAttrib(GLX_ACCUM_BLUE_SIZE); + accumAlphaBits = gfb.ConfigAttrib(GLX_ACCUM_ALPHA_SIZE); + + auxBuffers = gfb.ConfigAttrib(GLX_AUX_BUFFERS); + + stereo = gfb.ConfigAttrib(GLX_STEREO); + +// if (GLXEW_ARB_framebuffer_sRGB) + sRGB = gfb.ConfigAttrib(GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB) > 0; + + doublebuffer = gfb.ConfigAttrib(GLX_DOUBLEBUFFER) > 0; + + XVisualInfo *vi = gfb.Visual(); + if(vi) { + depth = vi->depth; + colormode = vi->c_class; +#ifdef HAVE_LIBXRENDER + XRenderPictFormat *pf = XRenderFindVisualFormat(dpy, vi->visual); + transparency = pf && pf->direct.alphaMask>0; +#endif + XFree(vi); + } + +// if (GLXEW_ARB_multisample) + samples = gfb.ConfigAttrib(GLX_SAMPLES); + + renderType = gfb.ConfigAttrib(GLX_RENDER_TYPE); + drawableType = gfb.ConfigAttrib(GLX_DRAWABLE_TYPE); + } + + int bufferDifference(const FBconfig&cur) { + int missing = 0; + if (alphaBits > 0 && !cur.alphaBits) missing++; + if (depthBits > 0 && !cur.depthBits) missing++; + if (stencilBits > 0 && !cur.stencilBits) missing++; + if (auxBuffers > 0 && auxBuffers > cur.auxBuffers) missing += auxBuffers - cur.auxBuffers; + if (samples > 0 && !cur.samples) missing++; + if (transparency != cur.transparency) missing++; + return missing; + } +#define CHANNEL_DIFFERENCE(member) \ + (member >= 0)?((member-cur.member)*(member-cur.member) + !cur.member):0 + int colorChannelDifference(const FBconfig&cur) { + int diff = 0; + diff += CHANNEL_DIFFERENCE(redBits); + diff += CHANNEL_DIFFERENCE(greenBits); + diff += CHANNEL_DIFFERENCE(blueBits); + return diff; + } + int extraChannelDifference(const FBconfig&cur) { + int diff = 0; + + diff += CHANNEL_DIFFERENCE(alphaBits); + diff += CHANNEL_DIFFERENCE(depthBits); + diff += CHANNEL_DIFFERENCE(stencilBits); + diff += CHANNEL_DIFFERENCE(accumRedBits); + diff += CHANNEL_DIFFERENCE(accumGreenBits); + diff += CHANNEL_DIFFERENCE(accumBlueBits); + diff += CHANNEL_DIFFERENCE(accumAlphaBits); + diff += CHANNEL_DIFFERENCE(samples); + + if (sRGB != cur.sRGB) diff++; + return diff; + } + + + }; + + std::ostream& operator<<(std::ostream& out, const FBconfig& fb) { + out + << "FBconfig(" + << "rgba=[" + << fb.redBits << "," + << fb.greenBits << "," + << fb.blueBits << "," + << fb.alphaBits << "]," + << "accum=[" + << fb.accumRedBits << "," + << fb.accumGreenBits << "," + << fb.accumBlueBits << "," + << fb.accumAlphaBits << "]," + << "depth=" << fb.depthBits << "/" << fb.depth << "," + << "stencil=" << fb.stencilBits << "," + << "samples=" << fb.samples << "," + << "aux=" << fb.auxBuffers; + + if(fb.doublebuffer) out << ",doublebuffer"; + if(fb.stereo) out << ",stereo"; + if(fb.sRGB) out << ",sRGB"; + switch(fb.colormode) { + case StaticGray: out << ",StaticGray" ; break; + case GrayScale: out << ",GrayScale" ; break; + case StaticColor: out << ",StaticColor" ; break; + case PseudoColor: out << ",PseudoColor" ; break; + case TrueColor: out << ",TrueColor" ; break; + case DirectColor: out << ",DirectColor" ; break; + default: out << ",UnknownColor"; break; + } + return out << ")"; + } +}; + + struct gemglxwindow::PIMPL { CPPExtern *parent; int fs; // FullScreen @@ -391,6 +576,20 @@ struct gemglxwindow::PIMPL { bool create(std::string display, int buffer, bool fullscreen, bool border, int&x, int&y, unsigned int&w, unsigned int&h, bool transparent) { + GETGLXFUN(PFNGLXCHOOSEFBCONFIGPROC, glXChooseFBConfig); + GETGLXFUN(PFNGLXGETFBCONFIGSPROC, glXGetFBConfigs); + GETGLXFUN(PFNGLXGETVISUALFROMFBCONFIGPROC, glXGetVisualFromFBConfig); + + switch(buffer) { + default: + pd_error(parent, "only single/double buffer supported; defaulting to double"); + case 2: + buffer = 2; + break; + case 1: + break; + } + int modeNum=4; #ifdef HAVE_LIBXXF86VM XF86VidModeModeInfo **modes; @@ -423,118 +622,78 @@ struct gemglxwindow::PIMPL { } } - XVisualInfo *vi=0; + std::vectorfbconfs; + int nativeCount; + GLXFBConfig* nativeConfigs = glXGetFBConfigsFn(dpy, screen, &nativeCount); + for (int i=0; ivisual); - if(!pict_format) { - continue; - } - - fbconfig = fbconfigs[i]; - if(pict_format->direct.alphaMask > 0) { - ::verbose(0,"choose fbconfig : %d", i); - breakme = true; - break; - } - } - if ( breakme ) { - break; - } - } + if (!(fb.drawableType & GLX_WINDOW_BIT)) { + /* not a window */ + continue; + } + if (!(fb.renderType & GLX_RGBA_BIT)) { + /* does not allow RGBA rendering */ + continue; + } + if (buffer != (fb.doublebuffer?2:1)) { + /* requested doublebuffer but got singlebuffer, or vice versa */ + continue; + } - if(!fbconfig) { - ::pd_error(parent, "Can't find valid framebuffer configuration, try again with legacy method."); - } else { - typedef void(*glXGetFBConfigAttribProc)(Display* dpy,GLXFBConfig fbconfig, - int attr, int* val); - glXGetFBConfigAttribProc glXGetFBConfigAttribFn = - (glXGetFBConfigAttribProc)glXGetProcAddress((const GLubyte*) - "glXGetFBConfigAttrib"); - if ( glXGetFBConfigAttribFn ) { - int doublebuffer; - int red_bits, green_bits, blue_bits, alpha_bits, depth_bits; - - glXGetFBConfigAttribFn(dpy, fbconfig, GLX_DOUBLEBUFFER, &doublebuffer); - glXGetFBConfigAttribFn(dpy, fbconfig, GLX_RED_SIZE, &red_bits); - glXGetFBConfigAttribFn(dpy, fbconfig, GLX_GREEN_SIZE, &green_bits); - glXGetFBConfigAttribFn(dpy, fbconfig, GLX_BLUE_SIZE, &blue_bits); - glXGetFBConfigAttribFn(dpy, fbconfig, GLX_ALPHA_SIZE, &alpha_bits); - glXGetFBConfigAttribFn(dpy, fbconfig, GLX_DEPTH_SIZE, &depth_bits); - - ::verbose(0, "FBConfig selected:"); - ::verbose(0, " Doublebuffer: %s", doublebuffer == True ? "Yes" : "No"); - ::verbose(0, - " Red Bits: %d, Green Bits: %d, Blue Bits: %d, Alpha Bits: %d, Depth Bits: %d", - red_bits, green_bits, blue_bits, alpha_bits, depth_bits); - } else { - ::pd_error(parent, "can't get glXGetFBConfigAttrib function pointer"); - } - } + if (fb.colormode != TrueColor && fb.colormode != DirectColor) { + /* TrueColor visual required for this program... */ + continue; + } + if (fb.depthBits < 16) { + /* too shallow */ + continue; } - } -#endif // HAVE_LIBXRENDER + fbconfs.push_back(fb); + } - if (vi == NULL) { // if Xrender method doesn't work try legacy - static int**buf=0; - switch(buffer) { - default: - pd_error(parent, "only single/double buffer supported; defaulting to double"); - case 2: - buf=dblBufs; - break; - case 1: - buf=snglBufs; - break; - } - // the user wants double buffer - for(; *buf; buf++) { - vi = glXChooseVisual(dpy, screen, *buf); - if(vi) { - break; + /* now that we got a number of possible configurations, find the best one */ + FBconfig desired(8, 8); + desired.doublebuffer = (buffer != 1); + desired.depthBits = 16; + desired.stencilBits = 8; + desired.transparency = transparent; + + unsigned int leastBufferDiff = UINT_MAX; + unsigned int leastColorDiff = UINT_MAX; + unsigned int leastExtraDiff = UINT_MAX; + + const FBconfig*best = &desired; + for (auto it = fbconfs.begin(); it != fbconfs.end(); it++) { + const FBconfig¤t = *it; + unsigned int bufferDiff = desired.bufferDifference(current); + unsigned int colorDiff = desired.colorChannelDifference(current); + unsigned int extraDiff = desired.extraChannelDifference(current); + + if (bufferDiff < leastBufferDiff) + best = ¤t; + else if (bufferDiff == leastBufferDiff) + { + if ((colorDiff < leastColorDiff) || + (colorDiff == leastColorDiff && extraDiff < leastExtraDiff)) + { + best = ¤t; } } + if (¤t == best) + { + leastBufferDiff = bufferDiff; + leastColorDiff = colorDiff; + leastExtraDiff = extraDiff; + } + } + XVisualInfo *vi = 0; + + //std::cerr << desired << " -> " << *best << std::endl; + + if (best->dpy && best->fb) { + vi = (XVisualInfo*) glXGetVisualFromFBConfigFn(best->dpy, best->fb); } if (vi == NULL) { From 1ab705d3ac7b054d59d5e71927b5b83c60c028de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 3 May 2024 12:43:59 +0200 Subject: [PATCH 149/387] [gemglxwindow] honour FSAA message Closes: https://github.com/umlaeute/Gem/issues/428 --- src/Output/gemglxwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index 7a0b4505c..7b77faf29 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -574,7 +574,8 @@ struct gemglxwindow::PIMPL { } bool create(std::string display, int buffer, bool fullscreen, bool border, - int&x, int&y, unsigned int&w, unsigned int&h, bool transparent) + int&x, int&y, unsigned int&w, unsigned int&h, bool transparent, + int msaa) { GETGLXFUN(PFNGLXCHOOSEFBCONFIGPROC, glXChooseFBConfig); GETGLXFUN(PFNGLXGETFBCONFIGSPROC, glXGetFBConfigs); @@ -659,6 +660,7 @@ struct gemglxwindow::PIMPL { desired.depthBits = 16; desired.stencilBits = 8; desired.transparency = transparent; + desired.samples = msaa; unsigned int leastBufferDiff = UINT_MAX; unsigned int leastColorDiff = UINT_MAX; @@ -1088,7 +1090,7 @@ bool gemglxwindow :: create(void) int x=0, y=0; unsigned int w=1, h=1; success=sharedPimpl->create(m_display, 2, false, false, x, y, w, h, - m_transparent); + m_transparent, m_fsaa); } catch (GemException&ex) { error("creation of shared glxcontext failed: %s", ex.what()); verbose(0, "continuing at your own risk!"); @@ -1122,7 +1124,7 @@ bool gemglxwindow :: create(void) try { success=m_pimpl->create(m_display, m_buffer, m_fullscreen, m_border, - m_xoffset, m_yoffset, m_width, m_height, m_transparent); + m_xoffset, m_yoffset, m_width, m_height, m_transparent, m_fsaa); } catch (GemException&x) { x.report(); success=false; From bc69202956ab2a3c6fd2249e2a6e9dfd487c0f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 3 May 2024 12:45:31 +0200 Subject: [PATCH 150/387] gemglxwindow: drop manual enumeration of fbconfigs --- src/Output/gemglxwindow.cpp | 240 ------------------------------------ 1 file changed, 240 deletions(-) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index 7b77faf29..1fcd0b76a 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -50,246 +50,6 @@ CPPEXTERN_NEW(gemglxwindow); #define GETGLXFUN(type, name) type name##Fn = (type) glXGetProcAddress((const GLubyte*) #name ) -#ifdef HAVE_LIBXRENDER -static int fbDbl32[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, True, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_ALPHA_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbDbl32Stereo[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, True, - GLX_STEREO, True, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_ALPHA_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbDbl24[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, True, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbDbl24Stereo[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, True, - GLX_STEREO, True, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbDbl8[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, True, - GLX_RED_SIZE, 3, - GLX_GREEN_SIZE, 3, - GLX_BLUE_SIZE, 2, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbDbl8Stereo[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, True, - GLX_STEREO, True, - GLX_RED_SIZE, 3, - GLX_GREEN_SIZE, 3, - GLX_BLUE_SIZE, 2, - GLX_DEPTH_SIZE, 16, - None - }; - -static int *dblBufFbCfg[] = {fbDbl32, - fbDbl32Stereo, - fbDbl24, - fbDbl24Stereo, - fbDbl8, - fbDbl8Stereo, - 0 - }; - -static int fbSngl32[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, False, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_ALPHA_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbSngl32Stereo[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, False, - GLX_STEREO, True, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_ALPHA_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbSngl24[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, False, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbSngl24Stereo[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, False, - GLX_STEREO, True, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_DEPTH_SIZE, 16, - None - }; -static int fbSngl8[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, False, - GLX_RED_SIZE, 3, - GLX_GREEN_SIZE, 3, - GLX_BLUE_SIZE, 2, - GLX_DEPTH_SIZE, 16, - None - }; - -static int fbSngl8Stereo[] = {GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, False, - GLX_STEREO, True, - GLX_RED_SIZE, 3, - GLX_GREEN_SIZE, 3, - GLX_BLUE_SIZE, 2, - GLX_DEPTH_SIZE, 16, - None - }; - -static int *snglBufFbCfg[] = {fbSngl32, - fbSngl32Stereo, - fbSngl24, - fbSngl24Stereo, - fbSngl8, - fbSngl8Stereo, - 0 - }; - -#endif // HAVE_LIBXRENDER - -// window creation variables -static int snglBuf24[] = {GLX_RGBA, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_DEPTH_SIZE, 16, - GLX_STENCIL_SIZE, 8, - GLX_ACCUM_RED_SIZE, 8, - GLX_ACCUM_GREEN_SIZE, 8, - GLX_ACCUM_BLUE_SIZE, 8, - None - }; -static int snglBuf24Stereo[] = {GLX_RGBA, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_DEPTH_SIZE, 16, - GLX_STENCIL_SIZE, 8, - GLX_ACCUM_RED_SIZE, 8, - GLX_ACCUM_GREEN_SIZE, 8, - GLX_ACCUM_BLUE_SIZE, 8, - GLX_STEREO, - None - }; -static int dblBuf24[] = {GLX_RGBA, - GLX_RED_SIZE, 4, - GLX_GREEN_SIZE, 4, - GLX_BLUE_SIZE, 4, - GLX_DEPTH_SIZE, 16, - GLX_STENCIL_SIZE, 8, - GLX_ACCUM_RED_SIZE, 8, - GLX_ACCUM_GREEN_SIZE, 8, - GLX_ACCUM_BLUE_SIZE, 8, - GLX_DOUBLEBUFFER, - None - }; -static int dblBuf24Stereo[] = {GLX_RGBA, - GLX_RED_SIZE, 4, - GLX_GREEN_SIZE, 4, - GLX_BLUE_SIZE, 4, - GLX_DEPTH_SIZE, 16, - GLX_STENCIL_SIZE, 8, - GLX_ACCUM_RED_SIZE, 8, - GLX_ACCUM_GREEN_SIZE, 8, - GLX_ACCUM_BLUE_SIZE, 8, - GLX_DOUBLEBUFFER, - GLX_STEREO, - None - }; -static int snglBuf8[] = {GLX_RGBA, - GLX_RED_SIZE, 3, - GLX_GREEN_SIZE, 3, - GLX_BLUE_SIZE, 2, - GLX_DEPTH_SIZE, 16, - None - }; -static int snglBuf8Stereo[] = {GLX_RGBA, - GLX_RED_SIZE, 3, - GLX_GREEN_SIZE, 3, - GLX_BLUE_SIZE, 2, - GLX_DEPTH_SIZE, 16, - GLX_STEREO, - None - }; -static int dblBuf8[] = {GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 2, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 16, - GLX_DOUBLEBUFFER, - None - }; - -static int dblBuf8Stereo[] = {GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 2, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 16, - GLX_DOUBLEBUFFER, - GLX_STEREO, - None - }; - -static int*dblBufs[]= { - dblBuf24Stereo, - dblBuf24, - dblBuf8Stereo, - dblBuf8, - 0 -}; -static int*snglBufs[]= { - snglBuf24Stereo, - snglBuf24, - snglBuf8Stereo, - snglBuf8, - 0 -}; - static int xerr; static int ErrorHandler (Display *dpy, XErrorEvent *event) { From 6b54846c15901f996d4af60d072bfd7ff9633996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 3 May 2024 18:13:51 +0200 Subject: [PATCH 151/387] gemglxwindow: output transparency --- src/Output/gemglxwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index 1fcd0b76a..df9d5ebc2 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -240,6 +240,7 @@ namespace { if(fb.doublebuffer) out << ",doublebuffer"; if(fb.stereo) out << ",stereo"; if(fb.sRGB) out << ",sRGB"; + if(fb.transparency) out << ",transparency"; switch(fb.colormode) { case StaticGray: out << ",StaticGray" ; break; case GrayScale: out << ",GrayScale" ; break; From 87cc3574b518955656476fb188ad9696d809f3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 3 May 2024 18:23:21 +0200 Subject: [PATCH 152/387] [gemglxwindow] cleanup --- src/Output/gemglxwindow.cpp | 38 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index df9d5ebc2..f2a10b70f 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -15,7 +15,6 @@ ///////////////////////////////////////////////////////// #include "Gem/GemConfig.h" -#ifdef HAVE_GL_GLX_H #include "gemglxwindow.h" #include "Gem/GemGL.h" @@ -23,7 +22,7 @@ #include "Gem/Exception.h" #ifdef HAVE_LIBXXF86VM -# include +# include #endif #include @@ -120,10 +119,10 @@ namespace { FBconfig(int colorBits, int accumBits) : dpy(0), fb(0) , redBits(colorBits), greenBits(colorBits), blueBits(colorBits), alphaBits(colorBits) - , depthBits(0), stencilBits(0) + , depthBits(-1), stencilBits(-1) , accumRedBits(accumBits), accumGreenBits(accumBits), accumBlueBits(accumBits), accumAlphaBits(accumBits) - , auxBuffers(0) - , samples(0), depth(0) + , auxBuffers(-1) + , samples(-1), depth(-1) , stereo(false), sRGB(false), doublebuffer(true), transparency(false) , colormode(TrueColor) , renderType(GLX_RGBA_BIT), drawableType(GLX_WINDOW_BIT) @@ -338,7 +337,6 @@ struct gemglxwindow::PIMPL { int&x, int&y, unsigned int&w, unsigned int&h, bool transparent, int msaa) { - GETGLXFUN(PFNGLXCHOOSEFBCONFIGPROC, glXChooseFBConfig); GETGLXFUN(PFNGLXGETFBCONFIGSPROC, glXGetFBConfigs); GETGLXFUN(PFNGLXGETVISUALFROMFBCONFIGPROC, glXGetVisualFromFBConfig); @@ -352,8 +350,8 @@ struct gemglxwindow::PIMPL { break; } - int modeNum=4; #ifdef HAVE_LIBXXF86VM + int modeNum=4; XF86VidModeModeInfo **modes; #endif @@ -412,6 +410,8 @@ struct gemglxwindow::PIMPL { continue; } + //std::cerr << fb << std::endl; + fbconfs.push_back(fb); } @@ -712,8 +712,6 @@ void gemglxwindow::dispatch(void) XEvent event; XButtonEvent* eb = (XButtonEvent*)&event; XKeyEvent* kb = (XKeyEvent*)&event; - char keystring[2]; - KeySym keysym_return; unsigned long devID=0; while (XCheckWindowEvent(m_pimpl->dpy,m_pimpl->win, @@ -738,7 +736,8 @@ void gemglxwindow::dispatch(void) if(!m_pimpl->have_border) { int err=XSetInputFocus(m_pimpl->dpy, m_pimpl->win, RevertToParent, CurrentTime); - err=0; + if(err) + err=0; } break; case KeyPress: @@ -871,18 +870,15 @@ bool gemglxwindow :: create(void) /* creation of gem::Context is deferred until *after* window creation */ } - int modeNum=4; -#ifdef HAVE_LIBXXF86VM - XF86VidModeModeInfo **modes; -#endif - char svalue[3]; - snprintf(svalue, 3, "%d", m_fsaa); - svalue[2]=0; - if (m_fsaa!=0) { - setenv("__GL_FSAA_MODE", svalue, 1); // this works only for NVIDIA-cards + if(m_fsaa>=0 && m_fsaa<100) { + char svalue[3]; + snprintf(svalue, 3, "%d", m_fsaa); + svalue[2]=0; + if (m_fsaa!=0) { + setenv("__GL_FSAA_MODE", svalue, 1); // this works only for NVIDIA-cards + } } - try { success=m_pimpl->create(m_display, m_buffer, m_fullscreen, m_border, m_xoffset, m_yoffset, m_width, m_height, m_transparent, m_fsaa); @@ -1037,5 +1033,3 @@ void gemglxwindow :: cursorMess(bool state) void gemglxwindow :: obj_setupCallback(t_class *classPtr) { } - -#endif /* HAVE_GL_GLX_H */ From 8521341e744d1c101df7c5af1385f7cb7d7e6e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 23 May 2024 13:23:57 +0200 Subject: [PATCH 153/387] [ci] use new libvirt based runners for Windows builds --- .git-ci/gitlab-iem.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 1089a40df..d9117cac6 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -169,7 +169,9 @@ stages: extends: - .build tags: - - windows + - libvirt:windows + image: + - windows:latest variables: IEMCI_CONFIGURATIONS: mingw64 pd_downloadsuffix: .msw.zip From add73732363663e1604f0c519848033a04916026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 23 May 2024 13:24:47 +0200 Subject: [PATCH 154/387] [ci] only a single image is a allowed for a job --- .git-ci/gitlab-iem.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index d9117cac6..4eb6e9d5d 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -170,8 +170,7 @@ stages: - .build tags: - libvirt:windows - image: - - windows:latest + image: windows:latest variables: IEMCI_CONFIGURATIONS: mingw64 pd_downloadsuffix: .msw.zip From 1659d628b7756e043b675053dfb1c2717e8ad986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 23 May 2024 15:00:34 +0200 Subject: [PATCH 155/387] [ci] on WIndows, only install packages that actually exist --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 4eb6e9d5d..ed294cd23 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -187,7 +187,7 @@ stages: - rm -f "${PDDIR}"/bin/msvcr*.dll - export PD="${PDDIR}/bin/pd.com" - result=0 - - pacman --noconfirm -S --needed $(cat .git-ci/msys2.pacman | sed -e 's|#.*||' -e "s|@MINGW@|${MINGW_PACKAGE_PREFIX}-|") || result=$? + - pacman --noconfirm -S --needed $(sed -e 's|#.*||' -e "s|@MINGW@|${MINGW_PACKAGE_PREFIX}-|" -e '/^\s*$/d' .git-ci/msys2.pacman | while read -r pkg _; do ! pacman -Sp "${pkg}" >/dev/null || echo "${pkg}"; done) # if pacman failed, try to continue (but do not mark the run as 'success') - echo "pacman returned ${result}" - test "${result}" = "0" || result="skip" From a4409e952f13174b86d3f284f0405204f074e085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Jun 2024 23:44:28 +0200 Subject: [PATCH 156/387] Add "--floatsize" configureflag --- configure.ac | 4 +++- m4/gem.m4 | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d6ce4eca1..848b74778 100644 --- a/configure.ac +++ b/configure.ac @@ -169,7 +169,7 @@ AC_SUBST(GEM_CXXFLAGS) AC_SUBST(GEM_LIBS) GEM_CHECK_WERROR -GEM_CPPFLAGS="" +GEM_CPPFLAGS="${GEM_RTE_CPPFLAGS}" GEM_CHECK_EXTERNAL # additional debugging @@ -817,7 +817,9 @@ Configuration: RTE (${GEM_RTE}): external-extension : ${GEM_RTE_EXTENSION} + CPPFLAGS : ${GEM_RTE_CPPFLAGS} CFLAGS : ${GEM_RTE_CFLAGS} + CXXFLAGS : ${GEM_RTE_CXXFLAGS} LIBS : ${GEM_RTE_LIBS} used optional libraries: diff --git a/m4/gem.m4 b/m4/gem.m4 index a41757cff..dc4e55d00 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -628,6 +628,20 @@ AS_IF([ test "x$with_extension" != "x" ],[ GEM_RTE_EXTENSION=$EXT AC_SUBST(GEM_RTE_EXTENSION) +AC_SUBST(GEM_RTE_CPPFLAGS) +AC_ARG_WITH([floatsize], + AC_HELP_STRING([--with-floatsize=], + [use a given floatsize (32, 64)])) +AC_MSG_CHECKING([floatsize]) +AS_CASE([$with_floatsize], + [32], [floatsize=32], + [64], [floatsize=64], + [""], [floatsize=""], + [AC_MSG_ERROR([invalid floatsize: only 32 and 64 are currently allowed])]) +AS_IF([test "x$floatsize" != "x"],[GEM_RTE_CPPFLAGS+=" -DPD_FLOATSIZE=${floatsize}"]) +AC_MSG_RESULT([${floatsize:-default}]) + + CPPFLAGS="$tmp_rte_cppflags" CFLAGS="$tmp_rte_cflags" CXXFLAGS="$tmp_rte_cxxflags" @@ -636,6 +650,7 @@ LIBS="$tmp_rte_libs" ]) # GEM_CHECK_RTE + AC_DEFUN([GEM_CHECK_THREADS], [ GEM_ARG_ENABLE([threads], [default: use threads]) From a4ed44a33b8ba58bbf6f7705db2a0edcd01ba5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 18 Jun 2024 08:28:58 +0200 Subject: [PATCH 157/387] "--disable-plugins" to not build (or configure) any plugins --- Makefile.am | 2 + configure.ac | 115 +++++++++++++++++++++++++++++---------------------- 2 files changed, 68 insertions(+), 49 deletions(-) diff --git a/Makefile.am b/Makefile.am index 843802215..9ce743f7b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,9 @@ SUBDIRS+=help doc examples SUBDIRS+=tools ## plugins +if PLUGINS SUBDIRS+=plugins +endif ## window objects SUBDIRS+=src/Output diff --git a/configure.ac b/configure.ac index 848b74778..6e8d94b25 100644 --- a/configure.ac +++ b/configure.ac @@ -22,50 +22,54 @@ AC_CONFIG_FILES([src/Output/Makefile ]) AC_CONFIG_FILES([src/deprecated/Makefile ]) ## plugins that use this autoconf instance for configuration -AC_CONFIG_FILES([plugins/Makefile]) - -AC_CONFIG_FILES([plugins/ASSIMP2/Makefile]) -AC_CONFIG_FILES([plugins/ASSIMP3/Makefile]) -AC_CONFIG_FILES([plugins/AVI/Makefile]) -AC_CONFIG_FILES([plugins/AVIPLAY/Makefile]) -AC_CONFIG_FILES([plugins/DC1394/Makefile]) -AC_CONFIG_FILES([plugins/DECKLINK/Makefile]) -AC_CONFIG_FILES([plugins/DV4L/Makefile]) -AC_CONFIG_FILES([plugins/FFMPEG/Makefile]) -AC_CONFIG_FILES([plugins/GMERLIN/Makefile]) -AC_CONFIG_FILES([plugins/imageIO/Makefile]) -AC_CONFIG_FILES([plugins/imageMAGICK/Makefile]) -AC_CONFIG_FILES([plugins/JPEG/Makefile]) -AC_CONFIG_FILES([plugins/MPEG1/Makefile]) -AC_CONFIG_FILES([plugins/MPEG3/Makefile]) -AC_CONFIG_FILES([plugins/NDI/Makefile]) -AC_CONFIG_FILES([plugins/OBJ/Makefile]) -AC_CONFIG_FILES([plugins/OptiTrack/Makefile]) -AC_CONFIG_FILES([plugins/PNM/Makefile]) -AC_CONFIG_FILES([plugins/PIPEWIRE/Makefile]) -AC_CONFIG_FILES([plugins/QT4L/Makefile]) -AC_CONFIG_FILES([plugins/QuickTime/Makefile]) -AC_CONFIG_FILES([plugins/SGI/Makefile]) -AC_CONFIG_FILES([plugins/STB/Makefile]) -AC_CONFIG_FILES([plugins/TEST/Makefile]) -AC_CONFIG_FILES([plugins/TIFF/Makefile]) -AC_CONFIG_FILES([plugins/UNICAP/Makefile]) -AC_CONFIG_FILES([plugins/V4L/Makefile]) -AC_CONFIG_FILES([plugins/V4L2/Makefile]) -AC_CONFIG_FILES([plugins/VFW/Makefile]) -AC_CONFIG_FILES([plugins/VIDS/Makefile]) -AC_CONFIG_FILES([plugins/VLC/Makefile]) -AC_CONFIG_FILES([plugins/VNC/Makefile]) - -AC_CONFIG_FILES([plugins/filmAVF/Makefile]) -AC_CONFIG_FILES([plugins/filmDS/Makefile]) -AC_CONFIG_FILES([plugins/filmDSATL/Makefile]) -AC_CONFIG_FILES([plugins/filmDarwin/Makefile]) - -AC_CONFIG_FILES([plugins/videoAVF/Makefile]) -AC_CONFIG_FILES([plugins/videoDS/Makefile]) -AC_CONFIG_FILES([plugins/videoDarwin/Makefile]) -AC_CONFIG_FILES([plugins/videoSGI/Makefile]) +AS_IF([test "$enable_plugins" != "no" ], [ + AC_CONFIG_FILES([plugins/Makefile]) + + AC_CONFIG_FILES([plugins/ASSIMP2/Makefile]) + AC_CONFIG_FILES([plugins/ASSIMP3/Makefile]) + AC_CONFIG_FILES([plugins/AVI/Makefile]) + AC_CONFIG_FILES([plugins/AVIPLAY/Makefile]) + AC_CONFIG_FILES([plugins/DC1394/Makefile]) + AC_CONFIG_FILES([plugins/DECKLINK/Makefile]) + AC_CONFIG_FILES([plugins/DV4L/Makefile]) + AC_CONFIG_FILES([plugins/FFMPEG/Makefile]) + AC_CONFIG_FILES([plugins/GMERLIN/Makefile]) + AC_CONFIG_FILES([plugins/imageIO/Makefile]) + AC_CONFIG_FILES([plugins/imageMAGICK/Makefile]) + AC_CONFIG_FILES([plugins/JPEG/Makefile]) + AC_CONFIG_FILES([plugins/MPEG1/Makefile]) + AC_CONFIG_FILES([plugins/MPEG3/Makefile]) + AC_CONFIG_FILES([plugins/NDI/Makefile]) + AC_CONFIG_FILES([plugins/OBJ/Makefile]) + AC_CONFIG_FILES([plugins/OptiTrack/Makefile]) + AC_CONFIG_FILES([plugins/PNM/Makefile]) + AC_CONFIG_FILES([plugins/PIPEWIRE/Makefile]) + AC_CONFIG_FILES([plugins/QT4L/Makefile]) + AC_CONFIG_FILES([plugins/QuickTime/Makefile]) + AC_CONFIG_FILES([plugins/SGI/Makefile]) + AC_CONFIG_FILES([plugins/STB/Makefile]) + AC_CONFIG_FILES([plugins/TEST/Makefile]) + AC_CONFIG_FILES([plugins/TIFF/Makefile]) + AC_CONFIG_FILES([plugins/UNICAP/Makefile]) + AC_CONFIG_FILES([plugins/V4L/Makefile]) + AC_CONFIG_FILES([plugins/V4L2/Makefile]) + AC_CONFIG_FILES([plugins/VFW/Makefile]) + AC_CONFIG_FILES([plugins/VIDS/Makefile]) + AC_CONFIG_FILES([plugins/VLC/Makefile]) + AC_CONFIG_FILES([plugins/VNC/Makefile]) + + AC_CONFIG_FILES([plugins/filmAVF/Makefile]) + AC_CONFIG_FILES([plugins/filmDS/Makefile]) + AC_CONFIG_FILES([plugins/filmDSATL/Makefile]) + AC_CONFIG_FILES([plugins/filmDarwin/Makefile]) + + AC_CONFIG_FILES([plugins/videoAVF/Makefile]) + AC_CONFIG_FILES([plugins/videoDS/Makefile]) + AC_CONFIG_FILES([plugins/videoDarwin/Makefile]) + AC_CONFIG_FILES([plugins/videoSGI/Makefile]) +]) +AM_CONDITIONAL([PLUGINS], [test "${enable_plugins}" != "no"]) + ## extra holds additional objects/libraries @@ -92,10 +96,11 @@ AC_CONFIG_HEADERS([src/Gem/GemGLconfig.h]) AC_CONFIG_SRCDIR([src/Base/GemBase.h]) AC_CONFIG_SUBDIRS([extra]) - -AS_IF([test -d "$srcdir/plugins/AVT"], [AC_CONFIG_SUBDIRS([plugins/AVT])]) -AS_IF([test -d "$srcdir/plugins/HALCON"], [AC_CONFIG_SUBDIRS([plugins/HALCON])]) -AS_IF([test -d "$srcdir/plugins/PYLON"], [AC_CONFIG_SUBDIRS([plugins/PYLON])]) +AS_IF([test "$enable_plugins" != "no" ], [ + AS_IF([test -d "$srcdir/plugins/AVT"], [AC_CONFIG_SUBDIRS([plugins/AVT])]) + AS_IF([test -d "$srcdir/plugins/HALCON"], [AC_CONFIG_SUBDIRS([plugins/HALCON])]) + AS_IF([test -d "$srcdir/plugins/PYLON"], [AC_CONFIG_SUBDIRS([plugins/PYLON])]) +]) AC_LANG(C++) @@ -203,10 +208,12 @@ GEM_TARGET(Particles) GEM_TARGET(Pixes) GEM_TARGET(openGL) GEM_TARGET_DISABLED(Vertex) +GEM_ARG_ENABLE([plugins], [configure/build/install optional parts]) AC_ARG_ENABLE([experimental], AC_HELP_STRING([--enable-experimental], [enable experimental objects (if any)])) AM_CONDITIONAL(EXPERIMENTAL, [test "x$enable_experimental" = "xyes"]) + # checks for default headers IEM_CHECK_INCLUDES_DEFAULT([windows.h]) @@ -826,7 +833,11 @@ Configuration: font-rendering : ${have_font} default font : ${GEM_DEFAULT_FONT} - +]) +AS_IF([test "$enable_plugins" != "no" ], [ + AC_MSG_RESULT([ +PLUGINS +======= image-support use ImageIO : ${have_imageio_framework} use JPEG : ${have_jpeg} @@ -871,6 +882,12 @@ Configuration: use OBJ : YES (local) use ASSIMP2 : ${have_assimp2} use ASSIMP3 : ${have_assimp3} + ])],[ + AC_MSG_RESULT([ +PLUGINS +======= + NONE + ]) ]) AS_IF([test "x$have_pd" = "xno"], [ From 434233ae1bef0d971ec9378bd9a7df3c4cb00005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 11:27:17 +0200 Subject: [PATCH 158/387] [ci] Use template jobs to select Windows/macOS runners --- .git-ci/gitlab-iem.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index ed294cd23..1191d1b1b 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -53,6 +53,16 @@ stages: set -o shwordsplit || true # zsh doesn't do wordsplitting by default... set -o nonomatch || true # zsh bails out if globbing patterns do not expand +.image:windows: + tags: + - libvirt:windows + image: windows:latest + +.image:macos: + tags: + - tart + image: ghcr.io/cirruslabs/macos-monterey-xcode:latest + .build: stage: build script: @@ -97,10 +107,8 @@ stages: .build:macos: extends: + - .image:macos - .build - tags: - - tart - image: ghcr.io/cirruslabs/macos-monterey-xcode:latest retry: max: 1 when: @@ -167,10 +175,8 @@ stages: .build:w64: extends: + - .image:windows - .build - tags: - - libvirt:windows - image: windows:latest variables: IEMCI_CONFIGURATIONS: mingw64 pd_downloadsuffix: .msw.zip From 7199a93027bb941871f3d694552cfd73dca1129b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 11:28:13 +0200 Subject: [PATCH 159/387] [ci] switch windows runners to sardinecake --- .git-ci/gitlab-iem.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 1191d1b1b..e9725bf11 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -55,8 +55,8 @@ stages: .image:windows: tags: - - libvirt:windows - image: windows:latest + - sardinecake + image: registry.git.iem.at/devtools/sardinecake/windows:latest .image:macos: tags: From 65755ed1d853c92d06af01fd3d97bbd88bbe4507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 11:33:47 +0200 Subject: [PATCH 160/387] [ci] print more build information Related: https://github.com/umlaeute/Gem/issues/431 --- .git-ci/gitlab-iem.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index e9725bf11..6f542e212 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -67,11 +67,19 @@ stages: stage: build script: - *script_zsh_compat + # print some system information - echo building against Pd-${PDVERSION} - echo building with ${NUMBER_OF_PROCESSORS:=$(nproc || sysctl -n hw.ncpu || echo 1)} CPUs - tools/systeminfo.sh || true - date + - autoreconf --version || true + - aclocal --version || true + - glibtoolize --version || libtoolize --version || true + - autoconf --version || true + - autoheader --version || true + - automake --version || true - g++ -v + # the actual build - mkdir -pv "${ARTIFACTSDIR}" - autoreconf -fiv || ./autogen.sh - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true From ab2c2a27f40cfb2515124cba257292971e44116b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 11:45:57 +0200 Subject: [PATCH 161/387] [ci] also print the paths --- .git-ci/gitlab-iem.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 6f542e212..e98341a63 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -72,6 +72,7 @@ stages: - echo building with ${NUMBER_OF_PROCESSORS:=$(nproc || sysctl -n hw.ncpu || echo 1)} CPUs - tools/systeminfo.sh || true - date + - which autoreconf aclocal glibtoolize libtoolize autoconf autoheader automake g++ || true - autoreconf --version || true - aclocal --version || true - glibtoolize --version || libtoolize --version || true From d37417f43731531ef785b65739444ba695c5a5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 09:17:31 +0200 Subject: [PATCH 162/387] m4/gem: moved floatsize checks at the beginning of RTE checks as we need to know the floatsize to get the linker flags on Windows --- m4/gem.m4 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/m4/gem.m4 b/m4/gem.m4 index dc4e55d00..d35bcd72d 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -501,6 +501,7 @@ ARCH=$(uname -m) KERN=$(uname -s) IEM_OPERATING_SYSTEM +AC_SUBST(GEM_RTE_CPPFLAGS) AC_SUBST(GEM_RTE_CFLAGS) AC_SUBST(GEM_RTE_LIBS) AC_SUBST(GEM_RTE) @@ -519,6 +520,19 @@ GEM_RTE_CFLAGS="-DPD" GEM_RTE_LIBS="" GEM_RTE="Pure Data" + +AC_ARG_WITH([floatsize], + AC_HELP_STRING([--with-floatsize=], + [use a given floatsize (32, 64)])) +AC_MSG_CHECKING([floatsize]) +AS_CASE([$with_floatsize], + [32], [floatsize=32], + [64], [floatsize=64], + [""], [floatsize=""], + [AC_MSG_ERROR([invalid floatsize: only 32 and 64 are currently allowed])]) +AS_IF([test "x$floatsize" != "x"],[GEM_RTE_CPPFLAGS+=" -DPD_FLOATSIZE=${floatsize}"]) +AC_MSG_RESULT([${floatsize:-default}]) + have_pd=no AC_ARG_WITH([pd], AS_HELP_STRING([--with-pd=],[where to find pd-binary (./bin/pd.exe) and pd-sources])) @@ -628,20 +642,6 @@ AS_IF([ test "x$with_extension" != "x" ],[ GEM_RTE_EXTENSION=$EXT AC_SUBST(GEM_RTE_EXTENSION) -AC_SUBST(GEM_RTE_CPPFLAGS) -AC_ARG_WITH([floatsize], - AC_HELP_STRING([--with-floatsize=], - [use a given floatsize (32, 64)])) -AC_MSG_CHECKING([floatsize]) -AS_CASE([$with_floatsize], - [32], [floatsize=32], - [64], [floatsize=64], - [""], [floatsize=""], - [AC_MSG_ERROR([invalid floatsize: only 32 and 64 are currently allowed])]) -AS_IF([test "x$floatsize" != "x"],[GEM_RTE_CPPFLAGS+=" -DPD_FLOATSIZE=${floatsize}"]) -AC_MSG_RESULT([${floatsize:-default}]) - - CPPFLAGS="$tmp_rte_cppflags" CFLAGS="$tmp_rte_cflags" CXXFLAGS="$tmp_rte_cxxflags" From 235faf11ce76974f0672db365471ec8a4dd0a370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 09:36:01 +0200 Subject: [PATCH 163/387] take floatsize into account when searching for pd binaries --- m4/gem.m4 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/m4/gem.m4 b/m4/gem.m4 index d35bcd72d..f6c7f5c75 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -515,6 +515,7 @@ tmp_rte_cflags="$CFLAGS" tmp_rte_cxxflags="$CXXFLAGS" tmp_rte_ldflags="$LDFLAGS" tmp_rte_libs="$LIBS" +tmp_rte_pd="pd" GEM_RTE_CFLAGS="-DPD" GEM_RTE_LIBS="" @@ -525,13 +526,14 @@ AC_ARG_WITH([floatsize], AC_HELP_STRING([--with-floatsize=], [use a given floatsize (32, 64)])) AC_MSG_CHECKING([floatsize]) +tmp_rte_pd="pd${with_floatsize}" AS_CASE([$with_floatsize], - [32], [floatsize=32], + [32], [floatsize=32; tmp_rte_pd="pd"], [64], [floatsize=64], [""], [floatsize=""], [AC_MSG_ERROR([invalid floatsize: only 32 and 64 are currently allowed])]) AS_IF([test "x$floatsize" != "x"],[GEM_RTE_CPPFLAGS+=" -DPD_FLOATSIZE=${floatsize}"]) -AC_MSG_RESULT([${floatsize:-default}]) +AC_MSG_RESULT([${floatsize:-default (32)}]) have_pd=no AC_ARG_WITH([pd], @@ -541,11 +543,11 @@ AS_IF([ test "x${with_pd}" = "x" ],[ AS_CASE([$host_os], [*-darwin*], [ # get the latest and greatest Pd installed in /Applications - with_pd_=$(ls -S /Applications/Pd*.app/Contents/Resources/bin/pd 2>/dev/null | sort | tail -1 | sed "s/\/bin\/pd$//") + with_pd_=$(ls -S "/Applications/Pd*.app/Contents/Resources/bin/${tmp_rte_pd}" 2>/dev/null | sort | tail -1 | sed "s/\/bin\/${tmp_rte_pd}$//") AS_IF([ test -d "${with_pd_}" ], [ with_pd="${with_pd_}" ]) ], [*mingw* | *cygwin*], [ - dnl AS_IF([ test -d "${PROGRAMFILES}/pd" ], [ with_pd="${PROGRAMFILES}/pd" ]) + dnl AS_IF([ test -d "${PROGRAMFILES}/${tmp_rte_pd}" ], [ with_pd="${PROGRAMFILES}/${tmp_rte_pd}" ]) ],)]) AS_IF([ test "x${with_pd}" = "x" || test "x${with_pd}" = "yes" ], [ @@ -591,11 +593,11 @@ AS_IF([ test "x${have_pd}" = "xyes" ],[ LIBS="$LIBS ${GEM_RTE_LIBS}" ]) -AC_CHECK_LIB([:pd.dll], [nullfn], [have_pddll="yes"], [have_pddll="no"]) +AC_CHECK_LIB([:${tmp_rte_pd}.dll], [nullfn], [have_pddll="yes"], [have_pddll="no"]) AS_IF([ test "x$have_pddll" = "xyes" ], [ - GEM_RTE_LIBS="${GEM_RTE_LIBS}${GEM_RTE_LIBS:+ }-Xlinker -l:pd.dll" + GEM_RTE_LIBS="${GEM_RTE_LIBS}${GEM_RTE_LIBS:+ }-Xlinker -l:${tmp_rte_pd}.dll" ],[ - AC_CHECK_LIB([pd], [nullfn], [GEM_RTE_LIBS="${GEM_RTE_LIBS}${GEM_RTE_LIBS:+ }-lpd"]) + AC_CHECK_LIB([${tmp_rte_pd}], [nullfn], [GEM_RTE_LIBS="${GEM_RTE_LIBS}${GEM_RTE_LIBS:+ }-l${tmp_rte_pd}"]) ]) AC_CHECK_HEADERS([m_pd.h], [have_pd="yes"], [have_pd="no"]) @@ -614,7 +616,7 @@ AC_CHECK_HEADERS([m_imp.h], [], [], #endif ]) -AC_PATH_PROGS([PD_EXE], [pd.com pd], [pd], [${with_pd}/bin:${with_pd}/src:${with_pd}]) +AC_PATH_PROGS([PD_EXE], [${tmp_rte_pd}.com ${tmp_rte_pd}], [${tmp_rte_pd}], [${with_pd}/bin:${with_pd}/src:${with_pd}]) ### this should only be set if Pd has been found # the extension From 8a66a80331e073ad508f5749466e69cb8a00b23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 09:36:40 +0200 Subject: [PATCH 164/387] subst (and print) RTE executable --- configure.ac | 1 + m4/gem.m4 | 2 ++ 2 files changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 6e8d94b25..767a03901 100644 --- a/configure.ac +++ b/configure.ac @@ -823,6 +823,7 @@ Configuration: Install path : ${prefix} RTE (${GEM_RTE}): + executable : ${GEM_RTE_EXE} external-extension : ${GEM_RTE_EXTENSION} CPPFLAGS : ${GEM_RTE_CPPFLAGS} CFLAGS : ${GEM_RTE_CFLAGS} diff --git a/m4/gem.m4 b/m4/gem.m4 index f6c7f5c75..95a0e075e 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -617,6 +617,8 @@ AC_CHECK_HEADERS([m_imp.h], [], [], ]) AC_PATH_PROGS([PD_EXE], [${tmp_rte_pd}.com ${tmp_rte_pd}], [${tmp_rte_pd}], [${with_pd}/bin:${with_pd}/src:${with_pd}]) +GEM_RTE_EXE="${PD_EXE}" +AC_SUBST(GEM_RTE_EXE) ### this should only be set if Pd has been found # the extension From 549bbf60b055c6d3fb379216726ab625a06f7a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 10:11:22 +0200 Subject: [PATCH 165/387] drop GEM_RTE_CPPFLAGS and GEM_RTE_CXXFLAGS they are nowhere used (it's all in GEM_RTE_CFLAGS), which breeds confusion as to where preprocessor flags and the like should go --- configure.ac | 4 +--- m4/gem.m4 | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 767a03901..aba915742 100644 --- a/configure.ac +++ b/configure.ac @@ -174,7 +174,7 @@ AC_SUBST(GEM_CXXFLAGS) AC_SUBST(GEM_LIBS) GEM_CHECK_WERROR -GEM_CPPFLAGS="${GEM_RTE_CPPFLAGS}" +GEM_CPPFLAGS="" GEM_CHECK_EXTERNAL # additional debugging @@ -825,9 +825,7 @@ Configuration: RTE (${GEM_RTE}): executable : ${GEM_RTE_EXE} external-extension : ${GEM_RTE_EXTENSION} - CPPFLAGS : ${GEM_RTE_CPPFLAGS} CFLAGS : ${GEM_RTE_CFLAGS} - CXXFLAGS : ${GEM_RTE_CXXFLAGS} LIBS : ${GEM_RTE_LIBS} used optional libraries: diff --git a/m4/gem.m4 b/m4/gem.m4 index 95a0e075e..23a0833f0 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -501,7 +501,6 @@ ARCH=$(uname -m) KERN=$(uname -s) IEM_OPERATING_SYSTEM -AC_SUBST(GEM_RTE_CPPFLAGS) AC_SUBST(GEM_RTE_CFLAGS) AC_SUBST(GEM_RTE_LIBS) AC_SUBST(GEM_RTE) @@ -532,7 +531,7 @@ AS_CASE([$with_floatsize], [64], [floatsize=64], [""], [floatsize=""], [AC_MSG_ERROR([invalid floatsize: only 32 and 64 are currently allowed])]) -AS_IF([test "x$floatsize" != "x"],[GEM_RTE_CPPFLAGS+=" -DPD_FLOATSIZE=${floatsize}"]) +AS_IF([test "x$floatsize" != "x"],[GEM_RTE_CFLAGS+=" -DPD_FLOATSIZE=${floatsize}"]) AC_MSG_RESULT([${floatsize:-default (32)}]) have_pd=no @@ -552,9 +551,7 @@ AS_IF([ test "x${with_pd}" = "x" ],[ AS_IF([ test "x${with_pd}" = "x" || test "x${with_pd}" = "yes" ], [ PKG_CHECK_MODULES([PD], [pd], [have_pd="yes"]) - GEM_RTE_CPPFLAGS="${GEM_RTE_CPPFLAGS} ${PD_CFLAGS}" GEM_RTE_CFLAGS="${GEM_RTE_CFLAGS} ${PD_CFLAGS}" - GEM_RTE_CXXFLAGS="${GEM_RTE_CXXFLAGS} ${PD_CFLAGS}" GEM_RTE_LIBS="${GEM_RTE_LIBS} ${PD_LIBS}" with_pd="" ]) From c5b9093c85063cc7b54d1cc4fd67be3ec4fbe6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 11:42:25 +0200 Subject: [PATCH 166/387] On Windows, link against Gem with custom extension rather than hardcoding Gem.dll --- m4/gem.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/gem.m4 b/m4/gem.m4 index 23a0833f0..0c7ca1a48 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -685,6 +685,6 @@ AC_DEFUN([GEM_CHECK_EXTERNAL], AC_SUBST(GEM_EXTERNAL_CFLAGS) AC_SUBST(GEM_EXTERNAL_LIBS) - AS_IF([test "x$have_pddll" = "xyes" ], [ GEM_EXTERNAL_LIBS="${GEM_EXTERNAL_LIBS}${GEM_EXTERNAL_LIBS:+ }-Xlinker -l:Gem.dll" ]) + AS_IF([test "x$have_pddll" = "xyes" ], [ GEM_EXTERNAL_LIBS="${GEM_EXTERNAL_LIBS}${GEM_EXTERNAL_LIBS:+ }-Xlinker -l:Gem.${GEM_RTE_EXTENSION:-dll}" ]) AS_IF([test "x$WINDOWS" = "xyes" ], [GEM_CHECK_CXXFLAGS([-mms-bitfields], [GEM_EXTERNAL_CFLAGS+="-mms-bitfields"])]) ]) From d9bfb647685797f3b8c9e5bfdc31349150724995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 00:51:53 +0200 Subject: [PATCH 167/387] [ci] lowercase jobnames --- .git-ci/gitlab-iem.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index e98341a63..1c4066faa 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -221,7 +221,7 @@ stages: ################################################### ### the actual jobs: (linux,macos,windows)*(release,snapshot) -Source: +source: extends: - .artifacts - .run-selected @@ -231,24 +231,24 @@ Source: - apt-get update && apt-get --no-install-recommends -y install git script: # create a source package - - git archive --format=tar --prefix="${ARTIFACTSDIR}/Source/${CI_PROJECT_NAME}/" HEAD | tar xf - + - git archive --format=tar --prefix="${ARTIFACTSDIR}/${CI_JOB_NAME}}/${CI_PROJECT_NAME}/" HEAD | tar xf - -Linux-amd64-32: +linux-amd64-32: extends: - .build:linux - .artifacts - .run-selected -Darwin-fat-32: +darwin-fat-32: extends: - .build:macos - .artifacts - .run-selected -Windows-i386-32: +windows-i386-32: extends: - .build:w32 - .artifacts - .run-selected -Windows-amd64-32: +windows-amd64-32: extends: - .build:w64 - .artifacts @@ -323,9 +323,9 @@ macOS:notarize: stage: deploy image: python:alpine dependencies: - - Darwin-fat-32 + - darwin-fat-32 needs: - - Darwin-fat-32 + - darwin-fat-32 variables: IEM_NOTARIZE_SRCDIR: artifacts IEM_NOTARIZE_ARCHIVE: Gem.zip From 7480a243564673710d80db35e3e581b6b4211ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 08:49:55 +0200 Subject: [PATCH 168/387] [ci] set pd_extension for jobs this is mainly useful for the windows builds (otherwise both use .dll) --- .git-ci/gitlab-iem.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 1c4066faa..dfc83784d 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -238,21 +238,29 @@ linux-amd64-32: - .build:linux - .artifacts - .run-selected + variables: + pd_extension: "pd_linux" darwin-fat-32: extends: - .build:macos - .artifacts - .run-selected + variables: + pd_extension: "d_fat" windows-i386-32: extends: - .build:w32 - .artifacts - .run-selected + variables: + pd_extension: "dll" windows-amd64-32: extends: - .build:w64 - .artifacts - .run-selected + variables: + pd_extension: "m_amd64" distcheck: extends: From 5863d3bcb8574813b8266a9dc7929864a8435533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 21 Jun 2024 08:34:10 +0200 Subject: [PATCH 169/387] [ci] terse version prints of tools --- .git-ci/gitlab-iem.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index dfc83784d..fb5d0af74 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -73,12 +73,7 @@ stages: - tools/systeminfo.sh || true - date - which autoreconf aclocal glibtoolize libtoolize autoconf autoheader automake g++ || true - - autoreconf --version || true - - aclocal --version || true - - glibtoolize --version || libtoolize --version || true - - autoconf --version || true - - autoheader --version || true - - automake --version || true + - for tool in autoreconf aclocal libtoolize glibtoolize autoconf autoheader automake; do "${tool}" --version | grep "^${tool}" || true; done || true - g++ -v # the actual build - mkdir -pv "${ARTIFACTSDIR}" From 0d39df407acac681ca9fa598e454f2e57bcb3bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 00:32:39 +0200 Subject: [PATCH 170/387] [ci] trick syntax highlighter in emacs --- .git-ci/gitlab-iem.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index fb5d0af74..df8cf1ca5 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -146,7 +146,7 @@ stages: - test ! -f "${IEM_CI_TMPDIR}"/Pd.zip || unzip "${IEM_CI_TMPDIR}"/Pd.zip -d "${IEM_CI_TMPDIR}" # the ZIP-file shoud contain a .dmg containing Pd - | - for dmg in "${IEM_CI_TMPDIR}"/Pd*.dmg; do break; done + for dmg in "${IEM_CI_TMPDIR}"/Pd*.dmg ; do break; done - pddisk="" - test ! -f "${dmg}" || pddisk=$(hdiutil attach "${dmg}" 2>/dev/null | egrep "^/.*/Volumes/" | tail -1 | awk '{print $NF}') - rm -rf "${dmg}" @@ -154,7 +154,7 @@ stages: for app in "${pddisk}"/Pd*.app "${IEM_CI_TMPDIR}"/Pd*.app; do if test -d "${app}"; then cp -r "${app}" /Applications/; break; fi; done - test ! -d "${pddisk}" || umount "${pddisk}" - | - rm -rf "${IEM_CI_TMPDIR}" + rm -rf "${IEM_CI_TMPDIR}" | true dmg="" pddisk="" app="" From b2b9ec3c99bf69eb76d51048b62421b9578cb3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 09:07:20 +0200 Subject: [PATCH 171/387] [ci] use a helpervar for the download URL and calculcate the filename from it --- .git-ci/gitlab-iem.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index df8cf1ca5..8396954a1 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -187,9 +187,11 @@ stages: before_script: - tools/systeminfo.sh || true - export PDDIR="$(pwd)/_pd" - - downloadfile="pd-${PDVERSION}${pd_downloadsuffix}" - - echo wget -q -O "${downloadfile}" "http://msp.ucsd.edu/Software/pd-${PDVERSION}${pd_downloadsuffix}" - - wget -q -O "${downloadfile}" "http://msp.ucsd.edu/Software/pd-${PDVERSION}${pd_downloadsuffix}" + - | + : ${pd_download_url:="http://msp.ucsd.edu/Software/pd-${PDVERSION}${pd_downloadsuffix}"} + - downloadfile="${pd_download_url##*/}" + - echo wget -q -O "${downloadfile}" "${pd_download_url}" + - wget -q -O "${downloadfile}" "${pd_download_url}" - mkdir -p "${PDDIR}" - test "x${downloadfile}" = "x${downloadfile%.zip}" || unzip -q "${downloadfile}" -d "${PDDIR}" - mv -v "${PDDIR}"/*/* "${PDDIR}" From aa03dcbec6e26cb59b05888d99aced22229b8f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 17:03:33 +0200 Subject: [PATCH 172/387] [ci] all /.git* stuff is not-distributed --- .git-ci/nodist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/nodist b/.git-ci/nodist index 6122050a5..5ff24cce5 100644 --- a/.git-ci/nodist +++ b/.git-ci/nodist @@ -21,4 +21,4 @@ doc/notes/keynames.org **/*.vsprops **/* * tests/ -.github/ +.git* From 5e808cf26d1b7f5ea2990e73bfe35c845b81c7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 18:24:40 +0200 Subject: [PATCH 173/387] [ci] do not delete .gitignore from submodules --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 8396954a1..bec129d29 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -302,7 +302,7 @@ nodist: script: ## pre-cleanup # get rid of gitignores - - find . -name .gitignore -delete + - git ls-tree -r HEAD --name-only -z | grep --null-data "\.gitignore" | xargs -0 rm - git commit -a -m "Drop .gitignore files" ## create 'make dist' package - autoreconf -fiv || ./autogen.sh From 1eb735552fd01f047ae1781449d0225e09558f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 15:44:41 +0200 Subject: [PATCH 174/387] [ci] Add iem-ci as submodule (for improved localdeps) --- .git-ci/gitlab-iem.yml | 3 ++- .git-ci/iem-ci | 1 + .gitmodules | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 160000 .git-ci/iem-ci create mode 100644 .gitmodules diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index bec129d29..10bf8a303 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -24,7 +24,8 @@ variables: gem_defaultwindow: value: "gemglfw3window" description: "default window backend" - + GIT_SUBMODULE_STRATEGY: recursive + GIT_SUBMODULE_DEPTH: 1 stages: - build diff --git a/.git-ci/iem-ci b/.git-ci/iem-ci new file mode 160000 index 000000000..4c9d89f56 --- /dev/null +++ b/.git-ci/iem-ci @@ -0,0 +1 @@ +Subproject commit 4c9d89f563f82f1ea13209f718d5eda44c5871ec diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..344b83fcd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".git-ci/iem-ci"] + path = .git-ci/iem-ci + url = https://git.iem.at/pd/iem-ci.git From bfc9cc1346e03e2ff2406127d5c94dd58b008760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 15:53:17 +0200 Subject: [PATCH 175/387] [ci] use improved localdeps scripts but only for macOS and Windows. On Linux, this would pull in the whole world, among them the openGL-, X11-, wayland-, and SDL-(including pulse-) stacks. --- .git-ci/gitlab-iem.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 10bf8a303..ddaa4f277 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -66,6 +66,8 @@ stages: .build: stage: build + variables: + localdeps: ".git-ci/iem-ci/localdeps/localdeps" script: - *script_zsh_compat # print some system information @@ -174,7 +176,7 @@ stages: after_script: - *script_zsh_compat - mkdir -p "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-d_*}" -o -name "*.pd_darwin" -o -name "*.so" ")" -exec .git-ci/localdeps.macos.sh {} + + - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-d_*}" -o -name "*.pd_darwin" -o -name "*.so" ")" -exec "${localdeps}.macos.sh" {} + - IEM_SIGN_SRCDIR="${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - !reference [.script:codesign:macos] @@ -206,7 +208,7 @@ stages: - test "${result}" = "0" || result="skip" after_script: - mkdir -p "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-m_*}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec .git-ci/localdeps.win.sh {} + + - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-m_*}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec "${localdeps}.win.sh" {} + .build:w32: extends: From 262a3c9bccdfb1bd57ddeafdc5e099cfadf78ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 15:07:15 +0200 Subject: [PATCH 176/387] [ci] helper-script to inject an arch-specifier into a filename e.g. "gem_imageSTB.so" -> "gem_imageSTB.amd64.so" the plugin-loader doesn't care about the actual extension, so we can use this to make plugins-coinstallable. --- .git-ci/rename-gnutriplet.sh | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100755 .git-ci/rename-gnutriplet.sh diff --git a/.git-ci/rename-gnutriplet.sh b/.git-ci/rename-gnutriplet.sh new file mode 100755 index 000000000..b9dfc93e1 --- /dev/null +++ b/.git-ci/rename-gnutriplet.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +: "${CC:=cc}" + +usage() { + arch="$(${CC} -dumpmachine)" +cat <] [ ...] + +renames each to include . just before the file-extension. +the no is specified, use $arch. + +E.g. + foo.so -> foo.${arch}.so + bar -> bar.${arch} + +EOF + +if [ -n "$1" ]; then + exit "$((1+0))" +fi +exit +} + +addinfix() { + local f + local d + local b + local x + f="$1" + d="${f%/*}" + if [ "${d}" = "${f}" ]; then + d="." + else + f="${f##*/}" + fi + b="${f%.*}" + if [ "${b}" = "${f}" ]; then + x="" + else + x=".${f##*.}" + fi + mv "$1" "${d}/${b}.${2}${x}" +} + +while getopts "ha:" arg; do + case $arg in + h) + usage + ;; + a) + arch="${OPTARG}" + ;; + *) + usage 1 + ;; + esac +done +shift $((OPTIND-1)) +test -n "$*" || usage 1 + +: "${arch:=$(${CC} -dumpmachine)}" +if [ -z "${arch}" ]; then + echo "$0: Unable to determine " 1>&2 + exit 1 +fi + +for f in "$@"; do + addinfix "$f" "${arch}" +done From 4dfdb3578218aeabba560abb298320fd17fdde4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 15:12:40 +0200 Subject: [PATCH 177/387] [ci] Inject gnutriplet into Gem plugin filenames --- .git-ci/gitlab-iem.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index ddaa4f277..585a55e99 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -84,7 +84,11 @@ stages: - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true - test -n "${CI_COMMIT_TAG}" || cp -v config.log "${ARTIFACTSDIR}" - make check -j"${NUMBER_OF_PROCESSORS}" - - make install DESTDIR=$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*} libdir=/ extradir=/Gem includedir=/Gem/include + - DESTDIR="$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" + - make install DESTDIR="${DESTDIR}" libdir=/ extradir=/Gem includedir=/Gem/include + # make Gem-plugins co-installable + - gnuptriplet="$(g++ -dumpmachine)" + - find "${DESTDIR}" "(" -name "gem_*.so" -or -name "gem_*.dll" ")" -exec .git-ci/rename-gnutriplet.sh -a "${gnutriplet}" {} "+" # finally split the binaries from the debug information - base_dir_ci=$(pwd) - cd "$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}/Gem" From b9aaa58e9e3c96d0b3f9ff4a1a89e39a57ae99fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 18:03:50 +0200 Subject: [PATCH 178/387] [ci] Use job-name (without floatsize) to separate Gem plugins nicer names than the gnutriplet --- .git-ci/gitlab-iem.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 585a55e99..4c252144a 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -88,7 +88,8 @@ stages: - make install DESTDIR="${DESTDIR}" libdir=/ extradir=/Gem includedir=/Gem/include # make Gem-plugins co-installable - gnuptriplet="$(g++ -dumpmachine)" - - find "${DESTDIR}" "(" -name "gem_*.so" -or -name "gem_*.dll" ")" -exec .git-ci/rename-gnutriplet.sh -a "${gnutriplet}" {} "+" + - depdir="${CI_JOB_NAME%-[0-9][0-9]} + - find "${DESTDIR}" "(" -name "gem_*.so" -or -name "gem_*.dll" ")" -exec .git-ci/rename-gnutriplet.sh -a "${depdir}" {} "+" # finally split the binaries from the debug information - base_dir_ci=$(pwd) - cd "$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}/Gem" From e1da7f620b1217698cfabce7b78006ea2b98ed08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 19 Jun 2024 18:04:44 +0200 Subject: [PATCH 179/387] [ci] puts localdeps into subdir --- .git-ci/gitlab-iem.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 4c252144a..b889e21be 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -87,9 +87,9 @@ stages: - DESTDIR="$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - make install DESTDIR="${DESTDIR}" libdir=/ extradir=/Gem includedir=/Gem/include # make Gem-plugins co-installable - - gnuptriplet="$(g++ -dumpmachine)" - - depdir="${CI_JOB_NAME%-[0-9][0-9]} - - find "${DESTDIR}" "(" -name "gem_*.so" -or -name "gem_*.dll" ")" -exec .git-ci/rename-gnutriplet.sh -a "${depdir}" {} "+" + # - gnuptriplet="$(g++ -dumpmachine)" + - gnutriplet="${CI_JOB_NAME%-[0-9][0-9]}" + - find "${DESTDIR}" "(" -name "gem_*.so" -or -name "gem_*.dll" ")" -exec .git-ci/rename-gnutriplet.sh -a "${gnutriplet}" {} "+" # finally split the binaries from the debug information - base_dir_ci=$(pwd) - cd "$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}/Gem" @@ -181,7 +181,8 @@ stages: after_script: - *script_zsh_compat - mkdir -p "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-d_*}" -o -name "*.pd_darwin" -o -name "*.so" ")" -exec "${localdeps}.macos.sh" {} + + - depdir="${CI_JOB_NAME%-[0-9][0-9]}" + - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-d_*}" -o -name "*.pd_darwin" -o -name "*.so" ")" -exec "${localdeps}.macos.sh" -F -v -d ".${depdir}" {} + - IEM_SIGN_SRCDIR="${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - !reference [.script:codesign:macos] @@ -213,7 +214,8 @@ stages: - test "${result}" = "0" || result="skip" after_script: - mkdir -p "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-m_*}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec "${localdeps}.win.sh" {} + + - depdir="${CI_JOB_NAME%-[0-9][0-9]}" + - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-m_*}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec "${localdeps}.win.sh" -v -d ".${depdir}" {} + .build:w32: extends: From b4315961a39fa912e8cf2446ec2bc77799d3d15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 00:33:46 +0200 Subject: [PATCH 180/387] [ci] calculate "gnutriplet" from jobname --- .git-ci/gitlab-iem.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index b889e21be..116fd4c30 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -70,6 +70,9 @@ stages: localdeps: ".git-ci/iem-ci/localdeps/localdeps" script: - *script_zsh_compat + # - gnutriplet="$(g++ -dumpmachine)" + - arch="${CI_JOB_NAME%-[0-9][0-9]}" + - gnutriplet=$(echo "$arch" | tr "[:upper:]" "[:lower:]") # print some system information - echo building against Pd-${PDVERSION} - echo building with ${NUMBER_OF_PROCESSORS:=$(nproc || sysctl -n hw.ncpu || echo 1)} CPUs @@ -87,8 +90,6 @@ stages: - DESTDIR="$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" - make install DESTDIR="${DESTDIR}" libdir=/ extradir=/Gem includedir=/Gem/include # make Gem-plugins co-installable - # - gnuptriplet="$(g++ -dumpmachine)" - - gnutriplet="${CI_JOB_NAME%-[0-9][0-9]}" - find "${DESTDIR}" "(" -name "gem_*.so" -or -name "gem_*.dll" ")" -exec .git-ci/rename-gnutriplet.sh -a "${gnutriplet}" {} "+" # finally split the binaries from the debug information - base_dir_ci=$(pwd) From 21d79ee81c4f17812e8faf9d285ceaa82ba8fea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 00:49:24 +0200 Subject: [PATCH 181/387] [ci] jobs ending with "-64" build for Pd64 --- .git-ci/gitlab-iem.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 116fd4c30..34071b8f0 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -70,9 +70,17 @@ stages: localdeps: ".git-ci/iem-ci/localdeps/localdeps" script: - *script_zsh_compat + # handle Pd64 jobs + - if test "${OS}" = "Windows_NT"; then defaultext="dll"; else defaultext="so"; fi # - gnutriplet="$(g++ -dumpmachine)" - arch="${CI_JOB_NAME%-[0-9][0-9]}" - - gnutriplet=$(echo "$arch" | tr "[:upper:]" "[:lower:]") + - floatsize="${CI_JOB_NAME#arch}" + - floatsize="${floatsize#-}" + - test "${floatsize}" != 32 || floatsize="" + - arch=$(echo "${arch}" | tr "[:upper:]" "[:lower:]") + - test -z "${floatsize}" || pd_extension="{arch}-${floatsize}.${defaultext}" + - gnutriplet="${arch}" + - echo "arch=${arch} pd_extension=${pd_extension} floatsize=${floatsize}" # print some system information - echo building against Pd-${PDVERSION} - echo building with ${NUMBER_OF_PROCESSORS:=$(nproc || sysctl -n hw.ncpu || echo 1)} CPUs @@ -84,7 +92,7 @@ stages: # the actual build - mkdir -pv "${ARTIFACTSDIR}" - autoreconf -fiv || ./autogen.sh - - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true + - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${floatsize:+--with-floatsize=${floatsize}} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true - test -n "${CI_COMMIT_TAG}" || cp -v config.log "${ARTIFACTSDIR}" - make check -j"${NUMBER_OF_PROCESSORS}" - DESTDIR="$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" From 0d44a1517d298ec4908a9169ae3beaeb20e8e174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 06:13:57 +0200 Subject: [PATCH 182/387] [ci] fix typos --- .git-ci/gitlab-iem.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 34071b8f0..6cd43eb1e 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -74,11 +74,10 @@ stages: - if test "${OS}" = "Windows_NT"; then defaultext="dll"; else defaultext="so"; fi # - gnutriplet="$(g++ -dumpmachine)" - arch="${CI_JOB_NAME%-[0-9][0-9]}" - - floatsize="${CI_JOB_NAME#arch}" + - floatsize="${CI_JOB_NAME#${arch}}" - floatsize="${floatsize#-}" - test "${floatsize}" != 32 || floatsize="" - - arch=$(echo "${arch}" | tr "[:upper:]" "[:lower:]") - - test -z "${floatsize}" || pd_extension="{arch}-${floatsize}.${defaultext}" + - test -z "${floatsize}" || pd_extension="${arch}-${floatsize}.${defaultext}" - gnutriplet="${arch}" - echo "arch=${arch} pd_extension=${pd_extension} floatsize=${floatsize}" # print some system information From dafb24e793e1adbf2a65ad7cc762bf45d509fbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 00:54:32 +0200 Subject: [PATCH 183/387] [ci] enable Pd64-jobs --- .git-ci/gitlab-iem.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 6cd43eb1e..b0339b807 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -277,6 +277,14 @@ windows-amd64-32: variables: pd_extension: "m_amd64" +# Pd64 +linux-amd64-64: + extends: linux-amd64-32 +darwin-fat-64: + extends: darwin-fat-32 +windows-amd64-64: + extends: windows-amd64-32 + distcheck: extends: - .build:linux From b7ff89bf31368a5a2f762a90533ecf35a9bc9eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 06:24:21 +0200 Subject: [PATCH 184/387] [ci] disable all plugins when building Pd64 variants --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index b0339b807..e9de039b1 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -91,7 +91,7 @@ stages: # the actual build - mkdir -pv "${ARTIFACTSDIR}" - autoreconf -fiv || ./autogen.sh - - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${floatsize:+--with-floatsize=${floatsize}} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true + - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${floatsize:+--with-floatsize=${floatsize} --disable-plugins} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true - test -n "${CI_COMMIT_TAG}" || cp -v config.log "${ARTIFACTSDIR}" - make check -j"${NUMBER_OF_PROCESSORS}" - DESTDIR="$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" From 85480a9457d05cdaa1929c4e21c0c281085e0dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Jun 2024 09:08:19 +0200 Subject: [PATCH 185/387] [ci] manually set pd_download_url for windows-amd64-64 build --- .git-ci/gitlab-iem.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index e9de039b1..f48300c2b 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -284,6 +284,8 @@ darwin-fat-64: extends: darwin-fat-32 windows-amd64-64: extends: windows-amd64-32 + variables: + pd_download_url: "https://get.puredata.info/pure-data/releases/${PDVERSION}-pd64/Pd64-${PDVERSION}.msw.zip" distcheck: extends: From c385284059aded49d8eba93b60c7b7d83e21ca90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 21 Jun 2024 08:16:49 +0200 Subject: [PATCH 186/387] [ci] centralize "set DESTDIR" --- .git-ci/gitlab-iem.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index f48300c2b..76165dce2 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -54,6 +54,10 @@ stages: set -o shwordsplit || true # zsh doesn't do wordsplitting by default... set -o nonomatch || true # zsh bails out if globbing patterns do not expand +.script:set_destdir: &script_set_destdir + - DESTDIR="$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%%-*}" + + .image:windows: tags: - sardinecake @@ -94,13 +98,14 @@ stages: - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${floatsize:+--with-floatsize=${floatsize} --disable-plugins} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true - test -n "${CI_COMMIT_TAG}" || cp -v config.log "${ARTIFACTSDIR}" - make check -j"${NUMBER_OF_PROCESSORS}" - - DESTDIR="$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" + - *script_set_destdir + # " - make install DESTDIR="${DESTDIR}" libdir=/ extradir=/Gem includedir=/Gem/include # make Gem-plugins co-installable - find "${DESTDIR}" "(" -name "gem_*.so" -or -name "gem_*.dll" ")" -exec .git-ci/rename-gnutriplet.sh -a "${gnutriplet}" {} "+" # finally split the binaries from the debug information - base_dir_ci=$(pwd) - - cd "$(pwd)/${ARTIFACTSDIR}/${CI_JOB_NAME%_*}/Gem" + - cd "${DESTDIR}/Gem" - du -sh - | "${base_dir_ci}/.git-ci/split-debug" ${pd_extension:+*.${pd_extension}} *.pd_* *.?_* *.dll *.so || echo "ignoring problems when splitting debug info" @@ -188,10 +193,11 @@ stages: - echo "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" after_script: - *script_zsh_compat - - mkdir -p "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" + - *script_set_destdir + - mkdir -p "${DESTDIR}" - depdir="${CI_JOB_NAME%-[0-9][0-9]}" - - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-d_*}" -o -name "*.pd_darwin" -o -name "*.so" ")" -exec "${localdeps}.macos.sh" -F -v -d ".${depdir}" {} + - - IEM_SIGN_SRCDIR="${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" + - find "${DESTDIR}" -type f "(" -name "*.${pd_extension:-d_*}" -o -name "*.pd_darwin" -o -name "*.so" ")" -exec "${localdeps}.macos.sh" -F -v -d ".${depdir}" {} + + - IEM_SIGN_SRCDIR="${DESTDIR}" - !reference [.script:codesign:macos] .build:w64: @@ -221,9 +227,10 @@ stages: - echo "pacman returned ${result}" - test "${result}" = "0" || result="skip" after_script: - - mkdir -p "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" + - *script_set_destdir + - mkdir -p "${DESTDIR}" - depdir="${CI_JOB_NAME%-[0-9][0-9]}" - - find "${ARTIFACTSDIR}/${CI_JOB_NAME%_*}" -type f "(" -name "*.${pd_extension:-m_*}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec "${localdeps}.win.sh" -v -d ".${depdir}" {} + + - find "${DESTDIR}" -type f "(" -name "*.${pd_extension:-m_*}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec "${localdeps}.win.sh" -v -d ".${depdir}" {} + .build:w32: extends: From d63cf4975ab2fa07da0c6c1a519e8e83817d6cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 21 Jun 2024 08:21:09 +0200 Subject: [PATCH 187/387] [ci] on Windows, make sure that the Gem-plugins have per-job extensions the plugins need to dylink against Gem (encoding its full name), so we cannot use the same gem_imageFOO plugin linking against Gem.m_amd64 with the Pd64 Gem.windows-amd64-64.so sigh! --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 76165dce2..01744d36a 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -82,7 +82,7 @@ stages: - floatsize="${floatsize#-}" - test "${floatsize}" != 32 || floatsize="" - test -z "${floatsize}" || pd_extension="${arch}-${floatsize}.${defaultext}" - - gnutriplet="${arch}" + - if test "${OS}" = "Windows_NT"; then gnutriplet="${CI_JOB_NAME}"; else gnutriplet="${arch}"; fi - echo "arch=${arch} pd_extension=${pd_extension} floatsize=${floatsize}" # print some system information - echo building against Pd-${PDVERSION} From c6ac62b5e4d47fbd21576b9530c8fe7a8c082cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 21 Jun 2024 08:34:45 +0200 Subject: [PATCH 188/387] [ci] on Windows, build plugins per floatsize --- .git-ci/gitlab-iem.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 01744d36a..cb112622b 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -83,6 +83,10 @@ stages: - test "${floatsize}" != 32 || floatsize="" - test -z "${floatsize}" || pd_extension="${arch}-${floatsize}.${defaultext}" - if test "${OS}" = "Windows_NT"; then gnutriplet="${CI_JOB_NAME}"; else gnutriplet="${arch}"; fi + - configure_floatsize="" + - test -z "${floatsize}" || configure_floatsize="${configure_floatsize} --floatsize=${floatsize}" + # on Windows, plugins link against Gem, so we cannot share them between floatsizes + - test -z "${floatsize}" || test "${OS}" = "Windows_NT" || configure_floatsize="${configure_floatsize} --disable-plugins" - echo "arch=${arch} pd_extension=${pd_extension} floatsize=${floatsize}" # print some system information - echo building against Pd-${PDVERSION} @@ -95,7 +99,7 @@ stages: # the actual build - mkdir -pv "${ARTIFACTSDIR}" - autoreconf -fiv || ./autogen.sh - - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${floatsize:+--with-floatsize=${floatsize} --disable-plugins} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true + - ./configure --disable-dependency-tracking ${TARGETARCH:+--host=}${TARGETARCH} ${fat_binary:+--enable-fat-binary=}${fat_binary} ${PDDIR:+--with-pd=}${PDDIR} ${pd_extension:+--with-extension=}${pd_extension} ${configure_floatsize} ${gem_defaultwindow:+--with-defaultwindow=}${gem_defaultwindow} --with-DeckLink=local || true - test -n "${CI_COMMIT_TAG}" || cp -v config.log "${ARTIFACTSDIR}" - make check -j"${NUMBER_OF_PROCESSORS}" - *script_set_destdir From 919f36f354eea220439a274337a48745154b4453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 21 Jun 2024 10:11:19 +0200 Subject: [PATCH 189/387] [ci] fix configure flag for floatsize it's "--with-floatsize=..." rather than "--floatsize=..." --- .git-ci/gitlab-iem.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index cb112622b..4e68ed448 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -83,9 +83,8 @@ stages: - test "${floatsize}" != 32 || floatsize="" - test -z "${floatsize}" || pd_extension="${arch}-${floatsize}.${defaultext}" - if test "${OS}" = "Windows_NT"; then gnutriplet="${CI_JOB_NAME}"; else gnutriplet="${arch}"; fi - - configure_floatsize="" - - test -z "${floatsize}" || configure_floatsize="${configure_floatsize} --floatsize=${floatsize}" - # on Windows, plugins link against Gem, so we cannot share them between floatsizes + - configure_floatsize="${floatsize:+--with-floatsize=${floatsize}}" + # on Windows, plugins link against Gem, so we cannot share them between floatsizes; other platforms are fine - test -z "${floatsize}" || test "${OS}" = "Windows_NT" || configure_floatsize="${configure_floatsize} --disable-plugins" - echo "arch=${arch} pd_extension=${pd_extension} floatsize=${floatsize}" # print some system information From 92ae7eac8aff4798ac06d5861130b9d6dcd55cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 21 Jun 2024 12:59:16 +0200 Subject: [PATCH 190/387] [ci] print info if split-debug has not matches --- .git-ci/split-debug | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.git-ci/split-debug b/.git-ci/split-debug index 17d2969b2..1836f26c9 100755 --- a/.git-ci/split-debug +++ b/.git-ci/split-debug @@ -51,6 +51,15 @@ list_files() { } +if ! list_files "$@" | grep -q .; then + cat >/dev/stderr < Date: Wed, 26 Jun 2024 08:51:17 +0200 Subject: [PATCH 191/387] [ci] notarize darwin-fat-64 as well --- .git-ci/gitlab-iem.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 4e68ed448..f8b482492 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -367,8 +367,10 @@ macOS:notarize: image: python:alpine dependencies: - darwin-fat-32 + - darwin-fat-64 needs: - darwin-fat-32 + - darwin-fat-64 variables: IEM_NOTARIZE_SRCDIR: artifacts IEM_NOTARIZE_ARCHIVE: Gem.zip From b6fd20ae4791c121774d90f1f070ae5575da7c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Jun 2024 11:42:55 +0200 Subject: [PATCH 192/387] moved text/objects into positive coordinate space --- help/part_render-help.pd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/help/part_render-help.pd b/help/part_render-help.pd index 69fb03806..f4a12af71 100644 --- a/help/part_render-help.pd +++ b/help/part_render-help.pd @@ -1,11 +1,11 @@ #N canvas 503 464 695 398 10; #X declare -lib Gem; -#X obj 539 -2 declare -lib Gem; +#X obj 539 8 declare -lib Gem; #X obj 7 55 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 468 54 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 472 223 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 8 166 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X text 464 -2 GEM object; +#X text 464 8 GEM object; #X text 467 35 Example:; #X obj 7 205 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 39 28 Class: Particle System; From 9beb39da746cdbde55b0128822c5f0287d07c9ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Jun 2024 11:47:57 +0200 Subject: [PATCH 193/387] Add meta information to help-patches --- help/GLdefine-help.pd | 10 +++++++++- help/accumrotate-help.pd | 13 ++++++++++++- help/alpha-help.pd | 11 ++++++++++- help/ambient-help.pd | 11 ++++++++++- help/ambientRGB-help.pd | 14 +++++++++++++- help/circle-help.pd | 11 ++++++++++- help/color-help.pd | 11 ++++++++++- help/colorRGB-help.pd | 14 +++++++++++++- help/colorSquare-help.pd | 15 ++++++++++++++- help/cone-help.pd | 12 +++++++++++- help/cube-help.pd | 11 ++++++++++- help/cuboid-help.pd | 13 ++++++++++++- help/curve-help.pd | 12 +++++++++++- help/curve3d-help.pd | 10 +++++++++- help/cylinder-help.pd | 12 +++++++++++- help/depth-help.pd | 10 +++++++++- help/diffuse-help.pd | 11 ++++++++++- help/diffuseRGB-help.pd | 14 +++++++++++++- help/disk-help.pd | 13 ++++++++++++- help/emission-help.pd | 11 ++++++++++- help/emissionRGB-help.pd | 14 +++++++++++++- help/fragment_program-help.pd | 10 +++++++++- help/gemframebuffer-help.pd | 11 ++++++++++- help/gemhead-help.pd | 10 +++++++++- help/gemkeyboard-help.pd | 10 +++++++++- help/gemkeyname-help.pd | 11 ++++++++++- help/gemlist-help.pd | 11 ++++++++++- help/gemlist_info-help.pd | 14 +++++++++++++- help/gemlist_matrix-help.pd | 11 ++++++++++- help/gemmanager-help.pd | 8 +++++++- help/gemmouse-help.pd | 14 +++++++++++++- help/gemvertexbuffer-help.pd | 10 +++++++++- help/gemwin-help.pd | 8 +++++++- help/glsl_fragment-help.pd | 11 ++++++++++- help/glsl_geometry-help.pd | 11 ++++++++++- help/glsl_program-help.pd | 11 ++++++++++- help/glsl_vertex-help.pd | 11 ++++++++++- help/imageVert-help.pd | 10 +++++++++- help/light-help.pd | 11 ++++++++++- help/linear_path-help.pd | 9 ++++++++- help/mesh_line-help.pd | 11 ++++++++++- help/mesh_square-help.pd | 11 ++++++++++- help/model-help.pd | 10 +++++++++- help/multimodel-help.pd | 10 +++++++++- help/newWave-help.pd | 13 ++++++++++++- help/ortho-help.pd | 10 +++++++++- help/part_color-help.pd | 11 ++++++++++- help/part_damp-help.pd | 9 ++++++++- help/part_draw-help.pd | 8 +++++++- help/part_follow-help.pd | 8 +++++++- help/pix_2grey-help.pd | 10 +++++++++- help/pix_a_2grey-help.pd | 11 ++++++++++- help/pix_add-help.pd | 11 ++++++++++- help/pix_aging-help.pd | 10 +++++++++- help/pix_alpha-help.pd | 13 ++++++++++++- help/pix_background-help.pd | 11 ++++++++++- help/pix_backlight-help.pd | 13 ++++++++++++- help/pix_biquad-help.pd | 10 +++++++++- help/pix_bitmask-help.pd | 12 +++++++++++- help/pix_buf-help.pd | 10 +++++++++- help/pix_buffer-help.pd | 10 +++++++++- help/pix_buffer_read-help.pd | 11 ++++++++++- help/pix_buffer_write-help.pd | 11 ++++++++++- help/pix_chroma_key-help.pd | 11 ++++++++++- help/pix_color-help.pd | 11 ++++++++++- help/pix_coloralpha-help.pd | 10 +++++++++- help/pix_colorclassify-help.pd | 11 ++++++++++- help/pix_colormatrix-help.pd | 11 ++++++++++- help/pix_colorreduce-help.pd | 13 ++++++++++++- help/pix_compare-help.pd | 11 ++++++++++- help/pix_composite-help.pd | 11 ++++++++++- help/pix_contrast-help.pd | 12 +++++++++++- help/pix_convert-help.pd | 10 +++++++++- help/pix_convolve-help.pd | 11 ++++++++++- help/pix_coordinate-help.pd | 11 ++++++++++- help/pix_crop-help.pd | 14 +++++++++++++- help/pix_curve-help.pd | 10 +++++++++- help/pix_deinterlace-help.pd | 10 +++++++++- help/pix_delay-help.pd | 10 +++++++++- help/pix_diff-help.pd | 11 ++++++++++- help/pix_dot-help.pd | 11 ++++++++++- help/pix_draw-help.pd | 10 +++++++++- help/pix_dump-help.pd | 11 ++++++++++- help/pix_duotone-help.pd | 13 ++++++++++++- help/pix_equal-help.pd | 10 +++++++++- help/pix_film-help.pd | 13 ++++++++++++- help/pix_flip-help.pd | 10 +++++++++- help/pix_freeframe-help.pd | 10 +++++++++- help/pix_frei0r-help.pd | 10 +++++++++- help/pix_gain-help.pd | 12 +++++++++++- help/pix_grey-help.pd | 10 +++++++++- help/pix_halftone-help.pd | 13 ++++++++++++- help/pix_histo-help.pd | 10 +++++++++- help/pix_hsv2rgb-help.pd | 10 +++++++++- help/pix_image-help.pd | 10 +++++++++- help/pix_imageInPlace-help.pd | 11 ++++++++++- help/pix_info-help.pd | 17 ++++++++++++++++- help/pix_invert-help.pd | 10 +++++++++- help/pix_kaleidoscope-help.pd | 17 ++++++++++++++++- help/pix_levels-help.pd | 16 +++++++++++++++- help/pix_lumaoffset-help.pd | 12 +++++++++++- help/pix_mask-help.pd | 11 ++++++++++- help/pix_mean_color-help.pd | 11 ++++++++++- help/pix_metaimage-help.pd | 11 ++++++++++- help/pix_mix-help.pd | 12 +++++++++++- help/pix_motionblur-help.pd | 11 ++++++++++- help/pix_movement-help.pd | 11 ++++++++++- help/pix_movement2-help.pd | 12 +++++++++++- help/pix_movie-help.pd | 14 +++++++++++++- help/pix_multiblob-help.pd | 11 ++++++++++- help/pix_multiimage-help.pd | 11 ++++++++++- help/pix_multiply-help.pd | 11 ++++++++++- help/pix_multitexture-help.pd | 10 +++++++++- help/pix_noise-help.pd | 8 +++++++- help/pix_normalize-help.pd | 10 +++++++++- help/pix_offset-help.pd | 12 +++++++++++- help/pix_pix2sig~-help.pd | 13 ++++++++++++- help/pix_posterize-help.pd | 12 +++++++++++- help/pix_puzzle-help.pd | 10 +++++++++- help/pix_rds-help.pd | 10 +++++++++- help/pix_record-help.pd | 12 +++++++++++- help/pix_rectangle-help.pd | 12 +++++++++++- help/pix_refraction-help.pd | 10 +++++++++- help/pix_resize-help.pd | 10 +++++++++- help/pix_rgb2hsv-help.pd | 10 +++++++++- help/pix_rgba-help.pd | 10 +++++++++- help/pix_roi-help.pd | 10 +++++++++- help/pix_roll-help.pd | 11 ++++++++++- help/pix_rtx-help.pd | 10 +++++++++- help/pix_scanline-help.pd | 11 ++++++++++- help/pix_set-help.pd | 11 ++++++++++- help/pix_share_read-help.pd | 11 ++++++++++- help/pix_share_write-help.pd | 11 ++++++++++- help/pix_sig2pix~-help.pd | 13 ++++++++++++- help/pix_snap-help.pd | 12 +++++++++++- help/pix_snap2tex-help.pd | 12 +++++++++++- help/pix_subtract-help.pd | 11 ++++++++++- help/pix_tIIR-help.pd | 10 +++++++++- help/pix_takealpha-help.pd | 11 ++++++++++- help/pix_test-help.pd | 10 +++++++++- help/pix_texture-help.pd | 11 ++++++++++- help/pix_threshold-help.pd | 12 +++++++++++- help/pix_threshold_bernsen-help.pd | 12 +++++++++++- help/pix_video-help.pd | 11 ++++++++++- help/pix_write-help.pd | 12 +++++++++++- help/pix_writer-help.pd | 10 +++++++++- help/pix_yuv-help.pd | 10 +++++++++- help/polygon-help.pd | 12 +++++++++++- help/polygon_smooth-help.pd | 10 +++++++++- help/pqtorusknots-help.pd | 10 +++++++++- help/primTri-help.pd | 16 +++++++++++++++- help/rectangle-help.pd | 12 +++++++++++- help/render_trigger-help.pd | 11 ++++++++++- help/ripple-help.pd | 14 +++++++++++++- help/rotate-help.pd | 12 +++++++++++- help/rotateXYZ-help.pd | 13 ++++++++++++- help/rubber-help.pd | 14 +++++++++++++- help/scale-help.pd | 12 +++++++++++- help/scaleXYZ-help.pd | 13 ++++++++++++- help/scopeXYZ~-help.pd | 13 ++++++++++++- help/separator-help.pd | 10 +++++++++- help/shearXY-help.pd | 11 ++++++++++- help/shearXZ-help.pd | 11 ++++++++++- help/shearYX-help.pd | 11 ++++++++++- help/shearYZ-help.pd | 11 ++++++++++- help/shearZX-help.pd | 11 ++++++++++- help/shearZY-help.pd | 11 ++++++++++- help/shininess-help.pd | 11 ++++++++++- help/slideSquares-help.pd | 12 +++++++++++- help/specular-help.pd | 11 ++++++++++- help/specularRGB-help.pd | 14 +++++++++++++- help/sphere-help.pd | 12 +++++++++++- help/sphere3d-help.pd | 12 +++++++++++- help/spline_path-help.pd | 9 ++++++++- help/spot_light-help.pd | 12 +++++++++++- help/square-help.pd | 11 ++++++++++- help/surface3d-help.pd | 10 +++++++++- help/teapot-help.pd | 12 +++++++++++- help/text2d-help.pd | 11 ++++++++++- help/text3d-help.pd | 11 ++++++++++- help/textextruded-help.pd | 11 ++++++++++- help/textoutline-help.pd | 11 ++++++++++- help/torus-help.pd | 12 +++++++++++- help/translate-help.pd | 12 +++++++++++- help/translateXYZ-help.pd | 13 ++++++++++++- help/trapezoid-help.pd | 12 +++++++++++- help/triangle-help.pd | 11 ++++++++++- help/tube-help.pd | 18 +++++++++++++++++- help/vertex_program-help.pd | 10 +++++++++- help/world_light-help.pd | 11 ++++++++++- 190 files changed, 1957 insertions(+), 190 deletions(-) diff --git a/help/GLdefine-help.pd b/help/GLdefine-help.pd index e3e28bafc..aeffe9456 100644 --- a/help/GLdefine-help.pd +++ b/help/GLdefine-help.pd @@ -25,7 +25,15 @@ #X msg 542 98 GL_LINES; #X obj 534 142 GLdefine GL_ADD; #X msg 553 119 symbol GL_ACCUM; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION gets the value of a OpenGL constant; +#X text 10 65 KEYWORDS Gem openGL; +#X text 20 85 INLET_0 bang message; +#X text 20 105 OUTLET_0 float; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 568 228 _gemwin; #X connect 10 0 23 0; #X connect 22 0 23 0; diff --git a/help/accumrotate-help.pd b/help/accumrotate-help.pd index 128a4cf94..b0d33f47d 100644 --- a/help/accumrotate-help.pd +++ b/help/accumrotate-help.pd @@ -33,7 +33,18 @@ #X text 34 335 see also:; #X obj 143 337 rotateXYZ; #X obj 95 337 rotate; -#X obj 520 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION accumulated rotation; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist reset; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 520 8 pd META; #X obj 524 263 _gemwin; #X connect 22 0 27 0; #X connect 24 0 27 0; diff --git a/help/alpha-help.pd b/help/alpha-help.pd index 1d4ebfb7a..808259944 100644 --- a/help/alpha-help.pd +++ b/help/alpha-help.pd @@ -56,7 +56,16 @@ #X text 70 498 19=GL_ONE_MINUS_SRC1_ALPHA; #X obj 477 210 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X floatatom 501 210 2 0 19 0 - - - 0; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION enable alpha blending; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist float message; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 588 271 _gemwin; #X connect 12 0 23 0; #X connect 17 0 16 0; diff --git a/help/ambient-help.pd b/help/ambient-help.pd index ef77175e6..b78caffc6 100644 --- a/help/ambient-help.pd +++ b/help/ambient-help.pd @@ -29,7 +29,16 @@ #X floatatom 549 193 5 0 0 0 - - - 0; #X obj 84 332 ambientRGB; #X text 21 332 see also:; -#X obj 519 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION ambient colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 519 8 pd META; #X obj 461 256 _gemwin \; 0 \; 0 \; lighting 1; #X connect 13 0 23 0; #X connect 16 0 18 0; diff --git a/help/ambientRGB-help.pd b/help/ambientRGB-help.pd index cb1993f93..109cae985 100644 --- a/help/ambientRGB-help.pd +++ b/help/ambientRGB-help.pd @@ -35,7 +35,19 @@ #X obj 500 211 rotate 70 1 0 0; #X text 20 333 see also:; #X obj 93 332 ambient; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION ambient colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 453 260 _gemwin \; 0 \; 0 \; lighting 1; #X connect 13 0 26 0; #X connect 16 0 32 0; diff --git a/help/circle-help.pd b/help/circle-help.pd index 65711558c..027936cd1 100644 --- a/help/circle-help.pd +++ b/help/circle-help.pd @@ -26,7 +26,16 @@ #X floatatom 626 130 5 0 0 2 size - - 0; #X text 64 191 default:1; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a circle.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 541 245 _gemwin; #X connect 19 0 18 0; #X connect 20 0 18 0; diff --git a/help/color-help.pd b/help/color-help.pd index 19a08a70f..c7c8cc79c 100644 --- a/help/color-help.pd +++ b/help/color-help.pd @@ -25,7 +25,16 @@ #X text 29 67 Description: colouring; #X text 449 272 see also:; #X obj 452 301 colorRGB; -#X obj 519 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 519 8 pd META; #X obj 517 213 _gemwin; #X connect 13 0 17 0; #X connect 17 0 14 0; diff --git a/help/colorRGB-help.pd b/help/colorRGB-help.pd index bc516645f..bd959a410 100644 --- a/help/colorRGB-help.pd +++ b/help/colorRGB-help.pd @@ -31,7 +31,19 @@ #X text 22 81 [colorRGB] sets the colour of all subsequent shape and vertex operations until reset by another [color]/[colorRGB] object. If you set the alpha-value \, you will need an [alpha] object to enable alpha-blending; #X text 447 272 see also:; #X obj 449 297 color; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 528 213 _gemwin; #X connect 13 0 26 0; #X connect 20 0 26 1; diff --git a/help/colorSquare-help.pd b/help/colorSquare-help.pd index fa1a32b79..b1a8bbcc7 100644 --- a/help/colorSquare-help.pd +++ b/help/colorSquare-help.pd @@ -34,7 +34,20 @@ #X text 27 305 Inlet 5: list: 3(RGB) float values for the upperright corner; #X text 27 322 Inlet 6: list: 3(RGB) float values for the upperleft corner; #X text 16 86 The colorSquare object renders a square at the current position. The size of the square can be changed via the second inlet. The colors of the 4 corners can be specified separately and are drawn as gradients.; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a square with several colors.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 list; +#X text 20 145 INLET_3 list; +#X text 20 165 INLET_4 list; +#X text 20 185 INLET_5 list; +#X text 20 205 OUTLET_0 gemlist; +#X text 10 225 AUTHOR IOhannes m zmölnig; +#X text 10 245 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 587 308 _gemwin; #X connect 17 0 24 0; #X connect 18 0 24 0; diff --git a/help/cone-help.pd b/help/cone-help.pd index 2d1a409f7..b115d223e 100644 --- a/help/cone-help.pd +++ b/help/cone-help.pd @@ -29,7 +29,17 @@ #X text 64 180 defaults: 1 10; #X text 63 162 size of the cone \, number of segments; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a cone.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 int; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 540 224 _gemwin; #X connect 17 0 25 0; #X connect 18 0 25 0; diff --git a/help/cube-help.pd b/help/cube-help.pd index 90910bd2b..009a3415e 100644 --- a/help/cube-help.pd +++ b/help/cube-help.pd @@ -26,7 +26,16 @@ #X obj 593 159 cube; #X msg 525 106 draw line; #X msg 525 85 draw default; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a cube.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 583 236 _gemwin; #X connect 19 0 23 0; #X connect 20 0 23 0; diff --git a/help/cuboid-help.pd b/help/cuboid-help.pd index f690709dd..4dfc0d829 100644 --- a/help/cuboid-help.pd +++ b/help/cuboid-help.pd @@ -33,7 +33,18 @@ #X text 27 275 Inlet 3: float: height (dimY); #X text 27 289 Inlet 4: float: depth (dimZ); #X text 65 181 default: 1 1 0; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a cuboid box.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 595 244 _gemwin; #X connect 14 0 19 0; #X connect 15 0 19 0; diff --git a/help/curve-help.pd b/help/curve-help.pd index 500d7713b..86d05da28 100644 --- a/help/curve-help.pd +++ b/help/curve-help.pd @@ -50,7 +50,17 @@ #X floatatom 600 274 5 0 100 0 - - - 0; #X msg 600 291 res \$1; #X msg 605 213 \$1 \$1 \$1; -#X obj 569 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a bezier-curve; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw width res; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_N list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 569 8 pd META; #X obj 571 357 _gemwin; #X connect 26 0 43 0; #X connect 27 0 43 0; diff --git a/help/curve3d-help.pd b/help/curve3d-help.pd index be3b653e3..192ef37bd 100644 --- a/help/curve3d-help.pd +++ b/help/curve3d-help.pd @@ -1565,7 +1565,15 @@ #X text 53 349 This message can be use to set the position of a control point. (Mx \, My : position of the point in the matrix. X \, Y \, Z : position of this control point; #X text 21 447 examples :; #X text 29 87 The curve3d object renders a curve at the current position with current color or texture. The shape of the curve is controlled from a matrix. Note that control points are not necessarily part of the curve.; -#X obj 848 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a 3d bezier curve.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw res grid set; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 848 8 pd META; #X obj 863 486 _gemwin \; 0 \; 0 \; lighting 1; #X obj 871 416 gemhead; #X obj 871 439 world_light; diff --git a/help/cylinder-help.pd b/help/cylinder-help.pd index 8ec03ee01..dc6187758 100644 --- a/help/cylinder-help.pd +++ b/help/cylinder-help.pd @@ -29,7 +29,17 @@ #X text 63 167 size of the cylinder \, segments; #X text 63 182 defaults: 1 \, 10; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; -#X obj 558 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a cylinder.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 int; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 558 8 pd META; #X obj 561 241 _gemwin; #X connect 14 0 23 0; #X connect 15 0 23 0; diff --git a/help/depth-help.pd b/help/depth-help.pd index 765dc44c5..b1272b132 100644 --- a/help/depth-help.pd +++ b/help/depth-help.pd @@ -31,7 +31,15 @@ #X msg 607 229 lighting \$1; #X text 630 210 lighting; #X text 516 113 turn depth test on/off; -#X obj 608 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Activate / Deactivate depth test; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist float; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 608 8 pd META; #X obj 607 326 _gemwin; #X obj 622 274 gemhead; #X obj 622 297 world_light; diff --git a/help/diffuse-help.pd b/help/diffuse-help.pd index 373d5a7a1..b8f68049e 100644 --- a/help/diffuse-help.pd +++ b/help/diffuse-help.pd @@ -29,7 +29,16 @@ #X obj 451 156 diffuse 0 1 0; #X obj 451 355 diffuseRGB; #X text 448 332 see also:; -#X obj 508 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION diffuse colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 508 8 pd META; #X obj 525 253 _gemwin \; 0 \; 0 \; lighting 1; #X connect 13 0 26 0; #X connect 15 0 25 0; diff --git a/help/diffuseRGB-help.pd b/help/diffuseRGB-help.pd index 91fc44a89..4d0e739f7 100644 --- a/help/diffuseRGB-help.pd +++ b/help/diffuseRGB-help.pd @@ -34,7 +34,19 @@ #X obj 500 211 rotate 63 1 0 0; #X text 447 331 see also:; #X obj 449 353 diffuse; -#X obj 508 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION diffuse colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 508 8 pd META; #X obj 529 257 _gemwin \; 0 \; 0 \; lighting 1; #X connect 13 0 29 0; #X connect 15 0 31 0; diff --git a/help/disk-help.pd b/help/disk-help.pd index d423478ba..ad511ebc1 100644 --- a/help/disk-help.pd +++ b/help/disk-help.pd @@ -30,7 +30,18 @@ #X text 28 177 disk size(=outer radius) \, segments \, hole size(=inner radius); #X text 29 191 defaults: 1 \, 10 \, 0; #X text 27 247 Inlet 1: message: draw [line|fill|point|default]; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a disk.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 int; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 557 241 _gemwin; #X connect 13 0 25 0; #X connect 14 0 25 0; diff --git a/help/emission-help.pd b/help/emission-help.pd index f19c4b7a1..de92fb47b 100644 --- a/help/emission-help.pd +++ b/help/emission-help.pd @@ -25,7 +25,16 @@ #X text 21 91 [emission] accepts a gemList and sets the emission-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 448 285 see also:; #X obj 450 308 emissionRGB; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION emission colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 527 206 _gemwin \; 0 \; 0 \; lighting 1; #X connect 13 0 20 0; #X connect 16 0 20 1; diff --git a/help/emissionRGB-help.pd b/help/emissionRGB-help.pd index 67aa64118..a2aeb4358 100644 --- a/help/emissionRGB-help.pd +++ b/help/emissionRGB-help.pd @@ -31,7 +31,19 @@ #X text 22 91 [emissionRGB] accepts a gemList and sets the emission-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 449 284 see also:; #X obj 451 307 emission; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION emission colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 509 198 _gemwin \; 0 \; 0 \; lighting 1; #X connect 13 0 24 0; #X connect 20 0 24 1; diff --git a/help/fragment_program-help.pd b/help/fragment_program-help.pd index 19103910c..14ba3c80b 100644 --- a/help/fragment_program-help.pd +++ b/help/fragment_program-help.pd @@ -41,7 +41,15 @@ #X text 443 406 see also; #X obj 508 406 vertex_program; #X obj 451 226 fragment_program random.fp; -#X obj 538 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION load and apply an ARB fragment shader; +#X text 10 65 KEYWORDS Gem openGL shader; +#X text 20 85 INLET_0 gemlist open; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 538 8 pd META; #X obj 547 330 _gemwin; #X connect 10 0 29 0; #X connect 16 0 17 0; diff --git a/help/gemframebuffer-help.pd b/help/gemframebuffer-help.pd index e9c54a5aa..8f64ded85 100644 --- a/help/gemframebuffer-help.pd +++ b/help/gemframebuffer-help.pd @@ -155,7 +155,16 @@ #X text 752 59 default; #X text 11 153 NOTE: the default view-point of [gemframebuffer] is at the origin 0/0/0 \, unlike [gemwin] where it is at 0/0/4. You might want to manually insert a [translateXYZ 0 0 -4]., f 72; #X text 31 587 Outlet 2: texture info : <0.>; -#X obj 778 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a scene in a texture \, for later use.; +#X text 10 65 KEYWORDS Gem framebuffer; +#X text 20 85 INLET_0 gemlist type format dimen color rectangle texunit perspec; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 texture; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 778 8 pd META; #X text 22 512 Inlet 1: message: perspec , f 66; #X msg 685 270 format RGBA32F; #X text 27 310 Inlet 1: message: format [RGB|RGBA|RGB32|RGBA32F|YUV]; diff --git a/help/gemhead-help.pd b/help/gemhead-help.pd index 4ed8041fc..3287828c8 100644 --- a/help/gemhead-help.pd +++ b/help/gemhead-help.pd @@ -50,7 +50,15 @@ #X obj 630 138 gemhead 50; #X obj 791 183 translateXYZ 2 0 0; #X text 42 520 Inlet 1: context : change rendering context (for multiple windows).; -#X obj 818 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION start a rendering chain; +#X text 10 65 KEYWORDS Gem control; +#X text 20 85 INLET_0 float bang set context; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 818 8 pd META; #X obj 690 421 _gemwin 2; #X connect 22 0 26 0; #X connect 23 0 44 0; diff --git a/help/gemkeyboard-help.pd b/help/gemkeyboard-help.pd index 38e515d65..61248a150 100644 --- a/help/gemkeyboard-help.pd +++ b/help/gemkeyboard-help.pd @@ -24,6 +24,14 @@ #X floatatom 508 153 5 0 0 1 keyCode - - 0; #X text 488 274 see also:; #X obj 489 299 gemkeyname; -#X obj 556 30 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION output keyboard events in the GEM window; +#X text 10 65 KEYWORDS Gem control; +#X text 20 85 INLET_0 non; +#X text 20 105 OUTLET_0 keyCode; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 556 30 pd META; #X obj 548 201 _gemwin; #X connect 20 0 21 0; diff --git a/help/gemkeyname-help.pd b/help/gemkeyname-help.pd index 6a87a711b..36785016f 100644 --- a/help/gemkeyname-help.pd +++ b/help/gemkeyname-help.pd @@ -26,7 +26,16 @@ #X floatatom 508 160 2 0 0 1 state - - 0; #X symbolatom 565 134 10 0 0 0 keyName - - 0; #X obj 508 115 gemkeyname; -#X obj 558 28 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION output keyboard events in the GEM window; +#X text 10 65 KEYWORDS Gem control; +#X text 20 85 INLET_0 non; +#X text 20 105 OUTLET_0 state; +#X text 20 125 OUTLET_1 keyName; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 558 28 pd META; #X obj 552 203 _gemwin; #X connect 25 0 23 0; #X connect 25 1 24 0; diff --git a/help/gemlist-help.pd b/help/gemlist-help.pd index e06c716b3..43d7a9a30 100644 --- a/help/gemlist-help.pd +++ b/help/gemlist-help.pd @@ -29,7 +29,16 @@ #X obj 498 107 route gem_state; #X obj 498 127 route float; #X obj 498 86 t a a; -#X obj 538 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Store a gemlist; +#X text 10 65 KEYWORDS Gem control; +#X text 20 85 INLET_0 gemlist bang; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 538 8 pd META; #X obj 524 317 _gemwin; #X obj 484 221 circle 0.3; #X connect 19 0 28 0; diff --git a/help/gemlist_info-help.pd b/help/gemlist_info-help.pd index 685824db4..503608669 100644 --- a/help/gemlist_info-help.pd +++ b/help/gemlist_info-help.pd @@ -225,7 +225,19 @@ #X text 76 349 <- more about gemlist_info; #X text 18 375 see also :; #X obj 100 375 gemlist_matrix; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION get current transformation of a gemlist; +#X text 10 65 KEYWORDS Gem information; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 3; +#X text 20 145 OUTLET_2 3; +#X text 20 165 OUTLET_3 3; +#X text 20 185 OUTLET_4 3; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 222 422 gemhead; #X obj 222 445 world_light; #X obj 17 421 _gemwin \; 0 \; 0 \; lighting 1; diff --git a/help/gemlist_matrix-help.pd b/help/gemlist_matrix-help.pd index 1682b8f35..6f2ac6a1a 100644 --- a/help/gemlist_matrix-help.pd +++ b/help/gemlist_matrix-help.pd @@ -58,7 +58,16 @@ #X text 50 12 Synopsis: [gemlist_matrix]; #X text 42 94 [gemlist_matrix] accepts a gemList and output the transformation matrix.; #X text 62 265 Outlet 2: transformation matrix (16 floats); -#X obj 538 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION get current transformation matrix of a gemlist; +#X text 10 65 KEYWORDS Gem information; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 transformation; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 538 8 pd META; #X obj 342 391 gemhead; #X obj 342 414 world_light; #X obj 22 383 _gemwin \; 0 \; 0 \; lighting 1; diff --git a/help/gemmanager-help.pd b/help/gemmanager-help.pd index 4934c5cdd..eb7b010d0 100644 --- a/help/gemmanager-help.pd +++ b/help/gemmanager-help.pd @@ -18,4 +18,10 @@ window-dimensions (important for a few objects like [ortho] or [pix_snap2tex]) #X text 15 195 This is object is probably of little use for the end-user (e.g.: you); #X obj 63 401 gemmanager; -#X obj 338 28 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION interact with the global GemState; +#X text 10 65 KEYWORDS Gem control; +#X text 10 85 AUTHOR IOhannes m zmölnig; +#X text 10 105 LICENSE GPL v2; +#X restore 338 28 pd META; diff --git a/help/gemmouse-help.pd b/help/gemmouse-help.pd index 0ac7f1ce5..76def549f 100644 --- a/help/gemmouse-help.pd +++ b/help/gemmouse-help.pd @@ -69,7 +69,19 @@ #X connect 12 0 13 0; #X connect 13 0 11 0; #X restore 656 209 pd follow_mouse; -#X obj 788 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION mouse events in the GEM window; +#X text 10 65 KEYWORDS Gem control; +#X text 20 85 INLET_0 non; +#X text 20 105 OUTLET_0 x; +#X text 20 125 OUTLET_1 y; +#X text 20 145 OUTLET_2 left; +#X text 20 165 OUTLET_3 middle; +#X text 20 185 OUTLET_4 right; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 788 8 pd META; #X obj 464 299 _gemwin; #X connect 25 0 26 0; #X connect 25 1 27 0; diff --git a/help/gemvertexbuffer-help.pd b/help/gemvertexbuffer-help.pd index 94fdf9532..3b7f55034 100644 --- a/help/gemvertexbuffer-help.pd +++ b/help/gemvertexbuffer-help.pd @@ -770,7 +770,15 @@ #X text 14 646 see examples/10.glsl/16.vertexbuffer_attributes.pd on how to; #X text 15 661 use attribute tables with the vertex buffer.; #X text 57 190 number of vertices to be used. if this is a power of two (2^n) \, you might have some performance gain.; -#X obj 868 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a vertexbuffer.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist position color texture normal resize position_enable draw_range program attribute reset_attributes print_attributes; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 868 8 pd META; #N canvas 735 418 450 300 startDSP 0; #X obj 46 30 inlet; #X obj 46 97 select 1; diff --git a/help/gemwin-help.pd b/help/gemwin-help.pd index ef20a6e4a..dc0b8807c 100644 --- a/help/gemwin-help.pd +++ b/help/gemwin-help.pd @@ -710,7 +710,13 @@ #X text 30 177 2d argument : context name; #X text 443 457 see also examples/14.multiple_windows; #X msg 490 260 color \$1 \$1 \$1 \$1; -#X obj 558 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION access to the window manager; +#X text 10 65 KEYWORDS Gem window; +#X text 10 85 AUTHOR IOhannes m zmölnig; +#X text 10 105 LICENSE GPL v2; +#X restore 558 8 pd META; #X connect 11 0 10 0; #X connect 12 0 10 0; #X connect 21 0 10 0; diff --git a/help/glsl_fragment-help.pd b/help/glsl_fragment-help.pd index 76d68e194..738e1d5ab 100644 --- a/help/glsl_fragment-help.pd +++ b/help/glsl_fragment-help.pd @@ -45,7 +45,16 @@ #X restore 470 116 pd open; #X msg 470 136 open Toon.frag; #X obj 453 382 glsl_geometry; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION load a GLSL fragment shader; +#X text 10 65 KEYWORDS Gem openGL shader; +#X text 20 85 INLET_0 gemlist open print; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 float; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 533 252 _gemwin; #X connect 18 1 17 0; #X connect 28 0 18 0; diff --git a/help/glsl_geometry-help.pd b/help/glsl_geometry-help.pd index 899d3fa6d..4a2f76460 100644 --- a/help/glsl_geometry-help.pd +++ b/help/glsl_geometry-help.pd @@ -45,7 +45,16 @@ #X obj 453 383 glsl_geometry; #X msg 473 141 open Toon.geom; #X text 14 157 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support the GLSL-standard (which is part of openGL-2.1) in order to make use of this object.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION load a GLSL geometry shader; +#X text 10 65 KEYWORDS Gem openGL shader; +#X text 20 85 INLET_0 gemlist open print; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 float; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 533 262 _gemwin; #X connect 16 1 15 0; #X connect 26 0 16 0; diff --git a/help/glsl_program-help.pd b/help/glsl_program-help.pd index b6931356b..3176e1465 100644 --- a/help/glsl_program-help.pd +++ b/help/glsl_program-help.pd @@ -48,7 +48,16 @@ #X text 31 262 Inlet 1: "geometry_outvertices <#vertices>": number of vertices to be created (default: MAX_OUTPUT_VERTICES), f 70; #X restore 29 553 pd geometry shaders; #X obj 453 402 glsl_geometry; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION link GLSL-modules into a shader program, f 67; +#X text 10 65 KEYWORDS Gem openGL shader; +#X text 20 85 INLET_0 geometry_intype geometry_outtype geometry_type geometry_outvertices gemlist print shader link keepuniforms; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 float; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X msg 476 175 keepuniforms 0; #X text 21 520 Inlet 1: "keepuniforms 1|0" enable(DEFAULT) or disable the caching of uniform variables across reload, f 67; #X text 14 229 Uniform variables survive linking a new program (if the new program has a compatible uniform of the same name). To clear the cached variables on linking \, set "keepuniforms" to "0"., f 69; diff --git a/help/glsl_vertex-help.pd b/help/glsl_vertex-help.pd index 6f0da800c..4a21a5d8d 100644 --- a/help/glsl_vertex-help.pd +++ b/help/glsl_vertex-help.pd @@ -45,7 +45,16 @@ #X restore 473 119 pd open; #X msg 473 139 open Toon.vert; #X obj 453 382 glsl_geometry; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION load a GLSL vertex shader; +#X text 10 65 KEYWORDS Gem openGL shader; +#X text 20 85 INLET_0 gemlist open print; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 float; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 533 252 _gemwin; #X connect 17 1 16 0; #X connect 27 0 17 0; diff --git a/help/imageVert-help.pd b/help/imageVert-help.pd index 726bb9fda..5a622f752 100644 --- a/help/imageVert-help.pd +++ b/help/imageVert-help.pd @@ -45,7 +45,15 @@ #X text 71 31 Class: geometric object; #X obj 451 165 rotateXYZ; #X floatatom 476 144 5 0 0 0 - - - 0; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION map luminance to height; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 522 272 _gemwin; #X connect 10 0 12 0; #X connect 11 0 12 1; diff --git a/help/light-help.pd b/help/light-help.pd index eb05bd6b6..a2065ad45 100644 --- a/help/light-help.pd +++ b/help/light-help.pd @@ -39,7 +39,16 @@ #X text 63 307 light-number; #X obj 492 175 tgl 20 0 empty \$0-onoff empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 27 362 Inlet 1: float: turn light on/off (default:1); -#X obj 538 9 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION adds a point-light to the scene; +#X text 10 65 KEYWORDS Gem non-geometric; +#X text 20 85 INLET_0 gemlist float debug; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 538 9 pd META; #X obj 551 337 _gemwin; #X connect 12 0 27 0; #X connect 20 0 19 1; diff --git a/help/linear_path-help.pd b/help/linear_path-help.pd index 0629e7de8..efa8ede29 100644 --- a/help/linear_path-help.pd +++ b/help/linear_path-help.pd @@ -60,7 +60,14 @@ its values in n-tuples like: " ..." Therefore #X text 50 240 name of the table; #X obj 516 168 linear_path 3 array; #X msg 543 140 open array; -#X obj 568 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION reads out a table; +#X text 10 65 KEYWORDS Gem; +#X text 20 85 INLET_0 float; +#X text 10 105 AUTHOR IOhannes m zmölnig; +#X text 10 125 LICENSE GPL v2; +#X restore 568 8 pd META; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 12 2 15 0; diff --git a/help/mesh_line-help.pd b/help/mesh_line-help.pd index de3a56d8a..e5df230fe 100644 --- a/help/mesh_line-help.pd +++ b/help/mesh_line-help.pd @@ -32,7 +32,16 @@ #X text 16 86 The [mesh_line] object renders a mesh in a line at the current position with current color. The size of the line can be changed via the second inlet. This object is useful when working with vertex_shader; #X text 63 186 resolution of the line mesh; #X text 575 107 (draw line); -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a mesh; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw list; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 603 402 _gemwin; #X connect 14 0 23 0; #X connect 15 0 23 0; diff --git a/help/mesh_square-help.pd b/help/mesh_square-help.pd index bac10c299..a35a8d000 100644 --- a/help/mesh_square-help.pd +++ b/help/mesh_square-help.pd @@ -37,7 +37,16 @@ #X text 27 274 Inlet 1: list: gridX float : change the X grid resolution; #X text 27 288 Inlet 1: list: gridY float : change the Y grid resolution; #X text 16 86 The [mesh_square] object renders a mesh in a square at the current position with current color. The size of the square can be changed via the second inlet. This object is useful when working with vertex_shader; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a mesh; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw list; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 603 402 _gemwin; #X connect 14 0 29 0; #X connect 15 0 29 0; diff --git a/help/model-help.pd b/help/model-help.pd index bbdcc27de..9253005d8 100644 --- a/help/model-help.pd +++ b/help/model-help.pd @@ -59,7 +59,15 @@ #X obj 558 346 t a; #X text 567 424 query backends; #X obj 490 424 t a; -#X obj 558 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders an Alias/Wavefront-Model.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist open rescale smooth revert material texture group backend; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 558 8 pd META; #X obj 494 451 r \$0-ctl; #N canvas 6 49 515 369 print 0; #X obj 102 176 inlet; diff --git a/help/multimodel-help.pd b/help/multimodel-help.pd index e88095692..c3280cac1 100644 --- a/help/multimodel-help.pd +++ b/help/multimodel-help.pd @@ -29,7 +29,15 @@ #X obj 563 412 pix_multiimage; #X text 7 69 Description: load multiple an Alias/Wavefront-Model and renders one of them; #X text 18 386 for other messages to [multimodel] see [model]; -#X obj 558 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION load multiple an Alias/Wavefront-Model and renders one of them; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist open; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 558 8 pd META; #X obj 483 301 _gemwin \; 0 \; 0 \; lighting 1; #X connect 15 0 16 0; #X connect 17 0 23 0; diff --git a/help/newWave-help.pd b/help/newWave-help.pd index 57cff1149..91a59c3b0 100644 --- a/help/newWave-help.pd +++ b/help/newWave-help.pd @@ -78,7 +78,18 @@ #X text 63 159 1 : X grid-resolution \, default : 3; #X text 63 171 2 : Y grid resolution \, default : X value; #X text 26 362 Inlet 1 : message texture [1|2] : change texturing mode; -#X obj 628 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a waving square (mass-spring-system); +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist bang K1 D1 K2 D2 K3 D3 position force noise draw message; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 int; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 628 8 pd META; #X obj 648 569 world_light; #X obj 648 542 gemhead; #X obj 492 528 _gemwin \; 0 \; 0 \; lighting 1; diff --git a/help/ortho-help.pd b/help/ortho-help.pd index 7d7a98648..08165e1b5 100644 --- a/help/ortho-help.pd +++ b/help/ortho-help.pd @@ -28,7 +28,15 @@ #X obj 480 137 rotateXYZ 45 45 0; #X msg 511 180 compat \$1; #X obj 511 160 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#X obj 508 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION orthographic rendering; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist bool compat; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 508 8 pd META; #X obj 544 114 % 360; #X obj 487 114 i 45; #X obj 581 114 t f f; diff --git a/help/part_color-help.pd b/help/part_color-help.pd index 4086ad291..fcb9cffd8 100644 --- a/help/part_color-help.pd +++ b/help/part_color-help.pd @@ -2,7 +2,16 @@ #X declare -lib Gem; #X text 31 14 Synopsis: [part_color]; #X text 51 37 Class: Particle System; -#X obj 539 18 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Defines color of particles; +#X text 10 65 KEYWORDS Gem particles; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 color; +#X text 20 125 INLET_2 color; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 539 18 pd META; #X obj 7 75 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 468 74 cnv 15 200 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 472 246 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; diff --git a/help/part_damp-help.pd b/help/part_damp-help.pd index a4a7a6f94..4c981cf79 100644 --- a/help/part_damp-help.pd +++ b/help/part_damp-help.pd @@ -1,7 +1,14 @@ #N canvas 615 303 754 395 10; #X declare -lib Gem; #X text 31 14 Synopsis: [part_damp]; -#X obj 539 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Change velocity of Particles; +#X text 10 65 KEYWORDS Gem particles; +#X text 20 85 INLET_1 list; +#X text 10 105 AUTHOR IOhannes m zmölnig; +#X text 10 125 LICENSE GPL v2; +#X restore 539 8 pd META; #X obj 7 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 468 64 cnv 15 170 300 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 472 233 cnv 15 150 40 empty empty empty 20 12 0 14 #14e814 #404040 0; diff --git a/help/part_draw-help.pd b/help/part_draw-help.pd index 114c31319..9d09b35c2 100644 --- a/help/part_draw-help.pd +++ b/help/part_draw-help.pd @@ -4,7 +4,13 @@ #X text 13 358 See also:; #X obj 86 359 part_render; #X text 31 14 Synopsis: [part_draw]; -#X obj 541 30 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Draw a particle system; +#X text 10 65 KEYWORDS Gem particles; +#X text 10 85 AUTHOR IOhannes m zmölnig; +#X text 10 105 LICENSE GPL v2; +#X restore 541 30 pd META; #X obj 9 87 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 470 86 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 474 296 cnv 15 100 40 empty empty empty 20 12 0 14 #14e814 #404040 0; diff --git a/help/part_follow-help.pd b/help/part_follow-help.pd index 966e9c6df..eec8ee8ba 100644 --- a/help/part_follow-help.pd +++ b/help/part_follow-help.pd @@ -1,7 +1,13 @@ #N canvas 589 385 718 449 10; #X declare -lib Gem; #X text 34 1 Synopsis: [part_follow]; -#X obj 546 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Particle follow each other; +#X text 10 65 KEYWORDS Gem particles; +#X text 10 85 AUTHOR IOhannes m zmölnig; +#X text 10 105 LICENSE GPL v2; +#X restore 546 8 pd META; #X obj 14 65 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 66 25 Class: particle object; #X obj 475 64 cnv 15 220 275 empty empty empty 20 12 0 14 #dce4fc #404040 0; diff --git a/help/pix_2grey-help.pd b/help/pix_2grey-help.pd index 71c6bcd2a..a63870089 100644 --- a/help/pix_2grey-help.pd +++ b/help/pix_2grey-help.pd @@ -21,7 +21,15 @@ #X text 17 151 So \, if you have an RGBA-image \, after [pix_2grey] the values for R \, G and B will be the same. the chroma-values of a YUV-image will be set to 127 (no chroma); #X obj 451 176 pix_2grey; #X text 17 97 Assuming that you have an image in the gemList (for instance \, loaded in with pix_image) \, [pix_2grey] will convert the image into a greyscale \, without changing the actual colorspace.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert a pix to greyscale; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 518 262 _gemwin; #X obj 451 233 _pix2rectange; #X obj 451 113 pix_test; diff --git a/help/pix_a_2grey-help.pd b/help/pix_a_2grey-help.pd index 15569f55b..a26610c75 100644 --- a/help/pix_a_2grey-help.pd +++ b/help/pix_a_2grey-help.pd @@ -46,7 +46,16 @@ #X msg 523 171 0.5; #X msg 479 170 -0.5; #X obj 451 137 pix_coloralpha; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert a pixel to greyscale based on alpha; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 518 259 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_add-help.pd b/help/pix_add-help.pd index f6364e3c3..0643694d4 100644 --- a/help/pix_add-help.pd +++ b/help/pix_add-help.pd @@ -53,7 +53,16 @@ #X text 29 91 [pix_add] simply adds two pixes together. It clamps the images so that they remain in the range of the image. (In other words \, it is easy to get a white out).; #X obj 451 218 pix_add; #X text 33 137 The 2 images have to be of the same size.; -#X obj 527 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION add 2 images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 527 8 pd META; #X obj 451 276 _pix2rectangle 3; #X obj 520 310 _gemwin; #X connect 11 0 13 0; diff --git a/help/pix_aging-help.pd b/help/pix_aging-help.pd index 891c80d5d..fbe2ebe2b 100644 --- a/help/pix_aging-help.pd +++ b/help/pix_aging-help.pd @@ -37,7 +37,15 @@ #X text 63 290 Inlet 1: pits 0|1: add "pits"; #X text 63 324 Inlet 1: scratch : add a maximum of # scratches; #X text 63 306 Inlet 1: coloraging 0|1: color-bleaching; -#X obj 538 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION apply a super8-like aging effect; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist dust pits coloraging scratch; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 538 8 pd META; #X obj 520 262 _gemwin; #X obj 451 113 pix_test; #X connect 11 0 39 0; diff --git a/help/pix_alpha-help.pd b/help/pix_alpha-help.pd index 6162e9070..5404f7c71 100644 --- a/help/pix_alpha-help.pd +++ b/help/pix_alpha-help.pd @@ -52,7 +52,18 @@ #X text 63 388 Inlet 3: : ALPHA-value if not passed; #X text 63 400 Inlet 4: : high-threshold (RGB); #X text 63 413 Inlet 4: : low-threshold (RGB); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION set the alpha values of an RGBA-pix; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 list; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 511 416 _gemwin; #X obj 451 283 _pix2rectangle 3; #X connect 11 0 25 0; diff --git a/help/pix_background-help.pd b/help/pix_background-help.pd index 34dc11e1e..b6067f0b8 100644 --- a/help/pix_background-help.pd +++ b/help/pix_background-help.pd @@ -55,7 +55,16 @@ #X restore 451 113 pd film; #X text 516 105 open an movie; #X text 509 118 (AVI \, MPEG \, MOV); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION separate an objects from background; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist reset bang; +#X text 20 105 INLET_1 list float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 233 _pix2rectangle 3; #X obj 519 259 _gemwin; #X connect 11 0 30 0; diff --git a/help/pix_backlight-help.pd b/help/pix_backlight-help.pd index 9b74730fd..b7a0b8c43 100644 --- a/help/pix_backlight-help.pd +++ b/help/pix_backlight-help.pd @@ -45,7 +45,18 @@ #X obj 469 172 / 100; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION backlighting effect; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 259 _gemwin; #X obj 451 233 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_biquad-help.pd b/help/pix_biquad-help.pd index 21519dda5..6277c3822 100644 --- a/help/pix_biquad-help.pd +++ b/help/pix_biquad-help.pd @@ -109,7 +109,15 @@ #X floatatom 582 191 3 0 1 2 ff3 - - 0; #X obj 457 209 pack 1 0 0 1 0 0; #X text 22 327 Inlet 1: : the filter-coefficients "fb0 fb1 fb2 ff1 ff2 ff3"; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION timebased IIR-filter; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist set list; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 538 308 _gemwin; #X obj 451 280 _pix2rectangle 3; #X connect 11 0 15 0; diff --git a/help/pix_bitmask-help.pd b/help/pix_bitmask-help.pd index c058d0aa7..8724b5564 100644 --- a/help/pix_bitmask-help.pd +++ b/help/pix_bitmask-help.pd @@ -45,7 +45,17 @@ #X msg 547 185 0 128 0; #X text 13 278 Inlet 2: list: mask value for all channels (0..255); #X text 13 295 Inlet 3: list: 3 (RGB) or 4 (RGBA) mask-values in INTeger (0..255); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION mask out pixels; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 233 _pix2rectangle; #X obj 520 260 _gemwin; #X connect 11 0 14 0; diff --git a/help/pix_buf-help.pd b/help/pix_buf-help.pd index b7d211d06..b711f786d 100644 --- a/help/pix_buf-help.pd +++ b/help/pix_buf-help.pd @@ -26,7 +26,15 @@ #X text 11 238 [pix_buf] can be used to separate two gemlists processing the same image-data. Thus is is also called [pix_separator]; #X text 22 362 Inlet 1: bang: copy of input-data to the output and force all subsequent [pix_]-objects to process.; #X text 22 391 Inlet 1: auto 1|0: force image-processing in subsequent objects each render-cycle (default:0); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION buffer a pix; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bang auto; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X text 63 296 the default value to force processing; #X obj 481 380 _gemwin; #X obj 451 251 _pix2rectangle 3; diff --git a/help/pix_buffer-help.pd b/help/pix_buffer-help.pd index 615f7b00a..accfc205c 100644 --- a/help/pix_buffer-help.pd +++ b/help/pix_buffer-help.pd @@ -47,7 +47,15 @@ #X msg 506 212 save /tmp/out.jpg 2; #X text 23 414 Inlet 1: message: copy : copy a pix from slot to slot ; #X text 23 444 Inlet 1: message: save : save image in given slot to harddisk.; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION a storage place for a number of images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 bang open allocate resize copy save; +#X text 20 105 OUTLET_0 int; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 464 277 route float; #X obj 587 240 r \$0-ctl; #N canvas 6 49 515 369 print 0; diff --git a/help/pix_buffer_read-help.pd b/help/pix_buffer_read-help.pd index 6d22d689d..a3797a852 100644 --- a/help/pix_buffer_read-help.pd +++ b/help/pix_buffer_read-help.pd @@ -28,7 +28,16 @@ #X text 11 79 [pix_buffer_read] reads an image from the named buffer provided by [pix_buffer]. Specify the frame of the buffer you want to read via the second inlet. If no frame is stored at the specified index \, you will get no image. (eg: no texture will be applied). You can change the buffer to read from on the fly via the [set( message.; #X msg 464 138 set depot3; #X obj 508 362 pix_buffer depot3 1; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION read from a [pix_buffer]; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist set; +#X text 20 105 INLET_1 int; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 548 295 _gemwin; #X obj 451 242 _pix2rectangle 1.9; #X connect 11 0 21 0; diff --git a/help/pix_buffer_write-help.pd b/help/pix_buffer_write-help.pd index ee6ae2cd1..380163a91 100644 --- a/help/pix_buffer_write-help.pd +++ b/help/pix_buffer_write-help.pd @@ -48,7 +48,16 @@ #X obj 508 382 pix_buffer_read; #X obj 507 362 pix_buffer depot2 1; #X text 29 57 Description: write images to a [pix_buffer]; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION write images to a [pix_buffer]; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist set; +#X text 20 105 INLET_1 int; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 541 298 _gemwin; #X obj 451 252 translate 2 0 1 0; #X obj 451 272 _pix2rectangle 1.9; diff --git a/help/pix_chroma_key-help.pd b/help/pix_chroma_key-help.pd index 9daa749d5..8c5c08893 100644 --- a/help/pix_chroma_key-help.pd +++ b/help/pix_chroma_key-help.pd @@ -75,7 +75,16 @@ #X connect 9 0 5 0; #X connect 10 0 9 0; #X restore 580 139 pd image; -#X obj 508 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION mix 2 images based on their color; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist value range direction; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 508 8 pd META; #X obj 451 161 pix_rgba; #X obj 580 162 pix_rgba; #X text 511 155 or [pix_yuv], f 9; diff --git a/help/pix_color-help.pd b/help/pix_color-help.pd index 497406277..e88c501d8 100644 --- a/help/pix_color-help.pd +++ b/help/pix_color-help.pd @@ -23,7 +23,16 @@ #X msg 458 164 1 0 0 1; #X text 42 95 [pix_color] sets each pixel of an image to a certain RGBA-value. As this is a pix_fx \, you will need an image first \, to set its pixels to a certain value.; #X text 63 275 Inlet 2: list: 3 (RGB) or 4 (RGBA) values; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION set the colour-channels of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 524 259 _gemwin; #X obj 451 113 pix_test; #X text 29 133 Note that this is done by the CPU in the main-memory of your machine \, while [color] can be done very fast by your graphics-card. Generally it is NOT a good idea to use [pix_color] if the same result can be achieved with the [color] object !; diff --git a/help/pix_coloralpha-help.pd b/help/pix_coloralpha-help.pd index 8cd684e7a..daafea3a8 100644 --- a/help/pix_coloralpha-help.pd +++ b/help/pix_coloralpha-help.pd @@ -25,7 +25,15 @@ #X text 16 155 This of course \, makes only sense with RGBA-images.; #X text 63 275 Inlet 1: 1|0 : turn on/off (default:1); #X obj 467 142 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 1 1; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION calculate the Alpha-channels from the RGB-data; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 522 244 _gemwin; #X obj 451 113 pix_test; #X obj 451 196 alpha; diff --git a/help/pix_colorclassify-help.pd b/help/pix_colorclassify-help.pd index ab38c5e62..72f43893e 100644 --- a/help/pix_colorclassify-help.pd +++ b/help/pix_colorclassify-help.pd @@ -41,7 +41,16 @@ #X text 16 357 Author: Ricardo Fabbri labmacambira.sf.net rfabbri at gmail; #X text 42 95 [pix_colorclassify] will detect colors in a pixImage \, classifying each pixel into 6 classes: red \, green \, blue \, yellow \, black \, white \, or 'uncertain'. It will only detect a color if it is unambiguous.; #X text 50 12 Synopsis: [pix_colorclassify]; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION detects color classes in an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist RGBA; +#X text 20 105 INLET_1 bool; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 258 _gemwin; #X obj 451 233 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_colormatrix-help.pd b/help/pix_colormatrix-help.pd index f643cc27d..ca8f2f73f 100644 --- a/help/pix_colormatrix-help.pd +++ b/help/pix_colormatrix-help.pd @@ -39,7 +39,16 @@ #X floatatom 495 185 3 -1 2 0 - \$0-1/3 \$0-1/3- 0; #X floatatom 518 185 3 -1 2 0 - \$0-2/3 \$0-2/3- 0; #X floatatom 541 185 3 -1 2 0 - \$0-3/3 \$0-3/3- 0; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION transform the pixel values by a matrix; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 520 317 _gemwin; #X obj 451 293 _pix2rectangle 3; #X obj 451 113 pix_test; diff --git a/help/pix_colorreduce-help.pd b/help/pix_colorreduce-help.pd index 14aee84bc..4edbc056c 100644 --- a/help/pix_colorreduce-help.pd +++ b/help/pix_colorreduce-help.pd @@ -42,7 +42,18 @@ #X obj 569 176 tgl 15 0 empty empty smooth 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION reduce the number of colour in the image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 522 258 _gemwin; #X obj 451 233 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_compare-help.pd b/help/pix_compare-help.pd index 789bbfa2c..771ecda4b 100644 --- a/help/pix_compare-help.pd +++ b/help/pix_compare-help.pd @@ -58,7 +58,16 @@ #X text 33 354 see also:; #X obj 99 355 pix_diff; #X obj 159 355 pix_subtract; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION mix 2 images based on their luminance; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist direction; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 252 _pix2rectangle 3; #X obj 521 283 _gemwin; #X connect 11 0 14 0; diff --git a/help/pix_composite-help.pd b/help/pix_composite-help.pd index 4930cd687..cc280c4c3 100644 --- a/help/pix_composite-help.pd +++ b/help/pix_composite-help.pd @@ -54,7 +54,16 @@ #X text 29 67 Description: alpha-blend 2 images; #X text 13 84 [pix_composite] mixes two pixes together based on the alpha value of the 1st pix.; #X obj 451 166 pix_coloralpha; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION alpha-blend 2 images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 519 295 _gemwin; #X obj 451 263 _pix2rectangle 3; #X connect 11 0 13 0; diff --git a/help/pix_contrast-help.pd b/help/pix_contrast-help.pd index bb6eb9e52..c83ca2a48 100644 --- a/help/pix_contrast-help.pd +++ b/help/pix_contrast-help.pd @@ -41,7 +41,17 @@ #X text 21 141 A contrast (or saturation) of "1" will not change the image. Both contrast and saturation modifiers must be >=0!; #X text 63 261 Inlet 2: float: contrast (>=0. default:1); #X text 63 274 Inlet 3: float: saturation (>=0. default:1); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION change contrast and saturation of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 233 _pix2rectangle 3; #X obj 520 263 _gemwin; #X connect 11 0 14 0; diff --git a/help/pix_convert-help.pd b/help/pix_convert-help.pd index 941e19676..cc37b64ca 100644 --- a/help/pix_convert-help.pd +++ b/help/pix_convert-help.pd @@ -33,7 +33,15 @@ #X obj 265 338 pix_rgba; #X text 63 276 Inlet 1: color :: colorspace to convert to; #X text 19 159 You can use [pix_convert] to convert images of any format into a format you can choose.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert the colorspace of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist color; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 233 _pix2rectangle 3; #X obj 451 113 pix_test; #X obj 521 260 _gemwin; diff --git a/help/pix_convolve-help.pd b/help/pix_convolve-help.pd index 94812f13b..c9174ff9d 100644 --- a/help/pix_convolve-help.pd +++ b/help/pix_convolve-help.pd @@ -161,7 +161,16 @@ #X text 20 144 The matrix must have the same size as the arguments (in this instance \, a 3 x 3 matrix) \, and is given as a single list of the matrix-values row after row.; #X text 63 266 : matrix dimensions; #X text 28 190 Currently \, only square matrices are supported.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION apply a convolution kernel; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 523 318 _gemwin; #X obj 451 293 _pix2rectangle 3; #X obj 451 113 pix_test; diff --git a/help/pix_coordinate-help.pd b/help/pix_coordinate-help.pd index 2f77e3783..aef4d94ed 100644 --- a/help/pix_coordinate-help.pd +++ b/help/pix_coordinate-help.pd @@ -29,7 +29,16 @@ #X msg 459 193 0 0 1 0 1 1 0 1; #X text 14 248 IMPORTANT NOTE-3: Images with dimensions that are not powers-of-2 \, will not "repeat" properly in any case., f 60; #X text 14 203 IMPORTANT NOTE-2: if your hardware supports it \, Gem tries to use "rectangle-texturing"\\\, which does not support "repeat" mode. This is an OpenGL limitation; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION set the texture-coordinates for a pix; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 113 pix_test; #X obj 451 136 pix_texture \; rectangle 0 \; repeat 1; #X obj 479 350 _gemwin; diff --git a/help/pix_crop-help.pd b/help/pix_crop-help.pd index c83a6818b..e22e9c87f 100644 --- a/help/pix_crop-help.pd +++ b/help/pix_crop-help.pd @@ -28,7 +28,19 @@ #X floatatom 556 177 5 0 0 1 offY - - 0; #X text 29 77 Description: get a subimage of an image; #X text 12 91 [pix_crop]: only passes the selected rectangle further on. The selection is made by the dimension of the subimage in pixels and the offset (in pixels) from the lower left corner.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION get a subimage of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 233 _pix2rectangle 3; #X obj 521 261 _gemwin; #X obj 451 113 pix_test; diff --git a/help/pix_curve-help.pd b/help/pix_curve-help.pd index 20b312434..a656c751d 100644 --- a/help/pix_curve-help.pd +++ b/help/pix_curve-help.pd @@ -101,7 +101,15 @@ #X text 23 415 Inlet 1: set : common table for all channels; #X text 23 432 Inlet 1: set : separate tables for all channels; #X text 23 461 Inlet 1: set : separate tables for all channels (incl. Alpha); -#X obj 618 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION apply color curves to an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist set; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 618 8 pd META; #X obj 590 262 _gemwin; #X obj 451 253 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_deinterlace-help.pd b/help/pix_deinterlace-help.pd index 20b106864..cc18eed91 100644 --- a/help/pix_deinterlace-help.pd +++ b/help/pix_deinterlace-help.pd @@ -46,7 +46,15 @@ #X text 17 97 [pix_deinterlace] will apply a deinterlacing algorithm on the incoming image. This is done by getting the average of neighbouring rows.; #X text 21 141 When mode is set to "0" \, only those pixels are de-interlaced if they appear to be interlaced (this is detected by thresholding the difference between adjacent pixels). In mode "1" de-interlacing is always enforced.; #X text 63 282 Inlet 1: mode : enforce(1) or not(0) (default:1); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION deinterlace an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist mode; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 223 _pix2rectangle 3; #X obj 521 261 _gemwin; #X connect 11 0 14 0; diff --git a/help/pix_delay-help.pd b/help/pix_delay-help.pd index 1fc71b220..26276699e 100644 --- a/help/pix_delay-help.pd +++ b/help/pix_delay-help.pd @@ -44,7 +44,15 @@ #X text 64 195 int: max.number of delayed frames; #X text 24 254 Inlet 1: int: delay (in frames); #X text 11 79 [pix_delay] is a frame-based delay-line. All frames stored in the delay-line have to have the same dimensions and colour-space. You can specify the length of the entire delay-line (==maximum delay) as an argument to the [pix_delay] object. The delay in frames defaults to 0 (route through) and can be changed via the second inlet.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION delay a series of images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist int; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 270 _pix2rectangle 3; #X obj 521 297 _gemwin; #X connect 11 0 18 0; diff --git a/help/pix_diff-help.pd b/help/pix_diff-help.pd index 9d1b6b758..13b15543f 100644 --- a/help/pix_diff-help.pd +++ b/help/pix_diff-help.pd @@ -56,7 +56,16 @@ #X text 32 353 see also:; #X obj 100 353 pix_subtract; #X obj 180 353 pix_compare; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION get the difference between 2 pixes; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 450 252 _pix2rectangle; #X obj 520 285 _gemwin; #X connect 11 0 13 0; diff --git a/help/pix_dot-help.pd b/help/pix_dot-help.pd index af84e282b..d5c52387a 100644 --- a/help/pix_dot-help.pd +++ b/help/pix_dot-help.pd @@ -38,7 +38,16 @@ #X text 509 118 (JPEG \, TIFF \, ..); #X text 34 94 [pix_dot] will simplify an image \, as the image will be segmented and each segment will be represented by a white dot \, whose size is relative to the luminance of the original segment.; #X text 63 166 ; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION make dotty images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 523 260 _gemwin; #X obj 451 233 _pix2rectangle 3; #X connect 11 0 16 0; diff --git a/help/pix_draw-help.pd b/help/pix_draw-help.pd index eb06600c4..c6445389d 100644 --- a/help/pix_draw-help.pd +++ b/help/pix_draw-help.pd @@ -42,7 +42,15 @@ #X floatatom 472 149 5 -4 4 0 - - - 0; #X floatatom 519 148 5 -4 4 0 - - - 0; #X floatatom 563 149 5 -4 2 0 - - - 0; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION draw pixels on the screen; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 520 260 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_dump-help.pd b/help/pix_dump-help.pd index e3d42fe07..09551c66a 100644 --- a/help/pix_dump-help.pd +++ b/help/pix_dump-help.pd @@ -29,7 +29,16 @@ #X obj 530 168 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 530 186 bytemode \$1; #X text 63 286 Inlet 1: bytemode: set normalization on or off; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION dump all the pixel-data of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bang bytemode; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 list; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 245 _pix2rectangle 3; #X obj 522 310 _gemwin; #X obj 451 113 pix_test 20 20; diff --git a/help/pix_duotone-help.pd b/help/pix_duotone-help.pd index 62bc7f828..c346978bc 100644 --- a/help/pix_duotone-help.pd +++ b/help/pix_duotone-help.pd @@ -42,7 +42,18 @@ #X text 63 245 Inlet 2: list: threshold (RGB); #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION reduce the number of colours by thresholding; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 INLET_3 list; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 261 _gemwin; #X obj 451 233 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_equal-help.pd b/help/pix_equal-help.pd index 37f447efa..8e47fbdbe 100644 --- a/help/pix_equal-help.pd +++ b/help/pix_equal-help.pd @@ -48,7 +48,15 @@ #X text 456 373 and having any alpha; #X text 457 342 e.g. marks whatever is within; #X text 456 358 a certain bright yellow range; -#X obj 528 18 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION marks the pixels nearly equal to a given color; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist RGBA; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 528 18 pd META; #X obj 531 280 _gemwin; #X obj 461 250 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_film-help.pd b/help/pix_film-help.pd index c771e5442..de7fc1015 100644 --- a/help/pix_film-help.pd +++ b/help/pix_film-help.pd @@ -85,7 +85,18 @@ #X text 14 151 Normally \, you will only get one specified (via the second inlet) frame of the film. To play back a complete film \, you have to change the frame accordingly \, OR use the "auto" message \, to automatically proceed to the next frame each rendering-cycle. In auto-mode \, the film is NOT looped. Instead you can reset the current-frame to zero when the end of the film is reached., f 69; #X text 16 445 Inlet 2: float: changes the frame to be decoded on rendering (starting with 0), f 69; #X text 17 391 Inlet 1: message : backend : open the film using only the specified backend(s), f 70; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION load in a movie-file; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist open colorspace message; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 20 145 OUTLET_1 list; +#X text 20 165 OUTLET_2 bang; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 578 8 pd META; #N canvas 2 93 450 310 :: 0; #X text 35 220 If a specific colorspace is required \, it is strongly recommended to convert using [pix_rgba] \, [pix_yuv] \, [pix_grey] etc. This is the only way to guarantee a colorspace., f 60; #X text 35 33 Note that the default colorspace may vary on different operating systems \, even for the same patch and same video file. For instance \, [pix_film] may output YUV images in macOS \, while the same patch and same video file may obtain RGB images in Linux. While most downstream [pix] objects can adapt automatically to the incoming format \, there are some (e.g. [pix_chroma_key]) which take a user-specified color as an input. Such objects are sensitive to the image's colorspace \, and patches using them may exhibit variable behavior on different OSes.; diff --git a/help/pix_flip-help.pd b/help/pix_flip-help.pd index 45a39d584..c13f6ca23 100644 --- a/help/pix_flip-help.pd +++ b/help/pix_flip-help.pd @@ -26,7 +26,15 @@ #X text 20 153 It defaults to none; #X text 63 275 Inlet 1: none|horizontal|vertical|both; #X obj 451 226 pix_flip; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION flips the image along an axis; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist none horizontal vertical both; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 520 292 _gemwin; #X obj 451 253 _pix2rectangle 3; #X obj 451 113 pix_test; diff --git a/help/pix_freeframe-help.pd b/help/pix_freeframe-help.pd index f47a25b9d..59de60b9f 100644 --- a/help/pix_freeframe-help.pd +++ b/help/pix_freeframe-help.pd @@ -64,7 +64,15 @@ #X text 22 406 Inlet 1: open : load another plugin (if applicable); #X text 22 419 Inlet 1: # : set parameter # (starting from 1); #X text 22 441 Inlet 1: : set parameter given by ; -#X obj 538 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION run a FreeFrame effect; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist open list ; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 538 8 pd META; #X obj 451 320 _pix2rectangle 3; #X obj 521 356 _gemwin; #X connect 15 0 16 0; diff --git a/help/pix_frei0r-help.pd b/help/pix_frei0r-help.pd index 5e8cad70e..11fe265fe 100644 --- a/help/pix_frei0r-help.pd +++ b/help/pix_frei0r-help.pd @@ -63,7 +63,15 @@ #X text 21 453 Inlet 2..N (if applicable): : depending on the settable parameter; #X text 22 419 Inlet 1: # : set parameter # (starting from 1); #X text 22 441 Inlet 1: : set parameter given by ; -#X obj 548 18 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION run a Frei0r effect; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist load list ; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 548 18 pd META; #X text 22 406 Inlet 1: load : load another plugin (if applicable); #X obj 521 350 _gemwin; #X obj 451 320 _pix2rectangle 3; diff --git a/help/pix_gain-help.pd b/help/pix_gain-help.pd index 8c426495f..d8f6c66eb 100644 --- a/help/pix_gain-help.pd +++ b/help/pix_gain-help.pd @@ -25,7 +25,17 @@ #X msg 528 188 0 0.4 0.8 1; #X text 10 93 pix_gain applies a gain multiplier to each pixel in a pix. The float is a constant modifier applied to all color components. If you use just R G B \, it assumes an alpha of 1.0.; #X text 13 152 NOTE: while you can use this \, remember that you can often achieve the very same thing using the [color]-object for coloring the Geo onto which the image data is textured \, which could be done on the gfx-card (very efficient!) \, while [pix_gain] is always(!) done on the CPU!!!; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION multiply pixel-values; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist saturate; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 523 280 _gemwin; #X obj 451 113 pix_test; #X msg 480 216 saturate \$1; diff --git a/help/pix_grey-help.pd b/help/pix_grey-help.pd index f898ed035..47f7bdfc7 100644 --- a/help/pix_grey-help.pd +++ b/help/pix_grey-help.pd @@ -30,7 +30,15 @@ #X obj 248 338 pix_rgba; #X obj 24 390 pix_2grey; #X text 97 384 produces similar ("grey") results \, but does NO colourspace-conversion!!; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert the colorspace of an image to GREY; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 113 pix_test; #X obj 523 259 _gemwin; #X connect 11 0 31 0; diff --git a/help/pix_halftone-help.pd b/help/pix_halftone-help.pd index 64b2a16f8..d845db2db 100644 --- a/help/pix_halftone-help.pd +++ b/help/pix_halftone-help.pd @@ -51,7 +51,18 @@ #X text 111 405 2...diamond dots; #X text 111 418 3...'euclidean' dots; #X text 111 431 4...postscript diamond dots; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION make halftone-patterns; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist style; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 237 _pix2rectangle 3; #X obj 521 268 _gemwin; #X connect 11 0 13 0; diff --git a/help/pix_histo-help.pd b/help/pix_histo-help.pd index d536f8471..c92b33ddd 100644 --- a/help/pix_histo-help.pd +++ b/help/pix_histo-help.pd @@ -55,7 +55,15 @@ #X text 63 435 Inlet 1: set
: table to store grey-histogram; #X text 63 449 Inlet 1: set : tables to store RGB-histograms; #X text 63 474 Inlet 1: set : tables to store RGBA-histograms; -#X obj 528 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION excerpt histograms of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist set; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 528 8 pd META; #X obj 522 271 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_hsv2rgb-help.pd b/help/pix_hsv2rgb-help.pd index d6311e18b..ad510e43b 100644 --- a/help/pix_hsv2rgb-help.pd +++ b/help/pix_hsv2rgb-help.pd @@ -42,7 +42,15 @@ #X text 24 156 On the technical (internal) side \, the image is always RGBA. The Red-channel is interpreted as Hue-values....; #X text 94 340 see also:; #X obj 187 338 pix_rgb2hsv; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert HSV into RGB; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 519 258 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_image-help.pd b/help/pix_image-help.pd index 2805287ca..ed2e8b99c 100644 --- a/help/pix_image-help.pd +++ b/help/pix_image-help.pd @@ -47,7 +47,15 @@ #X obj 521 177 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 15 138 [pix_image] loads in TIFFs \, JPEGs and probably more (depending on your platform and how Gem was compiled); #X obj 451 226 pix_image examples/data/fractal.JPG; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION loads in an image file; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist open thread; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 578 8 pd META; #X text 14 202 The image can be either drawn directly using [pix_draw] (VERY slow) or applied as a texture onto a Geo ([pix_texture]), f 68; #X obj 569 257 _gemwin; #X connect 11 0 30 0; diff --git a/help/pix_imageInPlace-help.pd b/help/pix_imageInPlace-help.pd index 122bceecd..d56ba89e5 100644 --- a/help/pix_imageInPlace-help.pd +++ b/help/pix_imageInPlace-help.pd @@ -35,7 +35,16 @@ #X text 23 397 Inlet 1: download : load the "preload"ed images into texture-RAM; #X text 24 427 Inlet 1: purge: delete images from texture-RAM; #X text 24 100 [pix_imageInPlace] is slightly different than [pix_multiimage]. When you select an image to display with [pix_multiimage] \, it copies over the image data to the pix-buffer \, which is then used by [pix_texture].; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION loads in multiple image files; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist preload download purge; +#X text 20 105 INLET_1 int; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 522 260 _gemwin; #X connect 11 0 20 0; #X connect 16 0 20 1; diff --git a/help/pix_info-help.pd b/help/pix_info-help.pd index 5d5e6abe8..f18278d3e 100644 --- a/help/pix_info-help.pd +++ b/help/pix_info-help.pd @@ -43,7 +43,22 @@ #X text 57 490 Outlet 8: pointer: image-data; #X text 57 459 Outlet 6: list: ; #X text 57 476 Outlet 7: list: ; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION get information about the current image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist symbolic; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 int; +#X text 20 145 OUTLET_2 int; +#X text 20 165 OUTLET_3 int; +#X text 20 185 OUTLET_4 int; +#X text 20 205 OUTLET_5 list; +#X text 20 225 OUTLET_6 list; +#X text 20 245 OUTLET_7 pointer; +#X text 10 265 AUTHOR IOhannes m zmölnig; +#X text 10 285 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 265 pix_info -m, f 25; #X obj 451 162 pix_info, f 20; #X obj 461 314 unpack; diff --git a/help/pix_invert-help.pd b/help/pix_invert-help.pd index b6960fc30..b1931daf6 100644 --- a/help/pix_invert-help.pd +++ b/help/pix_invert-help.pd @@ -23,7 +23,15 @@ #X text 29 76 Description: invert an image; #X text 16 126 [pix_invert] will invert your image. Thus all black pixels will become white and vice-versa.; #X text 50 12 Synopsis: [pix_invert]; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION invert an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 519 258 _gemwin; #X obj 451 113 pix_test; #X connect 11 0 25 0; diff --git a/help/pix_kaleidoscope-help.pd b/help/pix_kaleidoscope-help.pd index c7c7f7a5d..0edd8964c 100644 --- a/help/pix_kaleidoscope-help.pd +++ b/help/pix_kaleidoscope-help.pd @@ -47,7 +47,22 @@ #X floatatom 547 187 4 0 100 0 - - - 0; #X obj 495 206 * 0.01; #X obj 547 206 * 0.01; -#X obj 538 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION kaleidoscope effect; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 list; +#X text 20 165 INLET_4 float; +#X text 20 185 INLET_5 list; +#X text 20 205 INLET_6 float; +#X text 20 225 INLET_7 float; +#X text 20 245 OUTLET_0 gemlist; +#X text 10 265 AUTHOR IOhannes m zmölnig; +#X text 10 285 LICENSE GPL v2; +#X restore 538 8 pd META; #X obj 540 425 _gemwin; #X obj 449 121 pix_test; #X obj 449 391 _pix2rectangle 3; diff --git a/help/pix_levels-help.pd b/help/pix_levels-help.pd index 4205dabad..bd51bf183 100644 --- a/help/pix_levels-help.pd +++ b/help/pix_levels-help.pd @@ -62,7 +62,21 @@ #X msg 536 193 0 0.1 1 0.5; #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); -#X obj 523 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION level adjustment; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist auto uni inv; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 INLET_3 list; +#X text 20 165 INLET_4 list; +#X text 20 185 INLET_5 float; +#X text 20 205 INLET_6 float; +#X text 20 225 OUTLET_0 gemlist; +#X text 10 245 AUTHOR IOhannes m zmölnig; +#X text 10 265 LICENSE GPL v2; +#X restore 523 8 pd META; #X obj 522 318 _gemwin; #X obj 451 293 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_lumaoffset-help.pd b/help/pix_lumaoffset-help.pd index 0d98dcdd8..05bd07f7f 100644 --- a/help/pix_lumaoffset-help.pd +++ b/help/pix_lumaoffset-help.pd @@ -47,7 +47,17 @@ #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 13 357 NOTE: specifying too high offsets might cause crashes!!!; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION offset pixels depending on the luminance; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist fill smooth; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 522 260 _gemwin; #X obj 451 233 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_mask-help.pd b/help/pix_mask-help.pd index 80f87dff0..f77a66431 100644 --- a/help/pix_mask-help.pd +++ b/help/pix_mask-help.pd @@ -57,7 +57,16 @@ #X obj 531 108 gemhead 1; #X text 17 340 see also:; #X obj 82 342 pix_takealpha; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION mask out a pix; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 491 267 _gemwin \; 0 \; 0 \; color 0.5 0.5 0.5; #X obj 450 242 _pix2rectangle 3; #X connect 10 0 12 0; diff --git a/help/pix_mean_color-help.pd b/help/pix_mean_color-help.pd index 3c8744db1..330d56fc3 100644 --- a/help/pix_mean_color-help.pd +++ b/help/pix_mean_color-help.pd @@ -53,7 +53,16 @@ #X floatatom 583 186 3 0 0 0 - - - 0; #X obj 451 208 translateXYZ 0 2 0; #X text 36 239 Outlet 2: : the mean color of the image; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION get the mean color of the current image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 : size; #X text 22 148 Part of the scaling down process on the images involves properly smoothing them \; turning the "cheap" parameter ON skips that step \, giving a more jagged output but speeding up the processing., f 67; #X text 22 205 The "distance" parameter controls how the size of the images is changed by the 'size' message. If turned on \, then the size doesn't scale linearly \, but is used as if the images were on a plane in 3D space \, and controls the distance from the plane., f 67; -#X obj 518 9 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION display a pix by itself; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool cheap distance; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 9 pd META; #X obj 491 302 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_mix-help.pd b/help/pix_mix-help.pd index c179a53de..90527a18f 100644 --- a/help/pix_mix-help.pd +++ b/help/pix_mix-help.pd @@ -64,7 +64,17 @@ #X obj 451 229 pix_mix 0; #X text 14 81 [pix_mix] will mix 2 images just like a video-mixer. You can supply mixing factors A and B \, and the result will be out=in1*A+in2*B. If you supply only one factor A \, the result will be out=in1*(1-A)+in2*A.; #X text 22 255 Inlet 3: float: weight for left image. right weight will be the reciprocal value (for crossfading); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION mix 2 images based on mixing factors; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 INLET_2 list float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 296 _gemwin; #X obj 451 267 _pix2rectangle 3; #X connect 11 0 14 0; diff --git a/help/pix_motionblur-help.pd b/help/pix_motionblur-help.pd index 065dff203..3fcd2f6ea 100644 --- a/help/pix_motionblur-help.pd +++ b/help/pix_motionblur-help.pd @@ -44,7 +44,16 @@ #X text 64 195 ; #X text 24 254 Inlet 2: float: blur-factor (0..no blurring \, 1..only blurring); #X text 14 73 [pix_motionblur] applies a very simple and fast motion blur to an image stream. the method used involves blending the current image with a 'history' image and saving the result back to the 'history'. the blending is the same as pix_mix output = (stream * gain) + (history * 1 - gain) applying a higher blur factor will mix in more of the history image and thus more of the history will be saved resulting in heavier blurring.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION apply motionbluring on a series of images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 518 295 _gemwin; #X obj 451 267 _pix2rectangle 3; #X connect 11 0 15 0; diff --git a/help/pix_movement-help.pd b/help/pix_movement-help.pd index 1f385a1a5..db37eac36 100644 --- a/help/pix_movement-help.pd +++ b/help/pix_movement-help.pd @@ -51,7 +51,16 @@ #X obj 451 172 pix_rgba; #X text 457 370 see also:; #X obj 519 370 pix_movement2; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION timebased IIR-filter; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 451 330 _pix2rectangle 3; #X obj 541 267 _gemwin; #X connect 11 0 15 0; diff --git a/help/pix_movement2-help.pd b/help/pix_movement2-help.pd index aa8ead26e..ade880fd5 100644 --- a/help/pix_movement2-help.pd +++ b/help/pix_movement2-help.pd @@ -53,7 +53,17 @@ #X text 457 368 see also:; #X obj 521 370 pix_movement; #X text 15 78 [pix_movement2] detects movement in a frame with respect to the 2 previous frames and a "background"-image and stores it as a b/w-image (greyscale).; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION timebase IIR-filter for motion detection; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bang; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 451 261 _pix2rectangle 3; #X obj 550 296 _gemwin; #X connect 11 0 15 0; diff --git a/help/pix_movie-help.pd b/help/pix_movie-help.pd index bae87c65e..89b3d6485 100644 --- a/help/pix_movie-help.pd +++ b/help/pix_movie-help.pd @@ -68,7 +68,19 @@ #X text 17 427 Outlet 2: see [pix_film]; #X text 17 450 Outlet 3: see [pix_film]; #X text 21 161 Think of this object as a hybrid between [pix_film] and [pix_texture]...; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION load in a movie-file; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist see; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 20 145 OUTLET_1 see; +#X text 20 165 OUTLET_2 see; +#X text 20 185 OUTLET_3 list; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 599 447 _gemwin; #X connect 11 0 33 0; #X connect 14 0 24 0; diff --git a/help/pix_multiblob-help.pd b/help/pix_multiblob-help.pd index 8d7aeecee..00be60bdb 100644 --- a/help/pix_multiblob-help.pd +++ b/help/pix_multiblob-help.pd @@ -143,7 +143,16 @@ #X text 17 439 Outlet 2: (k \, 9) matrix: describing k detected blobs (with 0<=k : change the initialization of the random function, f 62; #X text 42 425 set : change size of the image (default : 64*64), f 66; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION generate a noise image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 10 85 AUTHOR IOhannes m zmölnig; +#X text 10 105 LICENSE GPL v2; +#X restore 518 8 pd META; #X text 457 474 see also:; #X obj 525 473 pix_test; #X obj 529 360 _gemwin \; 0 \; 0 \;; diff --git a/help/pix_normalize-help.pd b/help/pix_normalize-help.pd index 3e24ae6fd..405288e7e 100644 --- a/help/pix_normalize-help.pd +++ b/help/pix_normalize-help.pd @@ -46,7 +46,15 @@ #X text 29 76 Description: normalize an image; #X text 29 123 [pix_normalize] will normalize your image \, so that contrasts will appear sharper.; #X text 50 12 Synopsis: [pix_normalize]; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION normalize an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 520 261 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_offset-help.pd b/help/pix_offset-help.pd index 9655589b5..295f2810d 100644 --- a/help/pix_offset-help.pd +++ b/help/pix_offset-help.pd @@ -27,7 +27,17 @@ #X text 19 157 (adding "1 0 0" to "0.5 1 1" will result in "0.5 1 1" instead of "1 1 1"), f 68; #X text 63 305 Inlet 2: : offset for all channels; #X text 63 321 Inlet 3: list : offset for each channels; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION add an offset to the color; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool saturate; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 262 _gemwin; #X obj 451 113 pix_test; #X msg 466 197 saturate \$1; diff --git a/help/pix_pix2sig~-help.pd b/help/pix_pix2sig~-help.pd index 3cab43cda..a61e10bdd 100644 --- a/help/pix_pix2sig~-help.pd +++ b/help/pix_pix2sig~-help.pd @@ -33,7 +33,18 @@ #X obj 564 278 env~ 65536; #X obj 533 278 env~ 65536; #X obj 502 278 env~ 65536; -#X obj 528 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert images to signals; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist mode; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 signal~; +#X text 20 145 OUTLET_2 signal~; +#X text 20 165 OUTLET_3 signal~; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 528 8 pd META; #X text 25 124 In 'clear' mode (the default) \, each audio block will start reading at the beginning of the current image (so if you want to read the entire image \, you need large blocksizes). In 'fill' mode \, the object will remember where we stopped reading \, and continue there (so you can incrementally read the image). In 'line' mode only a single line is read (consecutively \, so the entire image is scanned) \, with zero-padding or data truncating as required. The similar 'waterfall' mode \, reads the same line for each signal block.; #X obj 576 92 block~ 4096; #N canvas 265 521 450 300 scope 0; diff --git a/help/pix_posterize-help.pd b/help/pix_posterize-help.pd index 27670db87..0e1587874 100644 --- a/help/pix_posterize-help.pd +++ b/help/pix_posterize-help.pd @@ -45,7 +45,17 @@ #X text 516 105 open an image; #X text 509 118 (JPEG \, TIFF \, ..); #X text 20 121 currently only YUV images are supported. use [pix_yuv] to make sure that you are in the correct colorspace.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION posterization effect; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 int; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 233 _pix2rectangle 3; #X obj 517 258 _gemwin; #X connect 11 0 14 0; diff --git a/help/pix_puzzle-help.pd b/help/pix_puzzle-help.pd index d8036c25e..7d73f7b86 100644 --- a/help/pix_puzzle-help.pd +++ b/help/pix_puzzle-help.pd @@ -78,7 +78,15 @@ #X connect 7 0 1 0; #X restore 475 176 pd numkeys; #X text 12 285 (i admit this is not very intuitive...); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shuffle an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool bang size move; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 510 298 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_rds-help.pd b/help/pix_rds-help.pd index 8c16ede47..74f7c2d36 100644 --- a/help/pix_rds-help.pd +++ b/help/pix_rds-help.pd @@ -43,7 +43,15 @@ #X floatatom 495 139 5 10 100 1 stride - - 0; #X text 63 245 Inlet 1: method [0|1] (crosseyed|walleyed); #X text 63 259 Inlet 1: stride distance (default:40); -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION random dot stereogram for luminance; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist method stride; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 223 _pix2rectangle 3; #X obj 519 261 _gemwin; #X connect 11 0 14 0; diff --git a/help/pix_record-help.pd b/help/pix_record-help.pd index e286524c3..6a40d106c 100644 --- a/help/pix_record-help.pd +++ b/help/pix_record-help.pd @@ -373,7 +373,17 @@ #X connect 8 0 9 0; #X connect 9 0 10 0; #X restore 553 375 pd print; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION output sequences of pixes; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist file record bang auto dialog codeclist codec set; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 number; +#X text 20 145 OUTLET_2 info; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X text 29 57 Description: output sequences of pixes; #X text 13 73 [pix_record] outputs a series of pixes \, e.g. into a movie file. You can set the file to write to via the "file" message., f 70; #X text 14 331 [pix_record] has a number of output methods \, like movies \, pipes or videodevices. Not all may be available on your system. Check here which backends you can use:, f 70; diff --git a/help/pix_rectangle-help.pd b/help/pix_rectangle-help.pd index 0dd6ec0d0..c351ca352 100644 --- a/help/pix_rectangle-help.pd +++ b/help/pix_rectangle-help.pd @@ -25,7 +25,17 @@ #X msg 494 151 40 10 100 200; #X text 13 305 Inlet 3: list : 3(RGB) or 4(RGBA) float-values defining the color of the rectangle (default: 1 1 1 1); #X text 21 111 pix_rectangle renders a rectangle onto a pix-buffer. This means that you have to have an image already loaded to render into. Set the position and size with the two corners of the rectangle.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION draw a rectangle into a pix; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 519 259 _gemwin; #X obj 451 113 pix_noise; #X connect 11 0 27 0; diff --git a/help/pix_refraction-help.pd b/help/pix_refraction-help.pd index 0dcaa2063..af864a8e6 100644 --- a/help/pix_refraction-help.pd +++ b/help/pix_refraction-help.pd @@ -60,7 +60,15 @@ #X text 63 421 Inlet 1: refract ; #X text 63 392 Inlet 1: height ; #X text 49 12 Synopsis: [pix_refraction]; -#X obj 519 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION display a pix through glass bricks; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool width height mag refract; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 519 8 pd META; #X obj 489 288 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_resize-help.pd b/help/pix_resize-help.pd index 6194d7446..dc8270a9a 100644 --- a/help/pix_resize-help.pd +++ b/help/pix_resize-help.pd @@ -20,7 +20,15 @@ #X text 63 186 ; #X text 63 245 Inlet 1: dimen ; #X msg 463 152 dimen 32 9; -#X obj 519 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION resize an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist dimen; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 519 8 pd META; #X text 12 79 if you don't specify any dimensions \, the image will be automatically resized to the next power of 2 (eg. 320x240 will be resized to 512x256). You can change the re-size with the "dimen"-message \; a value of "0" defaults to the next power-of-2 of the original image; #X obj 522 268 _gemwin; #X obj 451 186 pix_resize; diff --git a/help/pix_rgb2hsv-help.pd b/help/pix_rgb2hsv-help.pd index 851903a31..d1a940a09 100644 --- a/help/pix_rgb2hsv-help.pd +++ b/help/pix_rgb2hsv-help.pd @@ -27,7 +27,15 @@ #X text 30 140 This might enable simpler colour-detection...; #X text 29 162 On the technical (internal) side \, the image still stays RGBA. The Red-channel is filled with Hue-values....; #X obj 451 186 pix_rgb2hsv; -#X obj 521 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert RGB into HSV; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 521 8 pd META; #X obj 520 261 _gemwin; #X obj 451 113 pix_test; #X connect 11 0 29 0; diff --git a/help/pix_rgba-help.pd b/help/pix_rgba-help.pd index a1e1e8b41..f29148991 100644 --- a/help/pix_rgba-help.pd +++ b/help/pix_rgba-help.pd @@ -29,7 +29,15 @@ #X text 22 107 GREY-scale images have no color-component \, while YUV is missing the Alpha-channel.; #X text 19 159 You can use [pix_rgba] to convert images of any format into RGBA-space. If your image already is in RGBA-space \, this will do nothing.; #X text 19 133 Traditionally \, RGBA is the native colour-space of Gem \, although it is quite CPU-consumptive.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert the colorspace of an image to RGBA; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 113 pix_test; #X obj 520 257 _gemwin; #X connect 11 0 30 0; diff --git a/help/pix_roi-help.pd b/help/pix_roi-help.pd index 5b0072a6f..5e97ce93a 100644 --- a/help/pix_roi-help.pd +++ b/help/pix_roi-help.pd @@ -25,7 +25,15 @@ #X text 21 79 [pix_roi] will allow you to set the region of interest of the current image-data.; #X text 22 139 other pix-objects should then apply whatever they are doing on the so-specified sub-image.; #X text 22 170 (currently only [pix_set] supports ROI \, more will hopefully follow); -#X obj 528 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION set the region-of-interest of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist roi; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 528 8 pd META; #X text 442 358 see example/04.pix/27.bitmap_font.pd, f 32; #X connect 16 0 18 0; #X connect 18 0 17 0; diff --git a/help/pix_roll-help.pd b/help/pix_roll-help.pd index 601bfeca2..80bf36947 100644 --- a/help/pix_roll-help.pd +++ b/help/pix_roll-help.pd @@ -26,7 +26,16 @@ #X text 29 77 Description: (sc)roll through an image; #X text 33 245 Inlet 1: message: axis [0|1] scroll(0=default) or roll(1); #X text 13 116 [pix_roll] gives an effect similar to vertical and horizontal hold on a television. the offset is user defined and can be incremented using a counter object for a looping roll effect.; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION (sc)roll through an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist axis; +#X text 20 105 INLET_1 int; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 519 260 _gemwin; #X obj 451 233 _pix2rectangle 3; #X obj 451 113 pix_test; diff --git a/help/pix_rtx-help.pd b/help/pix_rtx-help.pd index 3cba26fd3..111246fa3 100644 --- a/help/pix_rtx-help.pd +++ b/help/pix_rtx-help.pd @@ -49,7 +49,15 @@ #X text 87 240 ; #X text 23 299 Inlet 1: set : sets the whole internal buffer to the next incoming frame; #X text 23 329 Inlet 1: mode 1|0 : clamp the discontinuity to the edge or not. (default:1); -#X obj 538 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION RealTime vs. X transformation; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist set mode; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 538 8 pd META; #X obj 554 296 _gemwin; #X obj 451 270 _pix2rectangle 3; #X connect 11 0 15 0; diff --git a/help/pix_scanline-help.pd b/help/pix_scanline-help.pd index f1927319a..bbfa5a2d2 100644 --- a/help/pix_scanline-help.pd +++ b/help/pix_scanline-help.pd @@ -41,7 +41,16 @@ #X text 16 103 [pix_scanline] manipulates each row of an image by either removing or duplicating them. this can be used an image resolution decimator in mode 0 or as an interlacer in mode 1; #X text 23 245 Inlet 1: message: mode [0|1] (duplicate(=default) or draw only); #X text 23 278 Inlet 2: int: the number of lines to duplicate or the to skip between drawing; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION scan lines of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist mode; +#X text 20 105 INLET_1 int; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 223 _pix2rectangle 3; #X obj 519 258 _gemwin; #X connect 11 0 14 0; diff --git a/help/pix_set-help.pd b/help/pix_set-help.pd index 923d48430..1ff67156e 100644 --- a/help/pix_set-help.pd +++ b/help/pix_set-help.pd @@ -36,7 +36,16 @@ #X text 53 411 Inlet 1: set : set the size of the image; #X obj 502 142 r pix_set_in; #X text 447 511 and example/04.pix/27.bitmap_font.pd, f 32; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION set the pixel-data of an image; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist RGBA RGB GREY bang fill set; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #N canvas 447 128 725 362 advanced 0; #X msg 26 210 set 16 16; #X msg 57 238 set 4 4; diff --git a/help/pix_share_read-help.pd b/help/pix_share_read-help.pd index 442bc7673..f115fae9f 100644 --- a/help/pix_share_read-help.pd +++ b/help/pix_share_read-help.pd @@ -38,7 +38,16 @@ #X text 543 121 arguments are optional; #X msg 666 103 set memory_name 256 256 RGBA; #X text 669 86 also work with symbol :; -#X obj 778 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION read pixels from a shared memory region; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 error; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 778 8 pd META; #X obj 451 154 _pix2rectangle; #X obj 490 211 _gemwin; #X connect 11 0 34 0; diff --git a/help/pix_share_write-help.pd b/help/pix_share_write-help.pd index acfb8b11f..d51f8e529 100644 --- a/help/pix_share_write-help.pd +++ b/help/pix_share_write-help.pd @@ -38,7 +38,16 @@ #X text 548 175 arguments are optional; #X msg 626 148 set memory_name 256 256 RGBA; #X text 643 128 also work with symbol :; -#X obj 778 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION write pixels to a shared memory region; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 error; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 778 8 pd META; #X obj 490 212 _gemwin; #X obj 451 113 pix_test; #X connect 11 0 40 0; diff --git a/help/pix_sig2pix~-help.pd b/help/pix_sig2pix~-help.pd index 541d769ea..ac8edfa5c 100644 --- a/help/pix_sig2pix~-help.pd +++ b/help/pix_sig2pix~-help.pd @@ -34,7 +34,18 @@ #X text 29 497 Inlet 4: signal: alpha channel; #X text 29 419 Inlet 1: message: dimen ; #X obj 457 413 pix_sig2pix~ 64 64; -#X obj 524 13 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert signals to images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist dimen type mode signal; +#X text 20 105 INLET_1 signal; +#X text 20 125 INLET_2 signal; +#X text 20 145 INLET_3 signal; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 524 13 pd META; #X text 29 431 Inlet 1: message: type BYTE|FLOAT|DOUBLE; #X obj 457 168 t a; #X msg 492 147 type BYTE; diff --git a/help/pix_snap-help.pd b/help/pix_snap-help.pd index 4a4a194ee..da1b83475 100644 --- a/help/pix_snap-help.pd +++ b/help/pix_snap-help.pd @@ -58,7 +58,17 @@ #X msg 518 227 0; #X obj 451 256 pix_snap 0 0 500 500; #X msg 570 209 100 100; -#X obj 598 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION take a screenshot and convert it to a Pix; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bang dimen offset snap type; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 598 8 pd META; #X text 33 376 Inlet 2: list: offsetX offsetY (in pixels. default: 0 0), f 63; #X text 33 391 Inlet 3: list: dimenX dimenY (in pixels. default: window-size), f 63; #X text 33 357 Inlet 1: type BYTE|FLOAT|DOUBLE; diff --git a/help/pix_snap2tex-help.pd b/help/pix_snap2tex-help.pd index f0313da39..d72a5389e 100644 --- a/help/pix_snap2tex-help.pd +++ b/help/pix_snap2tex-help.pd @@ -61,7 +61,17 @@ #X text 506 171 drawn but before the square; #X obj 474 164 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 504 158 SNAP! after the sphere is; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION take a screenshot and texture it; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bang bool quality; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 519 309 _gemwin; #X connect 15 0 40 0; #X connect 17 0 38 0; diff --git a/help/pix_subtract-help.pd b/help/pix_subtract-help.pd index 4e152e540..b06a2c385 100644 --- a/help/pix_subtract-help.pd +++ b/help/pix_subtract-help.pd @@ -56,7 +56,16 @@ #X text 39 366 see also:; #X obj 101 368 pix_diff; #X obj 164 368 pix_compare; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION subtract 2 images; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 268 _pix2rectangle 3; #X obj 520 296 _gemwin; #X connect 11 0 13 0; diff --git a/help/pix_tIIR-help.pd b/help/pix_tIIR-help.pd index dd358ed6b..3d33d84cf 100644 --- a/help/pix_tIIR-help.pd +++ b/help/pix_tIIR-help.pd @@ -94,7 +94,15 @@ #X text 11 161 The output y() will calculate from the input x() at a time n as follows; #X msg 517 183 set 0; #X text 11 79 [pix_tIIR] is a time-based filter like [pix_motionblur] \, [pix_biquad] or Pd's [biquad~]. The filter has a feedback- and a feedforward-section \, the length of each can be specified as arguments. The objects will have an inlet for each feedback-coefficient and an inlet for each feedforward-coefficient.; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION timebased IIR-filter; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist set; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 451 270 _pix2rectangle 3; #X obj 519 295 _gemwin; #X connect 11 0 15 0; diff --git a/help/pix_takealpha-help.pd b/help/pix_takealpha-help.pd index 9a50b0e38..8f1a016cb 100644 --- a/help/pix_takealpha-help.pd +++ b/help/pix_takealpha-help.pd @@ -58,7 +58,16 @@ #X text 50 12 Synopsis: [pix_takealpha]; #X text 31 356 see also:; #X obj 96 358 pix_mask; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION transfer the alpha-channel; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 gemlist; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 468 278 _gemwin \; 0 \; 0 \; color 0.5 0.5 0.5; #X obj 451 252 _pix2rectangle 3; #X connect 10 0 12 0; diff --git a/help/pix_test-help.pd b/help/pix_test-help.pd index 0c008eaab..ac558d2e3 100644 --- a/help/pix_test-help.pd +++ b/help/pix_test-help.pd @@ -13,7 +13,15 @@ #X text 46 445 Outlet 1: gemlist; #X text 53 342 Inlet 1: gemlist; #X text 63 296 ; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION create test pixes; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist colorspace dimen noise; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X text 50 12 Synopsis: [pix_test]; #X text 29 56 Description: create test pixes; #X text 22 79 [pix_test] creates a test image \, of the specified dimensions and colorspace.; diff --git a/help/pix_texture-help.pd b/help/pix_texture-help.pd index 4c0b82512..c1768d438 100644 --- a/help/pix_texture-help.pd +++ b/help/pix_texture-help.pd @@ -82,7 +82,16 @@ #X floatatom 537 332 5 0 0 0 - - - 0; #X msg 537 351 pbo \$1; #X text 28 626 Inlet 1: message: yuv : use native YUV-mode if available (default:1), f 69; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION apply texture mapping; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool quality repeat rectangle client_storage env texunit yuv pbo; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 texture; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 618 _gemwin; #X obj 257 781 _pix2rectangle; #X text 43 760 For the sake of brevity \, most Gem-helppatches use a small wrapper abstraction around [pix_texture]+[rectangle]:, f 77; diff --git a/help/pix_threshold-help.pd b/help/pix_threshold-help.pd index da5c61f10..0f8332df5 100644 --- a/help/pix_threshold-help.pd +++ b/help/pix_threshold-help.pd @@ -42,7 +42,17 @@ #X text 63 280 Inlet 3: : threshold (RGB) or (RGBA); #X obj 451 265 _pix2rectangle 3; #X msg 496 195 0.6 0.1 0.8; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION apply a threshold to pixes; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 301 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_threshold_bernsen-help.pd b/help/pix_threshold_bernsen-help.pd index 669991a9f..bd998f378 100644 --- a/help/pix_threshold_bernsen-help.pd +++ b/help/pix_threshold_bernsen-help.pd @@ -46,7 +46,17 @@ #X text 63 196 : number of tiles in x- & y-direction; #X text 123 211 default: 16 16; #X text 482 169 tiles; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION apply dynamic thresholds to pixes for binarization; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 473 272 _gemwin; #X connect 11 0 14 0; #X connect 13 0 14 1; diff --git a/help/pix_video-help.pd b/help/pix_video-help.pd index 41d6aef1d..ad4748adf 100644 --- a/help/pix_video-help.pd +++ b/help/pix_video-help.pd @@ -352,7 +352,16 @@ #X obj 657 374 r \$0-ctl; #X text 54 600 you can use [pix_buffer] to distribute the same pix to different parts of your render-chain; #X msg 625 235 device /dev/fw1; -#X obj 738 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION open a camera and get input; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist device backend colorspace dimen enumerate dialog enumProps get set clearProps setProps applyProps; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 info; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 738 8 pd META; #X obj 156 103 _backendinfo \$0 video; #X obj 724 466 _gemwin; #X obj 567 502 _pix2rectangle 3; diff --git a/help/pix_write-help.pd b/help/pix_write-help.pd index c5646af48..c68708b0d 100644 --- a/help/pix_write-help.pd +++ b/help/pix_write-help.pd @@ -49,7 +49,17 @@ #X text 71 394 list: [offsetX offsetY [dimX dimY [color_format]]]; #X text 26 99 When banged [pix_write] will take a snapshot of the current frame buffer and saves it to a file. When a "bang" message is sent to [pix_write] \, that is the moment that something is captured from the current frame buffer. When grabbing \, be sure that something is in the rendering-buffer \, else you will get a black texture. color_mode let you grab 1 (only red channel) \, 3 (RGB) or 4 (RGBA) byte per pixel. RGBA mode is useful with framebuffer.; #X msg 480 162 color_format 4; -#X obj 608 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Make a snapshot of the frame-buffer and write it to a file; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist file; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 608 8 pd META; #X obj 609 389 _gemwin; #X connect 16 0 45 2; #X connect 19 0 45 1; diff --git a/help/pix_writer-help.pd b/help/pix_writer-help.pd index adc2a08e4..5a46e0bf4 100644 --- a/help/pix_writer-help.pd +++ b/help/pix_writer-help.pd @@ -40,7 +40,15 @@ #X msg 500 245 file /Users/username/pix_test 99; #X text 26 239 Supported file-types are TIFF (quality=0) and JPEG (quality>0). TIFF-writing can be slow due to the large file size of uncompressed images! JPEG might be faster (but quality will be lower due to compression); #X text 523 190 activate/deactivate auto snapshot; -#X obj 608 18 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION write the current texture to a file; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist file; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 608 18 pd META; #X text 571 263 OSX format; #X obj 610 320 _gemwin; #X obj 461 106 pix_test; diff --git a/help/pix_yuv-help.pd b/help/pix_yuv-help.pd index 5084f15f6..83adb2be5 100644 --- a/help/pix_yuv-help.pd +++ b/help/pix_yuv-help.pd @@ -26,7 +26,15 @@ #X text 50 12 Synopsis: [pix_yuv]; #X obj 155 338 pix_rgba; #X text 15 101 Images can be stored in various formats/color-spaces.; -#X obj 514 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION convert the colorspace of an image to YUV; +#X text 10 65 KEYWORDS Gem pix image; +#X text 20 85 INLET_0 gemlist bool; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 514 8 pd META; #X obj 451 233 _pix2rectangle 3; #X obj 451 113 pix_test; #X obj 521 261 _gemwin; diff --git a/help/polygon-help.pd b/help/polygon-help.pd index 5385ba295..66538dbf9 100644 --- a/help/polygon-help.pd +++ b/help/polygon-help.pd @@ -43,7 +43,17 @@ #X obj 537 299 polygon 5; #X msg 603 246 width \$1; #X floatatom 619 226 5 0 10 0 - - - 0; -#X obj 568 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a polygon.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw width; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_N list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 568 8 pd META; #X obj 514 340 _gemwin; #X connect 13 0 40 0; #X connect 14 0 40 0; diff --git a/help/polygon_smooth-help.pd b/help/polygon_smooth-help.pd index f18cd561a..0595a8bde 100644 --- a/help/polygon_smooth-help.pd +++ b/help/polygon_smooth-help.pd @@ -28,7 +28,15 @@ #X text 48 362 FSAA antialiasing message to; #X obj 224 362 gemwin; #X obj 451 111 alpha 1; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION turn on/off polygon smoothing; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist float; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 451 240 circle 1; #X obj 524 271 _gemwin; #X connect 13 0 27 0; diff --git a/help/pqtorusknots-help.pd b/help/pqtorusknots-help.pd index 268adad89..353a71733 100644 --- a/help/pqtorusknots-help.pd +++ b/help/pqtorusknots-help.pd @@ -43,7 +43,15 @@ #X text 29 302 Inlet 1: message: clump <#clumps> ; #X text 29 317 Inlet 1: message: pq ; #X text 29 332 Inlet 1: message: ivScale : for texturing; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a 3d knot; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw steps facets thick clump pq ivScale; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 475 277 _gemwin; #X connect 13 0 34 0; #X connect 14 0 34 0; diff --git a/help/primTri-help.pd b/help/primTri-help.pd index 05a1dc0b5..4a413df10 100644 --- a/help/primTri-help.pd +++ b/help/primTri-help.pd @@ -42,7 +42,21 @@ #X text 27 325 Inlet 6: list: 3(RGB) or 4(RGBA) float values (color of 2nd corner); #X text 27 352 Inlet 7: list: 3(RGB) or 4(RGBA) float values (color of 3rd corner); #X obj 543 259 primTri, f 10; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a triangle with gradient colors.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 INLET_3 list; +#X text 20 165 INLET_4 list; +#X text 20 185 INLET_5 list; +#X text 20 205 INLET_6 list; +#X text 20 225 OUTLET_0 gemlist; +#X text 10 245 AUTHOR IOhannes m zmölnig; +#X text 10 265 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 491 296 _gemwin; #X connect 15 0 41 0; #X connect 16 0 41 0; diff --git a/help/rectangle-help.pd b/help/rectangle-help.pd index 3a9f5fc49..00d3031c7 100644 --- a/help/rectangle-help.pd +++ b/help/rectangle-help.pd @@ -28,7 +28,17 @@ #X text 27 294 Inlet 3: float: height (default to 1); #X text 16 86 The [rectangle] object renders a rectangle at the current position with current color. The width and height of the rectangle can be set by the arguments and changed via the second and third inlet., f 72; #X text 19 133 note for the nitpickers: the rectangle will span from (-width|-height) to (+width|+height) so the actual size is really double the specified size., f 71; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a rectangle; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 562 262 _gemwin; #X connect 14 0 23 0; #X connect 15 0 23 0; diff --git a/help/render_trigger-help.pd b/help/render_trigger-help.pd index 20c522fa7..319d27d84 100644 --- a/help/render_trigger-help.pd +++ b/help/render_trigger-help.pd @@ -28,7 +28,16 @@ #X obj 556 158 bng 15 250 50 0 empty empty pre 20 8 0 8 #fcfcfc #000000 #000000; #X obj 510 227 bng 15 250 50 0 empty empty post 20 8 0 8 #fcfcfc #000000 #000000; #X obj 554 208 bng 15 250 50 0 empty empty pre 20 8 0 8 #fcfcfc #000000 #000000; -#X obj 558 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION triggers on rendering; +#X text 10 65 KEYWORDS Gem control; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 20 125 OUTLET_1 bang; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 558 8 pd META; #X obj 519 294 _gemwin 2; #X connect 13 0 14 0; #X connect 14 0 15 0; diff --git a/help/ripple-help.pd b/help/ripple-help.pd index 3bd4b5a11..e9228d24c 100644 --- a/help/ripple-help.pd +++ b/help/ripple-help.pd @@ -38,7 +38,19 @@ #X floatatom 510 247 5 0 0 0 - - - 0; #X text 17 150 note: [ripple] distorts a bit different when texture-mapping is used!; #X text 27 303 Inlet 2: float: size; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders and distorts a square.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw bang; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 508 326 _gemwin; #X connect 14 0 19 0; #X connect 15 0 19 1; diff --git a/help/rotate-help.pd b/help/rotate-help.pd index b1fcbb04b..26a18fa89 100644 --- a/help/rotate-help.pd +++ b/help/rotate-help.pd @@ -30,7 +30,17 @@ #X text 38 332 see also:; #X obj 101 332 rotateXYZ; #X obj 169 332 accumrotate; -#X obj 508 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION rotation; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 508 8 pd META; #X obj 521 271 _gemwin; #X connect 13 0 18 0; #X connect 18 0 14 0; diff --git a/help/rotateXYZ-help.pd b/help/rotateXYZ-help.pd index 7f7b8c948..fc692a36f 100644 --- a/help/rotateXYZ-help.pd +++ b/help/rotateXYZ-help.pd @@ -30,7 +30,18 @@ #X text 22 349 see also:; #X obj 85 349 rotate; #X obj 132 349 accumrotate; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION rotation; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 526 277 _gemwin; #X connect 13 0 18 0; #X connect 17 0 18 1; diff --git a/help/rubber-help.pd b/help/rubber-help.pd index 3b84c1455..9c2bfcbce 100644 --- a/help/rubber-help.pd +++ b/help/rubber-help.pd @@ -41,7 +41,19 @@ #X text 27 298 Inlet 3: float: height; #X obj 488 94 accumrotate 135 0 0; #X obj 488 77 t a b; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders and distorts a square.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw bang; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 554 302 _gemwin; #X connect 14 0 39 0; #X connect 15 0 38 1; diff --git a/help/scale-help.pd b/help/scale-help.pd index e22845a35..dfb402a7d 100644 --- a/help/scale-help.pd +++ b/help/scale-help.pd @@ -35,7 +35,17 @@ #X obj 451 196 scale 0.5; #X text 450 339 see also:; #X obj 452 363 scaleXYZ; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION scale; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 529 276 _gemwin; #X connect 13 0 25 0; #X connect 21 0 32 1; diff --git a/help/scaleXYZ-help.pd b/help/scaleXYZ-help.pd index 83f5cc399..4a41fa05e 100644 --- a/help/scaleXYZ-help.pd +++ b/help/scaleXYZ-help.pd @@ -28,7 +28,18 @@ #X text 39 97 [scaleXYZ] accepts a gemList and changes the current transformation matrix by the specified scale; #X text 17 340 see also:; #X obj 83 340 scale; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION scale along the X- \, Y- and Z-axis; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 519 262 _gemwin; #X obj 451 263 cube \; draw line; #X connect 13 0 17 0; diff --git a/help/scopeXYZ~-help.pd b/help/scopeXYZ~-help.pd index baf914a67..7b727c1ea 100644 --- a/help/scopeXYZ~-help.pd +++ b/help/scopeXYZ~-help.pd @@ -70,7 +70,18 @@ #X text 28 343 Inlet 2: signal: X-values of the oscillograph; #X text 28 356 Inlet 3: signal: Y-values of the oscillograph; #X text 28 371 Inlet 4: signal: Z-values of the oscillograph; -#X obj 568 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION 3D oscilloscope; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw width length; +#X text 20 105 INLET_1 signal; +#X text 20 125 INLET_2 signal; +#X text 20 145 INLET_3 signal; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 568 8 pd META; #X obj 477 366 _gemwin; #X connect 16 0 35 0; #X connect 17 0 35 0; diff --git a/help/separator-help.pd b/help/separator-help.pd index 0d813735c..f24a8a45e 100644 --- a/help/separator-help.pd +++ b/help/separator-help.pd @@ -57,7 +57,15 @@ #X obj 520 293 circle; #X obj 446 293 cone; #X text 464 364 With the [separator] \, both objects will by translated \, but the rotation in one branch will not effect the other branch.; -#X obj 768 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION separate render chains; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 768 8 pd META; #X obj 608 450 _gemwin; #X connect 27 0 53 0; #X connect 28 0 45 0; diff --git a/help/shearXY-help.pd b/help/shearXY-help.pd index 4b248d691..65df97741 100644 --- a/help/shearXY-help.pd +++ b/help/shearXY-help.pd @@ -24,7 +24,16 @@ #X text 60 194 1st argument: shear factor (XY); #X text 63 261 Inlet 2: float: XY shear factor; #X obj 451 179 cube; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shear; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 256 _gemwin; #X connect 14 0 16 0; #X connect 15 0 16 1; diff --git a/help/shearXZ-help.pd b/help/shearXZ-help.pd index 8cb0707c8..08f6da5c5 100644 --- a/help/shearXZ-help.pd +++ b/help/shearXZ-help.pd @@ -24,7 +24,16 @@ #X floatatom 507 115 3 -4 4 0 - - - 0; #X obj 458 136 shearXZ 1; #X text 36 122 the X translation depend on Z position and the shear factor (float).; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shear; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 254 _gemwin; #X connect 19 0 22 0; #X connect 21 0 22 1; diff --git a/help/shearYX-help.pd b/help/shearYX-help.pd index 6947f964d..a861ba04b 100644 --- a/help/shearYX-help.pd +++ b/help/shearYX-help.pd @@ -24,7 +24,16 @@ #X obj 451 179 square; #X floatatom 500 117 3 -4 4 0 - - - 0; #X obj 451 138 shearYX 1; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shear; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 522 257 _gemwin; #X connect 20 0 23 0; #X connect 22 0 23 1; diff --git a/help/shearYZ-help.pd b/help/shearYZ-help.pd index acf31e83a..c618760ff 100644 --- a/help/shearYZ-help.pd +++ b/help/shearYZ-help.pd @@ -25,7 +25,16 @@ #X text 36 122 the Y translation depend on Z position and the shear factor (float).; #X obj 451 217 cube; #X obj 451 120 rotateXYZ 0 45 0; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shear; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 522 258 _gemwin; #X connect 19 0 24 0; #X connect 20 0 21 1; diff --git a/help/shearZX-help.pd b/help/shearZX-help.pd index cf9298e12..fb61f1d2e 100644 --- a/help/shearZX-help.pd +++ b/help/shearZX-help.pd @@ -24,7 +24,16 @@ #X obj 451 138 shearZX 1; #X text 36 122 the Z translation depend on X position and the shear factor (float).; #X obj 451 179 teapot; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shear; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 519 257 _gemwin; #X connect 19 0 21 0; #X connect 20 0 21 1; diff --git a/help/shearZY-help.pd b/help/shearZY-help.pd index 523c907aa..d4540d282 100644 --- a/help/shearZY-help.pd +++ b/help/shearZY-help.pd @@ -24,7 +24,16 @@ #X text 50 12 Synopsis: [shearYZ]; #X obj 451 138 shearZY 1; #X text 36 122 the Y translation depend on Z position and the shear factor (float).; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shear; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 521 251 _gemwin; #X connect 14 0 22 0; #X connect 16 0 22 1; diff --git a/help/shininess-help.pd b/help/shininess-help.pd index 7fd46f4be..820bbdd33 100644 --- a/help/shininess-help.pd +++ b/help/shininess-help.pd @@ -29,7 +29,16 @@ #X text 20 114 [shininess] accepts a single shininess-value that ranges between 0 and 128 the shininess can be set via an initial argument.; #X obj 451 140 shininess; #X text 60 191 default:0; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION shininess of the material; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 int; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 518 258 _gemwin \; 0 \; 0 \; lighting 1; #X connect 14 0 27 0; #X connect 15 0 18 0; diff --git a/help/slideSquares-help.pd b/help/slideSquares-help.pd index 538393914..bbf34be36 100644 --- a/help/slideSquares-help.pd +++ b/help/slideSquares-help.pd @@ -28,7 +28,17 @@ #X text 65 181 default: 1 1; #X text 27 260 Inlet 2: float: width (dimX); #X obj 513 209 slideSquares 1 1; -#X obj 568 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders sliding rectangles.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 568 8 pd META; #X obj 571 261 _gemwin; #X connect 15 0 27 0; #X connect 16 0 27 1; diff --git a/help/specular-help.pd b/help/specular-help.pd index 8759c9f44..328900f39 100644 --- a/help/specular-help.pd +++ b/help/specular-help.pd @@ -30,7 +30,16 @@ #X text 22 96 [specular] accepts a gemList and sets the specular-color for all subsequent vertex-operations. You have to enable lighting to see any effects.; #X text 36 323 see also:; #X obj 97 323 specularRGB; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION specular colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 520 258 _gemwin \; 0 \; 0 \; lighting 1; #X connect 14 0 25 0; #X connect 15 0 22 0; diff --git a/help/specularRGB-help.pd b/help/specularRGB-help.pd index 85d15356a..8d03b633f 100644 --- a/help/specularRGB-help.pd +++ b/help/specularRGB-help.pd @@ -34,7 +34,19 @@ #X text 62 260 Inlet 3: float: Green-value; #X text 35 341 see also:; #X obj 107 342 specular; -#X obj 508 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION specular colouring; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 INLET_4 float; +#X text 20 185 OUTLET_0 gemlist; +#X text 10 205 AUTHOR IOhannes m zmölnig; +#X text 10 225 LICENSE GPL v2; +#X restore 508 8 pd META; #X obj 513 254 cnv 15 100 75 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 520 258 _gemwin \; 0 \; 0 \; lighting 1; #X connect 13 0 21 0; diff --git a/help/sphere-help.pd b/help/sphere-help.pd index 9d79938c0..9885425dd 100644 --- a/help/sphere-help.pd +++ b/help/sphere-help.pd @@ -33,7 +33,17 @@ #X text 34 184 defaults: 1 \, 10; #X text 33 330 see also:; #X obj 102 331 sphere3d; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a sphere.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 int; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 492 257 _gemwin; #X connect 16 0 28 0; #X connect 17 0 28 0; diff --git a/help/sphere3d-help.pd b/help/sphere3d-help.pd index 42ec319a7..145b082ac 100644 --- a/help/sphere3d-help.pd +++ b/help/sphere3d-help.pd @@ -44,7 +44,17 @@ #X obj 553 229 sphere3d; #X text 14 139 Unlike [sphere] \, you can modify (dislocate) each point at the sphere via the setCartesian and setSpherical messages (for cartesian and spherical (in deg) coordinates resp.); #X text 27 292 Inlet 1: message: print; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a sphere3d.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw setCartesian setSpherical print; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 int; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 550 270 _gemwin; #X connect 16 0 30 0; #X connect 17 0 30 0; diff --git a/help/spline_path-help.pd b/help/spline_path-help.pd index 82b1c2d86..fffc6dac1 100644 --- a/help/spline_path-help.pd +++ b/help/spline_path-help.pd @@ -60,7 +60,14 @@ its values in n-tuples like: " ..." Therefore #X text 50 240 name of the table; #X obj 516 168 spline_path 3 array; #X msg 543 140 open array; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION reads out a table; +#X text 10 65 KEYWORDS Gem; +#X text 20 85 INLET_0 float; +#X text 10 105 AUTHOR IOhannes m zmölnig; +#X text 10 125 LICENSE GPL v2; +#X restore 578 8 pd META; #X connect 12 0 13 0; #X connect 12 1 14 0; #X connect 12 2 15 0; diff --git a/help/spot_light-help.pd b/help/spot_light-help.pd index 125fac229..084cde8d2 100644 --- a/help/spot_light-help.pd +++ b/help/spot_light-help.pd @@ -101,7 +101,17 @@ #X obj 527 477 world_light; #X obj 485 477 light; #X text 37 401 Inlet 1: float: turn light on/off (default:1); -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION adds a spot-light to the scene; +#X text 10 65 KEYWORDS Gem non-geometric; +#X text 20 85 INLET_0 gemlist float debug; +#X text 20 105 INLET_1 list; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 476 56 _gemwin; #X connect 13 0 40 0; #X connect 15 0 29 1; diff --git a/help/square-help.pd b/help/square-help.pd index 9dfcd7066..a442c7141 100644 --- a/help/square-help.pd +++ b/help/square-help.pd @@ -27,7 +27,16 @@ #X text 33 14 Synopsis: [square]; #X text 63 186 size of the square; #X text 16 86 The [square] object renders a square at the current position with current color. The size of the square can be changed via the second inlet.; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a square; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 557 238 _gemwin; #X connect 16 0 22 0; #X connect 17 0 22 0; diff --git a/help/surface3d-help.pd b/help/surface3d-help.pd index 5e0ce33fb..381215c12 100644 --- a/help/surface3d-help.pd +++ b/help/surface3d-help.pd @@ -1555,7 +1555,15 @@ #X obj 812 455 s curve3d_render; #X text 33 146 This object is related to curve3d; #X text 271 4 Create a 3d bicubic curve \, using a matrix of control points; -#X obj 848 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a 3d bicubic curve.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw res grid set normal; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 848 8 pd META; #X obj 821 582 gemhead; #X obj 821 602 world_light; #X obj 815 515 _gemwin \; 0 \; 0 \; lighting 1; diff --git a/help/teapot-help.pd b/help/teapot-help.pd index 242c32369..317b9cf30 100644 --- a/help/teapot-help.pd +++ b/help/teapot-help.pd @@ -30,7 +30,17 @@ #X text 15 88 The teapot object renders a teapot at the current position with current color. The size of the teapot can be changed via the second inlet.; #X obj 563 189 teapot 2 14; #X text 63 200 number of slices; -#X obj 578 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a teapot.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 578 8 pd META; #X obj 559 257 _gemwin; #X connect 18 0 28 0; #X connect 19 0 28 0; diff --git a/help/text2d-help.pd b/help/text2d-help.pd index 991fc13cf..5d15bdf52 100644 --- a/help/text2d-help.pd +++ b/help/text2d-help.pd @@ -84,7 +84,16 @@ #X restore 459 611 pd disappearing text; #X text 27 454 Inlet 2: float: size (in points) default:20, f 56; #X text 27 425 Inlet 1: message: justify []: horizontal&vertical justification; -#X obj 528 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a line of text; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist font text list alias justify; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 528 8 pd META; #X text 10 94 [text2d] renders a text with the current color \, but without(!) 3D-transformation (like [rotate] or [scale]).; #X obj 479 89 translateXYZ; #X obj 479 398 text2d; diff --git a/help/text3d-help.pd b/help/text3d-help.pd index cf2af1618..5f70a8a89 100644 --- a/help/text3d-help.pd +++ b/help/text3d-help.pd @@ -47,7 +47,16 @@ #X obj 541 532 textextruded; #X obj 541 555 textoutline; #X text 27 514 Inlet 2: float: size (in points) (default:20); -#X obj 528 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a line of text; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist font text list string justify alias; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 528 8 pd META; #X msg 506 273 string 20320 10 22909 10 19990 10 30028, f 17; #X msg 503 327 text مرحبا بالعالم; #X text 15 204 Note that text is rendered using only the given font. Therefore \, your font must have the glyphs you want to display (or you will only see placeholders); diff --git a/help/textextruded-help.pd b/help/textextruded-help.pd index 37fc6d19d..94ba22606 100644 --- a/help/textextruded-help.pd +++ b/help/textextruded-help.pd @@ -49,7 +49,16 @@ #X obj 545 418 text2d; #X obj 592 418 text3d; #X text 27 457 Inlet 2: float: size (in points). (default:20); -#X obj 531 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a line of text; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist font text list depth justify; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 531 8 pd META; #X obj 20 527 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 33 531 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; #X obj 472 344 _gemwin; diff --git a/help/textoutline-help.pd b/help/textoutline-help.pd index 204353aeb..e6df0272a 100644 --- a/help/textoutline-help.pd +++ b/help/textoutline-help.pd @@ -45,7 +45,16 @@ #X obj 489 441 text2d; #X obj 488 463 text3d; #X text 27 446 Inlet 2: float: size (in points). (default:20); -#X obj 528 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a line of text; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist font text list justify; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 528 8 pd META; #X obj 30 527 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 43 531 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; #X obj 472 353 _gemwin; diff --git a/help/torus-help.pd b/help/torus-help.pd index 68c8caaa2..24e73c3b7 100644 --- a/help/torus-help.pd +++ b/help/torus-help.pd @@ -33,7 +33,17 @@ #X text 63 199 # of slices; #X text 62 214 thickness (R-r); #X text 29 307 Inlet 3: float: thickness of the torus (R-r); -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a torus.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 561 261 _gemwin; #X connect 15 0 29 0; #X connect 16 0 29 0; diff --git a/help/translate-help.pd b/help/translate-help.pd index d4301c790..c1d45e0d7 100644 --- a/help/translate-help.pd +++ b/help/translate-help.pd @@ -30,7 +30,17 @@ #X obj 455 175 translate 0.1 1 1 0; #X text 35 332 see also:; #X obj 99 333 translateXYZ; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION translation; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 list; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 520 261 _gemwin; #X connect 14 0 27 0; #X connect 16 0 27 1; diff --git a/help/translateXYZ-help.pd b/help/translateXYZ-help.pd index bfaa06657..7683359ed 100644 --- a/help/translateXYZ-help.pd +++ b/help/translateXYZ-help.pd @@ -30,7 +30,18 @@ #X text 41 91 [translateXYZ] accepts a gemList and changes the current transformation matrix by the specified translation; #X text 23 333 see also:; #X obj 85 334 translate; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION translation; +#X text 10 65 KEYWORDS Gem openGL transformation; +#X text 20 85 INLET_0 gemlist; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 float; +#X text 20 165 OUTLET_0 gemlist; +#X text 10 185 AUTHOR IOhannes m zmölnig; +#X text 10 205 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 520 260 _gemwin; #X connect 14 0 18 0; #X connect 16 0 18 1; diff --git a/help/trapezoid-help.pd b/help/trapezoid-help.pd index 297b9dc9a..f7576c0aa 100644 --- a/help/trapezoid-help.pd +++ b/help/trapezoid-help.pd @@ -31,7 +31,17 @@ #X text 27 260 Inlet 2: float: size; #X text 27 275 Inlet 3: float: length of top line \, relative to the size; #X obj 549 225 trapezoid 1 0.7; -#X obj 548 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a trapezoid box.; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 OUTLET_0 gemlist; +#X text 10 165 AUTHOR IOhannes m zmölnig; +#X text 10 185 LICENSE GPL v2; +#X restore 548 8 pd META; #X obj 560 271 _gemwin; #X connect 15 0 30 0; #X connect 16 0 30 0; diff --git a/help/triangle-help.pd b/help/triangle-help.pd index 3f4be9de5..28dafc4fd 100644 --- a/help/triangle-help.pd +++ b/help/triangle-help.pd @@ -27,7 +27,16 @@ #X obj 563 168 triangle 2; #X text 7 69 Description: Renders an isosceles triangle; #X text 16 86 The [triangle] object renders an equal-sided (where the height equals the base) triangle at the current position with current color. The size of the triangle can be changed via the second inlet.; -#X obj 588 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders an isosceles triangle; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 588 8 pd META; #X obj 561 241 _gemwin; #X connect 16 0 24 0; #X connect 17 0 24 0; diff --git a/help/tube-help.pd b/help/tube-help.pd index 4f866d90c..3479878f0 100644 --- a/help/tube-help.pd +++ b/help/tube-help.pd @@ -54,7 +54,23 @@ #X text 7 72 The tube object generates a shape defined by 2 circles. These 2 circles can be rotated and translated independently to create different shapes.; #X text 63 217 4 : number of segments; #X text 63 199 3 : height of the tube; -#X obj 628 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a complex tube; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw numslices; +#X text 20 105 INLET_1 float; +#X text 20 125 INLET_2 float; +#X text 20 145 INLET_3 height; +#X text 20 165 INLET_4 float; +#X text 20 185 INLET_5 float; +#X text 20 205 INLET_6 float; +#X text 20 225 INLET_7 float; +#X text 20 245 INLET_8 float; +#X text 20 265 OUTLET_0 gemlist; +#X text 10 285 AUTHOR IOhannes m zmölnig; +#X text 10 305 LICENSE GPL v2; +#X restore 628 8 pd META; #X obj 513 527 _gemwin \; 0 \; 0 \; lighting 1; #X obj 622 530 gemhead; #X obj 622 553 world_light; diff --git a/help/vertex_program-help.pd b/help/vertex_program-help.pd index 9e2d2e6e7..33c78faf1 100644 --- a/help/vertex_program-help.pd +++ b/help/vertex_program-help.pd @@ -122,7 +122,15 @@ #X obj 453 422 fragment_program; #X text 451 405 see also:; #X obj 451 206 vertex_program toon.vp; -#X obj 518 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION set the ARB vertex shader; +#X text 10 65 KEYWORDS Gem openGL shader; +#X text 20 85 INLET_0 gemlist open; +#X text 20 105 OUTLET_0 gemlist; +#X text 10 125 AUTHOR IOhannes m zmölnig; +#X text 10 145 LICENSE GPL v2; +#X restore 518 8 pd META; #X obj 479 340 _gemwin; #X connect 11 0 13 0; #X connect 12 0 13 1; diff --git a/help/world_light-help.pd b/help/world_light-help.pd index 17bfffe2a..ae60eb940 100644 --- a/help/world_light-help.pd +++ b/help/world_light-help.pd @@ -41,7 +41,16 @@ #X obj 145 425 spot_light; #X obj 103 425 light; #X text 44 347 Inlet 1: float: turn light on/off (default:1); -#X obj 528 8 declare -lib Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION adds a point-light to the scene; +#X text 10 65 KEYWORDS Gem non-geometric; +#X text 20 85 INLET_0 gemlist float debug; +#X text 20 105 INLET_1 list; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 528 8 pd META; #X obj 481 338 _gemwin; #X connect 13 0 24 0; #X connect 18 0 32 1; From 23fe821fe52abb38b54c5a0494d68fcf79b723fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 12 Aug 2024 12:07:37 +0200 Subject: [PATCH 194/387] fix line/point rendering for [sphere] and [sphere3d] rather than having different code-paths for the various drawtypes, we just set the glPolygonMode() (as with [torus] and friends) Closes: https://github.com/umlaeute/Gem/issues/435 --- src/Geos/sphere.cpp | 382 +++++++++++++++--------------------------- src/Geos/sphere3d.cpp | 327 ++++++++++++++++-------------------- 2 files changed, 288 insertions(+), 421 deletions(-) diff --git a/src/Geos/sphere.cpp b/src/Geos/sphere.cpp index 4dd9d0940..861d14e6e 100644 --- a/src/Geos/sphere.cpp +++ b/src/Geos/sphere.cpp @@ -66,15 +66,11 @@ void sphere :: createSphere(GemState *state) GLint stacks=(m_numStacks>0)?m_numStacks:10; GLfloat rho, drho, theta, dtheta; - GLfloat s, t, ds, dt; GLint i, j, imin, imax; GLenum orientation = true; /* GLU_INSIDE; */ /* coverity[dead_error_condition] we might want to play with orientation (FIXME) */ GLfloat nsign = (orientation)?-1.0:1.0; - GLfloat xsize = 1.0, xsize0 = 0.0; - GLfloat ysize = 1.0, ysize0 = 0.0; - TexCoord*texCoords=NULL; int texNum=0; int texType=0; @@ -82,11 +78,6 @@ void sphere :: createSphere(GemState *state) state->get(GemState::_GL_TEX_TYPE, texType); state->get(GemState::_GL_TEX_NUMCOORDS, texNum); - - if(m_drawType==GL_DEFAULT_GEM) { - m_drawType=GL_FILL; - } - if(m_x) { delete[]m_x; } @@ -100,139 +91,67 @@ void sphere :: createSphere(GemState *state) } m_z=NULL; - if(texType && texNum>=3) { - xsize0 = texCoords[0].s; - xsize = texCoords[1].s-xsize0; - ysize0 = texCoords[1].t; - ysize = texCoords[2].t-ysize0; - } - drho = M_PI / static_cast(stacks); dtheta = 2.0 * M_PI / static_cast(slices); int src; - if (m_drawType == GL_FILL) { - - m_x = new float[slices * stacks * 3]; - m_y = new float[slices * stacks * 3]; - m_z = new float[slices * stacks * 3]; - src = 0; + m_x = new float[slices * stacks * 3]; + m_y = new float[slices * stacks * 3]; + m_z = new float[slices * stacks * 3]; - if (!texType) { - /* draw +Z end as a triangle fan */ + src = 0; - for (j = 0; j <= slices; j++) { - theta = (j == slices) ? 0.0 : j * dtheta; - m_x[src] = -sin(theta) * sin(drho); - m_y[src] = cos(theta) * sin(drho); - m_z[src] = nsign * cos(drho); - src++; - } - } + if (!texType) { + /* draw +Z end as a triangle fan */ - ds = 1.0 / slices; - dt = 1.0 / stacks; - t = 1.0; /* because loop now runs from 0 */ - if (texType) { - imin = 0; - imax = stacks; - } else { - imin = 1; - imax = stacks - 1; + for (j = 0; j <= slices; j++) { + theta = (j == slices) ? 0.0 : j * dtheta; + m_x[src] = -sin(theta) * sin(drho); + m_y[src] = cos(theta) * sin(drho); + m_z[src] = nsign * cos(drho); + src++; } + } - /* draw intermediate stacks as quad strips */ - for (i = imin; i < imax; i++) { - rho = i * drho; - s = 0.0; - for (j = 0; j <= slices; j++) { - theta = (j == slices) ? 0.0 : j * dtheta; - m_x[src] = -sin(theta) * sin(rho); - m_y[src] = cos(theta) * sin(rho); - m_z[src] = nsign * cos(rho); - src++; - m_x[src] = -sin(theta) * sin(rho + drho); - m_y[src] = cos(theta) * sin(rho + drho); - m_z[src] = nsign * cos(rho + drho); - src++; - - } - } + if (texType) { + imin = 0; + imax = stacks; + } else { + imin = 1; + imax = stacks - 1; + } - if (!texType) { - /* draw -Z end as a triangle fan */ - - rho = M_PI - drho; - s = 1.0; - t = dt; - for (j = slices; j >= 0; j--) { - theta = (j == slices) ? 0.0 : j * dtheta; - m_x[src] = -sin(theta) * sin(rho); - m_y[src] = cos(theta) * sin(rho); - m_z[src] = nsign * cos(rho); - src++; - } - } + /* draw intermediate stacks as quad strips */ + for (i = imin; i < imax; i++) { + rho = i * drho; + for (j = 0; j <= slices; j++) { + theta = (j == slices) ? 0.0 : j * dtheta; + m_x[src] = -sin(theta) * sin(rho); + m_y[src] = cos(theta) * sin(rho); + m_z[src] = nsign * cos(rho); + src++; + m_x[src] = -sin(theta) * sin(rho + drho); + m_y[src] = cos(theta) * sin(rho + drho); + m_z[src] = nsign * cos(rho + drho); + src++; - } else if (m_drawType == GL_LINE || m_drawType == GLU_SILHOUETTE) { - - //allocate memory - this has twice the vertices as GL_POINT - m_x = new float[slices * stacks * 2]; - m_y = new float[slices * stacks * 2]; - m_z = new float[slices * stacks * 2]; - - src = 0; - - /* draw stack lines */ - for (i = 1; i < stacks; - i++) { /* stack line at i==stacks-1 was missing here */ - rho = i * drho; - for (j = 0; j < slices; j++) { - theta = j * dtheta; - m_x[src] = cos(theta) * sin(rho); - m_y[src] = sin(theta) * sin(rho); - m_z[src] = cos(rho); - src++; - } - } - /* draw slice lines */ - for (j = 0; j < slices; j++) { - theta = j * dtheta; - for (i = 0; i <= stacks; i++) { - rho = i * drho; - m_x[src] = cos(theta) * sin(rho); - m_y[src] = sin(theta) * sin(rho); - m_z[src] = cos(rho); - src++; - } } } - else if (m_drawType == GL_POINT) { - - //allocate memory - each style has a different number of vertices - m_x = new float[slices * stacks]; - m_y = new float[slices * stacks]; - m_z = new float[slices * stacks]; - src = 0; - - /* loop over stacks and fill the arrays */ - for (i = 1; i < stacks - 1; i++) { - rho = i * drho; - for (j = 0; j < slices; j++) { - theta = j * dtheta; - m_x[src] = cos(theta) * sin(rho); - m_y[src] = sin(theta) * sin(rho); - m_z[src] = cos(rho); - src++; - } - } + if (!texType) { + /* draw -Z end as a triangle fan */ + rho = M_PI - drho; + for (j = slices; j >= 0; j--) { + theta = (j == slices) ? 0.0 : j * dtheta; + m_x[src] = -sin(theta) * sin(rho); + m_y[src] = cos(theta) * sin(rho); + m_z[src] = nsign * cos(rho); + src++; + } } - - } ///////////////////////////////////////////////////////// // render @@ -244,7 +163,6 @@ void sphere :: renderShape(GemState *state) GLint slices=(m_numSlices>0)?m_numSlices:10; GLint stacks=(m_numStacks>0)?m_numStacks:10; - GLfloat rho, drho, dtheta; GLfloat s, t, ds, dt; GLint i, j, imin, imax; GLenum orientation = true; /* GLU_INSIDE; */ @@ -262,6 +180,39 @@ void sphere :: renderShape(GemState *state) state->get(GemState::_GL_TEX_NUMCOORDS, texNum); state->get(GemState::_GL_LIGHTING, lighting); + GLenum type; + if(m_drawType==GL_DEFAULT_GEM) { + m_drawType=GL_FILL; + } + type = m_drawType; + + + switch(m_drawType) { + case GL_LINE_LOOP: + type=GL_LINE; + break; + case GL_POINTS : + type=GL_POINT; + break; + case GL_DEFAULT_GEM: // default + case GL_POLYGON : + type=GL_FILL; + break; + } +#ifdef GLU_TRUE + switch(m_drawType) { + case GLU_LINE : + type=GL_LINE; + break; + case GLU_POINT: + type=GL_POINT; + break; + case GLU_FILL : + type=GL_FILL; + break; + } +#endif + GLfloat xsize = 1.0, xsize0 = 0.0; GLfloat ysize = 1.0, ysize0 = 0.0; if(texType && texNum>=3) { @@ -271,8 +222,8 @@ void sphere :: renderShape(GemState *state) ysize = texCoords[2].t-ysize0; } - drho = M_PI / static_cast(stacks); - dtheta = 2.0 * M_PI / static_cast(slices); + ds = 1.0 / slices; + dt = 1.0 / stacks; /* texturing: s goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y axis */ /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */ @@ -291,137 +242,82 @@ void sphere :: renderShape(GemState *state) oldTexture = texType; } - if (m_drawType == GL_FILL) { - src = 0; - if (!texType) { - /* draw +Z end as a triangle fan */ - glBegin(GL_TRIANGLE_FAN); - glNormal3f(0.0, 0.0, 1.0); - glVertex3f(0.0, 0.0, nsign * radius); - for (j = 0; j <= slices; j++) { - if (lighting) { - glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); - } - glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); - src++; - } - glEnd(); - } - - ds = 1.0 / slices; - dt = 1.0 / stacks; - t = 1.0; /* because loop now runs from 0 */ - if (texType) { - imin = 0; - imax = stacks; - } else { - imin = 1; - imax = stacks - 1; - } - - /* draw intermediate stacks as quad strips */ - for (i = imin; i < imax; i++) { - glBegin(GL_QUAD_STRIP); - s = 0.0; - for (j = 0; j <= slices; j++) { - - if (lighting) { - glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); - } - glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); - src++; - if (lighting) { - glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, (t - dt)*ysize+ysize0); - } - s += ds; - glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); - src++; + src = 0; + if (!texType) { + /* draw +Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); + glNormal3f(0.0, 0.0, 1.0); + glVertex3f(0.0, 0.0, nsign * radius); + for (j = 0; j <= slices; j++) { + if (lighting) { + glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); } - glEnd(); - t -= dt; + glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); + src++; } + glEnd(); + } - if (!texType) { - /* draw -Z end as a triangle fan */ - glBegin(GL_TRIANGLE_FAN); - glNormal3f(0.0, 0.0, -1.0); - glVertex3f(0.0, 0.0, -radius * nsign); - s = 1.0; - t = dt; - for (j = slices; j >= 0; j--) { - if (lighting) { - glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); - } - s -= ds; - glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); - src++; - } - glEnd(); - } - } else if (m_drawType == GL_LINE || m_drawType == GLU_SILHOUETTE) { + ds = 1.0 / slices; + dt = 1.0 / stacks; + t = 1.0; /* because loop now runs from 0 */ + if (texType) { + imin = 0; + imax = stacks; + } else { + imin = 1; + imax = stacks - 1; + } - src = 0; + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, type); - for (i = 1; i < stacks; - i++) { // stack line at i==stacks-1 was missing here - glBegin(GL_LINE_LOOP); - for (j = 0; j < slices; j++) { + /* draw intermediate stacks as quad strips */ + for (i = imin; i < imax; i++) { + glBegin(GL_QUAD_STRIP); + s = 0.0; + for (j = 0; j <= slices; j++) { - if (lighting) { - glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); - } - glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); - src++; + if (lighting) { + glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); } - glEnd(); - } - - for (j = 0; j < slices; j++) { - glBegin(GL_LINE_STRIP); - for (i = 0; i <= stacks; i++) { - - if (lighting) { - glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); - } - glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); - src++; + if(texType) { + glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); + } + glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); + src++; + if (lighting) { + glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); + } + if(texType) { + glTexCoord2f(s*xsize+xsize0, (t - dt)*ysize+ysize0); } - glEnd(); + s += ds; + glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); + src++; } + glEnd(); + t -= dt; } - else if (m_drawType == GL_POINT) { - /* top and bottom-most points */ - glBegin(GL_POINTS); - if (lighting) { - glNormal3f(0.0, 0.0, nsign); - } - glVertex3d(0.0, 0.0, radius); - if (lighting) { - glNormal3f(0.0, 0.0, -nsign); - } - glVertex3d(0.0, 0.0, -radius); - - src = 0; - - for (i = 1; i < stacks - 1; i++) { - rho = i * drho; - for (j = 0; j < slices; j++) { - if (lighting) { - glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); - } - glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); - src++; + if (!texType) { + /* draw -Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); + glNormal3f(0.0, 0.0, -1.0); + glVertex3f(0.0, 0.0, -radius * nsign); + s = 1.0; + t = dt; + for (j = slices; j >= 0; j--) { + if (lighting) { + glNormal3f(m_x[src] * nsign, m_y[src] * nsign, m_z[src] * nsign); } + s -= ds; + glVertex3f(m_x[src] * radius, m_y[src] * radius, m_z[src] * radius); + src++; } glEnd(); } + glPopAttrib(); } ///////////////////////////////////////////////////////// // static member function diff --git a/src/Geos/sphere3d.cpp b/src/Geos/sphere3d.cpp index 32593e1be..f71cea8af 100644 --- a/src/Geos/sphere3d.cpp +++ b/src/Geos/sphere3d.cpp @@ -58,10 +58,6 @@ void sphere3d :: createSphere3d(void) // post("creating sphere %d %d", slices, stacks); - if(m_drawType==GL_DEFAULT_GEM) { - m_drawType=GL_FILL; - } - drho = 180. / static_cast(stacks); dtheta = 360. / static_cast(slices); @@ -197,6 +193,48 @@ void sphere3d :: renderShape(GemState *state) state->get(GemState::_GL_TEX_NUMCOORDS, texNum); state->get(GemState::_GL_LIGHTING, lighting); + GLenum type; + if(m_drawType==GL_DEFAULT_GEM) { + m_drawType=GL_FILL; + } + type = m_drawType; + + switch(m_drawType) { + case GL_LINE_LOOP: + type=GL_LINE; + break; + case GL_POINTS : + type=GL_POINT; + break; + case GL_DEFAULT_GEM: // default + case GL_POLYGON : + type=GL_FILL; + break; + } +#ifdef GLU_TRUE + switch(m_drawType) { + case GLU_LINE : + type=GL_LINE; + break; + case GLU_POINT: + type=GL_POINT; + break; + case GLU_FILL : + type=GL_FILL; + break; + } +#endif + + switch(type) { + case GL_FILL: + case GL_LINE: + case GL_POINT: + break; + default: + error("invalid draw type %d, switching to default", m_drawType); + m_drawType = type = GL_FILL; + } + glPushMatrix(); glScalef(m_size, m_size, m_size); @@ -239,6 +277,8 @@ void sphere3d :: renderShape(GemState *state) if(!m_displayList) { m_modified=true; } + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, type); if(m_modified) { @@ -249,227 +289,158 @@ void sphere3d :: renderShape(GemState *state) m_displayList=glGenLists(1); glNewList(m_displayList, GL_COMPILE_AND_EXECUTE); - if (m_drawType == GL_FILL) { - int src; - t = 1.0; - s = 0.0; - ds = 1.0 / slices; - dt = 1.0 / stacks; + int src; + t = 1.0; + s = 0.0; + ds = 1.0 / slices; + dt = 1.0 / stacks; - /* draw +Z end as a quad strip */ - glBegin(GL_QUAD_STRIP); + /* draw +Z end as a quad strip */ + glBegin(GL_QUAD_STRIP); - src=1; - for (int j = 0; j < slices; j++) { - if(normals) { - glNormal3f(m_x[0], m_y[0], m_z[0]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); - } - glVertex3f(m_x[0], m_y[0], m_z[0]); - - if(normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, (t-dt)*ysize+ysize0); - } - glVertex3f(m_x[src], m_y[src], m_z[src]); - - src++; - s += ds; - } - src=1; + src=1; + for (int j = 0; j < slices; j++) { if(normals) { - glNormal3f(m_x[0], m_y[0], m_z[0]); + glNormal3f(m_x[0], m_y[0], m_z[0]); } if(texType) { - glTexCoord2f(1.f*xsize+xsize0, t*ysize+ysize0); + glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); } glVertex3f(m_x[0], m_y[0], m_z[0]); if(normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); + glNormal3f(m_x[src], m_y[src], m_z[src]); } if(texType) { - glTexCoord2f(1.f*xsize+xsize0, (t-dt)*ysize+ysize0); + glTexCoord2f(s*xsize+xsize0, (t-dt)*ysize+ysize0); } glVertex3f(m_x[src], m_y[src], m_z[src]); - glEnd(); - t-=dt; - - /* draw intermediate stacks as quad strips */ - src=1; - for (int i = 0; i < stacks-2; i++) { - int src2=0; - s = 0.0; - glBegin(GL_QUAD_STRIP); - for (int j = 0; j < slices; j++) { - src2=src+slices; - - if(normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); - } - glVertex3f(m_x[src], m_y[src], m_z[src]); - src++; - - if(normals) { - glNormal3f(m_x[src2], m_y[src2], m_z[src2]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, (t - dt)*ysize+ysize0); - } - glVertex3f(m_x[src2], m_y[src2], m_z[src2]); - src2++; - - s += ds; - } - - if(normals) { - glNormal3f(m_x[src-slices], m_y[src-slices], m_z[src-slices]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); - } - glVertex3f(m_x[src-slices], m_y[src-slices], m_z[src-slices]); - - if(normals) { - glNormal3f(m_x[src2-slices], m_y[src2-slices], m_z[src2-slices]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, (t - dt)*ysize+ysize0); - } - glVertex3f(m_x[src2-slices], m_y[src2-slices], m_z[src2-slices]); - - glEnd(); - t -= dt; - } + src++; + s += ds; + } + src=1; + if(normals) { + glNormal3f(m_x[0], m_y[0], m_z[0]); + } + if(texType) { + glTexCoord2f(1.f*xsize+xsize0, t*ysize+ysize0); + } + glVertex3f(m_x[0], m_y[0], m_z[0]); - /* draw -Z end as a quad strip */ - glBegin(GL_QUAD_STRIP); + if(normals) { + glNormal3f(m_x[src], m_y[src], m_z[src]); + } + if(texType) { + glTexCoord2f(1.f*xsize+xsize0, (t-dt)*ysize+ysize0); + } + glVertex3f(m_x[src], m_y[src], m_z[src]); + + glEnd(); + t-=dt; - src=(slices*(stacks-2)+1); - const int last=slices*(stacks-1)+1; - s=0.0; + /* draw intermediate stacks as quad strips */ + src=1; + for (int i = 0; i < stacks-2; i++) { + int src2=0; + s = 0.0; + glBegin(GL_QUAD_STRIP); for (int j = 0; j < slices; j++) { - if(normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); - } - glVertex3f(m_x[src], m_y[src], m_z[src]); - src++; - - if(normals) { - glNormal3f(m_x[last], m_y[last], m_z[last]); - } - if(texType) { - glTexCoord2f(s*xsize+xsize0, (t-dt)*ysize+ysize0); - } - glVertex3f(m_x[last], m_y[last], m_z[last]); - - s+=ds; + src2=src+slices; + + if(normals) { + glNormal3f(m_x[src], m_y[src], m_z[src]); + } + if(texType) { + glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); + } + glVertex3f(m_x[src], m_y[src], m_z[src]); + src++; + + if(normals) { + glNormal3f(m_x[src2], m_y[src2], m_z[src2]); + } + if(texType) { + glTexCoord2f(s*xsize+xsize0, (t - dt)*ysize+ysize0); + } + glVertex3f(m_x[src2], m_y[src2], m_z[src2]); + src2++; + + s += ds; } - src=(slices*(stacks-2)+1); + if(normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); + glNormal3f(m_x[src-slices], m_y[src-slices], m_z[src-slices]); } if(texType) { - glTexCoord2f(1.f*xsize+xsize0, t*ysize+ysize0); + glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); } - glVertex3f(m_x[src], m_y[src], m_z[src]); + glVertex3f(m_x[src-slices], m_y[src-slices], m_z[src-slices]); if(normals) { - glNormal3f(m_x[last], m_y[last], m_z[last]); + glNormal3f(m_x[src2-slices], m_y[src2-slices], m_z[src2-slices]); } if(texType) { - glTexCoord2f(1.f*xsize+xsize0, (t-dt)*ysize+ysize0); + glTexCoord2f(s*xsize+xsize0, (t - dt)*ysize+ysize0); } - glVertex3f(m_x[last], m_y[last], m_z[last]); + glVertex3f(m_x[src2-slices], m_y[src2-slices], m_z[src2-slices]); glEnd(); - - } else if (m_drawType == GL_LINE || m_drawType == GLU_SILHOUETTE) { - - int src = 1; - for (int i = 1; i < stacks; - i++) { // stack line at i==stacks-1 was missing here - glBegin(GL_LINE_LOOP); - for (int j = 0; j < slices; j++) { - - if (normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); - } - glVertex3f(m_x[src], m_y[src], m_z[src]); - src++; - } - glEnd(); - } - for (int j = 0; j < slices; j++) { - glBegin(GL_LINE_STRIP); - - if (normals) { - glNormal3f(m_x[0], m_y[0], m_z[0]); - } - glVertex3f(m_x[0], m_y[0], m_z[0]); - - for (int i = 0; i < stacks-1; i++) { - src=i*slices+1+j; - if (normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); - } - glVertex3f(m_x[src], m_y[src], m_z[src]); - } - src=slices*(stacks-1)+1; - if (normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); - } - glVertex3f(m_x[src], m_y[src], m_z[src]); - - glEnd(); - } + t -= dt; } - else if (m_drawType == GL_POINT) { - /* top and bottom-most points */ - int src=0; - - glBegin(GL_POINTS); + /* draw -Z end as a quad strip */ + glBegin(GL_QUAD_STRIP); + src=(slices*(stacks-2)+1); + const int last=slices*(stacks-1)+1; + s=0.0; + for (int j = 0; j < slices; j++) { if(normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); + glNormal3f(m_x[src], m_y[src], m_z[src]); + } + if(texType) { + glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); } glVertex3f(m_x[src], m_y[src], m_z[src]); src++; - for (int i = 0; i < stacks-1; i++) { - for (int j = 0; j < slices; j++) { - if (normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); - } - glVertex3f(m_x[src], m_y[src], m_z[src]); - src++; - } - } if(normals) { - glNormal3f(m_x[src], m_y[src], m_z[src]); + glNormal3f(m_x[last], m_y[last], m_z[last]); } - glVertex3f(m_x[src], m_y[src], m_z[src]); + if(texType) { + glTexCoord2f(s*xsize+xsize0, (t-dt)*ysize+ysize0); + } + glVertex3f(m_x[last], m_y[last], m_z[last]); - glEnd(); + s+=ds; + } + src=(slices*(stacks-2)+1); + if(normals) { + glNormal3f(m_x[src], m_y[src], m_z[src]); } + if(texType) { + glTexCoord2f(1.f*xsize+xsize0, t*ysize+ysize0); + } + glVertex3f(m_x[src], m_y[src], m_z[src]); + + if(normals) { + glNormal3f(m_x[last], m_y[last], m_z[last]); + } + if(texType) { + glTexCoord2f(1.f*xsize+xsize0, (t-dt)*ysize+ysize0); + } + glVertex3f(m_x[last], m_y[last], m_z[last]); + + glEnd(); + glEndList(); } /* rebuild list */ else { glCallList(m_displayList); } + glPopAttrib(); glPopMatrix(); m_modified=false; } From 39818e03af44084513e3596d647b27ab0c9604df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 12 Aug 2024 12:24:54 +0200 Subject: [PATCH 195/387] fix line/point rendering of [disk] and [cylinder] (esp with textures) --- src/Geos/cylinder.cpp | 169 +++++++++++++++------------------- src/Geos/disk.cpp | 206 +++++++++++++++++------------------------- 2 files changed, 155 insertions(+), 220 deletions(-) diff --git a/src/Geos/cylinder.cpp b/src/Geos/cylinder.cpp index 0d419539e..16e8016be 100644 --- a/src/Geos/cylinder.cpp +++ b/src/Geos/cylinder.cpp @@ -65,6 +65,43 @@ void cylinder :: renderShape(GemState *state) m_drawType=GL_FILL; } + + GLenum type = m_drawType; + switch(m_drawType) { + case GL_LINE_LOOP: + type=GL_LINE; + break; + case GL_POINTS : + type=GL_POINT; + break; + case GL_DEFAULT_GEM: // default + case GL_POLYGON : + type=GL_FILL; + break; + } +#ifdef GLU_TRUE + switch(m_drawType) { + case GLU_LINE : + type=GL_LINE; + break; + case GLU_POINT: + type=GL_POINT; + break; + case GLU_FILL : + type=GL_FILL; + break; + } +#endif + switch(type) { + case GL_FILL: + case GL_LINE: + case GL_POINT: + break; + default: + error("invalid draw type %d (%d), switching to default %d", m_drawType, type, GL_FILL); + m_drawType = type = GL_FILL; + } + GLdouble da, r, dr, dz; GLfloat x, y, z, nz; GLint i, j; @@ -94,6 +131,9 @@ void cylinder :: renderShape(GemState *state) glPushMatrix(); glTranslatef(0.f, 0.f, -m_size); + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, type); + // gluCylinder(m_thing, m_size, m_size, m_size * 2, m_numSlices, m_numSlices); da = 2.0 * M_PI / slices; dr = (topRadius - baseRadius) / stacks; @@ -101,107 +141,42 @@ void cylinder :: renderShape(GemState *state) nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */ - if (m_drawType == GL_POINT) { - glBegin(GL_POINTS); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - - z = 0.0; - r = baseRadius; - for (j = 0; j <= stacks; j++) { - glVertex3f(x * r, y * r, z); - z += dz; - r += dr; - } - } - glEnd(); - } else if (m_drawType == GL_LINE || m_drawType == GLU_SILHOUETTE) { - /* Draw rings */ - if (m_drawType == GL_LINE) { - z = 0.0; - r = baseRadius; - for (j = 0; j <= stacks; j++) { - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * r, y * r, z); - } - glEnd(); - z += dz; - r += dr; + GLfloat ds = 1.0 / slices; + GLfloat dt = 1.0 / stacks; + GLfloat t = 0.0; + z = 0.0; + r = baseRadius; + for (j = 0; j < stacks; j++) { + GLfloat s = 0.0; + glBegin(GL_QUAD_STRIP); + for (i = 0; i <= slices; i++) { + GLfloat x, y; + if (i == slices) { + x = sin(0.0); + y = cos(0.0); + } else { + x = sin(i * da); + y = cos(i * da); } - } else { - /* draw one ring at each end */ - if (baseRadius != 0.0) { - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * baseRadius, y * baseRadius, 0.0); - } - glEnd(); - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * topRadius, y * topRadius, height); - } - glEnd(); + normal3f(x * nsign, y * nsign, nz * nsign); + if(texType) { + glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); } - } - /* draw length lines */ - glBegin(GL_LINES); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); + glVertex3f(x * r, y * r, z); normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * baseRadius, y * baseRadius, 0.0); - glVertex3f(x * topRadius, y * topRadius, height); - } + if(texType) { + glTexCoord2f(s*xsize+xsize0, (t + dt)*ysize+ysize0); + } + glVertex3f(x * (r + dr), y * (r + dr), z + dz); + + s += ds; + } /* for slices */ glEnd(); - } else if (m_drawType == GL_FILL) { - GLfloat ds = 1.0 / slices; - GLfloat dt = 1.0 / stacks; - GLfloat t = 0.0; - z = 0.0; - r = baseRadius; - for (j = 0; j < stacks; j++) { - GLfloat s = 0.0; - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= slices; i++) { - GLfloat x, y; - if (i == slices) { - x = sin(0.0); - y = cos(0.0); - } else { - x = sin(i * da); - y = cos(i * da); - } - normal3f(x * nsign, y * nsign, nz * nsign); - if(texType) { - glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0); - } - glVertex3f(x * r, y * r, z); - normal3f(x * nsign, y * nsign, nz * nsign); - if(texType) { - glTexCoord2f(s*xsize+xsize0, (t + dt)*ysize+ysize0); - } - glVertex3f(x * (r + dr), y * (r + dr), z + dz); - - s += ds; - } /* for slices */ - glEnd(); - r += dr; - t += dt; - z += dz; - } /* for stacks */ - } + r += dr; + t += dt; + z += dz; + } /* for stacks */ + glPopAttrib(); glPopMatrix(); } diff --git a/src/Geos/disk.cpp b/src/Geos/disk.cpp index 93af8fb8a..fa0e61e2d 100644 --- a/src/Geos/disk.cpp +++ b/src/Geos/disk.cpp @@ -92,6 +92,43 @@ void disk :: renderShape(GemState *state) m_drawType=GL_FILL; } + + GLenum type = m_drawType; + switch(m_drawType) { + case GL_LINE_LOOP: + type=GL_LINE; + break; + case GL_POINTS : + type=GL_POINT; + break; + case GL_DEFAULT_GEM: // default + case GL_POLYGON : + type=GL_FILL; + break; + } +#ifdef GLU_TRUE + switch(m_drawType) { + case GLU_LINE : + type=GL_LINE; + break; + case GLU_POINT: + type=GL_POINT; + break; + case GLU_FILL : + type=GL_FILL; + break; + } +#endif + switch(type) { + case GL_FILL: + case GL_LINE: + case GL_POINT: + break; + default: + error("invalid draw type %d (%d), switching to default %d", m_drawType, type, GL_FILL); + m_drawType = type = GL_FILL; + } + GLfloat da, dr; /* coverity[dead_error_condition] we might want to play with orientation (FIXME) */ @@ -138,135 +175,58 @@ void disk :: renderShape(GemState *state) GLfloat sa, ca; GLfloat r1 = m_innerRadius; - switch (m_drawType) { - default: - case GL_FILL: { - /* texture of a gluDisk is a cut out of the texture unit square - * x, y in [-m_size, +m_size]; s, t in [0, 1] - * (linear mapping) - */ - GLint l; - for (l = 0; l < loops; l++) { - GLfloat r2 = r1 + dr; - if (!orientation) { - GLint s; - glBegin(GL_QUAD_STRIP); - for (s = 0; s <= m_numSlices; s++) { - GLfloat a=(s == m_numSlices)?0.0:(s * da); - sa = sin(a); - ca = cos(a); - if(texType) { - glTexCoord2f((0.5 + sa * r2 / dtc)*xsize+xsize0, - (0.5 + ca * r2 / dtc)*ysize+ysize0); - } - glVertex2f(r2 * sa, r2 * ca); - if(texType) { - glTexCoord2f((0.5 + sa * r1 / dtc)*xsize+xsize0, - (0.5 + ca * r1 / dtc)*ysize+ysize0); - } - glVertex2f(r1 * sa, r1 * ca); - } - glEnd(); - } else { - GLint s; - glBegin(GL_QUAD_STRIP); - for (s = m_numSlices; s >= 0; s--) { - GLfloat a=(s==m_numSlices)?0.0:s * da; - sa = sin(a); - ca = cos(a); - if(texType) { - glTexCoord2f((0.5 - sa * r2 / dtc)*xsize+xsize0, - (0.5 + ca * r2 / dtc)*ysize+ysize0); - } - glVertex2f(r2 * sa, r2 * ca); - if(texType) { - glTexCoord2f((0.5 - sa * r1 / dtc)*xsize+xsize0, - (0.5 + ca * r1 / dtc)*ysize+ysize0); - } - glVertex2f(r1 * sa, r1 * ca); - } - glEnd(); - } - r1 = r2; - } - break; - } - case GL_LINE: { - GLint l, s; - /* draw loops */ - for (l = 0; l <= loops; l++) { - GLfloat r = m_innerRadius + l * dr; - glBegin(GL_LINE_LOOP); - for (s = 0; s < m_numSlices; s++) { - GLfloat a = s * da; - if(texType) { - glTexCoord2f((0.5+r*sin(a)/dtc)*xsize+xsize0, - (0.5+r*cos(a)/dtc)*ysize+ysize0); - } - glVertex2f(r * sin(a), r * cos(a)); - } - glEnd(); - } - /* draw spokes */ - for (s = 0; s < m_numSlices; s++) { - GLfloat a = s * da; - GLfloat x = sin(a); - GLfloat y = cos(a); - glBegin(GL_LINE_STRIP); - for (l = 0; l <= loops; l++) { - GLfloat r = m_innerRadius + l * dr; - if(texType) { - glTexCoord2f((0.5+r*x/dtc)*xsize+xsize0, (0.5+r*y/dtc)*ysize+ysize0); - } - glVertex2f(r * x, r * y); - } - glEnd(); - } - break; - } - case GL_POINT: { - GLint s; - glBegin(GL_POINTS); - for (s = 0; s < m_numSlices; s++) { - GLfloat a = s * da; - GLfloat x = sin(a); - GLfloat y = cos(a); - GLint l; - for (l = 0; l <= loops; l++) { - GLfloat r = m_innerRadius * l * dr; - glVertex2f(r * x, r * y); - if(texType) { - glTexCoord2f((0.5+r*x/dtc)*xsize+xsize0, (0.5+r*y/dtc)*ysize+ysize0); - } - } - } - glEnd(); - break; - } - case GLU_SILHOUETTE: { - if (m_innerRadius != 0.0) { - GLfloat a; - glBegin(GL_LINE_LOOP); - for (a = 0.0; a < 2.0 * M_PI; a += da) { - GLfloat x = m_innerRadius * sin(a); - GLfloat y = m_innerRadius * cos(a); - glVertex2f(x, y); + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, type); + + /* texture of a gluDisk is a cut out of the texture unit square + * x, y in [-m_size, +m_size]; s, t in [0, 1] + * (linear mapping) + */ + GLint l; + for (l = 0; l < loops; l++) { + GLfloat r2 = r1 + dr; + if (!orientation) { + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = 0; s <= m_numSlices; s++) { + GLfloat a=(s == m_numSlices)?0.0:(s * da); + sa = sin(a); + ca = cos(a); + if(texType) { + glTexCoord2f((0.5 + sa * r2 / dtc)*xsize+xsize0, + (0.5 + ca * r2 / dtc)*ysize+ysize0); + } + glVertex2f(r2 * sa, r2 * ca); + if(texType) { + glTexCoord2f((0.5 + sa * r1 / dtc)*xsize+xsize0, + (0.5 + ca * r1 / dtc)*ysize+ysize0); + } + glVertex2f(r1 * sa, r1 * ca); } glEnd(); - } - { - GLfloat a; - glBegin(GL_LINE_LOOP); - for (a = 0; a < 2.0 * M_PI; a += da) { - GLfloat x = m_size * sin(a); - GLfloat y = m_size * cos(a); - glVertex2f(x, y); + } else { + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = m_numSlices; s >= 0; s--) { + GLfloat a=(s==m_numSlices)?0.0:s * da; + sa = sin(a); + ca = cos(a); + if(texType) { + glTexCoord2f((0.5 - sa * r2 / dtc)*xsize+xsize0, + (0.5 + ca * r2 / dtc)*ysize+ysize0); + } + glVertex2f(r2 * sa, r2 * ca); + if(texType) { + glTexCoord2f((0.5 - sa * r1 / dtc)*xsize+xsize0, + (0.5 + ca * r1 / dtc)*ysize+ysize0); + } + glVertex2f(r1 * sa, r1 * ca); } glEnd(); } - break; - } + r1 = r2; } + glPopAttrib(); } ///////////////////////////////////////////////////////// From fe64422248189a507066c2e760129b540463a6fe Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 24 Sep 2024 09:53:00 +0200 Subject: [PATCH 196/387] most simple multitexture example --- examples/10.glsl/05.multitexture_basic.pd | 139 ++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 examples/10.glsl/05.multitexture_basic.pd diff --git a/examples/10.glsl/05.multitexture_basic.pd b/examples/10.glsl/05.multitexture_basic.pd new file mode 100644 index 000000000..87d8b872f --- /dev/null +++ b/examples/10.glsl/05.multitexture_basic.pd @@ -0,0 +1,139 @@ +#N canvas 507 4 759 759 10; +#X declare -lib Gem; +#X obj 76 5 gemhead; +#X obj 76 339 glsl_program; +#X obj 149 268 pack 0 0; +#X obj 170 248 t b f; +#X obj 164 203 change; +#X msg 149 294 link \$1 \$2; +#X floatatom 170 229 2 0 0 0 ID - - 0; +#X floatatom 148 121 2 0 0 0 ID - - 0; +#X obj 167 315 print linking; +#X msg 365 63 color 1 0 0; +#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X obj 76 79 glsl_vertex; +#X obj 76 183 glsl_fragment; +#X obj 159 365 openpanel; +#X obj 137 367 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X text 463 130 1) turn on rendering; +#N canvas 0 0 450 300 load_shader 0; +#X obj 89 99 t b b; +#X msg 119 126 0; +#X obj 89 154 outlet; +#X obj 89 71 gemhead 1; +#X connect 0 0 2 0; +#X connect 0 1 1 0; +#X connect 1 0 3 0; +#X connect 3 0 0 0; +#X restore 142 5 pd load_shader; +#X msg 159 390 set open \$1 \, bang; +#X obj 104 467 loadbang; +#X obj 95 389 loadbang; +#X msg 95 414 open ../data/img2.jpg; +#X obj 76 443 pix_image ../data/img2.jpg; +#X obj 148 98 change; +#X text 343 187 This is an example of multitexturing \, this shader mixes 2 textures; +#N canvas 87 154 247 179 Gem.init 0; +#X obj 118 46 loadbang; +#X msg 118 81 reset; +#X obj 118 113 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X restore 395 87 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 365 104 pd gemwin; +#X obj 76 708 rectangle 3 3; +#X obj 76 514 pix_texture; +#X obj 159 536 openpanel; +#X obj 139 537 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X msg 159 561 set open \$1 \, bang; +#X obj 104 636 loadbang; +#X obj 95 560 loadbang; +#X obj 76 683 pix_texture; +#X msg 95 585 open ../data/img1.jpg; +#X obj 76 614 pix_image ../data/img1.jpg; +#X obj 365 21 declare -lib Gem; +#X msg 90 57 open shader/multitexture.vert; +#X msg 86 153 open shader/multitexture.frag; +#X msg 104 658 rectangle 0 \, texunit 1; +#X msg 104 489 rectangle 0 \, texunit 0; +#X msg 170 341 MyTex 0 \, MyTex 1; +#X connect 0 0 11 0; +#X connect 1 0 21 0; +#X connect 1 1 41 0; +#X connect 2 0 5 0; +#X connect 3 0 2 0; +#X connect 3 1 2 1; +#X connect 4 0 6 0; +#X connect 5 0 1 0; +#X connect 5 0 8 0; +#X connect 6 0 3 0; +#X connect 7 0 2 0; +#X connect 9 0 25 0; +#X connect 10 0 37 0; +#X connect 10 0 38 0; +#X connect 11 0 12 0; +#X connect 11 1 22 0; +#X connect 12 0 1 0; +#X connect 12 1 4 0; +#X connect 13 0 17 0; +#X connect 14 0 13 0; +#X connect 16 0 10 0; +#X connect 17 0 20 0; +#X connect 18 0 40 0; +#X connect 19 0 20 0; +#X connect 20 0 21 0; +#X connect 21 0 27 0; +#X connect 22 0 7 0; +#X connect 24 0 25 0; +#X connect 27 0 35 0; +#X connect 28 0 30 0; +#X connect 29 0 28 0; +#X connect 30 0 34 0; +#X connect 31 0 39 0; +#X connect 32 0 34 0; +#X connect 33 0 26 0; +#X connect 34 0 35 0; +#X connect 35 0 33 0; +#X connect 37 0 11 0; +#X connect 38 0 12 0; +#X connect 39 0 33 0; +#X connect 40 0 27 0; +#X connect 41 0 1 0; From 2cfaf0a7a562457b63b6db3275d76b8e64806397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 24 Sep 2024 11:16:37 +0200 Subject: [PATCH 197/387] Add basic multitexture example to build-system --- examples/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Makefile.am b/examples/Makefile.am index 9602ae29a..00529fc8a 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -121,6 +121,7 @@ nobase_dist_gemexamples_DATA = \ 10.glsl/04.game_of_life.pd \ 10.glsl/05.multitexture.pd \ 10.glsl/05.multitexture_bis.pd \ + 10.glsl/05.multitexture_basic.pd \ 10.glsl/06.rectangle_multitexture.pd \ 10.glsl/07.framebuffer_and_shader.pd \ 10.glsl/08.multi_pass_rendering.pd \ From 9eb6bee5f849637b1da79cfe66f77c71271470be Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 25 Sep 2024 15:57:41 +0200 Subject: [PATCH 198/387] massive additive audio syntesis in the GPU --- .../10.glsl/18.additive_audio_synthesis.pd | 373 ++++++++++++++++++ examples/10.glsl/shader/additive.frag | 62 +++ examples/10.glsl/shader/additive.vert | 10 + 3 files changed, 445 insertions(+) create mode 100644 examples/10.glsl/18.additive_audio_synthesis.pd create mode 100644 examples/10.glsl/shader/additive.frag create mode 100644 examples/10.glsl/shader/additive.vert diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd new file mode 100644 index 000000000..8835f8532 --- /dev/null +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -0,0 +1,373 @@ +#N canvas 169 446 486 397 10; +#X declare -lib Gem; +#X obj 26 342 dac~; +#X obj 60 228 oscillo~; +#X obj 26 187 *~ 5; +#N canvas 671 180 972 717 audio_GPU 0; +#X obj 39 332 declare -lib Gem; +#X obj 40 116 select 0 1; +#X msg 40 137 0 \, destroy; +#X obj 40 95 tgl 16 0 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 79 445 bang~; +#X obj 318 601 outlet~; +#X obj 318 578 clip~ -1 1; +#X obj 40 305 block~ 4096; +#X obj 318 531 *~ 2; +#X obj 318 555 -~ 1; +#X obj 274 168 translateXYZ 0 0 -4; +#X obj 274 396 square 4; +#X obj 301 471 pix_pix2sig~; +#X obj 301 448 pix_snap 0 0 4096 1; +#X obj 274 419 t b a; +#X obj 334 500 /~ 255; +#X obj 383 500 /~ 65535; +#X msg 451 378 t \$1; +#X obj 451 309 f; +#X floatatom 463 357 5 0 0 0 - - - 0; +#X obj 451 332 + 1; +#X msg 451 264 0; +#X msg 39 448 0; +#X obj 39 423 loadbang; +#X obj 361 144 s rendered_sound; +#X obj 654 150 s input_image; +#X obj 567 60 gemhead 10; +#X obj 274 93 gemframebuffer \; dimen 4096 1 \; rectangle 1; +#X obj 274 322 pix_texture \; rectangle 1 \; quality 0; +#X obj 343 298 r input_image; +#X obj 274 66 gemhead 20 \;; +#X obj 90 502 s gemhead_input; +#X obj 73 526 s gemhead_sound; +#X obj 56 550 s gemhead_display; +#X obj 567 33 r gemhead_input; +#X obj 274 40 r gemhead_sound; +#X obj 462 286 bang~; +#X obj 567 593 square 4; +#X obj 567 572 translateXYZ 0 4 -4; +#X obj 705 591 square 4; +#X obj 705 547 pix_texture; +#X obj 768 522 r input_image; +#X obj 705 403 r gemhead_display; +#X obj 705 427 gemhead 30 \;; +#X obj 89 185 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 705 451 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; quality 0; +#X obj 705 570 translateXYZ 0 4 -4; +#X obj 567 539 pix_texture \; quality 0; +#X obj 567 150 t b a; +#X obj 567 441 separator; +#X obj 594 172 separator; +#X obj 567 403 gemhead 40 \; 0; +#X obj 274 623 tabwrite~ block_vector; +#X obj 38 358 table block_vector 4096; +#X text 270 643 only for visualisation purpose; +#N canvas 1440 78 450 366 noise 0; +#X obj 25 33 inlet; +#X obj 25 154 pix_noise 4096 1 \; auto 1; +#X obj 25 199 pix_texture; +#X msg 58 86 auto \$1; +#X obj 58 61 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 77 112 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 25 229 rectangle 4 4; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 6 0; +#X connect 3 0 1 0; +#X connect 4 0 3 0; +#X connect 5 0 1 0; +#X restore 628 327 pd noise; +#X f 11; +#N canvas 1441 501 450 300 route4 0; +#X obj 28 37 inlet; +#X obj 39 205 outlet; +#X obj 42 168 spigot 1; +#X obj 90 146 == 0; +#X obj 182 147 == 1; +#X obj 270 146 == 2; +#X obj 348 147 == 3; +#X obj 400 35 inlet; +#X obj 130 206 outlet; +#X obj 222 210 outlet; +#X obj 300 208 outlet; +#X obj 133 169 spigot 0; +#X obj 222 168 spigot 0; +#X obj 300 169 spigot 0; +#X connect 0 0 2 0; +#X connect 0 0 11 0; +#X connect 0 0 12 0; +#X connect 0 0 13 0; +#X connect 2 0 1 0; +#X connect 3 0 2 1; +#X connect 4 0 11 1; +#X connect 5 0 12 1; +#X connect 6 0 13 1; +#X connect 7 0 6 0; +#X connect 7 0 5 0; +#X connect 7 0 4 0; +#X connect 7 0 3 0; +#X connect 11 0 8 0; +#X connect 12 0 9 0; +#X connect 13 0 10 0; +#X restore 594 259 pd route4; +#N canvas 1441 501 450 300 video 0; +#X obj 35 100 pix_texture; +#X obj 35 75 pix_video; +#X obj 35 38 inlet; +#X obj 35 132 rectangle 4 4; +#X connect 0 0 3 0; +#X connect 1 0 0 0; +#X connect 2 0 1 0; +#X restore 646 348 pd video; +#N canvas 1458 625 450 300 test 0; +#X obj 35 26 inlet; +#X obj 35 173 translateXYZ 0 -4 0; +#X obj 35 204 rectangle 0.02 4; +#X obj 97 141 line; +#X obj 97 23 loadbang; +#X obj 97 46 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 113 118 5 0 0 0 - - - 0; +#X msg 97 95 -4 \, 4 20000; +#X obj 97 70 metro 20000; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 3 0 1 1; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 3 0; +#X connect 7 0 3 0; +#X connect 8 0 7 0; +#X restore 611 307 pd test; +#X f 14; +#X obj 39 477 t a a a a; +#X obj 39 573 s gemhead_display_text; +#N canvas 1058 252 669 673 visualisation 0; +#X obj 61 204 rectangle 4 1; +#X obj 61 175 translateXYZ 0 1.5 0; +#X obj 264 186 translateXYZ 0 -1.5 0; +#X obj 130 98 r input_image; +#X obj 61 76 gemhead 30; +#X obj 264 81 gemhead 30; +#X obj 61 122 pix_texture \; rectangle 1 \; quality 0; +#X obj 264 136 pix_texture \; rectangle 1 \; quality 0; +#X obj 333 109 r rendered_sound; +#X obj 61 50 r gemhead_display; +#X obj 264 52 r gemhead_display; +#X obj 264 209 rectangle 4 0.5; +#X obj 63 276 r gemhead_display_text; +#X obj 63 302 gemhead 40; +#X obj 63 336 translateXYZ -3.5 2 0; +#X obj 63 413 translateXYZ 0 -1 0; +#X obj 63 367 text2d last_input_buffer \; justify left; +#X obj 63 444 text2d current_input_buffer \; justify left; +#X obj 62 519 text2d audio_out_buffer \; justify left; +#X obj 62 488 translateXYZ 0 -2.5 0; +#X connect 1 0 0 0; +#X connect 2 0 11 0; +#X connect 3 0 6 1; +#X connect 4 0 6 0; +#X connect 5 0 7 0; +#X connect 6 0 1 0; +#X connect 7 0 2 0; +#X connect 8 0 7 1; +#X connect 9 0 4 0; +#X connect 10 0 5 0; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 14 0 16 0; +#X connect 15 0 17 0; +#X connect 16 0 15 0; +#X connect 17 0 19 0; +#X connect 19 0 18 0; +#X restore 37 617 pd visualisation; +#X msg 712 105 color 0 0 0; +#X obj 594 200 color 1 0 0; +#X text 675 202 only red channel is used; +#X text 563 624 copy the curent texture in an other buffer and render if the next frame \, to keep the previous frame in order to do smooth transition between 2 frames; +#X obj 703 286 vradio 20 1 0 4 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0; +#X text 737 282 you can change here to put what you want to convert to sound, f 25; +#N canvas 1252 195 496 590 img 0; +#X obj 35 38 inlet; +#X obj 105 271 line; +#X obj 105 190 metro 10000; +#X obj 105 143 loadbang; +#X obj 105 166 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X floatatom 118 244 5 0 0 0 - - - 0; +#X obj 35 111 pix_texture; +#X obj 35 324 rectangle 4 4; +#X obj 35 293 translateXYZ 0 0 0; +#X msg 105 217 -6 \, 2 10000; +#X obj 35 68 pix_image \; open ../data/dancer.JPG; +#X connect 0 0 10 0; +#X connect 1 0 8 2; +#X connect 2 0 9 0; +#X connect 3 0 4 0; +#X connect 4 0 2 0; +#X connect 5 0 1 0; +#X connect 6 0 8 0; +#X connect 8 0 7 0; +#X connect 9 0 1 0; +#X connect 10 0 6 0; +#X restore 594 286 pd img; +#X f 17; +#X obj 594 228 translateXYZ 0 0 -4; +#X obj 40 30 inlet; +#X obj 63 84 s pd; +#X msg 69 165 create \, 1 \, bang; +#N canvas 346 93 673 762 shader 0; +#X obj 78 339 glsl_vertex; +#X msg 32 338 print; +#X obj 78 626 glsl_program; +#X obj 163 555 pack 0 0; +#X msg 30 476 print; +#X obj 163 511 change; +#X obj 150 358 change; +#X msg 163 579 link \$1 \$2; +#X msg 32 620 print; +#X obj 77 490 glsl_fragment; +#X floatatom 163 535 2 0 0 0 ID - - 0; +#X floatatom 150 381 2 0 0 0 ID - - 0; +#X obj 181 600 print linking; +#X obj 15 21 inlet; +#X obj 78 662 outlet; +#X msg 106 309 open \$1.vert; +#X msg 90 453 open \$1.frag; +#X obj 577 95 inlet; +#X obj 15 44 route bang; +#X obj 255 11 gemhead 1; +#X msg 255 33 1; +#X obj 255 57 change; +#X obj 255 81 t b; +#X obj 157 647 change; +#X obj 157 668 t b; +#X obj 158 690 outlet; +#X obj 140 224 t a a; +#X obj 90 426 symbol; +#X obj 90 401 t b; +#X msg 287 598 0; +#X obj 15 65 t b b b, f 29; +#X obj 140 199 symbol shader/additive; +#X connect 0 0 9 0; +#X connect 0 1 6 0; +#X connect 1 0 0 0; +#X connect 2 0 14 0; +#X connect 2 1 23 0; +#X connect 3 0 7 0; +#X connect 4 0 9 0; +#X connect 5 0 10 0; +#X connect 6 0 11 0; +#X connect 6 0 28 0; +#X connect 7 0 2 0; +#X connect 7 0 12 0; +#X connect 8 0 2 0; +#X connect 9 0 2 0; +#X connect 9 1 5 0; +#X connect 10 0 3 0; +#X connect 11 0 3 1; +#X connect 13 0 18 0; +#X connect 15 0 0 0; +#X connect 16 0 9 0; +#X connect 17 0 2 0; +#X connect 18 0 30 0; +#X connect 18 1 0 0; +#X connect 19 0 20 0; +#X connect 20 0 21 0; +#X connect 21 0 22 0; +#X connect 22 0 31 0; +#X connect 23 0 24 0; +#X connect 24 0 25 0; +#X connect 26 0 15 0; +#X connect 26 1 27 1; +#X connect 27 0 16 0; +#X connect 28 0 27 0; +#X connect 29 0 23 0; +#X connect 30 0 10 0; +#X connect 30 1 31 0; +#X connect 30 2 29 0; +#X connect 31 0 26 0; +#X restore 274 223 pd shader; +#X obj 284 198 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 40 215 gemwin \; buffer 1 \; color 0.3 0.3 0.3; +#X obj 567 86 gemframebuffer \; dimen 4096 2 \; rectangle 1 \; texunit 0; +#X msg 63 59 dsp 0 \, dsp \$1; +#X connect 1 0 2 0; +#X connect 1 1 72 0; +#X connect 2 0 75 0; +#X connect 3 0 1 0; +#X connect 4 0 59 0; +#X connect 6 0 5 0; +#X connect 6 0 52 0; +#X connect 8 0 9 0; +#X connect 9 0 6 0; +#X connect 10 0 73 0; +#X connect 11 0 14 0; +#X connect 12 1 8 0; +#X connect 12 2 15 0; +#X connect 12 3 16 0; +#X connect 13 0 12 0; +#X connect 14 0 13 0; +#X connect 14 0 52 0; +#X connect 14 1 13 0; +#X connect 15 0 8 0; +#X connect 16 0 8 0; +#X connect 17 0 73 1; +#X connect 18 0 20 0; +#X connect 20 0 18 1; +#X connect 20 0 19 0; +#X connect 20 0 17 0; +#X connect 21 0 18 0; +#X connect 22 0 59 0; +#X connect 23 0 22 0; +#X connect 26 0 76 0; +#X connect 27 0 10 0; +#X connect 27 1 24 0; +#X connect 28 0 11 0; +#X connect 29 0 28 1; +#X connect 30 0 27 0; +#X connect 34 0 26 0; +#X connect 35 0 30 0; +#X connect 36 0 18 0; +#X connect 38 0 37 0; +#X connect 40 0 46 0; +#X connect 41 0 40 1; +#X connect 42 0 43 0; +#X connect 43 0 45 0; +#X connect 44 0 75 0; +#X connect 45 0 40 0; +#X connect 45 1 47 1; +#X connect 46 0 39 0; +#X connect 47 0 38 0; +#X connect 48 0 51 0; +#X connect 48 1 50 0; +#X connect 49 0 47 0; +#X connect 50 0 63 0; +#X connect 51 0 49 0; +#X connect 56 0 68 0; +#X connect 56 1 58 0; +#X connect 56 2 55 0; +#X connect 56 3 57 0; +#X connect 59 0 60 0; +#X connect 59 1 33 0; +#X connect 59 2 32 0; +#X connect 59 3 31 0; +#X connect 62 0 76 0; +#X connect 63 0 69 0; +#X connect 66 0 56 1; +#X connect 69 0 56 0; +#X connect 70 0 77 0; +#X connect 70 0 3 0; +#X connect 72 0 75 0; +#X connect 73 0 28 0; +#X connect 73 1 21 0; +#X connect 74 0 73 0; +#X connect 76 0 48 0; +#X connect 76 1 25 0; +#X connect 77 0 71 0; +#X restore 26 45 pd audio_GPU; +#X text 43 68 This patch use an image buffer to control the amplitude of 200 audio oscillators. Everything is computed inside the GPU.; +#X text 44 116 Rendering must be sync to audio dsp \, and large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticable!; +#X obj 26 14 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 51 15 <- start; +#X text 48 166 Pd sould be configured at 48KHz; +#X connect 2 0 0 0; +#X connect 2 0 1 0; +#X connect 2 0 0 1; +#X connect 3 0 2 0; +#X connect 6 0 3 0; diff --git a/examples/10.glsl/shader/additive.frag b/examples/10.glsl/shader/additive.frag new file mode 100644 index 000000000..b4c8840d9 --- /dev/null +++ b/examples/10.glsl/shader/additive.frag @@ -0,0 +1,62 @@ +#version 130 +#extension GL_ARB_texture_rectangle : enable +// Cyrille Henry 2024 + +uniform sampler2DRect texture0; // input texture +uniform float t; // current time, in order to adjust the phase of signals from 1 frame to the other + +varying vec2 texcoord0; // pixel coordinate in the image + +float oscilator(float phase, float amplitude) { + return (0.5 + 0.5*amplitude*cos(radians(360*phase))); +} + +float mtof(float midi) { // midi value to frequency value + return (440. * pow(2.,(midi-69.)/12.)); +} + +float ftof(float f) { // real frequency value to f value + // f = 1 -> 1 period is 4096 sample + return ((f/48000.) * 4096.); // for a sampling frequency of 48K +} + +void main (void) +{ + float outcolor, i; + float time = texcoord0.s /4096. ; // use X coordinate as time + + outcolor = 0.; + for(i=0.; i<200.; i++) { // 200 oscillators + float f_i = i/199.; + // use texture as oscillator amplitude + float amplitude1 = texture2DRect(texture0, vec2(f_i*4095.,1)).r; // previous frame amplitude + float amplitude2 = texture2DRect(texture0, vec2(f_i*4095.,-1)).r; // current frame amplitude + float amplitude = mix(amplitude1, amplitude2, time); // interpolation between this 2 vectors + amplitude *= amplitude; // pow(2) curve + + float f = ftof(mtof( mix(20.,110.,f_i) )); // uniform mapping between midi note 20 to 110 + + float phase; + //phase = fract((time+t) * f); // not accurate enough when t is high + // so we split the computation of the phase to small value in order to keep precision + phase = fract(time*fract(f)) + fract(time*floor(f)) + fract(t*fract(f)); + // we can skip some operations since : + // time is < 1.; so floor(time)=0.; and fract(time) = time; + // fract(t) = 0.; so floor(t) = t; + + outcolor += oscilator(phase, amplitude); + } + outcolor /= i; // normalisation + + // output color are 3 int value + // conversion to color channels + outcolor = clamp (outcolor,-1.,1.); + float r = floor(outcolor*255.)/255.; // crop to 8 bits + float g_float = 256.*(outcolor - r); + float g = floor(g_float*255.)/255.; // crop to 8 bits + float b_float = 256.*(g_float - g); + float b = floor(b_float*255.)/255.; // crop to 8 bits so the 24th bit is correct. it's maybe overkill... + + gl_FragColor = vec4(r, g , b, 1.0); + +} diff --git a/examples/10.glsl/shader/additive.vert b/examples/10.glsl/shader/additive.vert new file mode 100644 index 000000000..11dfd77d3 --- /dev/null +++ b/examples/10.glsl/shader/additive.vert @@ -0,0 +1,10 @@ +varying vec2 texcoord0; +varying vec2 texcoord1; + +void main() +{ + + texcoord0 = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; + gl_Position = ftransform(); + +} From 33bdc82dad0637755ed8ef7a3c15b2e9c04ada1c Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 25 Sep 2024 16:05:43 +0200 Subject: [PATCH 199/387] small debug and remove custom abstraction --- examples/10.glsl/18.additive_audio_synthesis.pd | 12 +++++------- examples/10.glsl/shader/additive.frag | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index 8835f8532..9cbaaa35f 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -1,7 +1,6 @@ -#N canvas 169 446 486 397 10; +#N canvas 159 554 487 279 10; #X declare -lib Gem; -#X obj 26 342 dac~; -#X obj 60 228 oscillo~; +#X obj 26 222 dac~; #X obj 26 187 *~ 5; #N canvas 671 180 972 717 audio_GPU 0; #X obj 39 332 declare -lib Gem; @@ -366,8 +365,7 @@ #X obj 26 14 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X text 51 15 <- start; #X text 48 166 Pd sould be configured at 48KHz; -#X connect 2 0 0 0; +#X connect 1 0 0 0; +#X connect 1 0 0 1; #X connect 2 0 1 0; -#X connect 2 0 0 1; -#X connect 3 0 2 0; -#X connect 6 0 3 0; +#X connect 5 0 2 0; diff --git a/examples/10.glsl/shader/additive.frag b/examples/10.glsl/shader/additive.frag index b4c8840d9..c6948f73c 100644 --- a/examples/10.glsl/shader/additive.frag +++ b/examples/10.glsl/shader/additive.frag @@ -8,7 +8,7 @@ uniform float t; // current time, in order to adjust the phase of signals from 1 varying vec2 texcoord0; // pixel coordinate in the image float oscilator(float phase, float amplitude) { - return (0.5 + 0.5*amplitude*cos(radians(360*phase))); + return (0.5 + 0.5*amplitude*cos(radians(360.*phase))); } float mtof(float midi) { // midi value to frequency value From f4fc91c4c4f21d2895f00e33faccd249d0169d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 25 Sep 2024 17:04:07 +0200 Subject: [PATCH 200/387] Add volume slider and use spaces in OSD --- .../10.glsl/18.additive_audio_synthesis.pd | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index 9cbaaa35f..adec9ebdc 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -1,8 +1,8 @@ -#N canvas 159 554 487 279 10; +#N canvas 159 554 487 306 10; #X declare -lib Gem; -#X obj 26 222 dac~; +#X obj 26 262 dac~; #X obj 26 187 *~ 5; -#N canvas 671 180 972 717 audio_GPU 0; +#N canvas 839 236 972 717 audio_GPU 0; #X obj 39 332 declare -lib Gem; #X obj 40 116 select 0 1; #X msg 40 137 0 \, destroy; @@ -154,10 +154,10 @@ #X obj 63 302 gemhead 40; #X obj 63 336 translateXYZ -3.5 2 0; #X obj 63 413 translateXYZ 0 -1 0; -#X obj 63 367 text2d last_input_buffer \; justify left; -#X obj 63 444 text2d current_input_buffer \; justify left; -#X obj 62 519 text2d audio_out_buffer \; justify left; #X obj 62 488 translateXYZ 0 -2.5 0; +#X obj 63 364 text2d \; text last input buffer \; justify left; +#X obj 63 444 text2d \; text current input buffer \; justify left; +#X obj 62 519 text2d \; text audio out buffer \; justify left; #X connect 1 0 0 0; #X connect 2 0 11 0; #X connect 3 0 6 1; @@ -170,11 +170,11 @@ #X connect 10 0 5 0; #X connect 12 0 13 0; #X connect 13 0 14 0; -#X connect 14 0 16 0; -#X connect 15 0 17 0; -#X connect 16 0 15 0; -#X connect 17 0 19 0; -#X connect 19 0 18 0; +#X connect 14 0 17 0; +#X connect 15 0 18 0; +#X connect 16 0 19 0; +#X connect 17 0 15 0; +#X connect 18 0 16 0; #X restore 37 617 pd visualisation; #X msg 712 105 color 0 0 0; #X obj 594 200 color 1 0 0; @@ -365,7 +365,19 @@ #X obj 26 14 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X text 51 15 <- start; #X text 48 166 Pd sould be configured at 48KHz; -#X connect 1 0 0 0; -#X connect 1 0 0 1; +#X obj 26 212 hip~ 5; +#X obj 26 237 *~; +#X obj 87 189 hsl 153 18 0 127 0 0 empty empty empty -2 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 84 212 dbtorms; +#X obj 84 235 pack 0 50; +#X obj 84 258 line~; +#X connect 1 0 8 0; #X connect 2 0 1 0; #X connect 5 0 2 0; +#X connect 8 0 9 0; +#X connect 9 0 0 0; +#X connect 9 0 0 1; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 13 0 9 1; From f217a5a4c03835350fb2f19acb83f2641c6d20ef Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 25 Sep 2024 17:46:36 +0200 Subject: [PATCH 201/387] small debug that help on osX --- examples/10.glsl/shader/additive.frag | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/10.glsl/shader/additive.frag b/examples/10.glsl/shader/additive.frag index c6948f73c..e2f1ce566 100644 --- a/examples/10.glsl/shader/additive.frag +++ b/examples/10.glsl/shader/additive.frag @@ -1,4 +1,3 @@ -#version 130 #extension GL_ARB_texture_rectangle : enable // Cyrille Henry 2024 @@ -50,7 +49,7 @@ void main (void) // output color are 3 int value // conversion to color channels - outcolor = clamp (outcolor,-1.,1.); + outcolor = clamp (outcolor,0.,1.); float r = floor(outcolor*255.)/255.; // crop to 8 bits float g_float = 256.*(outcolor - r); float g = floor(g_float*255.)/255.; // crop to 8 bits From 9ae7dfd5c3ae2ec341f70bd1e086a464dd9295aa Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 26 Sep 2024 09:04:20 +0200 Subject: [PATCH 202/387] FLOAT output version of the shader it did not work for me, but it should --- .../10.glsl/18.additive_audio_synthesis.pd | 150 +++++++++--------- examples/10.glsl/shader/additive.frag | 18 +-- 2 files changed, 80 insertions(+), 88 deletions(-) diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index adec9ebdc..1a3ae3e4c 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -2,24 +2,21 @@ #X declare -lib Gem; #X obj 26 262 dac~; #X obj 26 187 *~ 5; -#N canvas 839 236 972 717 audio_GPU 0; +#N canvas 713 199 972 717 audio_GPU 1; #X obj 39 332 declare -lib Gem; #X obj 40 116 select 0 1; #X msg 40 137 0 \, destroy; #X obj 40 95 tgl 16 0 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; #X obj 79 445 bang~; -#X obj 318 601 outlet~; -#X obj 318 578 clip~ -1 1; +#X obj 318 591 outlet~; +#X obj 318 568 clip~ -1 1; #X obj 40 305 block~ 4096; -#X obj 318 531 *~ 2; -#X obj 318 555 -~ 1; +#X obj 318 521 *~ 2; +#X obj 318 545 -~ 1; #X obj 274 168 translateXYZ 0 0 -4; #X obj 274 396 square 4; -#X obj 301 471 pix_pix2sig~; -#X obj 301 448 pix_snap 0 0 4096 1; +#X obj 301 496 pix_pix2sig~; #X obj 274 419 t b a; -#X obj 334 500 /~ 255; -#X obj 383 500 /~ 65535; #X msg 451 378 t \$1; #X obj 451 309 f; #X floatatom 463 357 5 0 0 0 - - - 0; @@ -30,15 +27,14 @@ #X obj 361 144 s rendered_sound; #X obj 654 150 s input_image; #X obj 567 60 gemhead 10; -#X obj 274 93 gemframebuffer \; dimen 4096 1 \; rectangle 1; #X obj 274 322 pix_texture \; rectangle 1 \; quality 0; #X obj 343 298 r input_image; -#X obj 274 66 gemhead 20 \;; +#X obj 274 56 gemhead 20 \;; #X obj 90 502 s gemhead_input; #X obj 73 526 s gemhead_sound; #X obj 56 550 s gemhead_display; #X obj 567 33 r gemhead_input; -#X obj 274 40 r gemhead_sound; +#X obj 274 30 r gemhead_sound; #X obj 462 286 bang~; #X obj 567 593 square 4; #X obj 567 572 translateXYZ 0 4 -4; @@ -176,7 +172,6 @@ #X connect 17 0 15 0; #X connect 18 0 16 0; #X restore 37 617 pd visualisation; -#X msg 712 105 color 0 0 0; #X obj 594 200 color 1 0 0; #X text 675 202 only red channel is used; #X text 563 624 copy the curent texture in an other buffer and render if the next frame \, to keep the previous frame in order to do smooth transition between 2 frames; @@ -286,79 +281,76 @@ #X obj 40 215 gemwin \; buffer 1 \; color 0.3 0.3 0.3; #X obj 567 86 gemframebuffer \; dimen 4096 2 \; rectangle 1 \; texunit 0; #X msg 63 59 dsp 0 \, dsp \$1; +#X obj 274 83 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; type FLOAT; +#X obj 301 458 pix_snap 0 0 4096 1 \; type FLOAT; #X connect 1 0 2 0; -#X connect 1 1 72 0; -#X connect 2 0 75 0; +#X connect 1 1 67 0; +#X connect 2 0 70 0; #X connect 3 0 1 0; -#X connect 4 0 59 0; +#X connect 4 0 55 0; #X connect 6 0 5 0; -#X connect 6 0 52 0; +#X connect 6 0 48 0; #X connect 8 0 9 0; #X connect 9 0 6 0; -#X connect 10 0 73 0; -#X connect 11 0 14 0; +#X connect 10 0 68 0; +#X connect 11 0 13 0; #X connect 12 1 8 0; -#X connect 12 2 15 0; -#X connect 12 3 16 0; -#X connect 13 0 12 0; -#X connect 14 0 13 0; -#X connect 14 0 52 0; -#X connect 14 1 13 0; -#X connect 15 0 8 0; -#X connect 16 0 8 0; -#X connect 17 0 73 1; -#X connect 18 0 20 0; -#X connect 20 0 18 1; +#X connect 13 0 48 0; +#X connect 13 0 74 0; +#X connect 13 1 74 0; +#X connect 14 0 68 1; +#X connect 15 0 17 0; +#X connect 17 0 15 1; +#X connect 17 0 16 0; +#X connect 17 0 14 0; +#X connect 18 0 15 0; +#X connect 19 0 55 0; #X connect 20 0 19 0; -#X connect 20 0 17 0; -#X connect 21 0 18 0; -#X connect 22 0 59 0; -#X connect 23 0 22 0; -#X connect 26 0 76 0; -#X connect 27 0 10 0; -#X connect 27 1 24 0; -#X connect 28 0 11 0; -#X connect 29 0 28 1; -#X connect 30 0 27 0; -#X connect 34 0 26 0; -#X connect 35 0 30 0; -#X connect 36 0 18 0; -#X connect 38 0 37 0; -#X connect 40 0 46 0; -#X connect 41 0 40 1; -#X connect 42 0 43 0; -#X connect 43 0 45 0; -#X connect 44 0 75 0; -#X connect 45 0 40 0; -#X connect 45 1 47 1; -#X connect 46 0 39 0; -#X connect 47 0 38 0; -#X connect 48 0 51 0; -#X connect 48 1 50 0; -#X connect 49 0 47 0; -#X connect 50 0 63 0; -#X connect 51 0 49 0; -#X connect 56 0 68 0; -#X connect 56 1 58 0; -#X connect 56 2 55 0; -#X connect 56 3 57 0; -#X connect 59 0 60 0; -#X connect 59 1 33 0; -#X connect 59 2 32 0; -#X connect 59 3 31 0; -#X connect 62 0 76 0; -#X connect 63 0 69 0; -#X connect 66 0 56 1; -#X connect 69 0 56 0; -#X connect 70 0 77 0; -#X connect 70 0 3 0; -#X connect 72 0 75 0; -#X connect 73 0 28 0; +#X connect 23 0 71 0; +#X connect 24 0 11 0; +#X connect 25 0 24 1; +#X connect 26 0 73 0; +#X connect 30 0 23 0; +#X connect 31 0 26 0; +#X connect 32 0 15 0; +#X connect 34 0 33 0; +#X connect 36 0 42 0; +#X connect 37 0 36 1; +#X connect 38 0 39 0; +#X connect 39 0 41 0; +#X connect 40 0 70 0; +#X connect 41 0 36 0; +#X connect 41 1 43 1; +#X connect 42 0 35 0; +#X connect 43 0 34 0; +#X connect 44 0 47 0; +#X connect 44 1 46 0; +#X connect 45 0 43 0; +#X connect 46 0 58 0; +#X connect 47 0 45 0; +#X connect 52 0 63 0; +#X connect 52 1 54 0; +#X connect 52 2 51 0; +#X connect 52 3 53 0; +#X connect 55 0 56 0; +#X connect 55 1 29 0; +#X connect 55 2 28 0; +#X connect 55 3 27 0; +#X connect 58 0 64 0; +#X connect 61 0 52 1; +#X connect 64 0 52 0; +#X connect 65 0 72 0; +#X connect 65 0 3 0; +#X connect 67 0 70 0; +#X connect 68 0 24 0; +#X connect 68 1 18 0; +#X connect 69 0 68 0; +#X connect 71 0 44 0; +#X connect 71 1 22 0; +#X connect 72 0 66 0; +#X connect 73 0 10 0; #X connect 73 1 21 0; -#X connect 74 0 73 0; -#X connect 76 0 48 0; -#X connect 76 1 25 0; -#X connect 77 0 71 0; +#X connect 74 0 12 0; #X restore 26 45 pd audio_GPU; #X text 43 68 This patch use an image buffer to control the amplitude of 200 audio oscillators. Everything is computed inside the GPU.; #X text 44 116 Rendering must be sync to audio dsp \, and large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticable!; @@ -367,7 +359,7 @@ #X text 48 166 Pd sould be configured at 48KHz; #X obj 26 212 hip~ 5; #X obj 26 237 *~; -#X obj 87 189 hsl 153 18 0 127 0 0 empty empty empty -2 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 87 189 hsl 153 18 0 127 0 1 empty empty empty -2 -9 0 10 #fcfcfc #000000 #000000 12000 1; #X obj 84 212 dbtorms; #X obj 84 235 pack 0 50; #X obj 84 258 line~; diff --git a/examples/10.glsl/shader/additive.frag b/examples/10.glsl/shader/additive.frag index e2f1ce566..111a2425f 100644 --- a/examples/10.glsl/shader/additive.frag +++ b/examples/10.glsl/shader/additive.frag @@ -47,15 +47,15 @@ void main (void) } outcolor /= i; // normalisation - // output color are 3 int value - // conversion to color channels outcolor = clamp (outcolor,0.,1.); - float r = floor(outcolor*255.)/255.; // crop to 8 bits - float g_float = 256.*(outcolor - r); - float g = floor(g_float*255.)/255.; // crop to 8 bits - float b_float = 256.*(g_float - g); - float b = floor(b_float*255.)/255.; // crop to 8 bits so the 24th bit is correct. it's maybe overkill... - - gl_FragColor = vec4(r, g , b, 1.0); + // output to 3 int value + //float r = floor(outcolor*255.)/255.; // crop to 8 bits + //float g_float = 256.*(outcolor - r); + //float g = floor(g_float*255.)/255.; // crop to 8 bits + //float b_float = 256.*(g_float - g); + //float b = floor(b_float*255.)/255.; // crop to 8 bits so the 24th bit is correct. it's maybe overkill... + + // Float output + gl_FragColor = vec4(outcolor, 0. , 0., 1.0); } From dfd2abf54d8e1761836fc898e13e27aba096806b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 26 Sep 2024 09:39:54 +0200 Subject: [PATCH 203/387] Add GLSL audio synth example to build-system --- examples/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/Makefile.am b/examples/Makefile.am index 00529fc8a..24598c3a2 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -134,8 +134,11 @@ nobase_dist_gemexamples_DATA = \ 10.glsl/15.bicubic_image_interpolation.pd \ 10.glsl/16.vertexbuffer_attributes.pd \ 10.glsl/17.light.pd \ + 10.glsl/18.additive_audio_synthesis.pd \ 10.glsl/_glsl.pd \ 10.glsl/single_blur.pd \ + 10.glsl/shader/additive.frag \ + 10.glsl/shader/additive.vert \ 10.glsl/shader/bicubic_interpolation.frag \ 10.glsl/shader/bicubic_interpolation.vert \ 10.glsl/shader/blur.frag \ From 1cafa16f0c074e973d5b733c45e5f2a23c1487c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 26 Sep 2024 11:02:39 +0200 Subject: [PATCH 204/387] [ci] ensure that 'libtool' is installed --- .git-ci/gitlab-iem.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index f8b482492..9eaac2595 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -189,6 +189,7 @@ stages: - echo "PDDIR=${PDDIR}" - brew bundle --no-upgrade --file=.git-ci/macOS.brew || true - brew list --full-name || true + - libtoolize --version || glibtoolize --version || brew install libtool || true # older versions of assimp are broken with clang>=14 - sed -e 's|^\([[:space:]]*mTextureCoordsNames = new aiString \*\[AI_MAX_NUMBER_OF_TEXTURECOORDS\]\) {};[[:space:]]*$|\1; for (size_t i=0; i Date: Thu, 26 Sep 2024 11:26:01 +0200 Subject: [PATCH 205/387] add a pop protection and clean the rendering with double buffering --- .../10.glsl/18.additive_audio_synthesis.pd | 218 +++++++++--------- 1 file changed, 106 insertions(+), 112 deletions(-) diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index 1a3ae3e4c..a9a7f540e 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -1,13 +1,12 @@ -#N canvas 159 554 487 306 10; +#N canvas 97 452 497 401 10; #X declare -lib Gem; -#X obj 26 262 dac~; -#X obj 26 187 *~ 5; -#N canvas 713 199 972 717 audio_GPU 1; +#X obj 26 352 dac~; +#X obj 26 227 *~ 5; +#N canvas 713 199 972 717 audio_GPU 0; #X obj 39 332 declare -lib Gem; #X obj 40 116 select 0 1; -#X msg 40 137 0 \, destroy; #X obj 40 95 tgl 16 0 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 79 445 bang~; +#X obj 123 168 bang~; #X obj 318 591 outlet~; #X obj 318 568 clip~ -1 1; #X obj 40 305 block~ 4096; @@ -22,26 +21,18 @@ #X floatatom 463 357 5 0 0 0 - - - 0; #X obj 451 332 + 1; #X msg 451 264 0; -#X msg 39 448 0; -#X obj 39 423 loadbang; #X obj 361 144 s rendered_sound; #X obj 654 150 s input_image; #X obj 567 60 gemhead 10; #X obj 274 322 pix_texture \; rectangle 1 \; quality 0; #X obj 343 298 r input_image; #X obj 274 56 gemhead 20 \;; -#X obj 90 502 s gemhead_input; -#X obj 73 526 s gemhead_sound; -#X obj 56 550 s gemhead_display; -#X obj 567 33 r gemhead_input; -#X obj 274 30 r gemhead_sound; #X obj 462 286 bang~; #X obj 567 593 square 4; #X obj 567 572 translateXYZ 0 4 -4; #X obj 705 591 square 4; #X obj 705 547 pix_texture; #X obj 768 522 r input_image; -#X obj 705 403 r gemhead_display; #X obj 705 427 gemhead 30 \;; #X obj 89 185 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X obj 705 451 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; quality 0; @@ -131,8 +122,6 @@ #X connect 8 0 7 0; #X restore 611 307 pd test; #X f 14; -#X obj 39 477 t a a a a; -#X obj 39 573 s gemhead_display_text; #N canvas 1058 252 669 673 visualisation 0; #X obj 61 204 rectangle 4 1; #X obj 61 175 translateXYZ 0 1.5 0; @@ -143,35 +132,29 @@ #X obj 61 122 pix_texture \; rectangle 1 \; quality 0; #X obj 264 136 pix_texture \; rectangle 1 \; quality 0; #X obj 333 109 r rendered_sound; -#X obj 61 50 r gemhead_display; -#X obj 264 52 r gemhead_display; #X obj 264 209 rectangle 4 0.5; -#X obj 63 276 r gemhead_display_text; #X obj 63 302 gemhead 40; #X obj 63 336 translateXYZ -3.5 2 0; #X obj 63 413 translateXYZ 0 -1 0; -#X obj 62 488 translateXYZ 0 -2.5 0; +#X obj 63 494 translateXYZ 0 -2.5 0; #X obj 63 364 text2d \; text last input buffer \; justify left; #X obj 63 444 text2d \; text current input buffer \; justify left; -#X obj 62 519 text2d \; text audio out buffer \; justify left; +#X obj 63 525 text2d \; text audio out buffer \; justify left; #X connect 1 0 0 0; -#X connect 2 0 11 0; +#X connect 2 0 9 0; #X connect 3 0 6 1; #X connect 4 0 6 0; #X connect 5 0 7 0; #X connect 6 0 1 0; #X connect 7 0 2 0; #X connect 8 0 7 1; -#X connect 9 0 4 0; -#X connect 10 0 5 0; -#X connect 12 0 13 0; -#X connect 13 0 14 0; -#X connect 14 0 17 0; -#X connect 15 0 18 0; -#X connect 16 0 19 0; -#X connect 17 0 15 0; -#X connect 18 0 16 0; -#X restore 37 617 pd visualisation; +#X connect 10 0 11 0; +#X connect 11 0 14 0; +#X connect 12 0 15 0; +#X connect 13 0 16 0; +#X connect 14 0 12 0; +#X connect 15 0 13 0; +#X restore 39 426 pd visualisation; #X obj 594 200 color 1 0 0; #X text 675 202 only red channel is used; #X text 563 624 copy the curent texture in an other buffer and render if the next frame \, to keep the previous frame in order to do smooth transition between 2 frames; @@ -204,7 +187,6 @@ #X obj 594 228 translateXYZ 0 0 -4; #X obj 40 30 inlet; #X obj 63 84 s pd; -#X msg 69 165 create \, 1 \, bang; #N canvas 346 93 673 762 shader 0; #X obj 78 339 glsl_vertex; #X msg 32 338 print; @@ -278,94 +260,105 @@ #X connect 31 0 26 0; #X restore 274 223 pd shader; #X obj 284 198 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X obj 40 215 gemwin \; buffer 1 \; color 0.3 0.3 0.3; #X obj 567 86 gemframebuffer \; dimen 4096 2 \; rectangle 1 \; texunit 0; -#X msg 63 59 dsp 0 \, dsp \$1; #X obj 274 83 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; type FLOAT; #X obj 301 458 pix_snap 0 0 4096 1 \; type FLOAT; -#X connect 1 0 2 0; -#X connect 1 1 67 0; -#X connect 2 0 70 0; -#X connect 3 0 1 0; -#X connect 4 0 55 0; -#X connect 6 0 5 0; -#X connect 6 0 48 0; -#X connect 8 0 9 0; -#X connect 9 0 6 0; -#X connect 10 0 68 0; -#X connect 11 0 13 0; -#X connect 12 1 8 0; -#X connect 13 0 48 0; -#X connect 13 0 74 0; -#X connect 13 1 74 0; -#X connect 14 0 68 1; -#X connect 15 0 17 0; -#X connect 17 0 15 1; -#X connect 17 0 16 0; +#X msg 123 197 render; +#X obj 40 245 gemwin \; color 0.3 0.3 0.3; +#X msg 69 165 create; +#X msg 40 137 destroy; +#X msg 63 59 dsp \$1; +#X connect 1 0 64 0; +#X connect 1 1 63 0; +#X connect 2 0 1 0; +#X connect 3 0 61 0; +#X connect 5 0 4 0; +#X connect 5 0 39 0; +#X connect 7 0 8 0; +#X connect 8 0 5 0; +#X connect 9 0 56 0; +#X connect 10 0 12 0; +#X connect 11 1 7 0; +#X connect 12 0 39 0; +#X connect 12 0 60 0; +#X connect 12 1 60 0; +#X connect 13 0 56 1; +#X connect 14 0 16 0; +#X connect 16 0 14 1; +#X connect 16 0 15 0; +#X connect 16 0 13 0; #X connect 17 0 14 0; -#X connect 18 0 15 0; -#X connect 19 0 55 0; -#X connect 20 0 19 0; -#X connect 23 0 71 0; -#X connect 24 0 11 0; -#X connect 25 0 24 1; -#X connect 26 0 73 0; -#X connect 30 0 23 0; -#X connect 31 0 26 0; -#X connect 32 0 15 0; -#X connect 34 0 33 0; -#X connect 36 0 42 0; -#X connect 37 0 36 1; -#X connect 38 0 39 0; -#X connect 39 0 41 0; -#X connect 40 0 70 0; -#X connect 41 0 36 0; -#X connect 41 1 43 1; -#X connect 42 0 35 0; -#X connect 43 0 34 0; -#X connect 44 0 47 0; -#X connect 44 1 46 0; -#X connect 45 0 43 0; -#X connect 46 0 58 0; -#X connect 47 0 45 0; -#X connect 52 0 63 0; -#X connect 52 1 54 0; -#X connect 52 2 51 0; -#X connect 52 3 53 0; -#X connect 55 0 56 0; -#X connect 55 1 29 0; -#X connect 55 2 28 0; -#X connect 55 3 27 0; -#X connect 58 0 64 0; -#X connect 61 0 52 1; -#X connect 64 0 52 0; -#X connect 65 0 72 0; -#X connect 65 0 3 0; -#X connect 67 0 70 0; -#X connect 68 0 24 0; -#X connect 68 1 18 0; -#X connect 69 0 68 0; -#X connect 71 0 44 0; -#X connect 71 1 22 0; -#X connect 72 0 66 0; -#X connect 73 0 10 0; -#X connect 73 1 21 0; -#X connect 74 0 12 0; +#X connect 20 0 58 0; +#X connect 21 0 10 0; +#X connect 22 0 21 1; +#X connect 23 0 59 0; +#X connect 24 0 14 0; +#X connect 26 0 25 0; +#X connect 28 0 33 0; +#X connect 29 0 28 1; +#X connect 30 0 32 0; +#X connect 31 0 62 0; +#X connect 32 0 28 0; +#X connect 32 1 34 1; +#X connect 33 0 27 0; +#X connect 34 0 26 0; +#X connect 35 0 38 0; +#X connect 35 1 37 0; +#X connect 36 0 34 0; +#X connect 37 0 47 0; +#X connect 38 0 36 0; +#X connect 43 0 52 0; +#X connect 43 1 45 0; +#X connect 43 2 42 0; +#X connect 43 3 44 0; +#X connect 47 0 53 0; +#X connect 50 0 43 1; +#X connect 53 0 43 0; +#X connect 54 0 65 0; +#X connect 54 0 2 0; +#X connect 56 0 21 0; +#X connect 56 1 17 0; +#X connect 57 0 56 0; +#X connect 58 0 35 0; +#X connect 58 1 19 0; +#X connect 59 0 9 0; +#X connect 59 1 18 0; +#X connect 60 0 11 0; +#X connect 61 0 62 0; +#X connect 63 0 62 0; +#X connect 64 0 62 0; +#X connect 65 0 55 0; #X restore 26 45 pd audio_GPU; -#X text 43 68 This patch use an image buffer to control the amplitude of 200 audio oscillators. Everything is computed inside the GPU.; -#X text 44 116 Rendering must be sync to audio dsp \, and large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticable!; +#X text 80 67 This patch use an image buffer to control the amplitude of 200 audio oscillators. Everything is computed inside the GPU.; +#X text 81 115 Rendering must be sync to audio dsp \, and large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticable!; #X obj 26 14 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X text 51 15 <- start; -#X text 48 166 Pd sould be configured at 48KHz; -#X obj 26 212 hip~ 5; -#X obj 26 237 *~; -#X obj 87 189 hsl 153 18 0 127 0 1 empty empty empty -2 -9 0 10 #fcfcfc #000000 #000000 12000 1; -#X obj 84 212 dbtorms; -#X obj 84 235 pack 0 50; -#X obj 84 258 line~; +#X text 85 165 Pd sould be configured at 48KHz; +#X obj 26 252 hip~ 5; +#X obj 26 327 *~; +#X obj 87 229 hsl 153 18 0 127 0 1 empty empty empty -2 -9 0 10 #fcfcfc #000000 #000000 12000 1; +#X obj 84 252 dbtorms; +#X obj 84 275 pack 0 50; +#X obj 84 298 line~; +#N canvas 2 90 450 300 no_pop 0; +#X obj 41 24 inlet~; +#X obj 42 191 outlet~; +#X msg 130 53 clear; +#X obj 143 77 sig~ 1; +#X obj 42 160 *~; +#X obj 130 27 inlet; +#X obj 130 104 lop~ 0.5; +#X connect 0 0 4 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 5 0 2 0; +#X connect 6 0 4 1; +#X restore 25 190 pd no_pop; #X connect 1 0 8 0; -#X connect 2 0 1 0; +#X connect 2 0 14 0; #X connect 5 0 2 0; +#X connect 5 0 14 1; #X connect 8 0 9 0; #X connect 9 0 0 0; #X connect 9 0 0 1; @@ -373,3 +366,4 @@ #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 9 1; +#X connect 14 0 1 0; From b15e3defa4d107dcb5ff0534d7630f5c037863ad Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 26 Sep 2024 13:53:59 +0200 Subject: [PATCH 206/387] add a missing "quality 0" fix typo --- .../10.glsl/18.additive_audio_synthesis.pd | 220 +++++++++--------- 1 file changed, 112 insertions(+), 108 deletions(-) diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index a9a7f540e..c7dac8bc3 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -1,18 +1,17 @@ -#N canvas 97 452 497 401 10; +#N canvas 135 508 522 409 10; #X declare -lib Gem; #X obj 26 352 dac~; -#X obj 26 227 *~ 5; -#N canvas 713 199 972 717 audio_GPU 0; -#X obj 39 332 declare -lib Gem; +#N canvas 507 120 973 717 audio_GPU 0; +#X obj 40 332 declare -lib Gem; #X obj 40 116 select 0 1; -#X obj 40 95 tgl 16 0 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 40 90 tgl 16 0 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; #X obj 123 168 bang~; -#X obj 318 591 outlet~; +#X obj 318 614 outlet~; #X obj 318 568 clip~ -1 1; #X obj 40 305 block~ 4096; #X obj 318 521 *~ 2; #X obj 318 545 -~ 1; -#X obj 274 168 translateXYZ 0 0 -4; +#X obj 274 164 translateXYZ 0 0 -4; #X obj 274 396 square 4; #X obj 301 496 pix_pix2sig~; #X obj 274 419 t b a; @@ -21,30 +20,25 @@ #X floatatom 463 357 5 0 0 0 - - - 0; #X obj 451 332 + 1; #X msg 451 264 0; -#X obj 361 144 s rendered_sound; -#X obj 654 150 s input_image; -#X obj 567 60 gemhead 10; +#X obj 361 126 s rendered_sound; +#X obj 654 130 s input_image; +#X obj 567 40 gemhead 10; #X obj 274 322 pix_texture \; rectangle 1 \; quality 0; #X obj 343 298 r input_image; -#X obj 274 56 gemhead 20 \;; #X obj 462 286 bang~; #X obj 567 593 square 4; #X obj 567 572 translateXYZ 0 4 -4; #X obj 705 591 square 4; -#X obj 705 547 pix_texture; -#X obj 768 522 r input_image; -#X obj 705 427 gemhead 30 \;; +#X obj 774 512 r input_image; #X obj 89 185 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X obj 705 451 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; quality 0; #X obj 705 570 translateXYZ 0 4 -4; #X obj 567 539 pix_texture \; quality 0; -#X obj 567 150 t b a; -#X obj 567 441 separator; -#X obj 594 172 separator; -#X obj 567 403 gemhead 40 \; 0; -#X obj 274 623 tabwrite~ block_vector; -#X obj 38 358 table block_vector 4096; -#X text 270 643 only for visualisation purpose; +#X obj 567 165 t b a; +#X obj 567 465 separator; +#X obj 594 187 separator; +#X obj 567 427 gemhead 40 \; 0; +#X obj 274 643 tabwrite~ block_vector; +#X obj 40 360 table block_vector 4096; #N canvas 1440 78 450 366 noise 0; #X obj 25 33 inlet; #X obj 25 154 pix_noise 4096 1 \; auto 1; @@ -59,7 +53,7 @@ #X connect 3 0 1 0; #X connect 4 0 3 0; #X connect 5 0 1 0; -#X restore 628 327 pd noise; +#X restore 628 342 pd noise; #X f 11; #N canvas 1441 501 450 300 route4 0; #X obj 28 37 inlet; @@ -92,7 +86,7 @@ #X connect 11 0 8 0; #X connect 12 0 9 0; #X connect 13 0 10 0; -#X restore 594 259 pd route4; +#X restore 594 274 pd route4; #N canvas 1441 501 450 300 video 0; #X obj 35 100 pix_texture; #X obj 35 75 pix_video; @@ -101,7 +95,7 @@ #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 2 0 1 0; -#X restore 646 348 pd video; +#X restore 646 363 pd video; #N canvas 1458 625 450 300 test 0; #X obj 35 26 inlet; #X obj 35 173 translateXYZ 0 -4 0; @@ -120,7 +114,7 @@ #X connect 6 0 3 0; #X connect 7 0 3 0; #X connect 8 0 7 0; -#X restore 611 307 pd test; +#X restore 611 322 pd test; #X f 14; #N canvas 1058 252 669 673 visualisation 0; #X obj 61 204 rectangle 4 1; @@ -154,12 +148,10 @@ #X connect 13 0 16 0; #X connect 14 0 12 0; #X connect 15 0 13 0; -#X restore 39 426 pd visualisation; -#X obj 594 200 color 1 0 0; -#X text 675 202 only red channel is used; -#X text 563 624 copy the curent texture in an other buffer and render if the next frame \, to keep the previous frame in order to do smooth transition between 2 frames; -#X obj 703 286 vradio 20 1 0 4 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0; -#X text 737 282 you can change here to put what you want to convert to sound, f 25; +#X restore 40 390 pd visualisation; +#X obj 594 215 color 1 0 0; +#X text 675 217 only red channel is used; +#X obj 703 301 vradio 20 1 0 4 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0; #N canvas 1252 195 496 590 img 0; #X obj 35 38 inlet; #X obj 105 271 line; @@ -182,11 +174,11 @@ #X connect 8 0 7 0; #X connect 9 0 1 0; #X connect 10 0 6 0; -#X restore 594 286 pd img; +#X restore 594 301 pd img; #X f 17; -#X obj 594 228 translateXYZ 0 0 -4; +#X obj 594 243 translateXYZ 0 0 -4; #X obj 40 30 inlet; -#X obj 63 84 s pd; +#X obj 63 88 s pd; #N canvas 346 93 673 762 shader 0; #X obj 78 339 glsl_vertex; #X msg 32 338 print; @@ -260,110 +252,122 @@ #X connect 31 0 26 0; #X restore 274 223 pd shader; #X obj 284 198 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X obj 567 86 gemframebuffer \; dimen 4096 2 \; rectangle 1 \; texunit 0; -#X obj 274 83 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; type FLOAT; +#X obj 274 63 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; type FLOAT; #X obj 301 458 pix_snap 0 0 4096 1 \; type FLOAT; #X msg 123 197 render; #X obj 40 245 gemwin \; color 0.3 0.3 0.3; #X msg 69 165 create; -#X msg 40 137 destroy; -#X msg 63 59 dsp \$1; -#X connect 1 0 64 0; -#X connect 1 1 63 0; +#X msg 40 141 destroy; +#X msg 63 63 dsp \$1; +#X obj 318 591 hip~ 5; +#X obj 705 537 pix_texture \; quality 0; +#X obj 705 427 gemhead 30; +#X obj 274 36 gemhead 20; +#X text 563 624 copy the current texture to another buffer and render in the next frame to keep the previous frame for smooth transitions between both frames; +#X text 270 663 only for visualisation; +#X text 737 297 change input to be converted to sound here, f 24; +#X obj 567 66 gemframebuffer \; dimen 4096 2 \; rectangle 1 \; texunit 0; +#X obj 705 451 gemframebuffer \; dimen 4096 1 \; rectangle 1; +#X connect 1 0 56 0; +#X connect 1 1 55 0; #X connect 2 0 1 0; -#X connect 3 0 61 0; -#X connect 5 0 4 0; -#X connect 5 0 39 0; +#X connect 3 0 53 0; +#X connect 5 0 35 0; +#X connect 5 0 58 0; #X connect 7 0 8 0; #X connect 8 0 5 0; -#X connect 9 0 56 0; +#X connect 9 0 49 0; #X connect 10 0 12 0; #X connect 11 1 7 0; -#X connect 12 0 39 0; -#X connect 12 0 60 0; -#X connect 12 1 60 0; -#X connect 13 0 56 1; +#X connect 12 0 35 0; +#X connect 12 0 52 0; +#X connect 12 1 52 0; +#X connect 13 0 49 1; #X connect 14 0 16 0; #X connect 16 0 14 1; #X connect 16 0 15 0; #X connect 16 0 13 0; #X connect 17 0 14 0; -#X connect 20 0 58 0; +#X connect 20 0 65 0; #X connect 21 0 10 0; #X connect 22 0 21 1; -#X connect 23 0 59 0; -#X connect 24 0 14 0; -#X connect 26 0 25 0; -#X connect 28 0 33 0; -#X connect 29 0 28 1; -#X connect 30 0 32 0; -#X connect 31 0 62 0; -#X connect 32 0 28 0; -#X connect 32 1 34 1; -#X connect 33 0 27 0; -#X connect 34 0 26 0; -#X connect 35 0 38 0; -#X connect 35 1 37 0; -#X connect 36 0 34 0; -#X connect 37 0 47 0; -#X connect 38 0 36 0; -#X connect 43 0 52 0; -#X connect 43 1 45 0; -#X connect 43 2 42 0; -#X connect 43 3 44 0; -#X connect 47 0 53 0; -#X connect 50 0 43 1; -#X connect 53 0 43 0; -#X connect 54 0 65 0; -#X connect 54 0 2 0; -#X connect 56 0 21 0; -#X connect 56 1 17 0; -#X connect 57 0 56 0; -#X connect 58 0 35 0; -#X connect 58 1 19 0; -#X connect 59 0 9 0; -#X connect 59 1 18 0; -#X connect 60 0 11 0; -#X connect 61 0 62 0; -#X connect 63 0 62 0; -#X connect 64 0 62 0; -#X connect 65 0 55 0; +#X connect 23 0 14 0; +#X connect 25 0 24 0; +#X connect 27 0 59 1; +#X connect 28 0 54 0; +#X connect 29 0 26 0; +#X connect 30 0 25 0; +#X connect 31 0 34 0; +#X connect 31 1 33 0; +#X connect 32 0 30 0; +#X connect 33 0 42 0; +#X connect 34 0 32 0; +#X connect 38 0 45 0; +#X connect 38 1 40 0; +#X connect 38 2 37 0; +#X connect 38 3 39 0; +#X connect 42 0 46 0; +#X connect 44 0 38 1; +#X connect 46 0 38 0; +#X connect 47 0 57 0; +#X connect 47 0 2 0; +#X connect 49 0 21 0; +#X connect 49 1 17 0; +#X connect 50 0 49 0; +#X connect 51 0 9 0; +#X connect 51 1 18 0; +#X connect 52 0 11 0; +#X connect 53 0 54 0; +#X connect 55 0 54 0; +#X connect 56 0 54 0; +#X connect 57 0 48 0; +#X connect 58 0 4 0; +#X connect 59 0 29 0; +#X connect 60 0 66 0; +#X connect 61 0 51 0; +#X connect 65 0 31 0; +#X connect 65 1 19 0; +#X connect 66 0 59 0; +#X connect 66 1 30 1; #X restore 26 45 pd audio_GPU; -#X text 80 67 This patch use an image buffer to control the amplitude of 200 audio oscillators. Everything is computed inside the GPU.; -#X text 81 115 Rendering must be sync to audio dsp \, and large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticable!; #X obj 26 14 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X text 51 15 <- start; -#X text 85 165 Pd sould be configured at 48KHz; -#X obj 26 252 hip~ 5; #X obj 26 327 *~; -#X obj 87 229 hsl 153 18 0 127 0 1 empty empty empty -2 -9 0 10 #fcfcfc #000000 #000000 12000 1; +#X obj 87 229 hsl 153 18 0 127 0 1 empty empty empty -2 -9 0 10 #fcfcfc #000000 #000000 13500 1; #X obj 84 252 dbtorms; #X obj 84 275 pack 0 50; #X obj 84 298 line~; -#N canvas 2 90 450 300 no_pop 0; +#N canvas 303 641 450 300 no_pop 0; #X obj 41 24 inlet~; -#X obj 42 191 outlet~; +#X obj 42 231 outlet~; #X msg 130 53 clear; #X obj 143 77 sig~ 1; -#X obj 42 160 *~; +#X obj 42 200 *~; #X obj 130 27 inlet; #X obj 130 104 lop~ 0.5; +#X obj 131 131 *~; +#X obj 131 165 *~; #X connect 0 0 4 0; #X connect 2 0 6 0; #X connect 3 0 6 0; #X connect 4 0 1 0; #X connect 5 0 2 0; -#X connect 6 0 4 1; +#X connect 6 0 7 0; +#X connect 6 0 7 1; +#X connect 7 0 8 0; +#X connect 7 0 8 1; +#X connect 8 0 4 1; #X restore 25 190 pd no_pop; -#X connect 1 0 8 0; -#X connect 2 0 14 0; -#X connect 5 0 2 0; -#X connect 5 0 14 1; -#X connect 8 0 9 0; -#X connect 9 0 0 0; -#X connect 9 0 0 1; -#X connect 10 0 11 0; -#X connect 11 0 12 0; -#X connect 12 0 13 0; -#X connect 13 0 9 1; -#X connect 14 0 1 0; +#X text 86 167 Pd samplerate should be set to 48KHz; +#X text 86 117 Rendering must be synced to audio dsp and a large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticable!; +#X text 85 69 This patch uses an image buffer to control the amplitude of 200 audio oscillators. Everything is computed inside the GPU.; +#X connect 1 0 9 0; +#X connect 2 0 1 0; +#X connect 2 0 9 1; +#X connect 4 0 0 0; +#X connect 4 0 0 1; +#X connect 5 0 6 0; +#X connect 6 0 7 0; +#X connect 7 0 8 0; +#X connect 8 0 4 1; +#X connect 9 0 4 0; From e0504ea898d15e33d130518310281db40bbeb5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 26 Sep 2024 15:17:47 +0200 Subject: [PATCH 207/387] monochrome image --- examples/10.glsl/shader/additive.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/10.glsl/shader/additive.frag b/examples/10.glsl/shader/additive.frag index 111a2425f..4af810314 100644 --- a/examples/10.glsl/shader/additive.frag +++ b/examples/10.glsl/shader/additive.frag @@ -56,6 +56,6 @@ void main (void) //float b = floor(b_float*255.)/255.; // crop to 8 bits so the 24th bit is correct. it's maybe overkill... // Float output - gl_FragColor = vec4(outcolor, 0. , 0., 1.0); + gl_FragColor = vec4(outcolor, outcolor, outcolor, 1.0); } From c095cba90158e26e8ede765b8cee60fcc754413e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 26 Sep 2024 15:19:11 +0200 Subject: [PATCH 208/387] spelling --- examples/10.glsl/18.additive_audio_synthesis.pd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index c7dac8bc3..81bbd0c98 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -359,7 +359,7 @@ #X connect 8 0 4 1; #X restore 25 190 pd no_pop; #X text 86 167 Pd samplerate should be set to 48KHz; -#X text 86 117 Rendering must be synced to audio dsp and a large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticable!; +#X text 86 117 Rendering must be synced to audio dsp and a large buffer should be used \, so we need to clock everything with a block~ 4096 Latency is highly noticeable!; #X text 85 69 This patch uses an image buffer to control the amplitude of 200 audio oscillators. Everything is computed inside the GPU.; #X connect 1 0 9 0; #X connect 2 0 1 0; From 59e828732b248b3bcfbc71435809f1f9037717fe Mon Sep 17 00:00:00 2001 From: Antoine Villeret Date: Fri, 25 Oct 2024 18:02:03 +0200 Subject: [PATCH 209/387] install missing Atom.h --- src/RTE/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RTE/Makefile.am b/src/RTE/Makefile.am index 2a7e36112..13e88a994 100644 --- a/src/RTE/Makefile.am +++ b/src/RTE/Makefile.am @@ -23,6 +23,7 @@ libRTE_la_includedir = $(includedir)/Gem/RTE libRTE_la_include_HEADERS = \ RTE.h \ Array.h \ + Atom.h \ MessageCallbacks.h From 92c8e8cdadab7398aa6110a37db8d80f8566d402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 7 Nov 2024 16:24:35 +0100 Subject: [PATCH 210/387] glx: only set the flags once (they are the same for fullscreen and w/o border --- src/Output/gemglxwindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index f2a10b70f..1eb41bbaf 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -533,19 +533,17 @@ struct gemglxwindow::PIMPL { XFree(modes); swa.override_redirect = True; - flags=CWBorderPixel|CWColormap|CWEventMask|CWOverrideRedirect; } else #endif { // !fullscren if (border) { swa.override_redirect = False; - flags=CWBorderPixel|CWColormap|CWEventMask|CWOverrideRedirect; } else { swa.override_redirect = True; - flags=CWBorderPixel|CWColormap|CWEventMask|CWOverrideRedirect; } } + flags=CWBorderPixel|CWColormap|CWEventMask|CWOverrideRedirect; fs = fullscreen; win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), x, y, w, h, From 2bdf8523eb86d358997b0559757c1a9b2cde8bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 7 Nov 2024 16:24:48 +0100 Subject: [PATCH 211/387] set default override_redirect --- src/Output/gemglxwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index 1eb41bbaf..15e0a858d 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -513,6 +513,7 @@ struct gemglxwindow::PIMPL { swa.border_pixel = 0; // event_mask creates signal that window has been created swa.event_mask = EVENT_MASK; + swa.override_redirect = False; int flags; #ifdef HAVE_LIBXXF86VM From c817127511340090168fb741957aa73bafa0c704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 7 Nov 2024 16:25:30 +0100 Subject: [PATCH 212/387] glx: grab the keyboard when in fs Closes: https://github.com/umlaeute/Gem/issues/454 --- src/Output/gemglxwindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index 15e0a858d..bb8f0562a 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -713,6 +713,10 @@ void gemglxwindow::dispatch(void) XKeyEvent* kb = (XKeyEvent*)&event; unsigned long devID=0; + if(m_pimpl->fs) + XGrabKeyboard(m_pimpl->dpy, m_pimpl->win, True, GrabModeAsync, GrabModeAsync, CurrentTime); + + while (XCheckWindowEvent(m_pimpl->dpy,m_pimpl->win, StructureNotifyMask | KeyPressMask | KeyReleaseMask | From 1912301a0c20835069c41554543562eeba559623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 30 Nov 2024 15:02:41 +0100 Subject: [PATCH 213/387] [pix_dump] specify channels for RGB-output --- src/Pixes/pix_dump.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Pixes/pix_dump.cpp b/src/Pixes/pix_dump.cpp index 1ce9a8c4b..60cc32336 100644 --- a/src/Pixes/pix_dump.cpp +++ b/src/Pixes/pix_dump.cpp @@ -108,6 +108,23 @@ namespace { } template static inline + size_t data3_to_atoms(t_atom*dest, const T*src, size_t n, t_float scale, const int channels[3]) { + size_t count = 0; + while(n--) { + for(size_t i=0; i<3; i++) { + int ch = channels[i]; + //if(ch<0)continue; + t_float v = static_cast(src[channels[ch]]) * scale; + SETFLOAT(dest, v); + dest++; + count++; + } + src+=3; + } + return count; + } + template + static inline size_t data_to_atoms(t_atom*dest, const T*src, size_t N, t_float scale) { size_t count = 0; for(size_t n=0; n width || (y0 > height)) return 0; @@ -156,10 +174,9 @@ namespace { } break; case GEM_RGB: - /* TODO: honor chRed,chGreen/chBlue */ for(size_t r=y0; r Date: Sat, 30 Nov 2024 15:21:53 +0100 Subject: [PATCH 214/387] pix_dump: fix double indirection when getting color channels Closes: https://github.com/umlaeute/Gem/issues/456 --- src/Pixes/pix_dump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pixes/pix_dump.cpp b/src/Pixes/pix_dump.cpp index 60cc32336..5a153e342 100644 --- a/src/Pixes/pix_dump.cpp +++ b/src/Pixes/pix_dump.cpp @@ -97,7 +97,7 @@ namespace { for(size_t i=0; i<4; i++) { int ch = channels[i]; if(ch<0)continue; - t_float v = static_cast(src[channels[ch]]) * scale; + t_float v = static_cast(src[ch]) * scale; SETFLOAT(dest, v); dest++; count++; @@ -114,7 +114,7 @@ namespace { for(size_t i=0; i<3; i++) { int ch = channels[i]; //if(ch<0)continue; - t_float v = static_cast(src[channels[ch]]) * scale; + t_float v = static_cast(src[ch]) * scale; SETFLOAT(dest, v); dest++; count++; From d7dda0c53deea504e0e52295cc5cd1c161317e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 30 Nov 2024 15:32:26 +0100 Subject: [PATCH 215/387] Install git on Linux builders to get a nice build-string --- .git-ci/gitlab-iem.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 9eaac2595..b81257d51 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -131,6 +131,7 @@ stages: - apt-get update - apt-get install ${TARGETDEBARCH:+-a}${TARGETDEBARCH} puredata-dev puredata-core - apt-get build-dep ${TARGETDEBARCH:+-a}${TARGETDEBARCH} gem || true + - apt-get install git - g++ -v .build:macos: From 2662e0e540b265d64dedd1f5073b174303bb6bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 30 Nov 2024 15:46:29 +0100 Subject: [PATCH 216/387] set SOURCE_DATE_EPOCH from CI_COMMIT_TIMESTAMP --- .git-ci/gitlab-iem.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index b81257d51..918093f15 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -74,6 +74,9 @@ stages: localdeps: ".git-ci/iem-ci/localdeps/localdeps" script: - *script_zsh_compat + # set SOURCE_DATE_EPOCH for reproducible builds + - export SOURCE_DATE_EPOCH="$(date --date="${CI_COMMIT_TIMESTAMP}" +%s 2>/dev/null || date -j -f %Y-%m-%dT%H:%M:%SZ "${CI_COMMIT_TIMESTAMP}" +%s || echo ${SOURCE_DATE_EPOCH})" + - echo "${CI_COMMIT_TIMESTAMP} -> ${SOURCE_DATE_EPOCH}" # handle Pd64 jobs - if test "${OS}" = "Windows_NT"; then defaultext="dll"; else defaultext="so"; fi # - gnutriplet="$(g++ -dumpmachine)" From f8e5e89ada9cebe88de2845553f3db4e037f0bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 30 Nov 2024 16:09:04 +0100 Subject: [PATCH 217/387] [ci] workaround macOS date quirks for parsing ISO-8601 --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 918093f15..f07308c76 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -75,7 +75,7 @@ stages: script: - *script_zsh_compat # set SOURCE_DATE_EPOCH for reproducible builds - - export SOURCE_DATE_EPOCH="$(date --date="${CI_COMMIT_TIMESTAMP}" +%s 2>/dev/null || date -j -f %Y-%m-%dT%H:%M:%SZ "${CI_COMMIT_TIMESTAMP}" +%s || echo ${SOURCE_DATE_EPOCH})" + - export SOURCE_DATE_EPOCH="$(date --date="${CI_COMMIT_TIMESTAMP}" +%s 2>/dev/null || date -j -f %Y-%m-%dT%H:%M:%SZ "$(echo ${CI_COMMIT_TIMESTAMP} | sed -e 's|\([+-][0-9][0-9]\):\([0-9][0-9]\)$|\1\2|')" +%s || echo ${SOURCE_DATE_EPOCH})" - echo "${CI_COMMIT_TIMESTAMP} -> ${SOURCE_DATE_EPOCH}" # handle Pd64 jobs - if test "${OS}" = "Windows_NT"; then defaultext="dll"; else defaultext="so"; fi From b0e8c26919ae57fb45d788a3e02c9ce8d494f980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 30 Nov 2024 16:33:17 +0100 Subject: [PATCH 218/387] [ci] yet another macOS date parsing fix --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index f07308c76..1d0f2ef00 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -75,7 +75,7 @@ stages: script: - *script_zsh_compat # set SOURCE_DATE_EPOCH for reproducible builds - - export SOURCE_DATE_EPOCH="$(date --date="${CI_COMMIT_TIMESTAMP}" +%s 2>/dev/null || date -j -f %Y-%m-%dT%H:%M:%SZ "$(echo ${CI_COMMIT_TIMESTAMP} | sed -e 's|\([+-][0-9][0-9]\):\([0-9][0-9]\)$|\1\2|')" +%s || echo ${SOURCE_DATE_EPOCH})" + - export SOURCE_DATE_EPOCH="$(date --date="${CI_COMMIT_TIMESTAMP}" +%s 2>/dev/null || date -j -f %Y-%m-%dT%H:%M:%S%z "$(echo ${CI_COMMIT_TIMESTAMP} | sed -e 's|\([+-][0-9][0-9]\):\([0-9][0-9]\)$|\1\2|')" +%s || echo ${SOURCE_DATE_EPOCH})" - echo "${CI_COMMIT_TIMESTAMP} -> ${SOURCE_DATE_EPOCH}" # handle Pd64 jobs - if test "${OS}" = "Windows_NT"; then defaultext="dll"; else defaultext="so"; fi From 2971c2b8c08ae2b88897d363695c17ddefe8a184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 28 Dec 2024 22:04:08 +0100 Subject: [PATCH 219/387] add "--tag=CXX" to libtoolflags for ObjC++-plugins Closes: https://github.com/umlaeute/Gem/issues/431 --- plugins/filmAVF/Makefile.am | 1 + plugins/imageIO/Makefile.am | 1 + plugins/videoAVF/Makefile.am | 1 + 3 files changed, 3 insertions(+) diff --git a/plugins/filmAVF/Makefile.am b/plugins/filmAVF/Makefile.am index 543bfdfec..3a5b24bcd 100644 --- a/plugins/filmAVF/Makefile.am +++ b/plugins/filmAVF/Makefile.am @@ -1,6 +1,7 @@ ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4 AM_CPPFLAGS = -I$(top_srcdir)/src $(GEM_EXTERNAL_CPPFLAGS) +AM_LIBTOOLFLAGS = --tag=CXX EXTRA_DIST = diff --git a/plugins/imageIO/Makefile.am b/plugins/imageIO/Makefile.am index 0397caab0..f555dfd81 100644 --- a/plugins/imageIO/Makefile.am +++ b/plugins/imageIO/Makefile.am @@ -1,6 +1,7 @@ ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4 AM_CPPFLAGS = -I$(top_srcdir)/src $(GEM_EXTERNAL_CPPFLAGS) +AM_LIBTOOLFLAGS = --tag=CXX EXTRA_DIST = diff --git a/plugins/videoAVF/Makefile.am b/plugins/videoAVF/Makefile.am index 17da97486..eaca79279 100644 --- a/plugins/videoAVF/Makefile.am +++ b/plugins/videoAVF/Makefile.am @@ -1,6 +1,7 @@ ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4 AM_CPPFLAGS = -I$(top_srcdir)/src $(GEM_EXTERNAL_CPPFLAGS) +AM_LIBTOOLFLAGS = --tag=CXX EXTRA_DIST = From 5a0003666e4794e76f2334f7383656cb2d7fd2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sun, 5 Jan 2025 21:53:56 +0100 Subject: [PATCH 220/387] add "--tag=CXX" to libtoolflags for ObjC++ Output objects as well Closes: https://github.com/umlaeute/Gem/issues/431 LATER: check if the ugly hacks in src/Output/Makefile.am:L116-138 are still needed --- src/Output/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Output/Makefile.am b/src/Output/Makefile.am index 7bec18482..bef9742fb 100644 --- a/src/Output/Makefile.am +++ b/src/Output/Makefile.am @@ -5,6 +5,7 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4 AM_CPPFLAGS = -I$(top_srcdir)/src +AM_LIBTOOLFLAGS = --tag=CXX include ../check-sources.mk pkglib_LTLIBRARIES = From d71198ebff6f5e5cc85af384308468a6c997b54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 4 Feb 2025 15:06:05 +0100 Subject: [PATCH 221/387] [pix_record] has a "file" message, not a "filename" message --- plugins/NDI/NDI-recordplugin.pd | 4 ++-- plugins/V4L2/v4l2-recordplugin.pd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/NDI/NDI-recordplugin.pd b/plugins/NDI/NDI-recordplugin.pd index d91afebb5..08f5ab3fd 100644 --- a/plugins/NDI/NDI-recordplugin.pd +++ b/plugins/NDI/NDI-recordplugin.pd @@ -5,11 +5,11 @@ #X text 89 47 recordNDI - send NDI video streams; #X text 89 57 ==================================; #X msg 261 102 codec ndi; -#X msg 261 162 filename TestStream; +#X msg 261 162 file TestStream; #X msg 261 212 record 1; #X text 75 161 2- name the NDI-stream; #X text 75 211 3- start sending out stream; -#X msg 260 362 filename Waiting\ Man; +#X msg 260 362 file Waiting\ Man; #X text 74 332 If your streamname should contain spaces \, escape them with backspace., f 74; #X connect 5 0 1 0; #X connect 6 0 1 0; diff --git a/plugins/V4L2/v4l2-recordplugin.pd b/plugins/V4L2/v4l2-recordplugin.pd index 0a6c8ea88..e12994c61 100644 --- a/plugins/V4L2/v4l2-recordplugin.pd +++ b/plugins/V4L2/v4l2-recordplugin.pd @@ -6,7 +6,7 @@ #X text 89 47 recordV4L2 - output pixes with the video4linux2 framework; #X text 89 57 =========================================================; #X msg 261 102 codec v4l2; -#X msg 261 162 filename /dev/video1; +#X msg 261 162 file /dev/video1; #X text 75 161 2- select a V4L2 output device; #X msg 135 369 https://github.com/umlaeute/v4l2loopback; #N canvas 0 0 204 175 URL 0; From ee61c5bdad86143088f9a7c847676736603510c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 4 Feb 2025 15:06:37 +0100 Subject: [PATCH 222/387] pix_record-help: connect the actual object! --- help/pix_record-help.pd | 51 +++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/help/pix_record-help.pd b/help/pix_record-help.pd index 6a40d106c..cadce6851 100644 --- a/help/pix_record-help.pd +++ b/help/pix_record-help.pd @@ -7,12 +7,12 @@ #X obj 449 53 cnv 15 170 410 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X text 453 36 Example:; #X obj 479 419 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X obj 451 166 cnv 15 167 230 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 451 166 cnv 15 167 250 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 451 59 gemhead; #X text 64 425 ; #X text 50 12 Synopsis: [pix_record]; #X text 71 31 Class: pix object (output); -#X obj 451 375 pix_record; +#X obj 451 363 pix_record; #X text 18 114 You can choose the codec you want to use either via a graphical dialog or by directly sending a "codec" with either the name or the enumeration number of the codec. Use "codeclist" to query the available codecs \, their names and their number., f 69; #X obj 470 315 cnv 15 145 25 empty empty empty 20 12 0 14 #d8fcd8 #404040 0; #X msg 480 319 bang; @@ -21,7 +21,6 @@ #X obj 470 171 cnv 15 145 65 empty empty empty 20 12 0 14 #d8fcd8 #404040 0; #X msg 476 196 codeclist; #X msg 472 175 dialog; -#X obj 472 216 t a; #X obj 460 243 cnv 15 155 65 empty empty empty 20 12 0 14 #d8fcd8 #404040 0; #X msg 463 264 file /tmp/mymovie.mov; #X obj 464 245 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fc2828 #000000 #000000; @@ -37,9 +36,8 @@ #X connect 3 0 4 0; #X connect 4 0 2 0; #X restore 484 244 pd savepanel; -#X msg 520 287 record \$1; -#X obj 500 289 tgl 15 0 empty \$0-record empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#X obj 463 287 t a; +#X msg 540 287 record \$1; +#X obj 520 289 tgl 15 0 empty \$0-record empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X text 18 174 When file and codec are specified \, you can open the writing connection with the message "record 1"., f 69; #X text 18 212 To actually do record a frame into the file \, send the object a "bang" message. If you want to record a consecutive number of frames \, use the "auto" message. This allows you to have full control on which frames are to be recorded., f 69; #X text 525 125 (monitoring); @@ -62,7 +60,7 @@ #X text 18 233 Inlet 1: set : set a property named to the value . properties are persistent across codec-changes. properties unknown to the currently selected coded are ignored.; #X text 18 123 Inlet 1: dialog: popup a dialog to select the codec (if available); #X restore 83 460 pd MESSAGES; -#X floatatom 527 377 3 0 0 0 - - - 0; +#X floatatom 479 387 3 0 0 0 - - - 0; #X msg 532 216 codec mjpa; #X msg 552 197 codec 3; #N canvas 129 512 599 344 PROPERTIES 0; @@ -351,9 +349,7 @@ #X connect 11 0 10 0; #X connect 12 0 10 0; #X restore 243 460 pd PROPERTIES; -#X obj 553 358 r \$0-ctl; -#X obj 621 233 s \$0-ctl; -#X obj 620 304 s \$0-ctl; +#X obj 553 345 r \$0-ctl; #N canvas 6 49 515 369 print 0; #X obj 102 176 inlet; #X obj 102 198 s \$0-info; @@ -372,7 +368,7 @@ #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 10 0; -#X restore 553 375 pd print; +#X restore 508 386 pd print; #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; #X text 10 45 DESCRIPTION output sequences of pixes; @@ -393,22 +389,23 @@ #X obj 451 140 _pix2rectangle 3; #X text 515 72 (some input); #X obj 484 425 _gemwin; -#X connect 8 0 48 0; -#X connect 12 1 34 0; -#X connect 12 2 41 0; +#X obj 472 216 s \$0-ctl; +#X obj 463 287 s \$0-ctl; +#X connect 8 0 44 0; +#X connect 12 1 32 0; +#X connect 12 2 37 0; #X connect 15 0 12 0; #X connect 16 0 12 0; #X connect 17 0 16 0; -#X connect 19 0 21 0; -#X connect 20 0 21 0; -#X connect 21 0 39 0; -#X connect 23 0 28 0; -#X connect 24 0 25 0; -#X connect 25 0 23 0; -#X connect 26 0 28 0; -#X connect 27 0 26 0; -#X connect 28 0 40 0; -#X connect 35 0 21 0; -#X connect 36 0 21 0; -#X connect 38 0 12 0; -#X connect 48 0 49 0; +#X connect 19 0 48 0; +#X connect 20 0 48 0; +#X connect 22 0 49 0; +#X connect 23 0 24 0; +#X connect 24 0 22 0; +#X connect 25 0 49 0; +#X connect 26 0 25 0; +#X connect 33 0 48 0; +#X connect 34 0 48 0; +#X connect 36 0 12 0; +#X connect 44 0 45 0; +#X connect 45 0 12 0; From b74268d40ca8afe552f4baa0d528b1540bca5055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 11 Feb 2025 10:35:57 +0100 Subject: [PATCH 223/387] m4: new style quotes --- m4/gem.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/gem.m4 b/m4/gem.m4 index 0c7ca1a48..f12c2c3ee 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -260,7 +260,7 @@ dnl PKG_CHECK_MODULES(AS_TR_CPP(PKG_$1), $1,AS_VAR_SET(acLib)yes, AC_CHECK_LIB( AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$2),[1], [$8]) ]) AS_IF([ test "x$4" != "x" ], [ - AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$4),[1], [Define to 1 if you have the `$4' function.]) + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$4),[1], [Define to 1 if you have the '$4' function.]) ]) GEM_LIB_[]NAME[]_CFLAGS=${PKG_[]NAME[]_CFLAGS} GEM_LIB_[]NAME[]_LIBS=${PKG_[]NAME[]_LIBS} From ab5bbc6c404ecb90dfef911cc13daf3645e88ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 11 Feb 2025 10:27:45 +0100 Subject: [PATCH 224/387] IEM_CHECK_FUNCS helper --- m4/iem.m4 | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/m4/iem.m4 b/m4/iem.m4 index 66289745b..b63916369 100644 --- a/m4/iem.m4 +++ b/m4/iem.m4 @@ -33,7 +33,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 15 +#serial 16 @@ -69,3 +69,32 @@ AC_DEFUN([IEM_CHECK_INCLUDES_DEFAULT], [ [#]endif" done ]) + +# +# SYNOPSIS +# +# IEM_CHECK_FUNCS(function..., [action-if-found], [action-if-not-found], [additional-cflags], [additional-libs]) +# +# DESCRIPTION +# +# check for functions +# +# For each function enumerated in the blank-or-newline-separated argument list, +# define HAVE_function (in all capitals) if it is available. +# if additional-cflags is given, it is temporarily appended to the CFLAGS. +# if additional-libs is given, it is temporarily appended to the LIBS +# +# Example: +# +# IEM_CHECK_FUNCS([foo bar], [], [], [-DHAVE_FOO=1], [-lfoo]) +# +AC_DEFUN([IEM_CHECK_FUNCS], [ + tmp_iemcheckfuncs_cflags="$CFLAGS" + tmp_iemcheckfuncs_libs="$LIBS" + CFLAGS="$CFLAGS $4" + LIBS="$LIBS $5" + AC_CHECK_FUNCS([$1], [$2], [$3]) + + CFLAGS="${tmp_iemcheckfuncs_cflags}" + LIBS="${tmp_iemcheckfuncs_libs}" +]) From be5eaa9a9a59faa94cc3f0e164b770a10c0697cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 11 Feb 2025 10:28:02 +0100 Subject: [PATCH 225/387] use IEM_CHECK_FUNCS to check for additional lqt functions --- configure.ac | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index aba915742..2bd34dbbb 100644 --- a/configure.ac +++ b/configure.ac @@ -422,15 +422,10 @@ AC_SUBST([GEM_LIB_FFMPEG_LIBS]) AM_CONDITIONAL(HAVE_FFMPEG, [test "x${have_ffmpeg}" = "xyes"]) # special function in libquicktime -old_cflags=${CFLAGS} -old_libs=${LIBS} -CFLAGS="${CFLAGS} $GEM_LIB_LIBQUICKTIME_CFLAGS $GEM_LIB_LQT_CFLAGS" -LIBS="${LIBS} $GEM_LIB_LIBQUICKTIME_LIBS $GEM_LIB_LQT_LIBS" -AC_CHECK_FUNCS([lqt_seek_video]) -AC_CHECK_FUNCS([lqt_open_write]) -CFLAGS=${old_cflags} -LIBS=${old_libs} - +IEM_CHECK_FUNCS([lqt_seek_video lqt_open_write],[],[], + [$GEM_LIB_LIBQUICKTIME_CFLAGS $GEM_LIB_LQT_CFLAGS], + [$GEM_LIB_LIBQUICKTIME_LIBS $GEM_LIB_LQT_LIBS] + ) #video GEM_CHECK_LIB([libdc1394-2], [dc1394],[dc1394/dc1394.h], [dc1394_new],,,, [video input]) GEM_CHECK_LIB([libdv], [dv],[libdv/dv.h], [dv_cleanup],,,, [video input]) From 0265a8bb62e37c7f63e3b014b47668633eb59dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 11 Feb 2025 10:36:42 +0100 Subject: [PATCH 226/387] check for new gmerlin-avdecoder functions --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 2bd34dbbb..bc598688a 100644 --- a/configure.ac +++ b/configure.ac @@ -398,6 +398,10 @@ GEM_CHECK_LIB([avifile], [aviplay],[avifile.h], [CreateIAviReadFile],,,,[movie l GEM_CHECK_LIB([gmerlin_avdec], [gmerlin_avdec],[gmerlin/avdec.h], [gavl_start],,,,[movie loader]) AS_IF([test "x$have_gmerlin_avdec" = "xyes"], [ AC_CHECK_HEADERS([gavl/log.h]) + IEM_CHECK_FUNCS([bgav_seek_to_video_frame bgav_num_video_frames],[],[], + [$GEM_LIB_GMERLIN_AVDEC_CFLAGS], + [$GEM_LIB_GMERLIN_AVDEC_LIBS], + ) ]) GEM_CHECK_LIB([mpeg], [mpeg],[mpeg.h], [OpenMPEG],,,,[movie loader]) GEM_CHECK_LIB([libmpeg3], [mpeg3],[libmpeg3.h], [mpeg3_check_sig],,,,[movie loader]) From 601c665cec6ceb3f83df20173edbad49f4370bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 11 Feb 2025 12:28:32 +0100 Subject: [PATCH 227/387] filemGMERLIN: use #if USE_FRAMETABLE rather than #ifdef --- plugins/GMERLIN/filmGMERLIN.cpp | 11 ++++++----- plugins/GMERLIN/filmGMERLIN.h | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/GMERLIN/filmGMERLIN.cpp b/plugins/GMERLIN/filmGMERLIN.cpp index b415df4d7..73b9eb7b7 100644 --- a/plugins/GMERLIN/filmGMERLIN.cpp +++ b/plugins/GMERLIN/filmGMERLIN.cpp @@ -66,7 +66,7 @@ filmGMERLIN :: filmGMERLIN(void) : m_gconverter(NULL), m_fps(0.), m_fps_num(1), m_fps_denum(1), m_next_timestamp(0), -#ifdef USE_FRAMETABLE +#if USE_FRAMETABLE m_frametable(NULL), #endif m_doConvert(false) @@ -93,7 +93,7 @@ void filmGMERLIN :: close(void) bgav_close(m_file); } m_file=NULL; -#ifdef USE_FRAMETABLE +#if USE_FRAMETABLE if(m_frametable) { gavl_frame_table_destroy(m_frametable); } @@ -312,7 +312,8 @@ bool filmGMERLIN :: open(const std::string&sfilename, m_fps_denum=gformat->frame_duration; m_numFrames=-1; -#ifdef USE_FRAMETABLE + +#if USE_FRAMETABLE m_frametable=bgav_get_frame_table(m_file, m_track); if(m_frametable) { m_numFrames=gavl_frame_table_num_frames (m_frametable); @@ -381,7 +382,7 @@ film::errCode filmGMERLIN :: changeImage(int imgNum, int trackNum) numvstreams); if(numvstreams) { bgav_select_track(m_file, m_track); -#ifdef USE_FRAMETABLE +#if USE_FRAMETABLE if(m_frametable) { gavl_frame_table_destroy(m_frametable); m_frametable=bgav_get_frame_table(m_file, m_track); @@ -400,7 +401,7 @@ film::errCode filmGMERLIN :: changeImage(int imgNum, int trackNum) if(bgav_can_seek(m_file)) { if(0) { -#ifdef USE_FRAMETABLE +#if USE_FRAMETABLE } else if(m_frametable) { // no assumptions about fixed framerate int64_t seekpos = gavl_frame_table_frame_to_time(m_frametable, imgNum, diff --git a/plugins/GMERLIN/filmGMERLIN.h b/plugins/GMERLIN/filmGMERLIN.h index 92f08c457..5a5a3464e 100644 --- a/plugins/GMERLIN/filmGMERLIN.h +++ b/plugins/GMERLIN/filmGMERLIN.h @@ -25,9 +25,9 @@ extern "C" { # include # if BGAV_BUILD >= BGAV_MAKE_BUILD(1,0,2) -# define USE_FRAMETABLE +# define USE_FRAMETABLE 1 # else -# undef USE_FRAMETABLE +# define USE_FRAMETABLE 0 # endif # ifdef HAVE_GAVL_LOG_H From 4794dd886650b1fb7426e8210e9c80d2d08f5fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 11 Feb 2025 12:29:18 +0100 Subject: [PATCH 228/387] filmGMERLIN: use bgav_seek_to_video_frame() where supported --- plugins/GMERLIN/filmGMERLIN.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/GMERLIN/filmGMERLIN.cpp b/plugins/GMERLIN/filmGMERLIN.cpp index 73b9eb7b7..44a292d0b 100644 --- a/plugins/GMERLIN/filmGMERLIN.cpp +++ b/plugins/GMERLIN/filmGMERLIN.cpp @@ -401,7 +401,11 @@ film::errCode filmGMERLIN :: changeImage(int imgNum, int trackNum) if(bgav_can_seek(m_file)) { if(0) { -#if USE_FRAMETABLE +#if HAVE_BGAV_SEEK_TO_VIDEO_FRAME + } else if (1) { + bgav_seek_to_video_frame(m_file, m_track, imgNum); + return film::SUCCESS; +#elif USE_FRAMETABLE } else if(m_frametable) { // no assumptions about fixed framerate int64_t seekpos = gavl_frame_table_frame_to_time(m_frametable, imgNum, From 2fb418dbea60ec55680ee457c19358126d0d3740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 11 Feb 2025 12:29:50 +0100 Subject: [PATCH 229/387] filmGMERLIN: don't use frametables for newer gmerlin --- plugins/GMERLIN/filmGMERLIN.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GMERLIN/filmGMERLIN.h b/plugins/GMERLIN/filmGMERLIN.h index 5a5a3464e..3b7941205 100644 --- a/plugins/GMERLIN/filmGMERLIN.h +++ b/plugins/GMERLIN/filmGMERLIN.h @@ -24,7 +24,7 @@ extern "C" { # include # include -# if BGAV_BUILD >= BGAV_MAKE_BUILD(1,0,2) +# if BGAV_BUILD >= BGAV_MAKE_BUILD(1,0,2) && !HAVE_BGAV_SEEK_TO_VIDEO_FRAME # define USE_FRAMETABLE 1 # else # define USE_FRAMETABLE 0 From bbc61d7efc0f45de76338b459ddddad15dad33f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 12:39:01 +0100 Subject: [PATCH 230/387] unconditionally replace verbose() with logpost() --- plugins/ASSIMP2/modelASSIMP2.cpp | 2 +- plugins/ASSIMP3/modelASSIMP3.cpp | 2 +- plugins/AVI/filmAVI.cpp | 14 +- plugins/AVT/videoAVT.cpp | 12 +- plugins/DC1394/videoDC1394.cpp | 56 ++++---- plugins/DECKLINK/decklink_common.h | 4 +- plugins/DECKLINK/recordDECKLINK.cpp | 4 +- plugins/DECKLINK/videoDECKLINK.cpp | 4 +- plugins/DV4L/videoDV4L.cpp | 14 +- plugins/FFMPEG/filmFFMPEG.cpp | 22 ++-- plugins/GMERLIN/filmGMERLIN.cpp | 22 ++-- plugins/HALCON/videoHALCON.cpp | 24 ++-- plugins/MPEG3/filmMPEG3.cpp | 4 +- plugins/NDI/init_ndi_library.hh | 14 +- plugins/NDI/recordNDI.cpp | 2 +- plugins/NDI/videoNDI.cpp | 16 +-- plugins/OBJ/modelOBJ.cpp | 2 +- plugins/OBJ/model_loader.cpp | 172 ++++++++++++------------- plugins/PNM/recordPNM.cpp | 4 +- plugins/PYLON/videoPYLON.cpp | 20 +-- plugins/QT4L/filmQT4L.cpp | 4 +- plugins/QT4L/recordQT4L.cpp | 14 +- plugins/QuickTime/filmQT.cpp | 18 +-- plugins/QuickTime/imageQT.cpp | 34 ++--- plugins/QuickTime/recordQT.cpp | 42 +++--- plugins/TIFF/imageTIFF.cpp | 12 +- plugins/UNICAP/videoUNICAP.cpp | 12 +- plugins/V4L/videoV4L.cpp | 16 +-- plugins/V4L2/recordV4L2.cpp | 6 +- plugins/V4L2/videoV4L2.cpp | 44 +++---- plugins/VFW/videoVFW.cpp | 20 +-- plugins/VIDS/videoVIDS.cpp | 6 +- plugins/VLC/videoVLC.cpp | 8 +- plugins/filmDS/filmDS.cpp | 28 ++-- plugins/filmDSATL/filmDS.cpp | 40 +++--- plugins/filmDarwin/filmDarwin.cpp | 20 +-- plugins/imageMAGICK/MagickCore.cpp | 4 +- plugins/imageMAGICK/MagickPlusPlus.cpp | 12 +- plugins/videoAVF/AVFVideoGrabber.mm | 12 +- plugins/videoDS/videoDS.cpp | 48 +++---- plugins/videoDarwin/videoDarwin.cpp | 56 ++++---- plugins/videoSGI/videoSGI.cpp | 30 ++--- src/Base/CPPExtern.cpp | 30 +---- src/Gem/ImageLoad.cpp | 2 +- src/Gem/Manager.cpp | 2 +- src/Gem/PixConvert.cpp | 2 +- src/Gem/Settings.cpp | 4 +- src/Gem/Setup.cpp | 30 ++--- src/Gem/State.h | 2 +- src/Output/gemglfw3window.cpp | 6 +- src/Output/gemglxwindow.cpp | 10 +- src/Pixes/pix_film.cpp | 2 +- src/Pixes/pix_freeframe.cpp | 6 +- src/Pixes/pix_frei0r.cpp | 8 +- src/Utils/SIMD.cpp | 6 +- src/plugins/film.cpp | 10 +- src/plugins/imageloader.cpp | 8 +- src/plugins/imagesaver.cpp | 12 +- src/plugins/modelloader.cpp | 10 +- src/plugins/record.cpp | 10 +- src/plugins/video.cpp | 10 +- 61 files changed, 525 insertions(+), 545 deletions(-) diff --git a/plugins/ASSIMP2/modelASSIMP2.cpp b/plugins/ASSIMP2/modelASSIMP2.cpp index db147ade0..91e2429ca 100644 --- a/plugins/ASSIMP2/modelASSIMP2.cpp +++ b/plugins/ASSIMP2/modelASSIMP2.cpp @@ -401,7 +401,7 @@ void modelASSIMP2 :: setProperties(gem::Properties&props) #if 0 std::vectorkeys=props.keys(); for(unsigned int i=0; ibiSize = sizeof(BITMAPINFOHEADER); @@ -189,18 +189,18 @@ bool filmAVI :: open(const std::string&filename, if (!(m_hic = ICLocate(ICTYPE_VIDEO, 0, m_pbmihRaw, m_pbmihDst, ICMODE_DECOMPRESS))) { - verbose(0, "[GEM:filmAVI] Could not find decompressor: %s", + logpost(0, 3+0, "[GEM:filmAVI] Could not find decompressor: %s", filename.c_str()); goto unsupported; } if (m_format==GEM_GRAY) { if (ICERR_OK != ICDecompressSetPalette(m_hic, m_pbmihDst)) { - verbose(0, "[GEM:filmAVI] Could not set palette: %s", filename.c_str()); + logpost(0, 3+0, "[GEM:filmAVI] Could not set palette: %s", filename.c_str()); } } if (ICERR_OK != ICDecompressBegin(m_hic, m_pbmihRaw, m_pbmihDst)) { - verbose(0, "[GEM:filmAVI] Could not begin decompression: %s", + logpost(0, 3+0, "[GEM:filmAVI] Could not begin decompression: %s", filename.c_str()); goto unsupported; } diff --git a/plugins/AVT/videoAVT.cpp b/plugins/AVT/videoAVT.cpp index 3bea44227..90ea633f6 100644 --- a/plugins/AVT/videoAVT.cpp +++ b/plugins/AVT/videoAVT.cpp @@ -231,7 +231,7 @@ bool videoAVT :: openDevice(gem::Properties&props) tPvCameraInfo*cameraList=new tPvCameraInfo[cameraNum]; if(m_devicenum>=0) { - verbose(0, "[GEM:videoAVT] trying to open #%d of %d devices", m_devicenum, + logpost(0, 3+0, "[GEM:videoAVT] trying to open #%d of %d devices", m_devicenum, cameraNum); if(cameraNum>m_devicenum && (cameraList[m_devicenum].PermittedAccess == ePvAccessMaster)) { @@ -241,7 +241,7 @@ bool videoAVT :: openDevice(gem::Properties&props) } } } else { - verbose(0, "[GEM:videoAVT] trying to open device '%s'", + logpost(0, 3+0, "[GEM:videoAVT] trying to open device '%s'", m_devicename.c_str()); /* cameraList[i].SerialString, @@ -253,7 +253,7 @@ bool videoAVT :: openDevice(gem::Properties&props) const unsigned long uid=strtoul(m_devicename.c_str(), NULL, 0); if(NULL==m_grabber && 0==errno) { - verbose(1, "[GEM:videoAVT] checking UniqueID: 0x% 8x", uid); + logpost(0, 3+1, "[GEM:videoAVT] checking UniqueID: 0x% 8x", uid); for(unsigned long i=0; i>8, (IpAddr & 0x0FF0000)>>16, diff --git a/plugins/DC1394/videoDC1394.cpp b/plugins/DC1394/videoDC1394.cpp index 529e41be7..29dd61862 100644 --- a/plugins/DC1394/videoDC1394.cpp +++ b/plugins/DC1394/videoDC1394.cpp @@ -148,12 +148,12 @@ bool videoDC1394 :: openDevice(gem::Properties&props) err=dc1394_camera_enumerate (m_dc, &list); /* Find cameras */ if(DC1394_SUCCESS!=err) { - verbose(0, "[GEM:videoDC1394] %s: failed to enumerate", + logpost(0, 3+0, "[GEM:videoDC1394] %s: failed to enumerate", dc1394_error_get_string(err)); return false; } if (list->num < 1) { - verbose(0, "[GEM:videoDC1394] no cameras found"); + logpost(0, 3+0, "[GEM:videoDC1394] no cameras found"); dc1394_camera_free_list (list); return false; } @@ -185,17 +185,17 @@ bool videoDC1394 :: openDevice(gem::Properties&props) list->ids[devicenum].unit); } else { m_dccamera=NULL; - verbose(0, "[GEM:videoDC1394] only found %d cameras but requested #%d!", + logpost(0, 3+0, "[GEM:videoDC1394] only found %d cameras but requested #%d!", list->num, devicenum); } dc1394_camera_free_list (list); if(!m_dccamera) { - verbose(0, "[GEM:videoDC1394] could not access camera!"); + logpost(0, 3+0, "[GEM:videoDC1394] could not access camera!"); return false; } - verbose(1, "[GEM:videoDC1394] using camera with GUID %s", + logpost(0, 3+1, "[GEM:videoDC1394] using camera with GUID %s", guid2string(m_dccamera->guid, m_dccamera->unit).c_str()); setProperties(props); @@ -208,7 +208,7 @@ bool videoDC1394 :: openDevice(gem::Properties&props) err=dc1394_video_get_supported_modes(m_dccamera,&video_modes); if(DC1394_SUCCESS!=err) { - verbose(0, "[GEM:videoDC1394] can't get video modes"); + logpost(0, 3+0, "[GEM:videoDC1394] can't get video modes"); closeDevice(); return false; } @@ -219,11 +219,11 @@ bool videoDC1394 :: openDevice(gem::Properties&props) mode=d; } - verbose(1, "[GEM:videoDC1394] trying mode %d", mode); + logpost(0, 3+1, "[GEM:videoDC1394] trying mode %d", mode); if(mode>=0) { if(mode>=video_modes.num) { - verbose(0, "[GEM:videoDC1394] requested channel %d/%d out of bounds", mode, + logpost(0, 3+0, "[GEM:videoDC1394] requested channel %d/%d out of bounds", mode, video_modes.num); mode=-1; } @@ -233,10 +233,10 @@ bool videoDC1394 :: openDevice(gem::Properties&props) unsigned int w=0, h=0; if(DC1394_SUCCESS==dc1394_get_image_size_from_video_mode(m_dccamera, video_modes.modes[i], &w, &h)) { - verbose(1, "[GEM:videoDC1394] videomode[%02d/%d]=%dx%d", i, + logpost(0, 3+1, "[GEM:videoDC1394] videomode[%02d/%d]=%dx%d", i, video_modes.num, w, h); } else { - verbose(1, "[GEM:videoDC1394] videomode %d refused dimen: %d", i, + logpost(0, 3+1, "[GEM:videoDC1394] videomode %d refused dimen: %d", i, video_modes.modes[i]); } @@ -244,7 +244,7 @@ bool videoDC1394 :: openDevice(gem::Properties&props) &coding); dc1394bool_t iscolor=DC1394_FALSE; if(DC1394_SUCCESS==dc1394_is_color(coding, &iscolor)) { - verbose(1, "[GEM:videoDC1394] videomode[%02d/%d] %d is%scolor", i, + logpost(0, 3+1, "[GEM:videoDC1394] videomode[%02d/%d] %d is%scolor", i, video_modes.num, coding, (iscolor?" ":" NOT ")); } @@ -270,12 +270,12 @@ bool videoDC1394 :: openDevice(gem::Properties&props) } } if (i < 0) { - verbose(0, "[GEM:videoDC1394] Could not get a valid mode"); + logpost(0, 3+0, "[GEM:videoDC1394] Could not get a valid mode"); closeDevice(); return false; } } else { - verbose(1, "[GEM:videoDC1394] using mode %d", mode); + logpost(0, 3+1, "[GEM:videoDC1394] using mode %d", mode); video_mode=video_modes.modes[mode]; } @@ -283,19 +283,19 @@ bool videoDC1394 :: openDevice(gem::Properties&props) unsigned int w=0, h=0; if(DC1394_SUCCESS==dc1394_get_image_size_from_video_mode(m_dccamera, video_mode, &w, &h)) { - verbose(1, "[GEM:videoDC1394] videomode[%d]=%dx%d", video_mode, w, h); + logpost(0, 3+1, "[GEM:videoDC1394] videomode[%d]=%dx%d", video_mode, w, h); } dc1394_get_color_coding_from_video_mode(m_dccamera,video_mode, &coding); dc1394bool_t iscolor=DC1394_FALSE; if(DC1394_SUCCESS==dc1394_is_color(coding, &iscolor)) { - verbose(1, "[GEM:videoDC1394] videomode %d is%scolor", coding, + logpost(0, 3+1, "[GEM:videoDC1394] videomode %d is%scolor", coding, (iscolor?" ":" NOT ")); } } err=dc1394_video_set_mode(m_dccamera, video_mode); if(DC1394_SUCCESS!=err) { - verbose(0, + logpost(0, 3+0, "[GEM:videoDC1394] unable to set specified mode, using default"); } } @@ -310,12 +310,12 @@ bool videoDC1394 :: openDevice(gem::Properties&props) if(DC1394_SUCCESS==err) { break; } - verbose(1, "[GEM:videoDC1394] failed to set operation mode to %d", + logpost(0, 3+1, "[GEM:videoDC1394] failed to set operation mode to %d", operation_mode); operation_mode--; } if(DC1394_SUCCESS!=err) { - verbose(0, + logpost(0, 3+0, "[GEM:videoDC1394] unable to set operation mode...continuing anyhow"); } } @@ -331,13 +331,13 @@ bool videoDC1394 :: openDevice(gem::Properties&props) if(DC1394_SUCCESS==err) { break; } - verbose(1, "[GEM:videoDC1394] failed to set ISO speed to %d", + logpost(0, 3+1, "[GEM:videoDC1394] failed to set ISO speed to %d", 100*(1<videoDC1394 :: enumerate() } for(int i=0; inum; i++) { - // verbose(1, "[GEM:videoDC1394] IIDC#%02d: %"PRIx64"\t%x\t%s", i, list->ids[i].guid, list->ids[i].unit, buf); + // logpost(0, 3+1, "[GEM:videoDC1394] IIDC#%02d: %"PRIx64"\t%x\t%s", i, list->ids[i].guid, list->ids[i].unit, buf); result.push_back(guid2string(list->ids[i].guid, list->ids[i].unit)); } return result; @@ -575,7 +575,7 @@ void videoDC1394::getProperties(gem::Properties&props) dc1394error_t err=DC1394_SUCCESS; #define DC1394_TRYGET(x) \ if(DC1394_SUCCESS!=(err=dc1394_video_get_##x)) { \ - verbose(0, "[GEM:videoDC1394] getting '%s' failed with '%s'", \ + logpost(0, 3+0, "[GEM:videoDC1394] getting '%s' failed with '%s'", \ key.c_str(), \ dc1394_error_get_string(err)); \ continue; \ @@ -1023,7 +1023,7 @@ void videoDC1394::setProperties(gem::Properties&props) } err=dc1394_feature_set_mode(m_dccamera, feature, mode); if (err!=DC1394_SUCCESS) { - verbose(0, "[GEM:videoDC1394] can't set %s to %s",key.c_str(), + logpost(0, 3+0, "[GEM:videoDC1394] can't set %s to %s",key.c_str(), svalue.c_str()); } } @@ -1032,7 +1032,7 @@ void videoDC1394::setProperties(gem::Properties&props) } } if(DC1394_SUCCESS!=err) { - verbose(0, "[GEM:videoDC1394] setting '%s' failed with '%s'", + logpost(0, 3+0, "[GEM:videoDC1394] setting '%s' failed with '%s'", key.c_str(), dc1394_error_get_string(err)); } diff --git a/plugins/DECKLINK/decklink_common.h b/plugins/DECKLINK/decklink_common.h index 654a70e7e..b68bb6210 100644 --- a/plugins/DECKLINK/decklink_common.h +++ b/plugins/DECKLINK/decklink_common.h @@ -123,7 +123,7 @@ BMDVideoConnection string2connection(std::string Name) s_connectionstrings["svideo"] = bmdVideoConnectionSVideo; #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) #else - verbose(0, "[GEM:videoDECKLINK] lacking C++11 support requires connections to be lower-case"); + logpost(0, 3+0, "[GEM:videoDECKLINK] lacking C++11 support requires connections to be lower-case"); #endif } done=true; @@ -213,7 +213,7 @@ BMDPixelFormat string2pixformat(std::string Name) s_pixformatstrings["rgba8"] = (BMDPixelFormat)((int)bmdFormat8BitYUV); #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) #else - verbose(0, "[GEM:videoDECKLINK] lacking C++11 support requires pixformats to be lower-case"); + logpost(0, 3+0, "[GEM:videoDECKLINK] lacking C++11 support requires pixformats to be lower-case"); #endif } done=true; diff --git a/plugins/DECKLINK/recordDECKLINK.cpp b/plugins/DECKLINK/recordDECKLINK.cpp index 132705520..c686ba1fa 100644 --- a/plugins/DECKLINK/recordDECKLINK.cpp +++ b/plugins/DECKLINK/recordDECKLINK.cpp @@ -19,7 +19,7 @@ #include "recordDECKLINK.h" -// for verbose(): +// for logpost(0, 3+): #include "Gem/RTE.h" #include "Gem/Exception.h" @@ -315,7 +315,7 @@ IDeckLinkDisplayMode*getDisplayMode(IDeckLinkOutput*dlo, if (S_OK == displayMode->GetName(&dmn)) { std::string dmns = deckstring2string(dmn); bool found=(formatname == dmns); - verbose(1, "[GEM:videoDECKLINK] checking format '%s'", dmns.c_str()); + logpost(0, 3+1, "[GEM:videoDECKLINK] checking format '%s'", dmns.c_str()); free_deckstring(dmn); if(found) { break; diff --git a/plugins/DECKLINK/videoDECKLINK.cpp b/plugins/DECKLINK/videoDECKLINK.cpp index 9299b571a..b3bac8e3b 100644 --- a/plugins/DECKLINK/videoDECKLINK.cpp +++ b/plugins/DECKLINK/videoDECKLINK.cpp @@ -216,7 +216,7 @@ IDeckLinkDisplayMode*getDisplayMode(IDeckLinkInput*dli, if (S_OK == displayMode->GetName(&dmn)) { std::string dmns = deckstring2string(dmn); bool found=(formatname == dmns); - verbose(1, "[GEM:videoDECKLINK] checking format '%s'", dmns.c_str()); + logpost(0, 3+1, "[GEM:videoDECKLINK] checking format '%s'", dmns.c_str()); free_deckstring(dmn); if(found) { break; @@ -557,7 +557,7 @@ bool videoDECKLINK::enumProperties(gem::Properties&readable, void videoDECKLINK::setProperties(gem::Properties&props) { if(trySetProperties(props, true)) { - verbose(1, "[GEM::videoDECKLINK] needs restart"); + logpost(0, 3+1, "[GEM::videoDECKLINK] needs restart"); if(m_dlInput) { stop(); start(); diff --git a/plugins/DV4L/videoDV4L.cpp b/plugins/DV4L/videoDV4L.cpp index d15e2db32..90e6a4d60 100644 --- a/plugins/DV4L/videoDV4L.cpp +++ b/plugins/DV4L/videoDV4L.cpp @@ -176,7 +176,7 @@ bool videoDV4L :: openDevice(gem::Properties&props) // http://www.dennedy.org/libraw1394/API-raw1394-new-handle.html m_raw=raw1394_new_handle(); if(!m_raw) { - verbose(0, "[GEM:videoDV4L] unable to get raw1394 handle"); + logpost(0, 3+0, "[GEM:videoDV4L] unable to get raw1394 handle"); return false; } @@ -184,7 +184,7 @@ bool videoDV4L :: openDevice(gem::Properties&props) struct raw1394_portinfo*pinf=new struct raw1394_portinfo[num_pinf]; int ports = raw1394_get_port_info(m_raw, pinf, num_pinf); - verbose(1, "[GEM:videoDV4L] got %d ports", ports); + logpost(0, 3+1, "[GEM:videoDV4L] got %d ports", ports); int devnum=m_devicenum; if (!m_devicename.empty()) { @@ -192,7 +192,7 @@ bool videoDV4L :: openDevice(gem::Properties&props) } for(int i=0; i=ports) { closeDevice(); @@ -228,12 +228,12 @@ bool videoDV4L :: openDevice(gem::Properties&props) m_dvfd = raw1394_get_fd(m_raw); if(m_dvfd<0) { - verbose(0, "[GEM:videoDV4L] illegal filedescriptor"); + logpost(0, 3+0, "[GEM:videoDV4L] illegal filedescriptor"); closeDevice(); return false; } - verbose(1, "[GEM:videoDV4L] successfully opened device %d", devnum); + logpost(0, 3+1, "[GEM:videoDV4L] successfully opened device %d", devnum); setProperties(props); @@ -288,7 +288,7 @@ bool videoDV4L :: startTransfer() } m_decoder->quality=m_quality; - verbose(1, "[GEM:videoDV4L] DV decoding quality %d ", m_decoder->quality); + logpost(0, 3+1, "[GEM:videoDV4L] DV decoding quality %d ", m_decoder->quality); m_iec = iec61883_dv_fb_init(m_raw, iec_frame, this); if(NULL==m_iec) { diff --git a/plugins/FFMPEG/filmFFMPEG.cpp b/plugins/FFMPEG/filmFFMPEG.cpp index 30f2dd4dc..27cd49548 100644 --- a/plugins/FFMPEG/filmFFMPEG.cpp +++ b/plugins/FFMPEG/filmFFMPEG.cpp @@ -37,7 +37,7 @@ namespace { /* the default prefix aligns with '[GEM:filmFFMPEG] ' */ static void show_error(int errcode, const char*prefix=" ") { char errbuf[MAXPDSTRING]; - verbose(0, "%s%s", prefix, av_make_error_string(errbuf, sizeof(errbuf), errcode)); + logpost(0, 3+0, "%s%s", prefix, av_make_error_string(errbuf, sizeof(errbuf), errcode)); } }; @@ -117,7 +117,7 @@ bool filmFFMPEG :: open(const std::string&sfilename, } m_avformat->seek2any = 1; if ((ret = avformat_find_stream_info(m_avformat, NULL)) < 0) { - verbose(0, "[GEM:filmFFMPEG] Unable to find stream information in %s", filename); + logpost(0, 3+0, "[GEM:filmFFMPEG] Unable to find stream information in %s", filename); show_error(ret); close(); return false; @@ -129,7 +129,7 @@ bool filmFFMPEG :: open(const std::string&sfilename, ret = av_find_best_stream(m_avformat, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0); int stream_index = ret; if(ret < 0) { - verbose(0, "[GEM:filmFFMPEG] Could not find video stream in %s", filename); + logpost(0, 3+0, "[GEM:filmFFMPEG] Could not find video stream in %s", filename); show_error(ret); close(); return false; @@ -147,27 +147,27 @@ bool filmFFMPEG :: open(const std::string&sfilename, if(!dec) dec = avcodec_find_decoder(st->codecpar->codec_id); if(!dec) { - verbose(0, "[GEM:filmFFMPEG] Failed to find video codec for %s", filename); + logpost(0, 3+0, "[GEM:filmFFMPEG] Failed to find video codec for %s", filename); close(); return false; } m_avdecoder = avcodec_alloc_context3(dec); if(!m_avdecoder) { - verbose(0, "[GEM:filmFFMPEG] Failed to allocate the video codec context"); + logpost(0, 3+0, "[GEM:filmFFMPEG] Failed to allocate the video codec context"); close(); return false; } /* Copy codec parameters from input stream to output codec context */ if ((ret = avcodec_parameters_to_context(m_avdecoder, st->codecpar)) < 0) { - verbose(0, "[GEM:filmFFMPEG] Failed to copy video codec parameters to decoder context"); + logpost(0, 3+0, "[GEM:filmFFMPEG] Failed to copy video codec parameters to decoder context"); show_error(ret); close(); return false; } /* Init the decoders */ if ((ret = avcodec_open2(m_avdecoder, dec, NULL)) < 0) { - verbose(0, "[GEM:filmFFMPEG] Failed to open codec"); + logpost(0, 3+0, "[GEM:filmFFMPEG] Failed to open codec"); show_error(ret); close(); return false; @@ -307,7 +307,7 @@ int filmFFMPEG :: decodePacket(void) // submit the packet to the decoder int ret = avcodec_send_packet(m_avdecoder, m_avpacket); if (ret < 0) { - verbose(0, "[GEM:filmFFMPEG] Error submitting packet for decoding (%d)", ret); + logpost(0, 3+0, "[GEM:filmFFMPEG] Error submitting packet for decoding (%d)", ret); show_error(ret); return ret; } @@ -321,7 +321,7 @@ int filmFFMPEG :: decodePacket(void) if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) return 0; - verbose(0, "[GEM:filmFFMPEG] Error during decoding (%d)", ret); + logpost(0, 3+0, "[GEM:filmFFMPEG] Error during decoding (%d)", ret); show_error(ret); return ret; } @@ -331,7 +331,7 @@ int filmFFMPEG :: decodePacket(void) #if 0 if(1) { enum AVPixelFormat pix_fmt = (AVPixelFormat)m_avframe->format; - verbose(0, "[GEM:filmFFMPEG] decoded VIDEO for %lu/%lu: %dx%d@%s!" + logpost(0, 3+0, "[GEM:filmFFMPEG] decoded VIDEO for %lu/%lu: %dx%d@%s!" , (unsigned long)m_avframe->pts, (unsigned long)m_avframe->pkt_dts , m_avframe->width, m_avframe->height, av_get_pix_fmt_name(pix_fmt) ); @@ -339,7 +339,7 @@ int filmFFMPEG :: decodePacket(void) #endif ret = convertFrame(); } else { - verbose(0, "[GEM:filmFFMPEG] ouch. unexpected type %s", av_get_media_type_string(m_avdecoder->codec->type)); + logpost(0, 3+0, "[GEM:filmFFMPEG] ouch. unexpected type %s", av_get_media_type_string(m_avdecoder->codec->type)); } av_frame_unref(m_avframe); diff --git a/plugins/GMERLIN/filmGMERLIN.cpp b/plugins/GMERLIN/filmGMERLIN.cpp index 44a292d0b..e81f127d2 100644 --- a/plugins/GMERLIN/filmGMERLIN.cpp +++ b/plugins/GMERLIN/filmGMERLIN.cpp @@ -112,13 +112,13 @@ void filmGMERLIN::log(gavl_log_level_t level, const char *log_domain, { switch(level) { case GAVL_LOG_DEBUG: - verbose(1, "[GEM:filmGMERLIN:%s] %s", log_domain, message); + logpost(0, 3+1, "[GEM:filmGMERLIN:%s] %s", log_domain, message); break; case GAVL_LOG_INFO: - verbose(0, "[GEM:filmGMERLIN:%s] %s", log_domain, message); + logpost(0, 3+0, "[GEM:filmGMERLIN:%s] %s", log_domain, message); break; case GAVL_LOG_WARNING: - verbose(0, "[GEM:filmGMERLIN:%s] %s", log_domain, message); + logpost(0, 3+0, "[GEM:filmGMERLIN:%s] %s", log_domain, message); break; case GAVL_LOG_ERROR: pd_error(0, "[GEM:filmGMERLIN:%s!] %s", log_domain, message); @@ -199,23 +199,23 @@ bool filmGMERLIN :: open(const std::string&sfilename, if(!strncmp(filename, "vcd://", 6)) { if(!bgav_open_vcd(m_file, filename + 5)) { - verbose(0, "[GEM:filmGMERLIN] Could not open VCD Device %s", + logpost(0, 3+0, "[GEM:filmGMERLIN] Could not open VCD Device %s", filename + 5); return false; } } else if(!strncmp(filename, "dvd://", 6)) { if(!bgav_open_dvd(m_file, filename + 5)) { - verbose(0, "[GEM:filmGMERLIN] Could not open DVD Device %s", filename + 5); + logpost(0, 3+0, "[GEM:filmGMERLIN] Could not open DVD Device %s", filename + 5); return false; } } else if(!strncmp(filename, "dvb://", 6)) { if(!bgav_open_dvb(m_file, filename + 6)) { - verbose(0, "[GEM:filmGMERLIN] Could not open DVB Device %s", filename + 6); + logpost(0, 3+0, "[GEM:filmGMERLIN] Could not open DVB Device %s", filename + 6); return false; } } else { if(!bgav_open(m_file, filename)) { - verbose(0, "[GEM:filmGMERLIN] Could not open file %s", filename); + logpost(0, 3+0, "[GEM:filmGMERLIN] Could not open file %s", filename); close(); return false; @@ -223,9 +223,9 @@ bool filmGMERLIN :: open(const std::string&sfilename, } if(bgav_is_redirector(m_file)) { int num_urls=bgav_redirector_get_num_urls(m_file); - verbose(1, "[GEM:filmGMERLIN] Found redirector:"); + logpost(0, 3+1, "[GEM:filmGMERLIN] Found redirector:"); for(int i = 0; i < num_urls; i++) { - verbose(1, "[GEM:filmGMERLIN] #%d: '%s' -> %s", i, + logpost(0, 3+1, "[GEM:filmGMERLIN] #%d: '%s' -> %s", i, bgav_redirector_get_name(m_file, i), bgav_redirector_get_url(m_file, i)); } for(int i = 0; i < num_urls; i++) { @@ -249,7 +249,7 @@ bool filmGMERLIN :: open(const std::string&sfilename, if(numvstreams) { bgav_select_track(m_file, m_track); } else { - verbose(1, + logpost(0, 3+1, "[GEM:filmGMERLIN] track %d does not contain a video-stream: skipping", m_track); } @@ -378,7 +378,7 @@ film::errCode filmGMERLIN :: changeImage(int imgNum, int trackNum) m_numTracks); } else { int numvstreams=bgav_num_video_streams (m_file, m_track); - verbose(1, "[GEM:filmGMERLIN] track %d contains %d video streams", m_track, + logpost(0, 3+1, "[GEM:filmGMERLIN] track %d contains %d video streams", m_track, numvstreams); if(numvstreams) { bgav_select_track(m_file, m_track); diff --git a/plugins/HALCON/videoHALCON.cpp b/plugins/HALCON/videoHALCON.cpp index fcfe0c716..307ca6a3f 100644 --- a/plugins/HALCON/videoHALCON.cpp +++ b/plugins/HALCON/videoHALCON.cpp @@ -82,7 +82,7 @@ static std::vectorgetBackends(void) s_backends.push_back(backend); } } catch (Halcon::HException &except) { - verbose(1, + logpost(0, 3+1, "[GEM::videoHALCON] trying to get framegraber info returned: %s", except.message); } @@ -194,7 +194,7 @@ bool videoHALCON :: grabFrame() unlock(); } catch (Halcon::HException& except) { - verbose(1, "[GEM:videoHALCON] HTuple exception: '%s'", except.message); + logpost(0, 3+1, "[GEM:videoHALCON] HTuple exception: '%s'", except.message); } return true; } @@ -230,7 +230,7 @@ static std::string parsedevicename(std::string devicename, std::vector parsed = split(devicename, ':'); switch(parsed.size()) { default: - verbose(0, "[GEM:videoHALCON] could not parse '%s'", devicename.c_str()); + logpost(0, 3+0, "[GEM:videoHALCON] could not parse '%s'", devicename.c_str()); return name; case 3: if(parsed[2].size()>0) { @@ -243,9 +243,9 @@ static std::string parsedevicename(std::string devicename, case 1: name=parsed[0]; } - verbose(1, "[GEM:videoHALCON] name ='%s'", name.c_str()); - verbose(1, "[GEM:videoHALCON] camera='%s'", cameratype.c_str()); - verbose(1, "[GEM:videoHALCON] device='%s'", device.c_str()); + logpost(0, 3+1, "[GEM:videoHALCON] name ='%s'", name.c_str()); + logpost(0, 3+1, "[GEM:videoHALCON] camera='%s'", cameratype.c_str()); + logpost(0, 3+1, "[GEM:videoHALCON] device='%s'", device.c_str()); return name; } @@ -295,7 +295,7 @@ static void printinfo(std::string name, std::string value) printtuple(ValueList); std::cerr << std::endl; } catch (Halcon::HException &except) { - verbose(0, "[GEM:videoHALCON] printinfo['%s'] %s", name.c_str(), + logpost(0, 3+0, "[GEM:videoHALCON] printinfo['%s'] %s", name.c_str(), except.message); } } @@ -308,7 +308,7 @@ static void getparam(Halcon::HFramegrabber*grabber, std::string name) std::cerr << "got parm for "<version()); + logpost(0, 3+1, "[GEM::%s] %s", prefix, result->version()); } return result; } notfound: if(firsttime) { - verbose(1, "[GEM:%s] Please (re)install the NewTek NDI Runtimes to use this plugin.", prefix); - verbose(1, " need to find the library '%s'", NDILIB_LIBRARY_NAME); + logpost(0, 3+1, "[GEM:%s] Please (re)install the NewTek NDI Runtimes to use this plugin.", prefix); + logpost(0, 3+1, " need to find the library '%s'", NDILIB_LIBRARY_NAME); if (std::string("") != NDILIB_REDIST_URL) - verbose(1, " get the NewTek Runtimes from %s", NDILIB_REDIST_URL); - verbose(1, " use the '%s' environment variable to set the path to the library.", NDILIB_REDIST_FOLDER); + logpost(0, 3+1, " get the NewTek Runtimes from %s", NDILIB_REDIST_URL); + logpost(0, 3+1, " use the '%s' environment variable to set the path to the library.", NDILIB_REDIST_FOLDER); if(p_NDI_runtime_folder) - verbose(1, " (currently set to '%s').", p_NDI_runtime_folder); + logpost(0, 3+1, " (currently set to '%s').", p_NDI_runtime_folder); } return 0; } diff --git a/plugins/NDI/recordNDI.cpp b/plugins/NDI/recordNDI.cpp index 301f5095d..5faf96ef5 100644 --- a/plugins/NDI/recordNDI.cpp +++ b/plugins/NDI/recordNDI.cpp @@ -19,7 +19,7 @@ #include "recordNDI.h" -// for verbose(): +// for logpost(0, 3+): #include "Gem/RTE.h" #include "Gem/Exception.h" diff --git a/plugins/NDI/videoNDI.cpp b/plugins/NDI/videoNDI.cpp index 5569917f4..d0d328d2b 100644 --- a/plugins/NDI/videoNDI.cpp +++ b/plugins/NDI/videoNDI.cpp @@ -156,7 +156,7 @@ std::vector videoNDI::enumerate() for(uint32_t i=0; i= no_srcs) { - verbose(1, "[GEM:videoNDI] device '%s' does not exist, skipping", m_devicename.c_str()); + logpost(0, 3+1, "[GEM:videoNDI] device '%s' does not exist, skipping", m_devicename.c_str()); return false; } } - verbose(1, "[GEM:videoNDI] opening device '%s'", m_devicename.c_str()); + logpost(0, 3+1, "[GEM:videoNDI] opening device '%s'", m_devicename.c_str()); m_ndi_recv = NDI->recv_create_v3(NULL); @@ -266,7 +266,7 @@ bool videoNDI :: stop() bool videoNDI :: reset() { MARK(); - verbose(0, "[GEM:videoNDI] 'reset' not implemented"); + logpost(0, 3+0, "[GEM:videoNDI] 'reset' not implemented"); return false; } @@ -293,15 +293,15 @@ pixBlock*videoNDI::getFrame(void) break; case NDIlib_FourCC_video_type_P216: case NDIlib_FourCC_video_type_PA16: - verbose(1, "[GEM:videoNDI] unknown format P..."); + logpost(0, 3+1, "[GEM:videoNDI] unknown format P..."); return NULL; case NDIlib_FourCC_video_type_YV12: case NDIlib_FourCC_video_type_I420: case NDIlib_FourCC_video_type_NV12: - verbose(1, "[GEM:videoNDI] unknown format Y..."); + logpost(0, 3+1, "[GEM:videoNDI] unknown format Y..."); return NULL; default: - verbose(1, "[GEM:videoNDI] unknown format..."); + logpost(0, 3+1, "[GEM:videoNDI] unknown format..."); return NULL; } m_pixBlock.image.setFormat(); @@ -316,7 +316,7 @@ pixBlock*videoNDI::getFrame(void) pd_error(0, "[GEM:videoNDI] lost connection"); return NULL; case NDIlib_frame_type_audio: - verbose(2, "[GEM:videoNDI] got audio frame"); + logpost(0, 3+2, "[GEM:videoNDI] got audio frame"); break; case NDIlib_frame_type_none: default: diff --git a/plugins/OBJ/modelOBJ.cpp b/plugins/OBJ/modelOBJ.cpp index 96e41ede4..ec132fa63 100644 --- a/plugins/OBJ/modelOBJ.cpp +++ b/plugins/OBJ/modelOBJ.cpp @@ -61,7 +61,7 @@ bool modelOBJ :: open(const std::string&name, #if 0 std::vectorkeys=requestprops.keys(); for(unsigned int i=0; imaterials[nummaterials].name = std::string(buf); } else { - verbose(0, "[GEM:modelOBJ] _glmReadMTL() failed reading material"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadMTL() failed reading material"); } break; case 'N': @@ -469,7 +469,7 @@ _glmReadMTL(GLMmodel* model, const std::string&name) model->materials[nummaterials].shininess /= 1000.0; model->materials[nummaterials].shininess *= 128.0; } else { - verbose(0, + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadMTL() failed reading material shininess"); } break; @@ -481,7 +481,7 @@ _glmReadMTL(GLMmodel* model, const std::string&name) &model->materials[nummaterials].diffuse[1], &model->materials[nummaterials].diffuse[2])) { } else { - verbose(0, "[GEM:modelOBJ] _glmReadMTL() failed reading diffuse material"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadMTL() failed reading diffuse material"); } break; case 's': @@ -490,7 +490,7 @@ _glmReadMTL(GLMmodel* model, const std::string&name) &model->materials[nummaterials].specular[1], &model->materials[nummaterials].specular[2])) { } else { - verbose(0, + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadMTL() failed reading specular material"); } break; @@ -500,13 +500,13 @@ _glmReadMTL(GLMmodel* model, const std::string&name) &model->materials[nummaterials].ambient[1], &model->materials[nummaterials].ambient[2])) { } else { - verbose(0, "[GEM:modelOBJ] _glmReadMTL() failed reading ambient material"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadMTL() failed reading ambient material"); } break; default: /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(1, "[GEM:modelOBJ] _glmReadMTL() really failed reading K"); + logpost(0, 3+1, "[GEM:modelOBJ] _glmReadMTL() really failed reading K"); continue; } break; @@ -515,7 +515,7 @@ _glmReadMTL(GLMmodel* model, const std::string&name) default: /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(1, "[GEM:modelOBJ] _glmReadMTL() really failed reading"); + logpost(0, 3+1, "[GEM:modelOBJ] _glmReadMTL() really failed reading"); continue; } break; @@ -551,7 +551,7 @@ _glmWriteMTL(const GLMmodel* model, const char* modelpath, /* open the file */ file = fopen(filename.c_str(), "w"); if (!file) { - verbose(0, "[GEM:modelOBJ] _glmWriteMTL() failed: can't open file \"%s\".", + logpost(0, 3+0, "[GEM:modelOBJ] _glmWriteMTL() failed: can't open file \"%s\".", filename.c_str()); return GL_FALSE; } @@ -608,7 +608,7 @@ _glmFirstPass(GLMmodel* model, FILE* file) case '#': /* comment */ /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass failed reading comment"); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass failed reading comment"); continue; } break; @@ -617,7 +617,7 @@ _glmFirstPass(GLMmodel* model, FILE* file) case '\0': /* vertex */ /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(0, "[GEM:modelOBJ] _glmFirstPass failed reading vertex"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmFirstPass failed reading vertex"); return GL_FALSE; } numvertices++; @@ -625,7 +625,7 @@ _glmFirstPass(GLMmodel* model, FILE* file) case 'n': /* normal */ /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(0, "[GEM:modelOBJ] _glmFirstPass failed reading normals"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmFirstPass failed reading normals"); return GL_FALSE; } numnormals++; @@ -633,45 +633,45 @@ _glmFirstPass(GLMmodel* model, FILE* file) case 't': /* texcoord */ /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(0, "[GEM:modelOBJ] _glmFirstPass failed reading texcoords"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmFirstPass failed reading texcoords"); return GL_FALSE; } numtexcoords++; break; default: - verbose(0, "[GEM:modelOBJ] _glmFirstPass: Unknown token \"%s\".", buf); + logpost(0, 3+0, "[GEM:modelOBJ] _glmFirstPass: Unknown token \"%s\".", buf); return GL_FALSE; } break; case 'm': if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(0, "[GEM:modelOBJ] _glmFirstPass failed reading material"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmFirstPass failed reading material"); return GL_FALSE; } if(EOF != sscanf(buf, "%s %s", buf, buf)) { model->mtllibname = buf; _glmReadMTL(model, buf); } else { - verbose(0, "[GEM:modelOBJ] glmFirstPass failed reading material lib"); + logpost(0, 3+0, "[GEM:modelOBJ] glmFirstPass failed reading material lib"); } break; case 'u': /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass failed reading u"); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass failed reading u"); continue; } break; case 'g': /* group */ /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(0, "[GEM:modelOBJ] _glmFirstPass failed reading groups"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmFirstPass failed reading groups"); return GL_FALSE; } #if SINGLE_STRING_GROUP_NAMES if(EOF != sscanf(buf, "%s", buf)) { } else { - verbose(0, + logpost(0, 3+0, "[GEM:modelOBJ] _glmFirstPass failed reading single-string group name"); return GL_FALSE; } @@ -688,13 +688,13 @@ _glmFirstPass(GLMmodel* model, FILE* file) if (strstr(buf, "//")) { /* v//n */ if(EOF == sscanf(buf, "%d//%d", &v, &n)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/n."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/n."); } if(EOF == fscanf(file, "%d//%d", &v, &n)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/n.."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/n.."); } if(EOF == fscanf(file, "%d//%d", &v, &n)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/n..."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/n..."); } numtriangles++; group->numtriangles++; @@ -705,10 +705,10 @@ _glmFirstPass(GLMmodel* model, FILE* file) } else if (sscanf(buf, "%d/%d/%d", &v, &t, &n) == 3) { /* v/t/n */ if(EOF == fscanf(file, "%d/%d/%d", &v, &t, &n)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t/n."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t/n."); } if(EOF == fscanf(file, "%d/%d/%d", &v, &t, &n)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t/n.."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t/n.."); } numtriangles++; group->numtriangles++; @@ -719,10 +719,10 @@ _glmFirstPass(GLMmodel* model, FILE* file) } else if (sscanf(buf, "%d/%d", &v, &t) == 2) { /* v/t */ if(EOF == fscanf(file, "%d/%d", &v, &t)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t."); } if(EOF == fscanf(file, "%d/%d", &v, &t)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t.."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v/t.."); } numtriangles++; group->numtriangles++; @@ -733,10 +733,10 @@ _glmFirstPass(GLMmodel* model, FILE* file) } else { /* v */ if(EOF == fscanf(file, "%d", &v)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v."); } if(EOF == fscanf(file, "%d", &v)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass: failed reading v.."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass: failed reading v.."); } numtriangles++; group->numtriangles++; @@ -746,14 +746,14 @@ _glmFirstPass(GLMmodel* model, FILE* file) } } } else { - verbose(1, "[GEM:modelOBJ] _glmFirstPass failed reading facet..."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass failed reading facet..."); } break; default: /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(1, "[GEM:modelOBJ] _glmFirstPass failed reading"); + logpost(0, 3+1, "[GEM:modelOBJ] _glmFirstPass failed reading"); continue; } break; @@ -793,7 +793,7 @@ static GLuint fixIndex(GLint current, GLuint baseindex) if(idx>0) { return (GLuint)idx; } else { - verbose(1, "[GEM:modelOBJ] unable to fix negative index %d @ %d", current, + logpost(0, 3+1, "[GEM:modelOBJ] unable to fix negative index %d @ %d", current, baseindex); return baseindex; } @@ -837,7 +837,7 @@ _glmSecondPass(GLMmodel* model, FILE* file) case '#': /* comment */ /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(1, "[GEM:modelOBJ] _glmSecondPass() failed reading"); + logpost(0, 3+1, "[GEM:modelOBJ] _glmSecondPass() failed reading"); continue; } break; @@ -850,7 +850,7 @@ _glmSecondPass(GLMmodel* model, FILE* file) &vertices[3 * numvertices + 2])) { numvertices++; } else { - verbose(1, "[GEM:modelOBJ] _glmSecondPass failed reading vertex %d", + logpost(0, 3+1, "[GEM:modelOBJ] _glmSecondPass failed reading vertex %d", numvertices); } break; @@ -861,7 +861,7 @@ _glmSecondPass(GLMmodel* model, FILE* file) &normals[3 * numnormals + 2])) { numnormals++; } else { - verbose(1, "[GEM:modelOBJ] _glmSecondPass failed reading normal %d", + logpost(0, 3+1, "[GEM:modelOBJ] _glmSecondPass failed reading normal %d", numnormals); } break; @@ -871,7 +871,7 @@ _glmSecondPass(GLMmodel* model, FILE* file) &texcoords[2 * numtexcoords + 1])) { numtexcoords++; } else { - verbose(1, "[GEM:modelOBJ] _glmSecondPass failed reading texcoord %d", + logpost(0, 3+1, "[GEM:modelOBJ] _glmSecondPass failed reading texcoord %d", numtexcoords); } break; @@ -879,25 +879,25 @@ _glmSecondPass(GLMmodel* model, FILE* file) break; case 'u': if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading material"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading material"); return GL_FALSE; } if(EOF != sscanf(buf, "%s %s", buf, buf)) { group->material = material = _glmFindMaterial(model, buf); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed finding material"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed finding material"); return GL_FALSE; } break; case 'g': /* group */ /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading group"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading group"); return GL_FALSE; } #if SINGLE_STRING_GROUP_NAMES if(EOF == sscanf(buf, "%s", buf)) { - verbose(0, + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading single-string group name"); return GL_FALSE; } @@ -918,19 +918,19 @@ _glmSecondPass(GLMmodel* model, FILE* file) T(numtriangles).vindices[0] = fixIndex(v,numvertices); T(numtriangles).nindices[0] = fixIndex(n,numnormals); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/n."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/n."); } if(EOF != fscanf(file, "%d//%d", &v, &n)) { T(numtriangles).vindices[1] = fixIndex(v,numvertices); T(numtriangles).nindices[1] = fixIndex(n, numnormals); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/n.."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/n.."); } if(EOF != fscanf(file, "%d//%d", &v, &n)) { T(numtriangles).vindices[2] = fixIndex(v,numvertices); T(numtriangles).nindices[2] = fixIndex(n, numnormals); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/n..."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/n..."); } group->triangles[group->numtriangles++] = numtriangles; numtriangles++; @@ -954,14 +954,14 @@ _glmSecondPass(GLMmodel* model, FILE* file) T(numtriangles).uvtindices[1] = fixIndex(t, numtexcoords); T(numtriangles).nindices[1] = fixIndex(n, numnormals); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t/n."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t/n."); } if(EOF != fscanf(file, "%d/%d/%d", &v, &t, &n)) { T(numtriangles).vindices[2] = fixIndex(v, numvertices); T(numtriangles).uvtindices[2] = fixIndex(t, numtexcoords); T(numtriangles).nindices[2] = fixIndex(n, numnormals); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t/n.."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t/n.."); } group->triangles[group->numtriangles++] = numtriangles; numtriangles++; @@ -986,13 +986,13 @@ _glmSecondPass(GLMmodel* model, FILE* file) T(numtriangles).vindices[1] = fixIndex(v, numvertices); T(numtriangles).uvtindices[1] = fixIndex(t, numtexcoords); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t."); } if(EOF != fscanf(file, "%d/%d", &v, &t)) { T(numtriangles).vindices[2] = fixIndex(v, numvertices); T(numtriangles).uvtindices[2] = fixIndex(t, numtexcoords); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t.."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v/t.."); } group->triangles[group->numtriangles++] = numtriangles; numtriangles++; @@ -1011,17 +1011,17 @@ _glmSecondPass(GLMmodel* model, FILE* file) if(EOF != sscanf(buf, "%d", &v)) { T(numtriangles).vindices[0] = fixIndex(v, numvertices); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v."); } if(EOF != fscanf(file, "%d", &v)) { T(numtriangles).vindices[1] = fixIndex(v, numvertices); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v.."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v.."); } if(EOF != fscanf(file, "%d", &v)) { T(numtriangles).vindices[2] = fixIndex(v, numvertices); } else { - verbose(0, "[GEM:modelOBJ] _glmSecondPass() failed reading v..."); + logpost(0, 3+0, "[GEM:modelOBJ] _glmSecondPass() failed reading v..."); } group->triangles[group->numtriangles++] = numtriangles; numtriangles++; @@ -1034,7 +1034,7 @@ _glmSecondPass(GLMmodel* model, FILE* file) } } } else { - verbose(1, "[GEM:modelOBJ] _glmSecondPass() failed reading..."); + logpost(0, 3+1, "[GEM:modelOBJ] _glmSecondPass() failed reading..."); continue; } break; @@ -1042,7 +1042,7 @@ _glmSecondPass(GLMmodel* model, FILE* file) default: /* eat up rest of line */ if(NULL==fgets(buf, sizeof(buf), file)) { - verbose(1, "[GEM:modelOBJ] _glmSecondPass() failed reading"); + logpost(0, 3+1, "[GEM:modelOBJ] _glmSecondPass() failed reading"); continue; } break; @@ -1050,7 +1050,7 @@ _glmSecondPass(GLMmodel* model, FILE* file) } /* announce the memory requirements */ - verbose(1, "[GEM:modelOBJ] Memory: %d bytes", (int)( + logpost(0, 3+1, "[GEM:modelOBJ] Memory: %d bytes", (int)( numvertices * 3*sizeof(GLfloat) + numnormals * 3*sizeof(GLfloat) + numtexcoords * 3*sizeof(GLfloat) + @@ -1386,7 +1386,7 @@ glmVertexNormals(GLMmodel* model, GLfloat angle) facet normal of every triangle this vertex is in */ node = members[i]; if (!node) { - verbose(0, "[GEM:modelOBJ] glmVertexNormals(): vertex w/o a triangle"); + logpost(0, 3+0, "[GEM:modelOBJ] glmVertexNormals(): vertex w/o a triangle"); } average[0] = 0.0; average[1] = 0.0; @@ -1524,7 +1524,7 @@ glmUVTexture(GLMmodel* model, float h, float w) } group = group->next; } - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmUVTexture(): generated %d UV texture coordinates", model->numtexcoords); } @@ -1576,7 +1576,7 @@ glmLinearTexture(GLMmodel* model, float h, float w) group = group->next; } - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmLinearTexture(): generated %d linear texture coordinates", model->numtexcoords); } @@ -1651,7 +1651,7 @@ glmSpheremapTexture(GLMmodel* model, float h, float w) group = group->next; } - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmSpheremapTexture(): generated %d spheremap texture coordinates", model->numtexcoords); } @@ -1805,7 +1805,7 @@ glmReadOBJ(const char* filename) /* open the file */ file = fopen(filename, "r"); if (!file) { - verbose(0, + logpost(0, 3+0, "[GEM:modelOBJ] glmReadOBJ() failed: can't open data file \"%s\".", filename); return NULL; @@ -1838,7 +1838,7 @@ glmReadOBJ(const char* filename) /* make a first pass through the file to get a count of the number of vertices, normals, texcoords & triangles */ if(GL_FALSE==_glmFirstPass(model, file)) { - verbose(0, "[GEM:modelOBJ] glmReadOBJ() failed: can't parse file \"%s\".", + logpost(0, 3+0, "[GEM:modelOBJ] glmReadOBJ() failed: can't parse file \"%s\".", filename); goto readobj_failed; } @@ -1857,7 +1857,7 @@ glmReadOBJ(const char* filename) rewind(file); if(GL_FALSE==_glmSecondPass(model, file)) { - verbose(0, "[GEM:modelOBJ] glmReadOBJ() failed: can't parse file \"%s\".", + logpost(0, 3+0, "[GEM:modelOBJ] glmReadOBJ() failed: can't parse file \"%s\".", filename); goto readobj_failed; } @@ -1905,42 +1905,42 @@ glmWriteOBJ(const GLMmodel* model, const char* filename, GLuint mode) /* do a bit of warning */ if (mode & GLM_FLAT && !model->facetnorms) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmWriteOBJ() warning: flat normal output requested " "with no facet normals defined."); mode &= ~GLM_FLAT; } if (mode & GLM_SMOOTH && !model->normals) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmWriteOBJ() warning: smooth normal output requested " "with no normals defined."); mode &= ~GLM_SMOOTH; } if (mode & GLM_TEXTURE && !model->texcoords) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmWriteOBJ() warning: texture coordinate output requested " "with no texture coordinates defined."); mode &= ~GLM_TEXTURE; } if (mode & GLM_FLAT && mode & GLM_SMOOTH) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmWriteOBJ() warning: flat normal output requested " "and smooth normal output requested (using smooth)."); mode &= ~GLM_FLAT; } if (mode & GLM_COLOR && !model->materials) { - verbose(1, "[GEM:modelOBJ] glmWriteOBJ() warning: color output requested " + logpost(0, 3+1, "[GEM:modelOBJ] glmWriteOBJ() warning: color output requested " "with no colors (materials) defined."); mode &= ~GLM_COLOR; } if (mode & GLM_MATERIAL && !model->materials) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmWriteOBJ() warning: material output requested " "with no materials defined."); mode &= ~GLM_MATERIAL; } if (mode & GLM_COLOR && mode & GLM_MATERIAL) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmWriteOBJ() warning: color and material output requested " "outputting only materials."); mode &= ~GLM_COLOR; @@ -1950,7 +1950,7 @@ glmWriteOBJ(const GLMmodel* model, const char* filename, GLuint mode) /* open the file */ file = fopen(filename, "w"); if (!file) { - verbose(0, + logpost(0, 3+0, "[GEM:modelOBJ] glmWriteOBJ() failed: can't open file \"%s\" to write.", filename); return -1; @@ -2088,40 +2088,40 @@ glmWriteOBJ(const GLMmodel* model, const char* filename, GLuint mode) static GLuint checkMode(const GLMmodel* model, GLuint mode) { if (mode & GLM_FLAT && !model->facetnorms) { - verbose(1, "[GEM:modelOBJ] glmDraw() warning: flat render mode requested " + logpost(0, 3+1, "[GEM:modelOBJ] glmDraw() warning: flat render mode requested " "with no facet normals defined."); mode &= ~GLM_FLAT; } if (mode & GLM_SMOOTH && !model->normals) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmDraw() warning: smooth render mode requested " "with no normals defined."); mode &= ~GLM_SMOOTH; } if (mode & GLM_TEXTURE && !model->texcoords) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmDraw() warning: texture render mode requested " "with no texture coordinates defined."); mode &= ~GLM_TEXTURE; } if (mode & GLM_FLAT && mode & GLM_SMOOTH) { - verbose(1, "[GEM:modelOBJ] glmDraw() warning: flat render mode requested " + logpost(0, 3+1, "[GEM:modelOBJ] glmDraw() warning: flat render mode requested " "and smooth render mode requested (using smooth)."); mode &= ~GLM_FLAT; } if (mode & GLM_COLOR && !model->materials) { - verbose(1, "[GEM:modelOBJ] glmDraw() warning: color render mode requested " + logpost(0, 3+1, "[GEM:modelOBJ] glmDraw() warning: color render mode requested " "with no materials defined."); mode &= ~GLM_COLOR; } if (mode & GLM_MATERIAL && !model->materials) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmDraw() warning: material render mode requested " "with no materials defined."); mode &= ~GLM_MATERIAL; } if (mode & GLM_COLOR && mode & GLM_MATERIAL) { - verbose(1, + logpost(0, 3+1, "[GEM:modelOBJ] glmDraw() warning: color and material render mode requested " "using only material mode."); mode &= ~GLM_COLOR; @@ -2256,7 +2256,7 @@ glmWeld(GLMmodel* model, GLfloat epsilon) vectors = model->vertices; copies = _glmWeldVectors(vectors, &numvectors, epsilon); - verbose(1, "[GEM:modelOBJ] glmWeld(): %d redundant vertices.", + logpost(0, 3+1, "[GEM:modelOBJ] glmWeld(): %d redundant vertices.", model->numvertices - numvectors - 1); for (i = 0; i < model->numtriangles; i++) { @@ -2328,12 +2328,12 @@ glmReadPPM(const char* filename, int* width, int* height) /* grab first two chars of the file and make sure that it has the correct magic cookie for a raw PPM file. */ if(NULL==fgets(head, 70, fp)) { - verbose(0, "[GEM:modelOBJ] _glmReadPPM() failed reading header"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadPPM() failed reading header"); fclose(fp); return NULL; } if (strncmp(head, "P6", 2)) { - verbose(0, "[GEM:modelOBJ] %s: Not a raw PPM file", filename); + logpost(0, 3+0, "[GEM:modelOBJ] %s: Not a raw PPM file", filename); fclose(fp); return NULL; } @@ -2342,7 +2342,7 @@ glmReadPPM(const char* filename, int* width, int* height) i = 0; while(i < 3) { if(NULL==fgets(head, 70, fp)) { - verbose(0, "[GEM:modelOBJ] _glmReadPPM() failed header info"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadPPM() failed header info"); fclose(fp); return NULL; } @@ -2370,7 +2370,7 @@ glmReadPPM(const char* filename, int* width, int* height) size_t count = fread(image, sizeof(unsigned char), imagesize, fp); fclose(fp); if(count!=imagesize) { - verbose(0, "[GEM:modelOBJ] _glmReadPPM failed to read all bytes"); + logpost(0, 3+0, "[GEM:modelOBJ] _glmReadPPM failed to read all bytes"); *width=*height=0; delete[]image; image=NULL; diff --git a/plugins/PNM/recordPNM.cpp b/plugins/PNM/recordPNM.cpp index 772fe44ad..30e0b11e2 100644 --- a/plugins/PNM/recordPNM.cpp +++ b/plugins/PNM/recordPNM.cpp @@ -80,7 +80,7 @@ static int guess_channels(const std::string&filename) unsigned int i=0; if(!extension) { - verbose(0, + logpost(0, 3+0, "[GEM:recordPNM] no extension given: encoding will be PPM"); return 3; } @@ -94,7 +94,7 @@ static int guess_channels(const std::string&filename) return 3; } - verbose(0, + logpost(0, 3+0, "[GEM:recordPNM] unknown extension: encoding will be PPM"); return 3; } diff --git a/plugins/PYLON/videoPYLON.cpp b/plugins/PYLON/videoPYLON.cpp index e9fb47fbc..f456d945e 100644 --- a/plugins/PYLON/videoPYLON.cpp +++ b/plugins/PYLON/videoPYLON.cpp @@ -213,7 +213,7 @@ gem::any node2any(GenApi::INode*node) break; } } catch (GenICam::GenericException &e) { - verbose(0, "[GEM:videoPYLON] %s", e.GetDescription()); + logpost(0, 3+0, "[GEM:videoPYLON] %s", e.GetDescription()); result.reset(); } return result; @@ -285,7 +285,7 @@ bool any2node(GenApi::INode*node, const gem::any&value) break; } } catch (GenICam::GenericException &e) { - verbose(0, "[GEM:videoPYLON] %s", e.GetDescription()); + logpost(0, 3+0, "[GEM:videoPYLON] %s", e.GetDescription()); return false; } return true; @@ -425,7 +425,7 @@ std::vector videoPYLON::enumerate() Pylon::DeviceInfoList_t devices; if (!m_factory->EnumerateDevices(devices)) { - verbose(1, "[GEM:videoPYLON] could not enumerate %d", devices.size()); + logpost(0, 3+1, "[GEM:videoPYLON] could not enumerate %d", devices.size()); return result; } @@ -433,7 +433,7 @@ std::vector videoPYLON::enumerate() std::string name; bool added=false; #if 0 -#define SHOWNAME(x, s) if(!s.empty())verbose(1, "[GEM::videoPYLON] device#%d['%s']\t%s", device - devices.begin(), x, s.c_str()) +#define SHOWNAME(x, s) if(!s.empty())logpost(0, 3+1, "[GEM::videoPYLON] device#%d['%s']\t%s", device - devices.begin(), x, s.c_str()) #else #define SHOWNAME(x, s) #endif @@ -514,14 +514,14 @@ bool videoPYLON :: open(gem::Properties&props) } } } catch (GenICam::GenericException &e) { - verbose(0, "[GEM:videoPYLON] %s", e.GetDescription()); + logpost(0, 3+0, "[GEM:videoPYLON] %s", e.GetDescription()); return false; } if(device) { - verbose(0, "[GEM:videoPYLON] found device '%s'", device->GetDeviceInfo().GetFullName().c_str()); + logpost(0, 3+0, "[GEM:videoPYLON] found device '%s'", device->GetDeviceInfo().GetFullName().c_str()); } else { - verbose(1, "[GEM:videoPYLON] creating device failed!"); + logpost(0, 3+1, "[GEM:videoPYLON] creating device failed!"); return false; } @@ -529,11 +529,11 @@ bool videoPYLON :: open(gem::Properties&props) m_camera.Attach(device); m_camera.Open(); } catch (GenICam::GenericException &e) { - verbose(0, "[GEM:videoPYLON] %s", e.GetDescription()); + logpost(0, 3+0, "[GEM:videoPYLON] %s", e.GetDescription()); close(); return false; } catch (std::exception &e) { - verbose(0, "[GEM:videoPYLON] %s", e.what()); + logpost(0, 3+0, "[GEM:videoPYLON] %s", e.what()); close(); return false; } @@ -597,7 +597,7 @@ bool videoPYLON :: stop() bool videoPYLON :: reset() { MARK(); - verbose(0, "[GEM:videoPYLON] 'reset' not implemented"); + logpost(0, 3+0, "[GEM:videoPYLON] 'reset' not implemented"); return false; } diff --git a/plugins/QT4L/filmQT4L.cpp b/plugins/QT4L/filmQT4L.cpp index f0f1ff832..521a53291 100644 --- a/plugins/QT4L/filmQT4L.cpp +++ b/plugins/QT4L/filmQT4L.cpp @@ -94,7 +94,7 @@ bool filmQT4L :: open(const std::string&filename, char*cfilename=const_cast(filename.c_str()); if (quicktime_check_sig(cfilename)) { /* ok, this is quicktime */ if (!(m_quickfile = quicktime_open(filename.c_str(), 1, 0))) { - verbose(0, "[GEM:filmQT4L] Unable to open file: %s", filename.c_str()); + logpost(0, 3+0, "[GEM:filmQT4L] Unable to open file: %s", filename.c_str()); return false; } m_curFrame = -1; @@ -111,7 +111,7 @@ bool filmQT4L :: open(const std::string&filename, m_image.image.ysize = quicktime_video_height(m_quickfile, m_curTrack); if (!quicktime_supported_video(m_quickfile, m_curTrack)) { char *codec = quicktime_video_compressor(m_quickfile, m_curTrack); - verbose(0, "[GEM:filmQT4L] unsupported CODEC '%s'!", codec); + logpost(0, 3+0, "[GEM:filmQT4L] unsupported CODEC '%s'!", codec); quicktime_close(m_quickfile); m_quickfile=0; return false; diff --git a/plugins/QT4L/recordQT4L.cpp b/plugins/QT4L/recordQT4L.cpp index f4f43d130..a987d6f5e 100644 --- a/plugins/QT4L/recordQT4L.cpp +++ b/plugins/QT4L/recordQT4L.cpp @@ -62,7 +62,7 @@ recordQT4L :: recordQT4L(void) : std::vectorcodecs=getCodecs(); if(codecs.size()>0) { setCodec(codecs[0]); - verbose(1, "[GEM:recordQT4L] default codec is: '%s'", m_codecname.c_str()); + logpost(0, 3+1, "[GEM:recordQT4L] default codec is: '%s'", m_codecname.c_str()); } } #else @@ -116,12 +116,12 @@ static lqt_file_type_t get_qtformat(const char*name) { for(unsigned int i = 0; i < sizeof(qtformats)/sizeof(*qtformats); i++) { if(!strcasecmp(name, qtformats[i].name)) { - verbose(1, "[GEM:recordQT4L] using format '%s'", qtformats[i].description); + logpost(0, 3+1, "[GEM:recordQT4L] using format '%s'", qtformats[i].description); return qtformats[i].type; } } - verbose(0, + logpost(0, 3+0, "[GEM:recordQT4L] unknown extension: encoding will be QuickTime"); return LQT_FILE_QT; /* should be save for now */ } @@ -131,7 +131,7 @@ static lqt_file_type_t guess_qtformat(const std::string&filename) const char * extension = strrchr(filename.c_str(), '.'); if(!extension) { - verbose(0, "[GEM:recordQT4L] no extension given: encoding will be QuickTime"); + logpost(0, 3+0, "[GEM:recordQT4L] no extension given: encoding will be QuickTime"); return LQT_FILE_QT; } @@ -139,12 +139,12 @@ static lqt_file_type_t guess_qtformat(const std::string&filename) for(unsigned int i = 0; i < sizeof(qtformats)/sizeof(*qtformats); i++) { if(!strcasecmp(extension, qtformats[i].extension)) { - verbose(1, "[GEM:recordQT4L] detected format '%s'", qtformats[i].description); + logpost(0, 3+1, "[GEM:recordQT4L] detected format '%s'", qtformats[i].description); return qtformats[i].type; } } - verbose(0, + logpost(0, 3+0, "[GEM:recordQT4L] unknown extension: encoding will be QuickTime"); return LQT_FILE_QT; /* should be save for now */ } @@ -485,7 +485,7 @@ bool recordQT4L :: setCodec(const std::string&name) } } if(codecname.empty()) { - verbose(0, "[GEM:recordQT4L] couldn't find default codec for this format"); + logpost(0, 3+0, "[GEM:recordQT4L] couldn't find default codec for this format"); return false; } } diff --git a/plugins/QuickTime/filmQT.cpp b/plugins/QuickTime/filmQT.cpp index e191144b3..e6c9dca50 100644 --- a/plugins/QuickTime/filmQT.cpp +++ b/plugins/QuickTime/filmQT.cpp @@ -36,7 +36,7 @@ static bool filmQT_initQT(void) OSErr err = noErr; // Initialize QuickTime if (err = EnterMovies()) { - verbose(0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", + logpost(0, 3+0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", err); return false; } @@ -62,14 +62,14 @@ static bool filmQT_initQT(void) // Initialize QuickTime Media Layer OSErr err = noErr; if ((err = InitializeQTML(0))) { - verbose(0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", + logpost(0, 3+0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", err); return false; } // Initialize QuickTime if (err = EnterMovies()) { - verbose(0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", + logpost(0, 3+0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", err); return false; } @@ -164,7 +164,7 @@ bool filmQT :: open(const std::string&filename_, return false; } if (!m_bInit) { - verbose(0, "[GEM:filmQT] QT object not correctly initialized\n"); + logpost(0, 3+0, "[GEM:filmQT] QT object not correctly initialized\n"); return false; } std::string filename = gem::string::utf8string_to_nativestring(filename_); @@ -189,13 +189,13 @@ bool filmQT :: open(const std::string&filename_, #endif if (err != noErr) { - verbose(0, "[GEM:filmQT] Unable to find file: %s (%d)", filename.c_str(), + logpost(0, 3+0, "[GEM:filmQT] Unable to find file: %s (%d)", filename.c_str(), err); //goto unsupported; } err = ::OpenMovieFile(&theFSSpec, &refnum, fsRdPerm); if (err) { - verbose(0, "[GEM:filmQT] Couldn't open the movie file: %s (%d)", + logpost(0, 3+0, "[GEM:filmQT] Couldn't open the movie file: %s (%d)", filename.c_str(), err); if (refnum) { ::CloseMovieFile(refnum); @@ -205,7 +205,7 @@ bool filmQT :: open(const std::string&filename_, err = ::NewMovieFromFile(&m_movie, refnum, NULL, NULL, newMovieActive, NULL); if (err) { - verbose(0, "[GEM:filmQT] Couldn't make a movie from file: %s (%d)", + logpost(0, 3+0, "[GEM:filmQT] Couldn't make a movie from file: %s (%d)", filename.c_str(), err); if (refnum) { ::CloseMovieFile(refnum); @@ -282,7 +282,7 @@ bool filmQT :: open(const std::string&filename_, SetMoviePlayHints(m_movie, hints, hints); err = SetMovieAudioMute(m_movie, true, 0); if(noErr!=err) { - verbose(0, "[GEM:filmQT] unable to mute movie..."); + logpost(0, 3+0, "[GEM:filmQT] unable to mute movie..."); } err = QTNewGWorldFromPtr( &m_srcGWorld, @@ -294,7 +294,7 @@ bool filmQT :: open(const std::string&filename_, m_image.image.data, m_rowBytes); if (err) { - verbose(0, "[GEM:filmQT] Couldn't make QTNewGWorldFromPtr %d", err); + logpost(0, 3+0, "[GEM:filmQT] Couldn't make QTNewGWorldFromPtr %d", err); goto unsupported; } diff --git a/plugins/QuickTime/imageQT.cpp b/plugins/QuickTime/imageQT.cpp index 6456e68c8..0659877e9 100644 --- a/plugins/QuickTime/imageQT.cpp +++ b/plugins/QuickTime/imageQT.cpp @@ -95,7 +95,7 @@ FSPathMakeFSSpec( std::string filename = gem::string::utf8string_to_nativestring(filename_); OSStatus err = ::NativePathNameToFSSpec (const_cast(filename.c_str()), spec, 0); if (err != noErr && err != -37) { - verbose(0, "[GEM:imageQT] error#%d in NativePathNameToFSSpec()", err); + logpost(0, 3+0, "[GEM:imageQT] error#%d in NativePathNameToFSSpec()", err); } else { err = noErr; } @@ -226,7 +226,7 @@ imageQT :: imageQT(void) if (err = EnterMovies()) { throw(GemException("unable to initialize QuickTime/Movies")); } - verbose(1, "[GEM:imageQT] QT init done"); + logpost(0, 3+1, "[GEM:imageQT] QT init done"); #endif // WINDOWS firsttime=false; } @@ -283,10 +283,10 @@ static bool QuickTimeImage2mem(GraphicsImportComponent inImporter, imageDescH = NULL; result.reallocate(); - verbose(1, "[GEM:imageQT] QuickTimeImage2mem() allocate %d bytes", + logpost(0, 3+1, "[GEM:imageQT] QuickTimeImage2mem() allocate %d bytes", result.xsize*result.ysize*result.csize); if (result.data == NULL) { - verbose(0, "[GEM:imageQT] Can't allocate memory for an image."); + logpost(0, 3+0, "[GEM:imageQT] Can't allocate memory for an image."); return false; } @@ -301,7 +301,7 @@ static bool QuickTimeImage2mem(GraphicsImportComponent inImporter, result.data, static_cast(result.xsize * result.csize)); if (err) { - verbose(0, "[GEM:imageQT] Can't create QTNewWorld"); + logpost(0, 3+0, "[GEM:imageQT] Can't create QTNewWorld"); } ::GraphicsImportSetGWorld(inImporter, gw, NULL); @@ -318,7 +318,7 @@ bool imageQT :: load(std::string filename, imageStruct&result, OSErr err; GraphicsImportComponent importer = NULL; - ::verbose(1, "[GEM:imageQT] reading '%s' with QuickTime", + ::logpost(0, 3+1, "[GEM:imageQT] reading '%s' with QuickTime", filename.c_str()); std::string myfilename=filename; // does the file even exist? @@ -326,13 +326,13 @@ bool imageQT :: load(std::string filename, imageStruct&result, FSSpec spec; err = ::FSPathMakeFSSpec(myfilename, &spec); if (err) { - verbose(0, "[GEM:imageQT] Unable to find file: %s", filename.c_str()); - verbose(1, "[GEM:imageQT] parID : %d", spec.parID); + logpost(0, 3+0, "[GEM:imageQT] Unable to find file: %s", filename.c_str()); + logpost(0, 3+1, "[GEM:imageQT] parID : %d", spec.parID); return false; } err = ::GetGraphicsImporterForFile(&spec, &importer); if (err) { - verbose(0, "[GEM:imageQT] GemImageLoad: Unable to import image '%s'", + logpost(0, 3+0, "[GEM:imageQT] GemImageLoad: Unable to import image '%s'", filename.c_str()); return false; } @@ -396,14 +396,14 @@ bool imageQT::save(const imageStruct&constimage, } if (err != noErr) { - verbose(1, "[GEM:imageQT] error#%d in FSPathMakeRef()", err); + logpost(0, 3+1, "[GEM:imageQT] error#%d in FSPathMakeRef()", err); } err = ::FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags, NULL, NULL, &spec, NULL); if (err != noErr) { - verbose(1, "[GEM:imageQT] error#%d in FSGetCatalogInfo()", err); + logpost(0, 3+1, "[GEM:imageQT] error#%d in FSGetCatalogInfo()", err); } err = FSMakeFSSpec(spec.vRefNum, spec.parID, filename8, @@ -414,13 +414,13 @@ bool imageQT::save(const imageStruct&constimage, err = ::NativePathNameToFSSpec (const_cast(myfilename.c_str()), &spec, 0); #endif if (err != noErr && err != -37) { - verbose(1, "[GEM:imageQT] error#%d in FSMakeFSSpec()", err); + logpost(0, 3+1, "[GEM:imageQT] error#%d in FSMakeFSSpec()", err); } err = OpenADefaultComponent(GraphicsExporterComponentType, osFileType, &geComp); if (err != noErr) { - verbose(0, "[GEM:imageQT] error#%d in OpenADefaultComponent()", err); + logpost(0, 3+0, "[GEM:imageQT] error#%d in OpenADefaultComponent()", err); return false; // FIXME: } @@ -452,14 +452,14 @@ bool imageQT::save(const imageStruct&constimage, // i don't know, whether quicktime still needs the buffer... if (err != noErr) { - verbose(0, "[GEM:imageQT] error#%d in QTNewGWorldFromPtr()", err); + logpost(0, 3+0, "[GEM:imageQT] error#%d in QTNewGWorldFromPtr()", err); goto cleanup; } // Set the input GWorld for the exporter cErr = GraphicsExportSetInputGWorld(geComp, img); if (cErr != noErr) { - verbose(0, "[GEM:imageQT] error#%d in GraphicsExportSetInputGWorld()", + logpost(0, 3+0, "[GEM:imageQT] error#%d in GraphicsExportSetInputGWorld()", cErr); goto cleanup; } @@ -467,7 +467,7 @@ bool imageQT::save(const imageStruct&constimage, // Set the output file to our FSSpec cErr = GraphicsExportSetOutputFile(geComp, &spec); if (cErr != noErr) { - verbose(0, "[GEM:imageQT] error#%d in GraphicsExportSetOutputFile()", + logpost(0, 3+0, "[GEM:imageQT] error#%d in GraphicsExportSetOutputFile()", cErr); goto cleanup; } @@ -507,7 +507,7 @@ bool imageQT::save(const imageStruct&constimage, // Export it cErr = GraphicsExportDoExport(geComp, NULL); if (cErr != noErr) { - verbose(0, "[GEM:imageQT] ERROR: %i in GraphicsExportDoExport()", cErr); + logpost(0, 3+0, "[GEM:imageQT] ERROR: %i in GraphicsExportDoExport()", cErr); goto cleanup; } diff --git a/plugins/QuickTime/recordQT.cpp b/plugins/QuickTime/recordQT.cpp index 812bca769..1f9a8f646 100644 --- a/plugins/QuickTime/recordQT.cpp +++ b/plugins/QuickTime/recordQT.cpp @@ -108,7 +108,7 @@ recordQT :: recordQT(void) if (err = EnterMovies()) { throw(GemException("unable to initialize QuickTime/Movies")); } - verbose(1, "[GEM:recordQT] QT init done"); + logpost(0, 3+1, "[GEM:recordQT] QT init done"); firsttime=false; } @@ -120,7 +120,7 @@ recordQT :: recordQT(void) GetCodecNameList(&codecList,1); count=codecList->count; codecContainer.clear(); - verbose(0, "[GEM:recordQT] %i codecs installed",codecList->count); + logpost(0, 3+0, "[GEM:recordQT] %i codecs installed",codecList->count); for (int i = 0; i < count; i++) { codecName = codecList->list[i]; std::string typeName = std::string((char*)codecName.typeName + 1, ((char*)codecName.typeName)[0]); @@ -137,7 +137,7 @@ recordQT :: recordQT(void) for(int i = 0; i < count; i++) { if (codecContainer[i].ctype == kJPEGCodecType) { m_codec = codecContainer[i].codec; - verbose(1, "[GEM:recordQT] found pjpeg codec %i %lu %p ctype", + logpost(0, 3+1, "[GEM:recordQT] found pjpeg codec %i %lu %p ctype", i, m_codecType, m_codec); break; } @@ -146,7 +146,7 @@ recordQT :: recordQT(void) stdComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType); if (stdComponent == NULL) { - verbose(0, "[GEM:recordQT] failed to open compressor component"); + logpost(0, 3+0, "[GEM:recordQT] failed to open compressor component"); } } @@ -160,7 +160,7 @@ recordQT :: ~recordQT(void) if (stdComponent != NULL) { compErr = CloseComponent(stdComponent); if (compErr != noErr) { - verbose(0, "[GEM:recordQT] CloseComponent failed with error %ld", compErr); + logpost(0, 3+0, "[GEM:recordQT] CloseComponent failed with error %ld", compErr); } } } @@ -262,11 +262,11 @@ void recordQT :: setupQT( m_srcRect.right = m_width; if (m_compressImage->format == GEM_YUV) { - verbose(0, "[GEM:recordQT] using YUV"); + logpost(0, 3+0, "[GEM:recordQT] using YUV"); colorspace = k422YpCbCr8CodecType; } if (m_compressImage->format == GEM_RGBA) { - verbose(0, "[GEM:recordQT] using BGRA"); + logpost(0, 3+0, "[GEM:recordQT] using BGRA"); colorspace = k32ARGBPixelFormat; } #ifdef _WIN32 @@ -313,7 +313,7 @@ void recordQT :: setupQT( if (m_compressImage->upsidedown && m_compressImage->format == GEM_RGBA) { MatrixRecord aMatrix; GetMovieMatrix(m_movie,&aMatrix); - verbose(1, "[GEM:recordQT] upside down"); + logpost(0, 3+1, "[GEM:recordQT] upside down"); ScaleMatrix(&aMatrix,Long2Fix(1),Long2Fix(-1),0,0); SetMovieMatrix(m_movie,&aMatrix); } @@ -418,7 +418,7 @@ void recordQT :: stop(void) m_recordSetup = false; m_firstRun = 1; - verbose(0, "[GEM:recordQT] movie written to %s",m_filename.c_str()); + logpost(0, 3+0, "[GEM:recordQT] movie written to %s",m_filename.c_str()); m_filename.clear(); } @@ -463,7 +463,7 @@ void recordQT :: compressFrame(void) startTime.QuadPart)/countFreq * 1000.f); seconds = (static_cast(endTime.QuadPart - startTime.QuadPart)/countFreq * 1.f); - verbose(1, + logpost(0, 3+1, "[GEM:recordQT] freq %f countFreq %f startTime %d endTime %d fps %f seconds %f", freq, countFreq, static_cast(startTime.QuadPart), static_cast(endTime.QuadPart), fps, seconds); @@ -576,7 +576,7 @@ bool recordQT :: dialog(void) compErr = CloseComponent(stdComponent); } if (compErr != noErr) { - verbose(0, "[GEM:recordQT] CloseComponent failed with error %ld", compErr); + logpost(0, 3+0, "[GEM:recordQT] CloseComponent failed with error %ld", compErr); } //open a new component from scratch @@ -591,7 +591,7 @@ bool recordQT :: dialog(void) compErr = SCRequestSequenceSettings(stdComponent); if (compErr != noErr) { - verbose(0, "[GEM:recordQT] SCRequestSequenceSettings failed with error %ld", + logpost(0, 3+0, "[GEM:recordQT] SCRequestSequenceSettings failed with error %ld", compErr); } @@ -600,7 +600,7 @@ bool recordQT :: dialog(void) compErr = SCGetInfo(stdComponent, scSpatialSettingsType, &SpatialSettings); if (compErr != noErr) { - verbose(0, "[GEM:recordQT] SCGetInfo failed with error %ld", compErr); + logpost(0, 3+0, "[GEM:recordQT] SCGetInfo failed with error %ld", compErr); } m_codecType = SpatialSettings.codecType; @@ -610,14 +610,14 @@ bool recordQT :: dialog(void) m_frameRate = TemporalSettings.frameRate; m_keyFrameRate = TemporalSettings.keyFrameRate; - verbose(1, "[GEM:recordQT] Dialog returned SpatialSettings\n" + logpost(0, 3+1, "[GEM:recordQT] Dialog returned SpatialSettings\n" "\tcodecType %lX\n" "\tcodec %p\n" "\tdepth %d\n" "\tspatialQuality %ld", SpatialSettings.codecType, SpatialSettings.codec, SpatialSettings.depth, SpatialSettings.spatialQuality); - verbose(1, "[GEM:recordQT] Dialog returned TemporalSettings\n" + logpost(0, 3+1, "[GEM:recordQT] Dialog returned TemporalSettings\n" "\ttemporalQualitye %ld\n" "\tframeRate %ld\n" "\tkeyFrameRate %ld", @@ -698,7 +698,7 @@ bool recordQT :: setCodec(const std::string&codecName) switch(requestedCodec) { case 1: /* PJPEG */ if (codecContainer[i].ctype == kJPEGCodecType) { - verbose(0, "[GEM:recordQT] found Photo Jpeg"); + logpost(0, 3+0, "[GEM:recordQT] found Photo Jpeg"); resetCodecSettings(); m_codecType = codecContainer[i].ctype; m_codec = codecContainer[i].codec; @@ -707,7 +707,7 @@ bool recordQT :: setCodec(const std::string&codecName) break; case 2: /* AIC */ if (static_cast(codecContainer[i].ctype) == 'icod') { - verbose(0, "[GEM:recordQT] found Apple Intermediate Codec"); + logpost(0, 3+0, "[GEM:recordQT] found Apple Intermediate Codec"); resetCodecSettings(); m_codecType = codecContainer[i].ctype; m_codec = codecContainer[i].codec; @@ -716,7 +716,7 @@ bool recordQT :: setCodec(const std::string&codecName) break; case 3: /* Animation */ if (codecContainer[i].ctype == kAnimationCodecType) { - verbose(0, "[GEM:recordQT] found Animation"); + logpost(0, 3+0, "[GEM:recordQT] found Animation"); resetCodecSettings(); m_codecType = codecContainer[i].ctype; m_codec = codecContainer[i].codec; @@ -725,7 +725,7 @@ bool recordQT :: setCodec(const std::string&codecName) break; case 4: /* DV NTSC */ if (codecContainer[i].ctype == kDVCNTSCCodecType) { - verbose(0, "[GEM:recordQT] found DV NTSC"); + logpost(0, 3+0, "[GEM:recordQT] found DV NTSC"); resetCodecSettings(); m_codecType = codecContainer[i].ctype; m_codec = codecContainer[i].codec; @@ -734,7 +734,7 @@ bool recordQT :: setCodec(const std::string&codecName) break; case 5: /* DV PAL */ if (codecContainer[i].ctype == kDVCPALCodecType) { - verbose(0, "[GEM:recordQT] found DV PAL"); + logpost(0, 3+0, "[GEM:recordQT] found DV PAL"); resetCodecSettings(); m_codecType = codecContainer[i].ctype; m_codec = codecContainer[i].codec; @@ -744,7 +744,7 @@ bool recordQT :: setCodec(const std::string&codecName) default: /* hmmm... */ if(gensym(codecName.c_str())==gensym(codecContainer[i].name.c_str())) { - verbose(0, "[GEM:recordQT] found '%s'", codecName.c_str()); + logpost(0, 3+0, "[GEM:recordQT] found '%s'", codecName.c_str()); resetCodecSettings(); m_codecType = codecContainer[i].ctype; m_codec = codecContainer[i].codec; diff --git a/plugins/TIFF/imageTIFF.cpp b/plugins/TIFF/imageTIFF.cpp index fa9b9fdf2..3d6022680 100644 --- a/plugins/TIFF/imageTIFF.cpp +++ b/plugins/TIFF/imageTIFF.cpp @@ -58,7 +58,7 @@ static void imageTIFF_verbosehandler(const int verbosity, vsnprintf(buf, MAXPDSTRING, fmt, ap); buf[MAXPDSTRING-1]=0; result+=buf; - verbose(verbosity, "%s", result.c_str()); + logpost(0, 3+verbosity, "%s", result.c_str()); } static void imageTIFF_errorhandler(const char*module, const char*fmt, va_list ap) @@ -178,7 +178,7 @@ bool imageTIFF :: load(std::string filename, imageStruct&result, for (uint32_t row = 0; row < height; row++) { unsigned char *pixels = dstLine; if (TIFFReadScanline(tif, buf, row, 0) < 0) { - verbose(1, "[GEM:imageTIFF] bad image data read on line: %d: %s", row, + logpost(0, 3+1, "[GEM:imageTIFF] bad image data read on line: %d: %s", row, filename.c_str()); TIFFClose(tif); return false; @@ -216,7 +216,7 @@ bool imageTIFF :: load(std::string filename, imageStruct&result, char emsg[1024]; TIFFRGBAImage img; if (TIFFRGBAImageBegin(&img, tif, 0, emsg) == 0) { - verbose(0, "[GEM:imageTIFF] Error reading in image file '%s': %s", + logpost(0, 3+0, "[GEM:imageTIFF] Error reading in image file '%s': %s", filename.c_str(), emsg); TIFFClose(tif); tiffhandlers_cleanup(); @@ -234,7 +234,7 @@ bool imageTIFF :: load(std::string filename, imageStruct&result, } if (TIFFRGBAImageGet(&img, raster, width, height) == 0) { - verbose(0, "[GEM:imageTIFF] Error getting image data in file '%s': %s", + logpost(0, 3+0, "[GEM:imageTIFF] Error getting image data in file '%s': %s", filename.c_str(), emsg); _TIFFfree(raster); TIFFClose(tif); @@ -327,7 +327,7 @@ bool imageTIFF :: load(std::string filename, imageStruct&result, orient = "unknown"; break; } if(orient) { - verbose(0, "[GEM:imageTIFF] unhandled orientation '%s' (%d)", orient, orientation); + logpost(0, 3+0, "[GEM:imageTIFF] unhandled orientation '%s' (%d)", orient, orientation); } return true; } @@ -405,7 +405,7 @@ bool imageTIFF::save(const imageStruct&constimage, for (uint32_t row = 0; row < height; row++) { if (TIFFWriteScanline(tif, srcLine, row, 0) < 0) { - verbose(0, "[GEM:imageTIFF] could not write line %d to image '%s'", row, + logpost(0, 3+0, "[GEM:imageTIFF] could not write line %d to image '%s'", row, filename.c_str()); TIFFClose(tif); tiffhandlers_cleanup(); diff --git a/plugins/UNICAP/videoUNICAP.cpp b/plugins/UNICAP/videoUNICAP.cpp index 74af24ca2..afe7b0610 100644 --- a/plugins/UNICAP/videoUNICAP.cpp +++ b/plugins/UNICAP/videoUNICAP.cpp @@ -315,7 +315,7 @@ void videoUNICAP::newFrame (unicap_handle_t handle, fourcc_t format=fourcc2fmt(fmt->fourcc); if(ILLEGAL==format) { - verbose(1, "[GEM:videoUNICAP] unsupported format '%s'", fmt->identifier); + logpost(0, 3+1, "[GEM:videoUNICAP] unsupported format '%s'", fmt->identifier); return; } @@ -373,7 +373,7 @@ void videoUNICAP::newFrame (unicap_handle_t handle, m_pix.image.fromYU12(data); break; default: - verbose(1, "[GEM:videoUNICAP] cannot convert from given format"); + logpost(0, 3+1, "[GEM:videoUNICAP] cannot convert from given format"); break; } m_pix.newimage=1; @@ -442,7 +442,7 @@ bool videoUNICAP :: start(void) int format_index=formatid[formatid_index]; if( !SUCCESS( unicap_enumerate_formats( m_handle, &format_spec, &format, format_index) ) ) { - verbose(1, "[GEM:videoUNICAP] Failed to get video format %d", + logpost(0, 3+1, "[GEM:videoUNICAP] Failed to get video format %d", format_index); continue; } @@ -587,7 +587,7 @@ std::vector videoUNICAP::enumerate(void) if(SUCCESS(status)) { const unsigned int cur=m_devices.size(); #if 0 - verbose(1, + logpost(0, 3+1, "[GEM:videoUNICAP] ID='%s'\tmodel='%s'\tvendor='%s'\tdevice='%s'\tCPI='%s'", device.identifier, device.model_name, @@ -865,10 +865,10 @@ void videoUNICAP :: setProperties(gem::Properties&props) } if(!SUCCESS(status)) { - verbose(1, "[GEM:videoUNICAP] could not set property '%s'", key.c_str()); + logpost(0, 3+1, "[GEM:videoUNICAP] could not set property '%s'", key.c_str()); #if 0 } else { - verbose(1, "[GEM:videoUNICAP] successfully set property '%s'", + logpost(0, 3+1, "[GEM:videoUNICAP] successfully set property '%s'", key.c_str()); #endif } diff --git a/plugins/V4L/videoV4L.cpp b/plugins/V4L/videoV4L.cpp index 4ef1c352f..7ad285405 100644 --- a/plugins/V4L/videoV4L.cpp +++ b/plugins/V4L/videoV4L.cpp @@ -250,7 +250,7 @@ bool videoV4L :: openDevice(gem::Properties&props) for (int i = 0; i < vcap.channels; i++) { vchannel.channel = i; - verbose(1, "[GEM:videoV4L] getting channel info for #%d", i); + logpost(0, 3+1, "[GEM:videoV4L] getting channel info for #%d", i); if (v4l1_ioctl(tvfd, VIDIOCGCHAN, &vchannel) < 0) { perror("[GEM:videoV4L] VIDIOCGCHAN"); goto closit; @@ -426,7 +426,7 @@ bool videoV4L :: startTransfer() m_haveVideo = 1; - verbose(1, "[GEM:videoV4L] startTransfer opened video connection %X", + logpost(0, 3+1, "[GEM:videoV4L] startTransfer opened video connection %X", tvfd); return true; } @@ -471,9 +471,9 @@ std::vector videoV4L::enumerate() for(int i=0; i videoV4L::enumerate() if (vcap.type & VID_TYPE_CAPTURE) { result.push_back(dev); } else { - verbose(1, "[GEM:videoV4L] %s is v4l1 but cannot capture", dev.c_str()); + logpost(0, 3+1, "[GEM:videoV4L] %s is v4l1 but cannot capture", dev.c_str()); } } else { - verbose(1, "[GEM:videoV4L] %s is no v4l1 device", dev.c_str()); + logpost(0, 3+1, "[GEM:videoV4L] %s is no v4l1 device", dev.c_str()); } v4l1_close(fd); @@ -662,13 +662,13 @@ void videoV4L::setProperties(gem::Properties&props) /* do compound settings */ if(do_s_chan) { - verbose(2, "[GEM:videoV4L] calling VIDIOCSCHAN"); + logpost(0, 3+2, "[GEM:videoV4L] calling VIDIOCSCHAN"); if (v4l1_ioctl(tvfd, VIDIOCSCHAN, &vchannel) < 0) { perror("[GEM:videoV4L] VDIOCSCHAN"); } } if(do_s_pict) { - verbose(2, "[GEM:videoV4L] calling VIDIOCSPICT"); + logpost(0, 3+2, "[GEM:videoV4L] calling VIDIOCSPICT"); if (v4l1_ioctl(tvfd, VIDIOCSPICT, &vpicture) < 0) { perror("[GEM:videoV4L] VIDIOCSPICT"); } diff --git a/plugins/V4L2/recordV4L2.cpp b/plugins/V4L2/recordV4L2.cpp index 01ae1f990..2617579bc 100644 --- a/plugins/V4L2/recordV4L2.cpp +++ b/plugins/V4L2/recordV4L2.cpp @@ -22,7 +22,7 @@ #include "Gem/Manager.h" #include "Gem/Exception.h" -// for verbose(): +// for logpost(0, 3+): #include "Gem/RTE.h" #include "plugins/PluginFactory.h" @@ -153,7 +153,7 @@ bool recordV4L2::init(const imageStruct* dummyImage, const int framedur) vid_format.fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; int format= vid_format.fmt.pix.pixelformat; - verbose(1, "[GEM:recordV4L2] v4l2-output requested %dx%d @ '%c%c%c%c'", + logpost(0, 3+1, "[GEM:recordV4L2] v4l2-output requested %dx%d @ '%c%c%c%c'", vid_format.fmt.pix.width, vid_format.fmt.pix.height, (char)(format), (char)(format>>8), @@ -165,7 +165,7 @@ bool recordV4L2::init(const imageStruct* dummyImage, const int framedur) return false; } - verbose(1, "[GEM:recordV4L2] v4l2-output returned %dx%d @ '%c%c%c%c'", + logpost(0, 3+1, "[GEM:recordV4L2] v4l2-output returned %dx%d @ '%c%c%c%c'", vid_format.fmt.pix.width, vid_format.fmt.pix.height, (char)(format), (char)(format>>8), diff --git a/plugins/V4L2/videoV4L2.cpp b/plugins/V4L2/videoV4L2.cpp index 855e0df5a..046899dd1 100644 --- a/plugins/V4L2/videoV4L2.cpp +++ b/plugins/V4L2/videoV4L2.cpp @@ -433,9 +433,9 @@ bool videoV4L2 :: openDevice(gem::Properties&props) int i=0; for(i=0; i= alldev.size() ) { - verbose(0, "[GEM:videoV4L2] no v4l2 input device on bus %s\n", + logpost(0, 3+0, "[GEM:videoV4L2] no v4l2 input device on bus %s\n", devname.c_str()); devname = ""; } @@ -467,7 +467,7 @@ bool videoV4L2 :: openDevice(gem::Properties&props) m_tvfd = v4l2_open (dev_name, O_RDWR /* required */, 0); if (-1 == m_tvfd) { - verbose(0, "[GEM:videoV4L2] Cannot open '%s': %d, %s", dev_name, errno, + logpost(0, 3+0, "[GEM:videoV4L2] Cannot open '%s': %d, %s", dev_name, errno, strerror (errno)); closeDevice(); return false; @@ -475,14 +475,14 @@ bool videoV4L2 :: openDevice(gem::Properties&props) struct stat st; if (-1 == fstat (m_tvfd, &st)) { - verbose(0, "[GEM:videoV4L2] Cannot identify '%s': %d, %s", dev_name, errno, + logpost(0, 3+0, "[GEM:videoV4L2] Cannot identify '%s': %d, %s", dev_name, errno, strerror (errno)); closeDevice(); return false; } if (!S_ISCHR (st.st_mode)) { - verbose(0, "[GEM:videoV4L2] %s is no device", dev_name); + logpost(0, 3+0, "[GEM:videoV4L2] %s is no device", dev_name); closeDevice(); return false; } @@ -492,7 +492,7 @@ bool videoV4L2 :: openDevice(gem::Properties&props) struct v4l2_capability cap; if (-1 == xioctl (m_tvfd, VIDIOC_QUERYCAP, &cap)) { if (EINVAL == errno) { - verbose(0, "[GEM:videoV4L2] %s is no V4L2 device", dev_name); + logpost(0, 3+0, "[GEM:videoV4L2] %s is no V4L2 device", dev_name); closeDevice(); return false; } else { @@ -503,26 +503,26 @@ bool videoV4L2 :: openDevice(gem::Properties&props) } if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { - verbose(0, "[GEM:videoV4L2] %s is no video capture device", dev_name); + logpost(0, 3+0, "[GEM:videoV4L2] %s is no video capture device", dev_name); closeDevice(); return false; } if (!(cap.capabilities & V4L2_CAP_STREAMING)) { - verbose(0, "[GEM:videoV4L2] %s does not support streaming i/o", dev_name); + logpost(0, 3+0, "[GEM:videoV4L2] %s does not support streaming i/o", dev_name); closeDevice(); return false; } #if defined V4L2_CAP_DEVICE_CAPS && defined V4L2_CAP_META_CAPTURE if (cap.capabilities & V4L2_CAP_DEVICE_CAPS && V4L2_CAP_META_CAPTURE & cap.device_caps) { - verbose(0, "[GEM:videoV4L2] %s is a metadata device", dev_name); + logpost(0, 3+0, "[GEM:videoV4L2] %s is a metadata device", dev_name); closeDevice(); return false; } #endif - verbose(1, "[GEM:videoV4L2] successfully opened %s", dev_name); + logpost(0, 3+1, "[GEM:videoV4L2] successfully opened %s", dev_name); setProperties(props); @@ -530,7 +530,7 @@ bool videoV4L2 :: openDevice(gem::Properties&props) } void videoV4L2 :: closeDevice() { - verbose(1, "[GEM:videoV4L2] closing device %d", m_tvfd); + logpost(0, 3+1, "[GEM:videoV4L2] closing device %d", m_tvfd); if (m_tvfd>=0) { v4l2_close(m_tvfd); } @@ -574,7 +574,7 @@ bool videoV4L2 :: startTransfer() debugPost("v4l2: start transfer"); m_stopTransfer=false; m_rendering=true; - verbose(1, "[GEM:videoV4L2] starting transfer"); + logpost(0, 3+1, "[GEM:videoV4L2] starting transfer"); int i; __u32 pixelformat=0; @@ -613,7 +613,7 @@ bool videoV4L2 :: startTransfer() if(fmt.fmt.pix.pixelformat != pixelformat) { fmt.fmt.pix.pixelformat = pixelformat; - verbose(1, "[GEM:videoV4L2] want 0x%X == '%c%c%c%c' ", m_reqFormat, + logpost(0, 3+1, "[GEM:videoV4L2] want 0x%X == '%c%c%c%c' ", m_reqFormat, (char)(fmt.fmt.pix.pixelformat), (char)(fmt.fmt.pix.pixelformat>>8), (char)(fmt.fmt.pix.pixelformat>>16), @@ -693,7 +693,7 @@ bool videoV4L2 :: startTransfer() /* we should really return here! */ } - verbose(1, "[GEM:videoV4L2] got '%c%c%c%c'", + logpost(0, 3+1, "[GEM:videoV4L2] got '%c%c%c%c'", (char)(m_gotFormat), (char)(m_gotFormat>>8), (char)(m_gotFormat>>16), @@ -768,7 +768,7 @@ bool videoV4L2 :: startTransfer() debugPost("v4l2: waiting for thread to come up"); } - verbose(1, "[GEM:videoV4L2] Opened video connection 0x%X", m_tvfd); + logpost(0, 3+1, "[GEM:videoV4L2] Opened video connection 0x%X", m_tvfd); return(1); @@ -857,9 +857,9 @@ std::vector videoV4L2::enumerate() for(int i=0; i videoV4L2::enumerate() memset (&cap, 0, sizeof (cap)); if (-1 != xioctl (fd, VIDIOC_QUERYCAP, &cap)) { if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { - verbose(1, "[GEM:videoV4L2] %s is v4l2 but cannot capture", dev.c_str()); + logpost(0, 3+1, "[GEM:videoV4L2] %s is v4l2 but cannot capture", dev.c_str()); #if defined V4L2_CAP_DEVICE_CAPS && defined V4L2_CAP_META_CAPTURE } else if (cap.capabilities & V4L2_CAP_DEVICE_CAPS && V4L2_CAP_META_CAPTURE & cap.device_caps) { - verbose(1, "[GEM:videoV4L2] %s is a v4l2 meta device", dev.c_str()); + logpost(0, 3+1, "[GEM:videoV4L2] %s is a v4l2 meta device", dev.c_str()); #endif } else { result.push_back(dev); } } else { - verbose(1, "[GEM:videoV4L2] %s is no v4l2 device", dev.c_str()); + logpost(0, 3+1, "[GEM:videoV4L2] %s is no v4l2 device", dev.c_str()); } v4l2_close(fd); } diff --git a/plugins/VFW/videoVFW.cpp b/plugins/VFW/videoVFW.cpp index 353f60694..92b155de2 100644 --- a/plugins/VFW/videoVFW.cpp +++ b/plugins/VFW/videoVFW.cpp @@ -72,7 +72,7 @@ bool videoVFW :: openDevice(gem::Properties&props) char driverName[256]; char driverDesc[256]; if (capGetDriverDescription(0, driverName, 256, driverDesc, 256)) { - verbose(1, "[GEM:videoVFW] driver '%s'", driverName); + logpost(0, 3+1, "[GEM:videoVFW] driver '%s'", driverName); } @@ -96,19 +96,19 @@ bool videoVFW :: openDevice(gem::Properties&props) 0, 0, m_width, m_height,// window position and dimensions GetDesktopWindow(), 0); if (!m_hWndC) { - verbose(0, "[GEM:videoVFW] Unable to create capture window"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to create capture window"); return false; } if (!capDriverConnect(m_hWndC, 0)) { - verbose(0, "[GEM:videoVFW] Unable to connect to video driver"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to connect to video driver"); closeDevice(); return false; } CAPTUREPARMS params; if (!capCaptureGetSetup(m_hWndC, ¶ms, sizeof(CAPTUREPARMS))) { - verbose(0, "[GEM:videoVFW] Unable to get capture parameters"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to get capture parameters"); closeDevice(); return false; } @@ -122,25 +122,25 @@ bool videoVFW :: openDevice(gem::Properties&props) params.fAbortLeftMouse = FALSE; params.fAbortRightMouse = FALSE; if (!capCaptureSetSetup(m_hWndC, ¶ms, sizeof(CAPTUREPARMS))) { - verbose(0, "[GEM:videoVFW] Unable to set capture parameters"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to set capture parameters"); closeDevice(); return false; } if (!capSetCallbackOnVideoStream(m_hWndC, videoVFW::videoFrameCallback)) { - verbose(0, "[GEM:videoVFW] Unable to set frame callback"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to set frame callback"); closeDevice(); return false; } if (!capSetUserData(m_hWndC, this)) { - verbose(0, "[GEM:videoVFW] Unable to set user data"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to set user data"); closeDevice(); return false; } DWORD formSize = capGetVideoFormat(m_hWndC, NULL, 0); BITMAPINFO *videoFormat = (BITMAPINFO *)(new char[formSize]); if (!capGetVideoFormat(m_hWndC, videoFormat, formSize)) { - verbose(0, "[GEM:videoVFW] Unable to get video format"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to get video format"); closeDevice(); return false; } @@ -153,7 +153,7 @@ bool videoVFW :: openDevice(gem::Properties&props) videoFormat->bmiHeader.biClrImportant = 0; videoFormat->bmiHeader.biSizeImage = 0; if (!capSetVideoFormat(m_hWndC, videoFormat, formSize)) { - verbose(0, "[GEM:videoVFW] Unable to set video format"); + logpost(0, 3+0, "[GEM:videoVFW] Unable to set video format"); delete[]videoFormat; closeDevice(); return false; @@ -164,7 +164,7 @@ bool videoVFW :: openDevice(gem::Properties&props) m_width=static_cast(videoFormat->bmiHeader.biWidth); m_height=static_cast(videoFormat->bmiHeader.biHeight); - verbose(1, "[GEM:videoVFW] Connected with %dx%d @ %d", + logpost(0, 3+1, "[GEM:videoVFW] Connected with %dx%d @ %d", m_width, m_height, static_cast(videoFormat->bmiHeader.biBitCount)); diff --git a/plugins/VIDS/videoVIDS.cpp b/plugins/VIDS/videoVIDS.cpp index faa1c5b4f..355a32f02 100644 --- a/plugins/VIDS/videoVIDS.cpp +++ b/plugins/VIDS/videoVIDS.cpp @@ -139,7 +139,7 @@ static inline void getVideoFilter(videoInput&vi, int device, return; } double d=((double)(cur-min))/((double)(max-min)); - verbose(1, "[GEM::videoVIDS] gotFilterSetting '%s' to %f (%d in %d..%d)", + logpost(0, 3+1, "[GEM::videoVIDS] gotFilterSetting '%s' to %f (%d in %d..%d)", propName.c_str(), d, (int)cur, (int)min, (int)max); props.set(propName, d); } @@ -164,7 +164,7 @@ static inline void getVideoCamera(videoInput&vi, int device, return; } double d=((double)(cur-min))/((double)(max-min)); - verbose(1, "[GEM::videoVIDS] gotCameraSetting '%s' to %f (%d in %d..%d)\n", + logpost(0, 3+1, "[GEM::videoVIDS] gotCameraSetting '%s' to %f (%d in %d..%d)\n", propName.c_str(), d, (int)cur, (int)min, (int)max); props.set(propName, d); } @@ -226,7 +226,7 @@ bool videoVIDS::enumProperties(gem::Properties&readable, void videoVIDS::setProperties(gem::Properties&props) { if(trySetProperties(props, true)) { - verbose(1, "[GEM::videoVIDS] needs restart"); + logpost(0, 3+1, "[GEM::videoVIDS] needs restart"); if(m_vi) { stop(); start(); diff --git a/plugins/VLC/videoVLC.cpp b/plugins/VLC/videoVLC.cpp index bf977fad9..d262a3791 100644 --- a/plugins/VLC/videoVLC.cpp +++ b/plugins/VLC/videoVLC.cpp @@ -372,10 +372,10 @@ unsigned videoVLC::setFormat(char chroma[4], unsigned &width, unsigned &height, unsigned &pitches, unsigned &lines) { #if 0 - verbose(1, "[GEM:videoVLC] chroma: %s", chroma); - verbose(1, "[GEM:videoVLC] dimen : %dx%d", width, height); - verbose(1, "[GEM:videoVLC] pitches: %d", pitches); - verbose(1, "[GEM:videoVLC] lines: %d", lines); + logpost(0, 3+1, "[GEM:videoVLC] chroma: %s", chroma); + logpost(0, 3+1, "[GEM:videoVLC] dimen : %dx%d", width, height); + logpost(0, 3+1, "[GEM:videoVLC] pitches: %d", pitches); + logpost(0, 3+1, "[GEM:videoVLC] lines: %d", lines); #endif memcpy(chroma, format_string, 4); diff --git a/plugins/filmDS/filmDS.cpp b/plugins/filmDS/filmDS.cpp index 72926fa60..1ca3d77ae 100644 --- a/plugins/filmDS/filmDS.cpp +++ b/plugins/filmDS/filmDS.cpp @@ -561,7 +561,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB mt.subtype = MEDIASUBTYPE_RGB32; break; default: - verbose(1, + logpost(0, 3+1, "[GEM:videoDS] Trying to set unsupported format this is an internal bug, using default RGBA"); mt.subtype = MEDIASUBTYPE_RGB32; } @@ -586,7 +586,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB //Set Params - One Shot should be false unless you want to capture just one buffer hr = m_pGrabber->SetOneShot(FALSE); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] unable to set one shot"); + logpost(0, 3+1, "[GEM:videoDS] unable to set one shot"); tearDown(); return false; } @@ -594,7 +594,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB //apparently setting to TRUE causes a small memory leak hr = m_pGrabber->SetBufferSamples(FALSE); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] unable to set buffer samples"); + logpost(0, 3+1, "[GEM:videoDS] unable to set buffer samples"); tearDown(); return false; } @@ -604,14 +604,14 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)(&m_pNullRenderer)); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] null renderer error"); + logpost(0, 3+1, "[GEM:videoDS] null renderer error"); tearDown(); return false; } hr = m_pGraph->AddFilter(m_pNullRenderer, L"Render"); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] unable to add null renderer"); + logpost(0, 3+1, "[GEM:videoDS] unable to add null renderer"); tearDown(); return false; } @@ -621,7 +621,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB hr = m_pGrabber->GetConnectedMediaType(&mt); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] unable to call GetConnectedMediaType"); + logpost(0, 3+1, "[GEM:videoDS] unable to call GetConnectedMediaType"); tearDown(); return false; } @@ -642,7 +642,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB hr = m_pGraph->FindFilterByName(L"Video Renderer", &m_pVideoRenderer); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] failed to find the video renderer"); + logpost(0, 3+1, "[GEM:videoDS] failed to find the video renderer"); tearDown(); return false; } @@ -650,14 +650,14 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB //we disconnect the video renderer window by finding the output pin of the sample grabber hr = m_pGrabberF->FindPin(L"Out", &pinOut); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] failed to find the sample grabber output pin"); + logpost(0, 3+1, "[GEM:videoDS] failed to find the sample grabber output pin"); tearDown(); return false; } hr = pinOut->Disconnect(); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] failed to disconnect grabber output pin"); + logpost(0, 3+1, "[GEM:videoDS] failed to disconnect grabber output pin"); tearDown(); return false; } @@ -665,7 +665,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB //we have to remove it as well otherwise the graph builder will reconnect it hr = m_pGraph->RemoveFilter(m_pVideoRenderer); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] failed to remove the default renderer"); + logpost(0, 3+1, "[GEM:videoDS] failed to remove the default renderer"); tearDown(); return false; } else { @@ -675,7 +675,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB //now connect the null renderer to the grabber output, if we don't do this not frames will be captured hr = m_pNullRenderer->FindPin(L"In", &pinIn); if (FAILED(hr)) { - verbose(1, + logpost(0, 3+1, "[GEM:videoDS] failed to find the input pin of the null renderer"); tearDown(); return false; @@ -683,7 +683,7 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB hr = pinOut->Connect(pinIn, NULL); if (FAILED(hr)) { - verbose(1, "[GEM:videoDS] failed to connect the null renderer"); + logpost(0, 3+1, "[GEM:videoDS] failed to connect the null renderer"); tearDown(); return false; } @@ -703,13 +703,13 @@ class gem::plugins::filmDS::DirectShowVideo : public ISampleGrabberCB if( FAILED(hr) || width == 0 || height == 0 ) { tearDown(); - verbose(1, + logpost(0, 3+1, "[GEM:videoDS] Error occurred while playing or pausing or opening the file"); return false; } } else { tearDown(); - verbose(1, + logpost(0, 3+1, "[GEM:videoDS] Error occurred while playing or pausing or opening the file"); return false; } diff --git a/plugins/filmDSATL/filmDS.cpp b/plugins/filmDSATL/filmDS.cpp index 60be5a589..146008278 100644 --- a/plugins/filmDSATL/filmDS.cpp +++ b/plugins/filmDSATL/filmDS.cpp @@ -245,7 +245,7 @@ bool filmDS :: open(const std::string&filename, BOOL bFrameTime = TRUE; GUID Guid; - verbose(1, "Trying DirectShow"); + logpost(0, 3+1, "Trying DirectShow"); // Convert c-string to Wide string. memset(&WideFileName, 0, MAXPDSTRING * 2); @@ -253,7 +253,7 @@ bool filmDS :: open(const std::string&filename, if (0 == MultiByteToWideChar(CP_ACP, 0, filename.c_str(), filename.length(), WideFileName, MAXPDSTRING)) { - verbose(0, "[GEM:filmDS:legacy]Unable to load %s", filename.c_str()); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to load %s", filename.c_str()); return false; } @@ -262,7 +262,7 @@ bool filmDS :: open(const std::string&filename, &VideoFilter); if (RetVal != S_OK || NULL == VideoFilter) { - verbose(0, "[GEM:filmDS:legacy]Unable to render %s", filename.c_str()); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to render %s", filename.c_str()); return false; } @@ -273,7 +273,7 @@ bool filmDS :: open(const std::string&filename, IID_IBaseFilter, (void**)&SampleFilter); if (RetVal != S_OK || NULL == SampleFilter) { - verbose(0, "[GEM:filmDS:legacy]Unable to create SampleFilter interface %d", + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to create SampleFilter interface %d", RetVal); return false; } @@ -282,7 +282,7 @@ bool filmDS :: open(const std::string&filename, RetVal = FilterGraph->AddFilter(SampleFilter, L"Sample Grabber"); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to add SampleFilter %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to add SampleFilter %d", RetVal); return false; } @@ -294,7 +294,7 @@ bool filmDS :: open(const std::string&filename, (void **)&SampleGrabber); if (RetVal != S_OK || NULL == SampleGrabber) { - verbose(0, + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to create SampleGrabber interface %d", RetVal); return false; } @@ -316,7 +316,7 @@ bool filmDS :: open(const std::string&filename, RetVal = SampleGrabber->SetOneShot(FALSE); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to setup sample grabber %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to setup sample grabber %d", RetVal); return false; } @@ -325,7 +325,7 @@ bool filmDS :: open(const std::string&filename, RetVal = SampleGrabber->SetBufferSamples(TRUE); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to setup sample grabber %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to setup sample grabber %d", RetVal); return false; } @@ -336,7 +336,7 @@ bool filmDS :: open(const std::string&filename, IID_IBaseFilter, (void**)&NullFilter); if (RetVal != S_OK || NULL == NullFilter) { - verbose(0, "[GEM:filmDS:legacy]Unable to create NullFilter interface %d", + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to create NullFilter interface %d", RetVal); return false; } @@ -345,7 +345,7 @@ bool filmDS :: open(const std::string&filename, RetVal = FilterGraph->AddFilter(NullFilter, L"NullRenderer"); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to add NullFilter %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to add NullFilter %d", RetVal); return false; } @@ -357,7 +357,7 @@ bool filmDS :: open(const std::string&filename, RetVal = filmConnectFilters(FilterGraph, VideoFilter, SampleFilter); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to connect filters %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to connect filters %d", RetVal); return false; } @@ -365,7 +365,7 @@ bool filmDS :: open(const std::string&filename, RetVal = filmConnectFilters(FilterGraph, SampleFilter, NullFilter); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to connect filters %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to connect filters %d", RetVal); return false; } @@ -383,7 +383,7 @@ bool filmDS :: open(const std::string&filename, RetVal = MediaSeeking->SetTimeFormat(&Guid); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to set video time format %d", + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to set video time format %d", RetVal); return false; } @@ -394,7 +394,7 @@ bool filmDS :: open(const std::string&filename, RetVal = MediaSeeking->GetDuration(&m_Duration); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to get video duration %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to get video duration %d", RetVal); return false; } @@ -420,7 +420,7 @@ bool filmDS :: open(const std::string&filename, RetVal = SampleGrabber->GetConnectedMediaType(&MediaType); if (RetVal != S_OK) { - verbose(0, "[GEM:filmDS:legacy]Unable to get media type %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to get media type %d", RetVal); return false; } @@ -438,7 +438,7 @@ bool filmDS :: open(const std::string&filename, } else { - verbose(0, "[GEM:filmDS:legacy]Invalid media type returned %s", + logpost(0, 3+0, "[GEM:filmDS:legacy]Invalid media type returned %s", filename.c_str()); return false; } @@ -452,7 +452,7 @@ bool filmDS :: open(const std::string&filename, m_frame = new BYTE[m_xsize * m_ysize * m_csize]; if (NULL == m_frame) { - verbose(0, + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to allocate memory for the video buffer %s", filename.c_str()); return false; @@ -497,7 +497,7 @@ bool filmDS :: open(const std::string&filename, RetVal = MediaControl->Run(); if (RetVal != S_OK && RetVal != S_FALSE) { - verbose(0, "[GEM:filmDS:legacy]Unable to start video %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to start video %d", RetVal); return false; } @@ -509,7 +509,7 @@ bool filmDS :: open(const std::string&filename, RetVal = MediaControl->GetState(0, &FilterState); if (RetVal != S_OK && RetVal != VFW_S_STATE_INTERMEDIATE) { - verbose(0, "[GEM:filmDS:legacy]Unable to run video %d", RetVal); + logpost(0, 3+0, "[GEM:filmDS:legacy]Unable to run video %d", RetVal); return false; } @@ -529,7 +529,7 @@ bool filmDS :: open(const std::string&filename, #ifdef REGISTER_FILTERGRAPH if (FAILED(RetVal = filmAddGraphToRot(FilterGraph, &m_GraphRegister))) { - verbose(0, + logpost(0, 3+0, "[GEM:filmDS:legacy]failed to register filter graph with ROT! hr=0x%X", RetVal); m_GraphRegister = 0; diff --git a/plugins/filmDarwin/filmDarwin.cpp b/plugins/filmDarwin/filmDarwin.cpp index 1de7bd199..6786f39d9 100644 --- a/plugins/filmDarwin/filmDarwin.cpp +++ b/plugins/filmDarwin/filmDarwin.cpp @@ -33,7 +33,7 @@ static bool filmQT_initQT(void) OSErr err = noErr; // Initialize QuickTime if (err = EnterMovies()) { - verbose(0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", + logpost(0, 3+0, "[GEM:filmQT]] Could not initialize quicktime: error %d\n", err); return false; } @@ -128,14 +128,14 @@ bool filmDarwin :: open(const std::string&filename, err = ::FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, &theFSSpec, NULL); if (err) { - verbose(0, "[GEM:filmDarwin] Unable to find file: %s", filename.c_str()); + logpost(0, 3+0, "[GEM:filmDarwin] Unable to find file: %s", filename.c_str()); goto unsupported; } } err = ::OpenMovieFile(&theFSSpec, &refnum, fsRdPerm); if (err) { - verbose(0, "[GEM:filmDarwin] Couldn't open the movie file: %#s (%d)", + logpost(0, 3+0, "[GEM:filmDarwin] Couldn't open the movie file: %#s (%d)", filename.c_str(), err); if (refnum) { ::CloseMovieFile(refnum); @@ -154,14 +154,14 @@ bool filmDarwin :: open(const std::string&filename, } m_lastFrame=-1; m_numTracks = (int)GetMovieTrackCount(m_movie); - verbose(1, "[GEM:filmDarwin] %d tracks", (int)m_numTracks); + logpost(0, 3+1, "[GEM:filmDarwin] %d tracks", (int)m_numTracks); // Get the length of the movie long movieDur, movieScale; movieDur = (long)GetMovieDuration(m_movie); movieScale = (long)GetMovieTimeScale(m_movie); - verbose(1, + logpost(0, 3+1, "[GEM:filmDarwin] duration = %d timescale = %d timebase = %d", movieDur, movieScale, (long)GetMovieTimeBase(m_movie)); @@ -181,7 +181,7 @@ bool filmDarwin :: open(const std::string&filename, m_fps=30.f; m_durationf=static_cast(movieScale)/m_fps; } - verbose(1, "[GEM:filmDarwin] %d frames @ %f", (int)m_numFrames, + logpost(0, 3+1, "[GEM:filmDarwin] %d frames @ %f", (int)m_numFrames, (float)m_durationf); // Get the bounds for the movie @@ -190,11 +190,11 @@ bool filmDarwin :: open(const std::string&filename, SetMovieBox(m_movie, &m_srcRect); m_image.image.xsize = m_srcRect.right - m_srcRect.left; m_image.image.ysize = m_srcRect.bottom - m_srcRect.top; - verbose(1, "[GEM:filmDarwin] rect rt:%d lt:%d", m_srcRect.right, + logpost(0, 3+1, "[GEM:filmDarwin] rect rt:%d lt:%d", m_srcRect.right, m_srcRect.left); - verbose(1, "[GEM:filmDarwin] rect top:%d bottom:%d", m_srcRect.top, + logpost(0, 3+1, "[GEM:filmDarwin] rect top:%d bottom:%d", m_srcRect.top, m_srcRect.bottom); - verbose(1, "[GEM:filmDarwin] movie size x:%d y:%d", m_image.image.xsize, + logpost(0, 3+1, "[GEM:filmDarwin] movie size x:%d y:%d", m_image.image.xsize, m_image.image.ysize); switch(m_wantedFormat) { @@ -225,7 +225,7 @@ bool filmDarwin :: open(const std::string&filename, m_image.image.data, m_rowBytes); if (err) { - verbose(0, "[GEM:filmDarwin] Couldn't make QTNewGWorldFromPtr %d", err); + logpost(0, 3+0, "[GEM:filmDarwin] Couldn't make QTNewGWorldFromPtr %d", err); goto unsupported; } m_movieTime = 0; diff --git a/plugins/imageMAGICK/MagickCore.cpp b/plugins/imageMAGICK/MagickCore.cpp index 0693a5b0e..942da85aa 100644 --- a/plugins/imageMAGICK/MagickCore.cpp +++ b/plugins/imageMAGICK/MagickCore.cpp @@ -78,9 +78,9 @@ static bool showException(ExceptionInfo*exception, } if(iswarning) { - verbose(0, "[GEM:imageMAGICK] %s", message.c_str()); + logpost(0, 3+0, "[GEM:imageMAGICK] %s", message.c_str()); } else { - verbose(0, "[GEM:imageMAGICK] %s", message.c_str()); + logpost(0, 3+0, "[GEM:imageMAGICK] %s", message.c_str()); } return (!iswarning); } diff --git a/plugins/imageMAGICK/MagickPlusPlus.cpp b/plugins/imageMAGICK/MagickPlusPlus.cpp index 227dfdc2e..c3fa1ae7d 100644 --- a/plugins/imageMAGICK/MagickPlusPlus.cpp +++ b/plugins/imageMAGICK/MagickPlusPlus.cpp @@ -43,7 +43,7 @@ bool imageMAGICK :: load(std::string filename, imageStruct&result, image.read( filename ); image.autoOrient(); } catch (Magick::Warning&e) { - verbose(0, "[GEM:imageMAGICK] loading problem: %s", e.what()); + logpost(0, 3+0, "[GEM:imageMAGICK] loading problem: %s", e.what()); } result.xsize=static_cast(image.columns()); @@ -63,10 +63,10 @@ bool imageMAGICK :: load(std::string filename, imageStruct&result, Magick::CharPixel, reinterpret_cast(result.data)); } catch (Magick::Warning&e) { - verbose(0, "[GEM:imageMAGICK] decoding problem: %s", e.what()); + logpost(0, 3+0, "[GEM:imageMAGICK] decoding problem: %s", e.what()); } } catch (Magick::Exception&e) { - verbose(0, "[GEM:imageMAGICK] loading image failed with: %s", e.what()); + logpost(0, 3+0, "[GEM:imageMAGICK] loading image failed with: %s", e.what()); return false; } return true; @@ -123,18 +123,18 @@ bool imageMAGICK::save(const imageStruct&image, const std::string&filename, // finally convert and export mimage.write(filename); } catch (Magick::Warning&e) { - verbose(0, "[GEM:imageMAGICK] saving problem: %s", e.what()); + logpost(0, 3+0, "[GEM:imageMAGICK] saving problem: %s", e.what()); } } catch (Magick::Exception&e) { - verbose(0, "[GEM:imageMAGICK] %s", e.what()); + logpost(0, 3+0, "[GEM:imageMAGICK] %s", e.what()); if(pImage!=&image) { delete pImage; } pImage=NULL; return false; } catch (...) { - verbose(0, "[GEM:imageMAGICK] uncaught exception!"); + logpost(0, 3+0, "[GEM:imageMAGICK] uncaught exception!"); return false; } if(pImage!=&image) { diff --git a/plugins/videoAVF/AVFVideoGrabber.mm b/plugins/videoAVF/AVFVideoGrabber.mm index f11cab546..1b8d87784 100644 --- a/plugins/videoAVF/AVFVideoGrabber.mm +++ b/plugins/videoAVF/AVFVideoGrabber.mm @@ -141,14 +141,14 @@ - (BOOL)initCapture:(int)framerate } - verbose(1, "[GEM:videoAVF] supported dimensions are: %dx%d", + logpost(0, 3+1, "[GEM:videoAVF] supported dimensions are: %dx%d", dimensions.width, dimensions.height); } // Set the new dimensions and format if( bestFormat != nullptr && bestW != 0 && bestH != 0 ) { if( bestW != width || bestH != height ) { - verbose(1, + logpost(0, 3+1, "[GEM:videoAVF] dimension %dx%d not supported. using %dx%d instead", width, height, bestW, bestH); } @@ -170,7 +170,7 @@ - (BOOL)initCapture:(int)framerate if( (floor(range.minFrameRate) <= framerate && ceil(range.maxFrameRate) >= framerate) ) { - verbose(1, + logpost(0, 3+1, "[GEM:videoAVF] found good framerate range %f .. %f for request %d", range.minFrameRate, range.maxFrameRate, framerate); desiredRange = range; @@ -183,10 +183,10 @@ - (BOOL)initCapture:(int)framerate device.activeVideoMinFrameDuration = desiredRange.minFrameDuration; device.activeVideoMaxFrameDuration = desiredRange.maxFrameDuration; } else { - verbose(1, "[GEM:videoAVF] could not set framerate to %d. Device supports", + logpost(0, 3+1, "[GEM:videoAVF] could not set framerate to %d. Device supports", framerate); for(AVFrameRateRange * range in supportedFrameRates) { - verbose(1, "\t%f .. %f", range.minFrameRate, range.maxFrameRate); + logpost(0, 3+1, "\t%f .. %f", range.minFrameRate, range.maxFrameRate); } } } @@ -315,7 +315,7 @@ -(void)stopCapture int i=0; for (AVCaptureDevice * captureDevice in devices) { deviceNames.push_back([captureDevice.localizedName UTF8String]); - verbose(0, "[GEM:videoAVF] device #%d: %s", i, deviceNames.back().c_str()); + logpost(0, 3+0, "[GEM:videoAVF] device #%d: %s", i, deviceNames.back().c_str()); i++; } return deviceNames; diff --git a/plugins/videoDS/videoDS.cpp b/plugins/videoDS/videoDS.cpp index ba1b8218d..0b52a294e 100644 --- a/plugins/videoDS/videoDS.cpp +++ b/plugins/videoDS/videoDS.cpp @@ -156,7 +156,7 @@ bool videoDS :: openDevice(gem::Properties&props) // Get the interface for DirectShow's GraphBuilder if (FAILED(hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&m_pGB))) { - verbose(0, "[GEM:videoDS] Could not get DShow GraphBuilder, hr 0x%X", hr); + logpost(0, 3+0, "[GEM:videoDS] Could not get DShow GraphBuilder, hr 0x%X", hr); break; } @@ -174,13 +174,13 @@ bool videoDS :: openDevice(gem::Properties&props) if ( FAILED(hr = (CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void **)&m_pCG))) || FAILED(hr = m_pCG->SetFiltergraph(m_pGB))) { - verbose(0, "[GEM:videoDS] Could not get DShow GraphBuilder, hr 0x%X", hr); + logpost(0, 3+0, "[GEM:videoDS] Could not get DShow GraphBuilder, hr 0x%X", hr); break; } // Create the capture device. if (FAILED(hr = FindCaptureDevice(device, &m_pCDbase))) { - verbose(0, "[GEM:videoDS] Could not open device: %d\n", device); + logpost(0, 3+0, "[GEM:videoDS] Could not open device: %d\n", device); break; } @@ -189,7 +189,7 @@ bool videoDS :: openDevice(gem::Properties&props) IID_IBaseFilter, (void**)&SampleFilter); if (hr != S_OK || NULL == SampleFilter) { - verbose(0, "[GEM:videoDS] Unable to create SampleFilter interface %d", hr); + logpost(0, 3+0, "[GEM:videoDS] Unable to create SampleFilter interface %d", hr); return false; } @@ -199,7 +199,7 @@ bool videoDS :: openDevice(gem::Properties&props) (void **)&SampleGrabber); if (hr != S_OK || NULL == SampleGrabber) { - verbose(0, "[GEM:videoDS] Unable to create SampleGrabber interface %d", + logpost(0, 3+0, "[GEM:videoDS] Unable to create SampleGrabber interface %d", hr); return false; } @@ -218,7 +218,7 @@ bool videoDS :: openDevice(gem::Properties&props) hr = SampleGrabber->SetOneShot(FALSE); if (hr != S_OK) { - verbose(0, "[GEM:videoDS] Unable to setup sample grabber %d", hr); + logpost(0, 3+0, "[GEM:videoDS] Unable to setup sample grabber %d", hr); return false; } @@ -227,7 +227,7 @@ bool videoDS :: openDevice(gem::Properties&props) hr = SampleGrabber->SetBufferSamples(TRUE); if (hr != S_OK) { - verbose(0, "[GEM:videoDS] Unable to setup sample grabber %d", hr); + logpost(0, 3+0, "[GEM:videoDS] Unable to setup sample grabber %d", hr); return false; } @@ -236,7 +236,7 @@ bool videoDS :: openDevice(gem::Properties&props) IID_IBaseFilter, (void**)&NullFilter); if (hr != S_OK || NULL == NullFilter) { - verbose(0, "[GEM:videoDS] Unable to create NullFilter interface %d", hr); + logpost(0, 3+0, "[GEM:videoDS] Unable to create NullFilter interface %d", hr); return false; } @@ -244,7 +244,7 @@ bool videoDS :: openDevice(gem::Properties&props) if (FAILED(hr = m_pGB->AddFilter(m_pCDbase, L"Capture Device")) || FAILED(hr = m_pGB->AddFilter(SampleFilter, L"Sample Grabber")) || FAILED(hr = m_pGB->AddFilter(NullFilter, L"Null Renderer"))) { - verbose(0, "[GEM:videoDS] Could not add the filters to the graph, hr 0x%X", + logpost(0, 3+0, "[GEM:videoDS] Could not add the filters to the graph, hr 0x%X", hr); break; } @@ -259,7 +259,7 @@ bool videoDS :: openDevice(gem::Properties&props) if (FAILED(hr = m_pCG->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, m_pCDbase, SampleFilter, NullFilter))) { - verbose(0, "[GEM:videoDS] Unable to connect to SampleGrabber."); + logpost(0, 3+0, "[GEM:videoDS] Unable to connect to SampleGrabber."); return false; } } @@ -267,7 +267,7 @@ bool videoDS :: openDevice(gem::Properties&props) // QueryInterface for DirectShow interfaces if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaFilter, (void **)&m_pMF)))) { - verbose(0, "[GEM:videoDS] Could not get media filter interface, hr 0x%X", + logpost(0, 3+0, "[GEM:videoDS] Could not get media filter interface, hr 0x%X", hr); break; } @@ -275,7 +275,7 @@ bool videoDS :: openDevice(gem::Properties&props) //MediaControl is used for Run, Stop, Pause and running state queries if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaControl, (void **)&m_pMC)))) { - verbose(0, "[GEM:videoDS] Could not get media control interface, hr 0x%X", + logpost(0, 3+0, "[GEM:videoDS] Could not get media control interface, hr 0x%X", hr); break; } @@ -283,7 +283,7 @@ bool videoDS :: openDevice(gem::Properties&props) //not used right now if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaEvent, (void **)&m_pME)))) { - verbose(0, "[GEM:videoDS] Could not get media event interface, hr 0x%X", + logpost(0, 3+0, "[GEM:videoDS] Could not get media event interface, hr 0x%X", hr); break; } @@ -291,7 +291,7 @@ bool videoDS :: openDevice(gem::Properties&props) //MediaSeeking for the end of a clip. not really used here if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaSeeking, (void **)&m_pMS)))) { - verbose(0, "[GEM:videoDS] Could not get media seeking interface, hr 0x%X", + logpost(0, 3+0, "[GEM:videoDS] Could not get media seeking interface, hr 0x%X", hr); break; } @@ -299,7 +299,7 @@ bool videoDS :: openDevice(gem::Properties&props) //for the position of a clip. not really used for device capture if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaPosition, (void **)&m_pMP)))) { - verbose(0, "[GEM:videoDS] Could not get media position interface, hr 0x%X", + logpost(0, 3+0, "[GEM:videoDS] Could not get media position interface, hr 0x%X", hr); break; } @@ -307,7 +307,7 @@ bool videoDS :: openDevice(gem::Properties&props) // Expose the filter graph so we can view it using GraphEdit #ifdef REGISTER_FILTERGRAPH if (FAILED(hr = AddGraphToRot(m_pGB, &m_GraphRegister))) { - verbose(0, + logpost(0, 3+0, "[GEM:videoDS] failed to register filter graph with ROT! hr=0x%X", hr); m_GraphRegister = 0; } @@ -316,7 +316,7 @@ bool videoDS :: openDevice(gem::Properties&props) // Turn off the reference clock. // if (FAILED(hr = m_pMF->SetSyncSource(NULL))) // { - // verbose(0, "[GEM:videoDS] failed to turn off the reference clock hr=0x%X", hr); + // logpost(0, 3+0, "[GEM:videoDS] failed to turn off the reference clock hr=0x%X", hr); // break; // } @@ -395,7 +395,7 @@ std::vectorvideoDS :: enumerate(void) hr = CoCreateInstance (CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC, IID_ICreateDevEnum, (void ** ) &pDevEnum); if (FAILED(hr)) { - verbose(0, "[GEM:videoDS] Couldn't create system enumerator!"); + logpost(0, 3+0, "[GEM:videoDS] Couldn't create system enumerator!"); break; } @@ -403,14 +403,14 @@ std::vectorvideoDS :: enumerate(void) hr = pDevEnum->CreateClassEnumerator (CLSID_VideoInputDeviceCategory, &pClassEnum, 0); if (FAILED(hr)) { - verbose(0, "[GEM:videoDS] Couldn't create class enumerator!"); + logpost(0, 3+0, "[GEM:videoDS] Couldn't create class enumerator!"); break; } // If there are no enumerators for the requested type, then // CreateClassEnumerator will succeed, but pClassEnum will be NULL. if (pClassEnum == NULL) { - verbose(0, "[GEM:videoDS] No video capture devices found!"); + logpost(0, 3+0, "[GEM:videoDS] No video capture devices found!"); break; } @@ -1142,7 +1142,7 @@ FindCaptureDevice(int device, IBaseFilter ** ppSrcFilter) hr = CoCreateInstance (CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC, IID_ICreateDevEnum, (void ** ) &pDevEnum); if (FAILED(hr)) { - verbose(0, "[GEM:videoDS] Couldn't create system enumerator!"); + logpost(0, 3+0, "[GEM:videoDS] Couldn't create system enumerator!"); break; } @@ -1151,14 +1151,14 @@ FindCaptureDevice(int device, IBaseFilter ** ppSrcFilter) hr = pDevEnum->CreateClassEnumerator (CLSID_VideoInputDeviceCategory, &pClassEnum, 0); if (FAILED(hr)) { - verbose(0, "[GEM:videoDS] Couldn't create class enumerator!"); + logpost(0, 3+0, "[GEM:videoDS] Couldn't create class enumerator!"); break; } // If there are no enumerators for the requested type, then // CreateClassEnumerator will succeed, but pClassEnum will be NULL. if (pClassEnum == NULL) { - verbose(0, "[GEM:videoDS] No video capture devices found!"); + logpost(0, 3+0, "[GEM:videoDS] No video capture devices found!"); hr = E_FAIL; break; } @@ -1174,7 +1174,7 @@ FindCaptureDevice(int device, IBaseFilter ** ppSrcFilter) // Bind Moniker to a filter object hr = pMoniker->BindToObject(0,0,IID_IBaseFilter, (void**)&pSrc); if (FAILED(hr)) { - verbose(0, "[GEM:videoDS] Couldn't bind moniker to filter object!"); + logpost(0, 3+0, "[GEM:videoDS] Couldn't bind moniker to filter object!"); } } COMRELEASE(pMoniker); diff --git a/plugins/videoDarwin/videoDarwin.cpp b/plugins/videoDarwin/videoDarwin.cpp index 3e4cec593..4d34385ab 100644 --- a/plugins/videoDarwin/videoDarwin.cpp +++ b/plugins/videoDarwin/videoDarwin.cpp @@ -82,13 +82,13 @@ videoDarwin :: ~videoDarwin() close(); if (m_vc) { if (::SGDisposeChannel(m_sg, m_vc)) { - verbose(0, "[GEM:videoDarwin] Unable to dispose a video channel"); + logpost(0, 3+0, "[GEM:videoDarwin] Unable to dispose a video channel"); } m_vc = NULL; } if (m_sg) { if (::CloseComponent(m_sg)) { - verbose(0, + logpost(0, 3+0, "[GEM:videoDarwin] Unable to dispose a sequence grabber component"); } m_sg = NULL; @@ -142,7 +142,7 @@ bool videoDarwin :: grabFrame() m_newFrame = true; } if (!m_haveVideo) { - verbose(0, "[GEM:videoDarwin] no video yet"); + logpost(0, 3+0, "[GEM:videoDarwin] no video yet"); return true; } m_img.copy2Image(&m_image.image); @@ -191,23 +191,23 @@ bool videoDarwin :: initSeqGrabber() m_sg = OpenDefaultComponent(SeqGrabComponentType, 0); if(m_sg==NULL) { - verbose(0, "[GEM:videoDarwin] could not open default component"); + logpost(0, 3+0, "[GEM:videoDarwin] could not open default component"); return false; } anErr = SGInitialize(m_sg); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] could not initialize SG error %d",anErr); + logpost(0, 3+0, "[GEM:videoDarwin] could not initialize SG error %d",anErr); return false; } anErr = SGSetDataRef(m_sg, 0, 0, seqGrabDontMakeMovie); if (anErr != noErr) { - verbose(0, "[GEM:videoDarwin] dataref failed with error %d",anErr); + logpost(0, 3+0, "[GEM:videoDarwin] dataref failed with error %d",anErr); } anErr = SGNewChannel(m_sg, VideoMediaType, &m_vc); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] could not make new SG channel error %d", + logpost(0, 3+0, "[GEM:videoDarwin] could not make new SG channel error %d", anErr); return false; } @@ -215,7 +215,7 @@ bool videoDarwin :: initSeqGrabber() enumerate(); anErr = SGGetChannelDeviceList(m_vc, sgDeviceListIncludeInputs, &devices); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] could not get SG channel Device List"); + logpost(0, 3+0, "[GEM:videoDarwin] could not get SG channel Device List"); } else { deviceCount = (*devices)->count; m_inputDevice = (*devices)->selectedIndex; @@ -239,17 +239,17 @@ bool videoDarwin :: initSeqGrabber() if (m_inputDevice >= 0 && m_inputDevice < deviceCount) {//check that the device is not out of bounds std::string devname=pascal2str((*devices)->entry[m_inputDevice].name); - verbose(1, "[GEM:videoDarwin] SGSetChannelDevice trying[%d] %s", + logpost(0, 3+1, "[GEM:videoDarwin] SGSetChannelDevice trying[%d] %s", m_inputDevice, devname.c_str()); } anErr = SGSetChannelDevice(m_vc, (*devices)->entry[m_inputDevice].name); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] SGSetChannelDevice returned error %d",anErr); + logpost(0, 3+0, "[GEM:videoDarwin] SGSetChannelDevice returned error %d",anErr); } anErr = SGSetChannelDeviceInput(m_vc,m_inputDeviceChannel); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] SGSetChannelDeviceInput returned error %d", + logpost(0, 3+0, "[GEM:videoDarwin] SGSetChannelDeviceInput returned error %d", anErr); } @@ -261,33 +261,33 @@ bool videoDarwin :: initSeqGrabber() Str255 vdigName; memset(vdigName,0,255); vdigErr = VDGetInputName(m_vdig,m_inputDevice,vdigName); - verbose(1, "[GEM:videoDarwin] vdigName is %s", + logpost(0, 3+1, "[GEM:videoDarwin] vdigName is %s", pascal2str(vdigName).c_str()); Rect vdRect; vdigErr = VDGetDigitizerRect(m_vdig,&vdRect); - verbose(1, + logpost(0, 3+1, "[GEM:videoDarwin] digitizer rect is top %d bottom %d left %d right %d", vdRect.top,vdRect.bottom,vdRect.left,vdRect.right); vdigErr = VDGetActiveSrcRect(m_vdig,0,&vdRect); - verbose(1, + logpost(0, 3+1, "[GEM:videoDarwin] active src rect is top %d bottom %d left %d right %d", vdRect.top,vdRect.bottom,vdRect.left,vdRect.right); anErr = SGSetChannelBounds(m_vc, &srcRect); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] could not set SG ChannelBounds "); + logpost(0, 3+0, "[GEM:videoDarwin] could not set SG ChannelBounds "); } anErr = SGSetVideoRect(m_vc, &srcRect); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] could not set SG Rect "); + logpost(0, 3+0, "[GEM:videoDarwin] could not set SG Rect "); } anErr = SGSetChannelUsage(m_vc, seqGrabPreview); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] could not set SG ChannelUsage "); + logpost(0, 3+0, "[GEM:videoDarwin] could not set SG ChannelUsage "); } SGSetChannelPlayFlags(m_vc, m_quality); OSType pixelFormat=0; @@ -298,12 +298,12 @@ bool videoDarwin :: initSeqGrabber() m_img.setFormat(m_colorspace); m_rowBytes = m_width*m_img.csize; pixelFormat=k32ARGBPixelFormat; - verbose(1, "[GEM:videoDarwin] using RGB"); + logpost(0, 3+1, "[GEM:videoDarwin] using RGB"); } else { m_img.setFormat(GEM_YUV); m_rowBytes = m_width*2; pixelFormat=k422YpCbCr8PixelFormat; - verbose(1, "[GEM:videoDarwin] using YUV"); + logpost(0, 3+1, "[GEM:videoDarwin] using YUV"); } m_img.reallocate(); anErr = QTNewGWorldFromPtr (&m_srcGWorld, @@ -316,11 +316,11 @@ bool videoDarwin :: initSeqGrabber() m_rowBytes); if (anErr!= noErr) { - verbose(0, "[GEM:videoDarwin] %d error at QTNewGWorldFromPtr", anErr); + logpost(0, 3+0, "[GEM:videoDarwin] %d error at QTNewGWorldFromPtr", anErr); return false; } if (NULL == m_srcGWorld) { - verbose(0, "[GEM:videoDarwin] could not allocate off screen"); + logpost(0, 3+0, "[GEM:videoDarwin] could not allocate off screen"); return false; } SGSetGWorld(m_sg,(CGrafPtr)m_srcGWorld, NULL); @@ -343,13 +343,13 @@ void videoDarwin :: destroySeqGrabber() { if (m_vc) { if (::SGDisposeChannel(m_sg, m_vc)) { - verbose(0, "[GEM:videoDarwin] Unable to dispose a video channel"); + logpost(0, 3+0, "[GEM:videoDarwin] Unable to dispose a video channel"); } m_vc = NULL; } if (m_sg) { if (::CloseComponent(m_sg)) { - verbose(0, + logpost(0, 3+0, "[GEM:videoDarwin] Unable to dispose a sequence grabber component"); } m_sg = NULL; @@ -363,7 +363,7 @@ void videoDarwin :: destroySeqGrabber() void videoDarwin :: resetSeqGrabber() { OSErr anErr; - verbose(1, "[GEM:videoDarwin] starting reset"); + logpost(0, 3+1, "[GEM:videoDarwin] starting reset"); destroySeqGrabber(); initSeqGrabber(); @@ -696,17 +696,17 @@ std::vector videoDarwin::enumerate() anErr = SGGetChannelDeviceList(m_vc, sgDeviceListIncludeInputs, &devices); if(anErr!=noErr) { - verbose(0, "[GEM:videoDarwin] could not get SG channel Device List"); + logpost(0, 3+0, "[GEM:videoDarwin] could not get SG channel Device List"); } else { short deviceCount = (*devices)->count; short deviceIndex = (*devices)->selectedIndex; short inputIndex; - verbose(1, "[GEM:videoDarwin] SG channel Device List count %d index %d", + logpost(0, 3+1, "[GEM:videoDarwin] SG channel Device List count %d index %d", deviceCount,deviceIndex); m_devices.clear(); for (int i = 0; i < deviceCount; i++) { m_devices.push_back(pascal2str((*devices)->entry[i].name)); - verbose(1, "[GEM:videoDarwin] SG channel Device List[%d] %s", i, + logpost(0, 3+1, "[GEM:videoDarwin] SG channel Device List[%d] %s", i, m_devices[i].c_str()); } SGGetChannelDeviceAndInputNames(m_vc, NULL, NULL, &inputIndex); @@ -721,7 +721,7 @@ std::vector videoDarwin::enumerate() //walk through the list for (int i = 0; i < inputIndex; i++) { std::string input=pascal2str((*theSGInputList)->entry[i].name); - verbose(1, "[GEM:videoDarwin] SG channel Input Device List %d %s", + logpost(0, 3+1, "[GEM:videoDarwin] SG channel Input Device List %d %s", i, input.c_str()); } } diff --git a/plugins/videoSGI/videoSGI.cpp b/plugins/videoSGI/videoSGI.cpp index cc71e996f..b16d2f937 100644 --- a/plugins/videoSGI/videoSGI.cpp +++ b/plugins/videoSGI/videoSGI.cpp @@ -74,7 +74,7 @@ bool videoSGI :: openDevice() { // Connect to the daemon if ( !(m_svr = vlOpenVideo("")) ) { - verbose(0, "[GEM:videoSGI] Unable to open video"); + logpost(0, 3+0, "[GEM:videoSGI] Unable to open video"); goto cleanup; } // Set up a drain node in memory @@ -89,7 +89,7 @@ bool videoSGI :: openDevice() // Set up the hardware for and define the usage of the path if ( (vlSetupPaths(m_svr, (VLPathList)&m_path, 1, VL_SHARE, VL_SHARE)) < 0 ) { - verbose(0, "[GEM:videoSGI] Unable to setup video path"); + logpost(0, 3+0, "[GEM:videoSGI] Unable to setup video path"); goto cleanup; } @@ -105,10 +105,10 @@ bool videoSGI :: openDevice() // according to vl.h, this is really ABGR (IrisGL format) val.intVal = VL_PACKING_RGBA_8; if ( vlSetControl(m_svr, m_path, m_drn, VL_PACKING, &val) ) { - verbose(0, "[GEM:videoSGI] Unable to set the video packing"); + logpost(0, 3+0, "[GEM:videoSGI] Unable to set the video packing"); goto cleanup; } - verbose(1, "[GEM:videoSGI] Video has to color swap (ABGR to RGBA)"); + logpost(0, 3+1, "[GEM:videoSGI] Video has to color swap (ABGR to RGBA)"); m_colorSwap = 1; } @@ -121,7 +121,7 @@ bool videoSGI :: openDevice() if ( vlSetControl(m_svr, m_path, m_drn, VL_SIZE, &value) ) { vlGetControl(m_svr, m_path, m_drn, VL_SIZE, &value); - verbose(1, "[GEM:videoSGI] dimen error: wanted %dx%d got %dx%d", m_width, + logpost(0, 3+1, "[GEM:videoSGI] dimen error: wanted %dx%d got %dx%d", m_width, m_height, value.xyVal.x, value.xyVal.y); m_width =value.xyVal.x; m_height=value.xyVal.y; @@ -247,13 +247,13 @@ pixBlock *videoSGI::getFrame(void) ///////////////////////////////////////////////////////// void videoSGI :: offsetMess(int x, int y) { if (!m_haveVideo) { - verbose(1, "[GEM:videoSGI] Connect to video first"); + logpost(0, 3+1, "[GEM:videoSGI] Connect to video first"); return; } // stop the transfer and destroy the buffer if ( !stopTransfer() ) { - verbose(0, "[GEM:videoSGI] error stopping transfer"); + logpost(0, 3+0, "[GEM:videoSGI] error stopping transfer"); return; } @@ -261,14 +261,14 @@ pixBlock *videoSGI::getFrame(void) value.xyVal.x = x; value.xyVal.y = y; if ( vlSetControl(m_svr, m_path, m_drn, VL_OFFSET, &value) ) { - verbose(0, "[GEM:videoSGI] offset error"); + logpost(0, 3+0, "[GEM:videoSGI] offset error"); startTransfer(); return; } // start the transfer and rebuild the buffer if ( !startTransfer() ) { - verbose(0, "[GEM:videoSGI] error starting transfer"); + logpost(0, 3+0, "[GEM:videoSGI] error starting transfer"); return; } } @@ -280,7 +280,7 @@ pixBlock *videoSGI::getFrame(void) ///////////////////////////////////////////////////////// void videoINDY :: zoomMess(int num, int denom) { if (!m_haveVideo) { - verbose(1, "[GEM:videoSGI] Connect to video first"); + logpost(0, 3+1, "[GEM:videoSGI] Connect to video first"); return; } VLControlValue value; @@ -297,7 +297,7 @@ pixBlock *videoSGI::getFrame(void) ///////////////////////////////////////////////////////// void videoINDY :: brightMess(int val) { if (!m_haveVideo) { - verbose(1, "[GEM:videoSGI] Connect to video first"); + logpost(0, 3+1, "[GEM:videoSGI] Connect to video first"); return; } VLControlValue value; @@ -313,7 +313,7 @@ pixBlock *videoSGI::getFrame(void) ///////////////////////////////////////////////////////// void videoINDY :: contrastMess(int val) { if (!m_haveVideo) { - verbose(1, "[GEM:videoSGI] Connect to video first"); + logpost(0, 3+1, "[GEM:videoSGI] Connect to video first"); return; } VLControlValue value; @@ -329,7 +329,7 @@ pixBlock *videoSGI::getFrame(void) ///////////////////////////////////////////////////////// void videoINDY :: hueMess(int val) { if (!m_haveVideo) { - verbose(1, "[GEM:videoSGI] Connect to video first"); + logpost(0, 3+1, "[GEM:videoSGI] Connect to video first"); return; } VLControlValue value; @@ -345,7 +345,7 @@ pixBlock *videoSGI::getFrame(void) ///////////////////////////////////////////////////////// void videoINDY :: satMess(int val) { if (!m_haveVideo) { - verbose(1, "[GEM:videoSGI] Connect to video first"); + logpost(0, 3+1, "[GEM:videoSGI] Connect to video first"); return; } VLControlValue value; @@ -384,7 +384,7 @@ pixBlock *videoSGI::getFrame(void) if ( vlSetControl(m_svr, m_path, m_drn, VL_SIZE, &value) ) { vlGetControl(m_svr, m_path, m_drn, VL_SIZE, &value); - verbose(1, "[GEM:videoSGI] dimen error: wanted %dx%d got %dx%d", m_width, + logpost(0, 3+1, "[GEM:videoSGI] dimen error: wanted %dx%d got %dx%d", m_width, m_height, value.xyVal.x, value.xyVal.y); m_width =value.xyVal.x; m_height=value.xyVal.y; diff --git a/src/Base/CPPExtern.cpp b/src/Base/CPPExtern.cpp index 503ff4bcc..7e1c347f5 100644 --- a/src/Base/CPPExtern.cpp +++ b/src/Base/CPPExtern.cpp @@ -154,40 +154,20 @@ void CPPExtern :: endpost(void) const ::endpost(); pimpl->endpost=true; } -typedef void (*verbose_t)(int level, const char *fmt, ...); void CPPExtern :: verbose(const int level, const char*fmt,...) const { + const int verbose2logpost_level = 3; char buf[MAXPDSTRING]; va_list ap; va_start(ap, fmt); vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); - static verbose_t rte_verbose=NULL; - static bool rte_verbose_checked=false; - if(false==rte_verbose_checked) { - gem::RTE::RTE*rte=gem::RTE::RTE::getRuntimeEnvironment(); - if(rte) { - rte_verbose=(verbose_t)rte->getFunction("verbose"); - } - } - rte_verbose_checked=true; - - /* only pd>=0.39(?) supports ::verbose() */ - if(rte_verbose) { - if(NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name - && &s_ != pimpl->objectname) { - rte_verbose(level, "[%s]: %s", pimpl->objectname->s_name, buf); - } else { - rte_verbose(level, "%s", buf); - } + if(NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name + && &s_ != pimpl->objectname) { + ::logpost(x_obj, verbose2logpost_level + level, "[%s]: %s", pimpl->objectname->s_name, buf); } else { - if(NULL!=pimpl->objectname && NULL!=pimpl->objectname->s_name - && &s_ != pimpl->objectname) { - ::post("[%s]: %s", pimpl->objectname->s_name, buf); - } else { - ::post("%s", buf); - } + ::logpost(x_obj, verbose2logpost_level + level, "%s", buf); } } diff --git a/src/Gem/ImageLoad.cpp b/src/Gem/ImageLoad.cpp index 542a160d9..904d76c5e 100644 --- a/src/Gem/ImageLoad.cpp +++ b/src/Gem/ImageLoad.cpp @@ -127,7 +127,7 @@ struct PixImageThreadLoader : public gem::thread::SynchedWorkerThread { i=0; static bool dunnit=false; if(!dunnit) { - verbose(1, "threaded ImageLoading not supported!"); + logpost(0, 3+1, "threaded ImageLoading not supported!"); } dunnit=true; } diff --git a/src/Gem/Manager.cpp b/src/Gem/Manager.cpp index 79133707d..3e1894826 100644 --- a/src/Gem/Manager.cpp +++ b/src/Gem/Manager.cpp @@ -882,7 +882,7 @@ void GemMan :: render(void *) post("unable to annihiliate %f ms", spent); } if(deltime<0.) { - verbose(1, "negative delay time: %f", deltime); + logpost(0, 3+1, "negative delay time: %f", deltime); deltime=1.f; } } diff --git a/src/Gem/PixConvert.cpp b/src/Gem/PixConvert.cpp index ce9de8cbc..79467d51f 100644 --- a/src/Gem/PixConvert.cpp +++ b/src/Gem/PixConvert.cpp @@ -66,7 +66,7 @@ #undef CONVERTER_MARK #if GEM_DEBUG_PIXCONVERT # include "m_pd.h" -# define CONVERTER_MARK() verbose(1, "%s(%ux%u)", __FUNCTION__, (unsigned int)width, (unsigned int)height) +# define CONVERTER_MARK() logpost(0, 3+1, "%s(%ux%u)", __FUNCTION__, (unsigned int)width, (unsigned int)height) #else # define CONVERTER_MARK() 0 #endif diff --git a/src/Gem/Settings.cpp b/src/Gem/Settings.cpp index 79b98fe6c..1d225cab5 100644 --- a/src/Gem/Settings.cpp +++ b/src/Gem/Settings.cpp @@ -126,12 +126,12 @@ struct PIMPL { r=binbuf_read(bb, (char*)filename, const_cast(gem::files::expandEnv(dirname, true).c_str()), 1); if(0==r) { - verbose(1, "found Gem-settings '%s' in '%s'", filename, dirname); + logpost(0, 3+1, "found Gem-settings '%s' in '%s'", filename, dirname); } } else { r=binbuf_read_via_path(bb, (char*)filename, (char*)".", 1); if(0==r) { - verbose(1, "found Gem-settings '%s'", filename); + logpost(0, 3+1, "found Gem-settings '%s'", filename); } } diff --git a/src/Gem/Setup.cpp b/src/Gem/Setup.cpp index ab5107568..ec4754761 100644 --- a/src/Gem/Setup.cpp +++ b/src/Gem/Setup.cpp @@ -154,11 +154,11 @@ static bool checkVersion(const char*dirname, const char*filename, if(!result) { pd_error(0, "GEM: binary/abstractions version mismatch!"); pd_error(0, "GEM: continue at your own risk..."); - verbose(0, "GEM: binary is %d.%d, but Gem abstractions are %s", + logpost(0, 3+0, "GEM: binary is %d.%d, but Gem abstractions are %s", GEM_VERSION_MAJOR, GEM_VERSION_MINOR, gotversion.c_str()); - verbose(0, + logpost(0, 3+0, "GEM: This usually means that you have a path to another version of Gem stored in your startup preferences"); - verbose(0, "GEM: Consider removing the wrong path!"); + logpost(0, 3+0, "GEM: Consider removing the wrong path!"); } return result; @@ -199,7 +199,7 @@ static void addownpath(const char*filename) buf[MAXPDSTRING-1]=0; if ((fd=_open(buf, flags))>=0) { _close(fd); - verbose(1, "GEM: trying to add Gem path '%s' to search-paths", mypath); + logpost(0, 3+1, "GEM: trying to add Gem path '%s' to search-paths", mypath); gem::RTE::RTE*rte=gem::RTE::RTE::getRuntimeEnvironment(); if(rte) { success = rte->addSearchPath(mypath, 0); @@ -251,23 +251,23 @@ void setup() firsttime = false; // startup GEM post("GEM: Graphics Environment for Multimedia"); - verbose(-1, "GEM: ver: %s", GemVersion::versionString()); - verbose(-1, "GEM: compiled " BUILD_DATE ); - verbose(-1, "GEM: maintained by %s", GEM_MAINTAINER); - verbose(-1, "GEM: Authors :\tMark Danks (original version)"); + logpost(0, 3-1, "GEM: ver: %s", GemVersion::versionString()); + logpost(0, 3-1, "GEM: compiled " BUILD_DATE ); + logpost(0, 3-1, "GEM: maintained by %s", GEM_MAINTAINER); + logpost(0, 3-1, "GEM: Authors :\tMark Danks (original version)"); for(unsigned int i=0; inext; - verbose(4, "registering Gem object: %s", l->name); + logpost(0, 3+4, "registering Gem object: %s", l->name); l->setup(); delete l; l = next; diff --git a/src/Gem/State.h b/src/Gem/State.h index 34f69201a..4b68a2ae5 100644 --- a/src/Gem/State.h +++ b/src/Gem/State.h @@ -215,7 +215,7 @@ class GEM_EXTERN GemState } return true; } catch (gem::bad_any_cast&x) { - ::verbose(3, "%s:%d [%s] %d :: %s", __FILE__, __LINE__, __FUNCTION__, key, + ::logpost(0, 3+3, "%s:%d [%s] %d :: %s", __FILE__, __LINE__, __FUNCTION__, key, x.what()); // type problem } diff --git a/src/Output/gemglfw3window.cpp b/src/Output/gemglfw3window.cpp index 6e8ada5e4..5921ac5e2 100644 --- a/src/Output/gemglfw3window.cpp +++ b/src/Output/gemglfw3window.cpp @@ -708,10 +708,10 @@ void gemglfw3window :: fullscreenMess(int on) if(on) { if (on<0 || on>count) { monitor = glfwGetPrimaryMonitor(); - verbose(0, "switching to fullscreen on primary monitor: %s", glfwGetMonitorName(monitor)); + logpost(0, 3+0, "switching to fullscreen on primary monitor: %s", glfwGetMonitorName(monitor)); } else { monitor = monitors[on-1]; - verbose(0, "switching to fullscreen on monitor #%d: %s", on, glfwGetMonitorName(monitor)); + logpost(0, 3+0, "switching to fullscreen on monitor #%d: %s", on, glfwGetMonitorName(monitor)); } } if(monitor) { @@ -1019,7 +1019,7 @@ void gemglfw3window :: obj_setupCallback(t_class *classPtr) { CPPEXTERN_MSG2(classPtr, "glprofile", glprofileMess, int, int); CPPEXTERN_MSG1(classPtr, "gles", glesMess, bool); - ::verbose(0, "[gemglfw3window]\n\tGLFW compile version: %d.%d.%d\n\tGLFW runtime version: %s" + ::logpost(0, 3+0, "[gemglfw3window]\n\tGLFW compile version: %d.%d.%d\n\tGLFW runtime version: %s" , GLFW_VERSION_MAJOR, GLFW_VERSION_MINOR, GLFW_VERSION_REVISION , glfwGetVersionString() ); diff --git a/src/Output/gemglxwindow.cpp b/src/Output/gemglxwindow.cpp index bb8f0562a..5cf21b727 100644 --- a/src/Output/gemglxwindow.cpp +++ b/src/Output/gemglxwindow.cpp @@ -478,7 +478,7 @@ struct gemglxwindow::PIMPL { } if(vi->depth<24) { - ::verbose(0, "Only using %d color bits", vi->depth); + ::logpost(0, 3+0, "Only using %d color bits", vi->depth); } if (vi->c_class != TrueColor && vi->c_class != DirectColor) { pd_error(parent, "TrueColor visual required for this program (got %d)", @@ -856,7 +856,7 @@ bool gemglxwindow :: create(void) m_transparent, m_fsaa); } catch (GemException&ex) { error("creation of shared glxcontext failed: %s", ex.what()); - verbose(0, "continuing at your own risk!"); + logpost(0, 3+0, "continuing at your own risk!"); } if(!sharedPimpl->gemcontext) { try { @@ -965,21 +965,21 @@ void gemglxwindow :: destroy(void) XUnmapWindow (m_pimpl->dpy, m_pimpl->win); err=XDestroyWindow(m_pimpl->dpy, m_pimpl->win); if(err) { - verbose(1, "XDestroyWindow returned %d", err); + logpost(0, 3+1, "XDestroyWindow returned %d", err); } } if (m_pimpl->cmap) { err=XFreeColormap(m_pimpl->dpy, m_pimpl->cmap); if(err) { - verbose(1, "XFreeColormap returned %d", err); + logpost(0, 3+1, "XFreeColormap returned %d", err); } } XFlush( m_pimpl->dpy ); err=XCloseDisplay(m_pimpl->dpy); /* this crashes if no window is there */ if(err) { - verbose(1, "XCloseDisplay returned %d", err); + logpost(0, 3+1, "XCloseDisplay returned %d", err); } } m_pimpl->dpy = NULL; diff --git a/src/Pixes/pix_film.cpp b/src/Pixes/pix_film.cpp index 941fba5b8..f48fd9287 100644 --- a/src/Pixes/pix_film.cpp +++ b/src/Pixes/pix_film.cpp @@ -708,7 +708,7 @@ void pix_film :: obj_setupCallback(t_class *classPtr) if(pd_objectmaker && reinterpret_cast(create_pix_film)==zgetfn(&pd_objectmaker, gensym("pix_filmQT"))) { - ::verbose(2, "not registering [pix_filmQT] again..."); + ::logpost(0, 2+3, "not registering [pix_filmQT] again..."); } else { class_addcreator(reinterpret_cast(create_pix_film), gensym("pix_filmQT"), A_GIMME, A_NULL); diff --git a/src/Pixes/pix_freeframe.cpp b/src/Pixes/pix_freeframe.cpp index 3ef5dd19f..6c48fbcfb 100644 --- a/src/Pixes/pix_freeframe.cpp +++ b/src/Pixes/pix_freeframe.cpp @@ -1068,11 +1068,11 @@ static const int offset_pix_=strlen("pix_"); static void*freeframe_loader_new(t_symbol*s, int argc, t_atom*argv) { if(!s) { - ::verbose(2, "freeframe_loader: no name given"); + ::logpost(0, 3+2, "freeframe_loader: no name given"); return 0; } - ::verbose(2, "freeframe_loader: %s",s->s_name); + ::logpost(0, 3+2, "freeframe_loader: %s",s->s_name); try { \ const char*realname=s->s_name+offset_pix_; /* strip of the leading 'pix_' */ @@ -1084,7 +1084,7 @@ static void*freeframe_loader_new(t_symbol*s, int argc, t_atom*argv) proxy.setObject(new pix_freeframe(gensym(realname))); return proxy.initialize(); } catch (GemException&e) { - ::verbose(2, "freeframe_loader: failed! (%s)", e.what()); + ::logpost(0, 3+2, "freeframe_loader: failed! (%s)", e.what()); return 0; } return 0; diff --git a/src/Pixes/pix_frei0r.cpp b/src/Pixes/pix_frei0r.cpp index 746d4c945..893c53145 100644 --- a/src/Pixes/pix_frei0r.cpp +++ b/src/Pixes/pix_frei0r.cpp @@ -694,10 +694,10 @@ static const int offset_pix_=strlen("pix_"); static void*frei0r_loader_new(t_symbol*s, int argc, t_atom*argv) { if(!s) { - ::verbose(2, "frei0r_loader: no name given"); + ::logpost(0, 3+2, "frei0r_loader: no name given"); return 0; } - ::verbose(2, "frei0r_loader: %s",s->s_name); + ::logpost(0, 3+2, "frei0r_loader: %s",s->s_name); try { const char*realname=s->s_name+offset_pix_; /* strip of the leading 'pix_' */ const int typespecs[] = {}; @@ -708,7 +708,7 @@ static void*frei0r_loader_new(t_symbol*s, int argc, t_atom*argv) proxy.setObject(new pix_frei0r(gensym(realname))); return proxy.initialize(); } catch (GemException&e) { - ::verbose(2, "frei0r_loader: failed! (%s)", e.what()); + ::logpost(0, 3+2, "frei0r_loader: failed! (%s)", e.what()); return 0; } return 0; @@ -745,7 +745,7 @@ bool pix_frei0r :: loader(const t_canvas*canvas, try { plugin=new F0RPlugin(filename); } catch (GemException&e) { - ::verbose(2, "frei0r_loader: failed!! (%s)", e.what()); + ::logpost(0, 3+2, "frei0r_loader: failed!! (%s)", e.what()); return false; } diff --git a/src/Utils/SIMD.cpp b/src/Utils/SIMD.cpp index b999d6da1..0778d5d6a 100644 --- a/src/Utils/SIMD.cpp +++ b/src/Utils/SIMD.cpp @@ -42,7 +42,7 @@ GemSIMD :: GemSIMD(void) #endif if(compiledarchs>0) { - verbose(-1, "GEM: compiled for %s architecture", compiledstr.c_str()); + logpost(0, 3-1, "GEM: compiled for %s architecture", compiledstr.c_str()); } if(cpuid) { @@ -69,8 +69,8 @@ GemSIMD :: GemSIMD(void) case 0: /* this should never happen but is here for compilers who hate to "switch" with only one "case" */ usingstr="invalid"; } - verbose(-1, "GEM: using %s optimization", usingstr.c_str()); - verbose(-1, "GEM: detected %d CPUs", gem::thread::getCPUCount()); + logpost(0, 3-1, "GEM: using %s optimization", usingstr.c_str()); + logpost(0, 3-1, "GEM: detected %d CPUs", gem::thread::getCPUCount()); } } diff --git a/src/plugins/film.cpp b/src/plugins/film.cpp index cad85c9d3..8ce043895 100644 --- a/src/plugins/film.cpp +++ b/src/plugins/film.cpp @@ -135,7 +135,7 @@ class filmMeta : public gem::plugins::film id.push_back(ID); } else { // request for an unavailable ID - verbose(2, "backend '%s' unavailable", ID.c_str()); + logpost(0, 3+2, "backend '%s' unavailable", ID.c_str()); return false; } } else { @@ -145,7 +145,7 @@ class filmMeta : public gem::plugins::film for(unsigned int i=0; i::getInstance(key); } catch(GemException&x) { handle=NULL; - verbose(1, "cannot use film plugin '%s': %s", key.c_str(), x.what()); + logpost(0, 3+1, "cannot use film plugin '%s': %s", key.c_str(), x.what()); } if(NULL==handle) { continue; @@ -161,7 +161,7 @@ class filmMeta : public gem::plugins::film m_ids.push_back(key); m_handles.push_back(handle); count++; - verbose(2, "added backend#%d '%s'", (int)(m_handles.size()-1), + logpost(0, 3+2, "added backend#%d '%s'", (int)(m_handles.size()-1), key.c_str()); } } @@ -252,7 +252,7 @@ class filmMeta : public gem::plugins::film } if(!tried) { if(!backends.empty() && !m_handles.empty()) { - verbose(2, "no available backend selected, fall back to valid ones"); + logpost(0, 3+2, "no available backend selected, fall back to valid ones"); } for(unsigned int i=0; iopen(name, requestprops)) { diff --git a/src/plugins/imageloader.cpp b/src/plugins/imageloader.cpp index fab1da29e..c5d23ec13 100644 --- a/src/plugins/imageloader.cpp +++ b/src/plugins/imageloader.cpp @@ -77,7 +77,7 @@ struct imageloaderMeta : public gem::plugins::imageloader id.push_back(ID); } else { // request for an unavailable ID - verbose(2, "backend '%s' unavailable", ID.c_str()); + logpost(0, 3+2, "backend '%s' unavailable", ID.c_str()); return false; } } else { @@ -87,7 +87,7 @@ struct imageloaderMeta : public gem::plugins::imageloader for(unsigned int i=0; i::getInstance(key); } catch(GemException&x) { loader=NULL; - verbose(1, "cannot use image loader plugin '%s': %s", key.c_str(), + logpost(0, 3+1, "cannot use image loader plugin '%s': %s", key.c_str(), x.what()); } if(NULL==loader) { @@ -104,7 +104,7 @@ struct imageloaderMeta : public gem::plugins::imageloader m_ids.push_back(key); m_loaders.push_back(loader); count++; - verbose(2, "added backend#%d '%s' @ %p", (int)(m_loaders.size()-1), + logpost(0, 3+2, "added backend#%d '%s' @ %p", (int)(m_loaders.size()-1), key.c_str(), loader); } } diff --git a/src/plugins/imagesaver.cpp b/src/plugins/imagesaver.cpp index a89ab3400..8023d00f3 100644 --- a/src/plugins/imagesaver.cpp +++ b/src/plugins/imagesaver.cpp @@ -209,7 +209,7 @@ class imagesaverMeta : public imagesaver id.push_back(ID); } else { // request for an unavailable ID - verbose(2, "backend '%s' unavailable", ID.c_str()); + logpost(0, 3+2, "backend '%s' unavailable", ID.c_str()); return false; } } else { @@ -219,7 +219,7 @@ class imagesaverMeta : public imagesaver for(unsigned int i=0; i::getInstance(key); } catch(GemException&x) { saver=NULL; - verbose(1, "cannot use image loader plugin '%s': %s", key.c_str(), + logpost(0, 3+1, "cannot use image loader plugin '%s': %s", key.c_str(), x.what()); } if(NULL==saver) { @@ -236,7 +236,7 @@ class imagesaverMeta : public imagesaver m_ids.push_back(key); m_savers.push_back(saver); count++; - verbose(2, "added backend#%d '%s' @ %p", (int)(m_savers.size()-1), + logpost(0, 3+2, "added backend#%d '%s' @ %p", (int)(m_savers.size()-1), key.c_str(), saver); } } @@ -271,7 +271,7 @@ class imagesaverMeta : public imagesaver for(unsigned int i=0; isave(img, filename, mimetype, props)) { return true; } @@ -287,7 +287,7 @@ class imagesaverMeta : public imagesaver for(rit=priorities.rbegin(); rit != priorities.rend(); ++rit) { float prio=rit->first; int index=rit->second; - verbose(2, "trying saver[%d]=%s / %f", index, m_ids[index].c_str(), prio); + logpost(0, 3+2, "trying saver[%d]=%s / %f", index, m_ids[index].c_str(), prio); if(m_savers[index]->save(img, filename, mimetype, props)) { return true; } diff --git a/src/plugins/modelloader.cpp b/src/plugins/modelloader.cpp index 92771f277..eebc327a8 100644 --- a/src/plugins/modelloader.cpp +++ b/src/plugins/modelloader.cpp @@ -59,7 +59,7 @@ class modelloaderMeta : public gem::plugins::modelloader id.push_back(ID); } else { // request for an unavailable ID - verbose(2, "backend '%s' unavailable", ID.c_str()); + logpost(0, 3+2, "backend '%s' unavailable", ID.c_str()); return false; } } else { @@ -69,7 +69,7 @@ class modelloaderMeta : public gem::plugins::modelloader for(unsigned int i=0; i::getInstance(key); } catch(GemException&x) { handle=NULL; - verbose(1, "cannot use modelloader plugin '%s': %s", key.c_str(), + logpost(0, 3+1, "cannot use modelloader plugin '%s': %s", key.c_str(), x.what()); } if(NULL==handle) { @@ -86,7 +86,7 @@ class modelloaderMeta : public gem::plugins::modelloader m_ids.push_back(key); m_handles.push_back(handle); count++; - verbose(2, "added backend#%d '%s'", (int)(m_handles.size()-1), + logpost(0, 3+2, "added backend#%d '%s'", (int)(m_handles.size()-1), key.c_str()); } } @@ -158,7 +158,7 @@ class modelloaderMeta : public gem::plugins::modelloader } if(!m_handle && !tried) { if(!backends.empty() && !m_handles.empty()) { - verbose(2, "no available loader selected, falling back to valid ones"); + logpost(0, 3+2, "no available loader selected, falling back to valid ones"); } for(unsigned int i=0; iopen(name, requestprops)) { diff --git a/src/plugins/record.cpp b/src/plugins/record.cpp index f2d166234..b026aa2e2 100644 --- a/src/plugins/record.cpp +++ b/src/plugins/record.cpp @@ -118,7 +118,7 @@ class recordMeta : public gem::plugins::record id.push_back(ID); } else { // request for an unavailable ID - verbose(2, "backend '%s' unavailable", ID.c_str()); + logpost(0, 3+2, "backend '%s' unavailable", ID.c_str()); return false; } } else { @@ -128,7 +128,7 @@ class recordMeta : public gem::plugins::record for(unsigned int i=0; i::getInstance(key); } catch(GemException&x) { handle=NULL; - verbose(1, "cannot use record plugin '%s': %s", key.c_str(), x.what()); + logpost(0, 3+1, "cannot use record plugin '%s': %s", key.c_str(), x.what()); } if(NULL==handle) { continue; @@ -144,7 +144,7 @@ class recordMeta : public gem::plugins::record m_ids.push_back(key); m_handles.push_back(handle); count++; - verbose(2, "added backend#%d '%s'", (int)(m_handles.size()-1), + logpost(0, 3+2, "added backend#%d '%s'", (int)(m_handles.size()-1), key.c_str()); } } @@ -320,7 +320,7 @@ class recordMeta : public gem::plugins::record } if(!tried) { if(!backends.empty() && !m_selectedHandles.empty()) { - verbose(2, "no available backend selected, fall back to valid ones"); + logpost(0, 3+2, "no available backend selected, fall back to valid ones"); } for(unsigned int i=0; istart(filename, props)) { diff --git a/src/plugins/video.cpp b/src/plugins/video.cpp index 504c0ea22..506a97f54 100644 --- a/src/plugins/video.cpp +++ b/src/plugins/video.cpp @@ -71,7 +71,7 @@ class videoMeta : public gem::plugins::video id.push_back(ID); } else { // request for an unavailable ID - verbose(2, "Gem::video: backend '%s' unavailable", ID.c_str()); + logpost(0, 3+2, "Gem::video: backend '%s' unavailable", ID.c_str()); return false; } } else { @@ -81,7 +81,7 @@ class videoMeta : public gem::plugins::video for(unsigned int i=0; i::getInstance(key); } catch(GemException&x) { handle=NULL; - verbose(1, "Gem::video: cannot use video plugin '%s': %s", key.c_str(), + logpost(0, 3+1, "Gem::video: cannot use video plugin '%s': %s", key.c_str(), x.what()); } if(NULL==handle) { @@ -98,7 +98,7 @@ class videoMeta : public gem::plugins::video m_ids.push_back(key); m_handles.push_back(handle); count++; - verbose(2, "Gem::video: added backend#%d '%s'", + logpost(0, 3+2, "Gem::video: added backend#%d '%s'", (int)(m_handles.size()-1), key.c_str()); } } @@ -219,7 +219,7 @@ class videoMeta : public gem::plugins::video } if(!tried) { if(!backends.empty() && !m_handles.empty()) { - verbose(2, "no available backend selected, fall back to valid ones"); + logpost(0, 3+2, "no available backend selected, fall back to valid ones"); } for(unsigned int i=0; iopen(props)) { From 2e86329192832ba80ca70ffd06d1e48345fe5e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 13:24:07 +0100 Subject: [PATCH 231/387] unconditionally replace clock_getsystime() with clock_getlogicaltime() --- src/Gem/Manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gem/Manager.cpp b/src/Gem/Manager.cpp index 3e1894826..17ef999ab 100644 --- a/src/Gem/Manager.cpp +++ b/src/Gem/Manager.cpp @@ -590,7 +590,7 @@ void GemMan :: render(void *) currentState.set(GemState::_TIMING_TICK, tickTime); - m_lastRenderTime = clock_getsystime(); + m_lastRenderTime = clock_getlogicaltime(); //test to see if stereo is supported //XXX maybe there is a better place to do this? @@ -922,7 +922,7 @@ void GemMan :: startRendering() return; } - m_lastRenderTime = clock_getsystime(); + m_lastRenderTime = clock_getlogicaltime(); render(NULL); } From 9b26e25a8d51bd8d06f3acafdcf4308599c406d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 13:24:49 +0100 Subject: [PATCH 232/387] disable deprecation awrning for garray_resize() garray_resize() is only a fallback if garray_resize_long() is not available --- src/RTE/Array.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/RTE/Array.cpp b/src/RTE/Array.cpp index 41414cb69..0751bb442 100644 --- a/src/RTE/Array.cpp +++ b/src/RTE/Array.cpp @@ -144,7 +144,19 @@ bool gem::RTE::Array :: resize(const size_t newsize) if(rte_resize) { rte_resize(m_pimpl->A, newsize); } else { +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4996 ) +#endif garray_resize(m_pimpl->A, newsize); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#elif defined _MSC_VER +#pragma warning( pop ) +#endif } return (size()==newsize); From 570a37f567dae80ac0851896a966999544fa5054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 13:47:08 +0100 Subject: [PATCH 233/387] .gitignore directories starting with underscore which is where *I* put out-of-tree builds --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0d8bab7c5..db7aa8d25 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,7 @@ \.libs # out-of-tree builds -/build-*/ -/build/ +/_*/ # autotools byproducts Makefile\.in /aclocal\.m4 From b19fe3b7d4ab0054394e444df0b60ea742087e06 Mon Sep 17 00:00:00 2001 From: Timothy Schoen Date: Thu, 10 Oct 2024 12:44:44 +0200 Subject: [PATCH 234/387] Fix crash when reloading model --- src/Gem/model.cpp | 17 ++++++++++++++++- src/Gem/model.h | 3 ++- src/Geos/model.cpp | 8 ++++++++ src/Geos/model.h | 1 + 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Gem/model.cpp b/src/Gem/model.cpp index 852bddaf4..7b20b11e4 100644 --- a/src/Gem/model.cpp +++ b/src/Gem/model.cpp @@ -146,8 +146,16 @@ namespace } else { vTexCoordsUV = vTexCoordsLinear; } - } + + void destroy() + { + vertices.destroy(); + normals.destroy(); + colors.destroy(); + texcoords.destroy(); + } + void update(enum gem::modelGL::texturetype t, float texW, float texH) { vertices.update(size, vVertices.data()); @@ -292,6 +300,12 @@ namespace gem { delete m_pimpl; } + void modelGL::destroy(void) { + for (auto& m: m_pimpl->mesh) { + m.destroy(); + } + } + bool modelGL::update(void) { m_pimpl->update = false; if(true) { @@ -322,6 +336,7 @@ namespace gem { } render(groups); } + void modelGL::render(std::vector&meshes) { if(m_pimpl->update) update(); diff --git a/src/Gem/model.h b/src/Gem/model.h index 430d2ac56..73d6846c6 100644 --- a/src/Gem/model.h +++ b/src/Gem/model.h @@ -35,7 +35,8 @@ namespace gem modelGL(gem::plugins::modelloader&loader); virtual ~modelGL(void); - + /* destroy VBOs */ + void destroy(void); /* update data */ bool update(void); /* render the model in the current openGL context */ diff --git a/src/Geos/model.cpp b/src/Geos/model.cpp index 858bc7f76..093ac2a4b 100644 --- a/src/Geos/model.cpp +++ b/src/Geos/model.cpp @@ -521,6 +521,14 @@ void model :: startRendering() if(m_loaded) m_loaded->update(); } + +void model :: stopRendering() +{ + if(m_loaded) + m_loaded->destroy(); +} + + ///////////////////////////////////////////////////////// // render // diff --git a/src/Geos/model.h b/src/Geos/model.h index 90418b407..a2b825db3 100644 --- a/src/Geos/model.h +++ b/src/Geos/model.h @@ -100,6 +100,7 @@ class GEM_EXTERN model : public GemBase ////////// virtual void render(GemState *state); virtual void startRendering(); + virtual void stopRendering(); gem::plugins::modelloader*m_loader; gem::modelGL*m_loaded; From bf399da9d1b3e948d38b0919bc1c215cd2699d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 14:21:22 +0100 Subject: [PATCH 235/387] [part_move] object that moves particles and does nothing else --- src/Particles/Makefile.am | 2 ++ src/Particles/part_move.cpp | 45 ++++++++++++++++++++++++++++++++++ src/Particles/part_move.h | 49 +++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 src/Particles/part_move.cpp create mode 100644 src/Particles/part_move.h diff --git a/src/Particles/Makefile.am b/src/Particles/Makefile.am index e459bbfb8..e74b8c22f 100644 --- a/src/Particles/Makefile.am +++ b/src/Particles/Makefile.am @@ -57,6 +57,8 @@ libParticles_la_SOURCES= \ part_killold.h \ part_killslow.cpp \ part_killslow.h \ + part_move.cpp \ + part_move.h \ part_orbitpoint.cpp \ part_orbitpoint.h \ part_render.cpp \ diff --git a/src/Particles/part_move.cpp b/src/Particles/part_move.cpp new file mode 100644 index 000000000..6a02a0745 --- /dev/null +++ b/src/Particles/part_move.cpp @@ -0,0 +1,45 @@ +//////////////////////////////////////////////////////// +// +// GEM - Graphics Environment for Multimedia +// +// zmoelnig@iem.at +// +// Copyright (c) 2025 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at +// For information on usage and redistribution, and for a DISCLAIMER OF ALL +// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. +// +///////////////////////////////////////////////////////// + +#include "part_move.h" +#include "papi/papi.h" + +CPPEXTERN_NEW(part_move); + +///////////////////////////////////////////////////////// +// +// part_move +// +///////////////////////////////////////////////////////// +// Constructor/Destructor +// +///////////////////////////////////////////////////////// +part_move :: part_move() {} +part_move :: ~part_move() {} + +///////////////////////////////////////////////////////// +// renderParticles +// +///////////////////////////////////////////////////////// +void part_move :: renderParticles(GemState *state) +{ + if (m_tickTime > 0.f) { + pMove(); + } +} + +///////////////////////////////////////////////////////// +// static member functions +// +///////////////////////////////////////////////////////// +void part_move :: obj_setupCallback(t_class *classPtr) +{} diff --git a/src/Particles/part_move.h b/src/Particles/part_move.h new file mode 100644 index 000000000..4ca06c81f --- /dev/null +++ b/src/Particles/part_move.h @@ -0,0 +1,49 @@ +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + Advance particles + + Copyright (c) 2025 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef _INCLUDE__GEM_PARTICLES_PART_MOVE_H_ +#define _INCLUDE__GEM_PARTICLES_PART_MOVE_H_ + +#include "Particles/partlib_base.h" + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + + part_move + + Draw a part_move group + +DESCRIPTION + +-----------------------------------------------------------------*/ +class GEM_EXTERN part_move : public partlib_base +{ + CPPEXTERN_HEADER(part_move, partlib_base); + +public: + + ////////// + // Constructor + part_move(); + + ////////// + virtual void renderParticles(GemState *state); + +protected: + + ////////// + // Destructor + virtual ~part_move(); +}; + +#endif // for header file From 8bb657d1b5ca5cdb9b8248f0e8f947ad8f586f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 14:34:06 +0100 Subject: [PATCH 236/387] Rename [part_info] to [part_information] and strip the pMove() Closes: https://github.com/umlaeute/Gem/pull/459 --- src/Particles/Makefile.am | 4 ++-- .../{part_info.cpp => part_information.cpp} | 18 +++++++----------- .../{part_info.h => part_information.h} | 18 +++++++++--------- 3 files changed, 18 insertions(+), 22 deletions(-) rename src/Particles/{part_info.cpp => part_information.cpp} (92%) rename src/Particles/{part_info.h => part_information.h} (77%) diff --git a/src/Particles/Makefile.am b/src/Particles/Makefile.am index e74b8c22f..7e4a0809c 100644 --- a/src/Particles/Makefile.am +++ b/src/Particles/Makefile.am @@ -51,8 +51,8 @@ libParticles_la_SOURCES= \ part_gravity.h \ part_head.cpp \ part_head.h \ - part_info.cpp \ - part_info.h \ + part_information.cpp \ + part_information.h \ part_killold.cpp \ part_killold.h \ part_killslow.cpp \ diff --git a/src/Particles/part_info.cpp b/src/Particles/part_information.cpp similarity index 92% rename from src/Particles/part_info.cpp rename to src/Particles/part_information.cpp index 8aec0d234..6fc1fd219 100644 --- a/src/Particles/part_info.cpp +++ b/src/Particles/part_information.cpp @@ -12,24 +12,24 @@ // ///////////////////////////////////////////////////////// -#include "part_info.h" +#include "part_information.h" #include #include "papi/papi.h" -CPPEXTERN_NEW(part_info); +CPPEXTERN_NEW(part_information); ///////////////////////////////////////////////////////// // -// part_info +// part_information // ///////////////////////////////////////////////////////// // Constructor // ///////////////////////////////////////////////////////// -part_info :: part_info() +part_information :: part_information() { m_number=1000; m_pos = new float[m_number*3]; @@ -56,7 +56,7 @@ part_info :: part_info() // Destructor // ///////////////////////////////////////////////////////// -part_info :: ~part_info() +part_information :: ~part_information() { outlet_free(out_num); outlet_free(out_pos); @@ -85,12 +85,8 @@ part_info :: ~part_info() // renderParticles // ///////////////////////////////////////////////////////// -void part_info :: renderParticles(GemState *state) +void part_information :: renderParticles(GemState *state) { - if (m_tickTime > 0.f) { - pMove(); - } - // pDrawGroupp(); int cnt = pGetGroupCount(); if(cnt < 1) { return; @@ -157,5 +153,5 @@ void part_info :: renderParticles(GemState *state) // static member functions // ///////////////////////////////////////////////////////// -void part_info :: obj_setupCallback(t_class *classPtr) +void part_information :: obj_setupCallback(t_class *classPtr) {} diff --git a/src/Particles/part_info.h b/src/Particles/part_information.h similarity index 77% rename from src/Particles/part_info.h rename to src/Particles/part_information.h index d9bfa5162..8ff5d52bd 100644 --- a/src/Particles/part_info.h +++ b/src/Particles/part_information.h @@ -2,7 +2,7 @@ LOG GEM - Graphics Environment for Multimedia - Draw a part_info group + Draw a part_information group Copyright (c) 1997-1999 Mark Danks. mark@danks.org Copyright (c) Günther Geiger. geiger@epy.co.at @@ -12,8 +12,8 @@ LOG -----------------------------------------------------------------*/ -#ifndef _INCLUDE__GEM_PARTICLES_PART_INFO_H_ -#define _INCLUDE__GEM_PARTICLES_PART_INFO_H_ +#ifndef _INCLUDE__GEM_PARTICLES_PART_INFORMATION_H_ +#define _INCLUDE__GEM_PARTICLES_PART_INFORMATION_H_ #include "Particles/partlib_base.h" @@ -21,22 +21,22 @@ LOG ------------------------------------------------------------------- CLASS - part_info + part_information - Draw a part_info group + Draw a part_information group DESCRIPTION -----------------------------------------------------------------*/ -class GEM_EXTERN part_info : public partlib_base +class GEM_EXTERN part_information : public partlib_base { - CPPEXTERN_HEADER(part_info, partlib_base); + CPPEXTERN_HEADER(part_information, partlib_base); public: ////////// // Constructor - part_info(); + part_information(); ////////// virtual void renderParticles(GemState *state); @@ -45,7 +45,7 @@ class GEM_EXTERN part_info : public partlib_base ////////// // Destructor - virtual ~part_info(); + virtual ~part_information(); // How the object should be drawn float *m_pos; From 5faf61aa6bae986b53d83e497be93876ac57dc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 14:34:25 +0100 Subject: [PATCH 237/387] [part_info] compat abstraction --- abstractions/Makefile.am | 4 +++- abstractions/part_info.pd | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 abstractions/part_info.pd diff --git a/abstractions/Makefile.am b/abstractions/Makefile.am index 65ed3a18d..d7e32023c 100644 --- a/abstractions/Makefile.am +++ b/abstractions/Makefile.am @@ -22,6 +22,7 @@ dist_gemabs_DATA = \ gemwin.pd \ hsv2rgb-help.pd \ hsv2rgb.pd \ + part_info.pd \ pix_blobtracker-help.pd \ pix_blobtracker.pd \ pix_buffer_filmopen-help.pd \ @@ -33,5 +34,6 @@ dist_gemabs_DATA = \ rgb2yuv-help.pd \ rgb2yuv.pd \ yuv2rgb-help.pd \ - yuv2rgb.pd + yuv2rgb.pd \ + $(empty) diff --git a/abstractions/part_info.pd b/abstractions/part_info.pd new file mode 100644 index 000000000..1e930148c --- /dev/null +++ b/abstractions/part_info.pd @@ -0,0 +1,22 @@ +#N canvas 2334 557 868 224 12; +#X obj 55 72 part_move; +#X obj 55 97 part_information, f 94; +#X obj 55 161 outlet gemlist; +#X obj 55 47 inlet gemlist; +#X obj 164 161 outlet num; +#X obj 273 161 outlet position; +#X obj 382 161 outlet color; +#X obj 491 161 outlet velocity; +#X obj 600 161 outlet size; +#X obj 710 161 outlet age; +#X text 208 51 compatibility abstraction; +#X text 581 20 © 2025 IOhannes m zmölnig \; part of GEM \; see LICENSE.txt for license information; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 4 0; +#X connect 1 2 5 0; +#X connect 1 3 6 0; +#X connect 1 4 7 0; +#X connect 1 5 8 0; +#X connect 1 6 9 0; +#X connect 3 0 0 0; From cca67ac1186bc0905269e312388de8257bafdd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 14:52:50 +0100 Subject: [PATCH 238/387] [part_information] use std::vector rather than manually allocated arrays --- src/Particles/part_information.cpp | 107 +++++++++-------------------- src/Particles/part_information.h | 14 ++-- 2 files changed, 40 insertions(+), 81 deletions(-) diff --git a/src/Particles/part_information.cpp b/src/Particles/part_information.cpp index 6fc1fd219..22f90a60a 100644 --- a/src/Particles/part_information.cpp +++ b/src/Particles/part_information.cpp @@ -31,18 +31,18 @@ CPPEXTERN_NEW(part_information); ///////////////////////////////////////////////////////// part_information :: part_information() { - m_number=1000; - m_pos = new float[m_number*3]; - m_colors = new float[m_number*4]; - m_velo = new float[m_number*3]; - m_sizes = new float[m_number*3]; - m_ages = new float[m_number]; + const size_t length = 1024; + m_position.reserve(length*3); + m_color.reserve(length*4); + m_velocity.reserve(length*3); + m_size.reserve(length*3); + m_age.reserve(length); out_num = outlet_new(this->x_obj, 0); - out_pos = outlet_new(this->x_obj, 0); - out_col = outlet_new(this->x_obj, 0); - out_vel = outlet_new(this->x_obj, 0); - out_siz = outlet_new(this->x_obj, 0); + out_position = outlet_new(this->x_obj, 0); + out_color = outlet_new(this->x_obj, 0); + out_velocity = outlet_new(this->x_obj, 0); + out_size = outlet_new(this->x_obj, 0); out_age = outlet_new(this->x_obj, 0); unsigned int i; @@ -57,29 +57,7 @@ part_information :: part_information() // ///////////////////////////////////////////////////////// part_information :: ~part_information() -{ - outlet_free(out_num); - outlet_free(out_pos); - outlet_free(out_col); - outlet_free(out_vel); - outlet_free(out_siz); - outlet_free(out_age); - if(m_pos) { - delete[]m_pos; - } - if(m_colors) { - delete[]m_colors; - } - if(m_velo) { - delete[]m_velo; - } - if(m_sizes) { - delete[]m_sizes; - } - if(m_ages) { - delete[]m_ages; - } -} +{} ///////////////////////////////////////////////////////// // renderParticles @@ -87,40 +65,23 @@ part_information :: ~part_information() ///////////////////////////////////////////////////////// void part_information :: renderParticles(GemState *state) { - int cnt = pGetGroupCount(); - if(cnt < 1) { + const int length = pGetGroupCount(); + if(length < 1) { return; } - if (cnt>m_number) { - if(m_colors) { - delete[]m_colors; - } - if(m_sizes ) { - delete[]m_sizes; - } - if(m_pos ) { - delete[]m_pos; - } - if(m_velo ) { - delete[]m_velo; - } - if(m_ages ) { - delete[]m_ages; - } - m_number = cnt; - m_pos = new float[m_number * 3]; - m_colors = new float[m_number * 4]; - m_velo = new float[m_number * 3]; - m_sizes = new float[m_number * 3]; - m_ages = new float[m_number]; - } - float *position = m_pos; - float *color = m_colors; - float *velo = m_velo; - float *size = m_sizes; - float *age = m_ages; - pGetParticles(0, cnt, position, color, velo, size, age); - for(int i = 0; i < cnt; i++) { + m_position.reserve(length*3); + m_color.reserve(length*4); + m_velocity.reserve(length*3); + m_size.reserve(length*3); + m_age.reserve(length); + + float *position = m_position.data(); + float *color = m_color.data(); + float *velocity = m_velocity.data(); + float *size = m_size.data(); + float *age = m_age.data(); + pGetParticles(0, length, position, color, velocity, size, age); + for(int i = 0; i < length; i++) { SETFLOAT(m_alist+0, position[0]); SETFLOAT(m_alist+1, position[1]); SETFLOAT(m_alist+2, position[2]); @@ -130,20 +91,20 @@ void part_information :: renderParticles(GemState *state) SETFLOAT(m_alist+5, color[2]); SETFLOAT(m_alist+6, color[3]); color+=4; - SETFLOAT(m_alist+7, velo[0]); - SETFLOAT(m_alist+8, velo[1]); - SETFLOAT(m_alist+9, velo[2]); - velo+=3; + SETFLOAT(m_alist+7, velocity[0]); + SETFLOAT(m_alist+8, velocity[1]); + SETFLOAT(m_alist+9, velocity[2]); + velocity+=3; SETFLOAT(m_alist+10, size[0]); SETFLOAT(m_alist+11, size[1]); SETFLOAT(m_alist+12, size[2]); size+=3; outlet_float(out_age, age[i]); - outlet_list (out_siz, &s_list, 3, m_alist+10); - outlet_list (out_vel, &s_list, 3, m_alist+7); - outlet_list (out_col, &s_list, 4, m_alist+3); - outlet_list (out_pos, &s_list, 3, m_alist+0); + outlet_list (out_size, &s_list, 3, m_alist+10); + outlet_list (out_velocity, &s_list, 3, m_alist+7); + outlet_list (out_color, &s_list, 4, m_alist+3); + outlet_list (out_position, &s_list, 3, m_alist+0); outlet_float(out_num, i); continueRender(state); } diff --git a/src/Particles/part_information.h b/src/Particles/part_information.h index 8ff5d52bd..93dc38361 100644 --- a/src/Particles/part_information.h +++ b/src/Particles/part_information.h @@ -48,15 +48,13 @@ class GEM_EXTERN part_information : public partlib_base virtual ~part_information(); // How the object should be drawn - float *m_pos; - float *m_colors; - float *m_sizes; - float *m_velo; - float *m_ages; + std::vectorm_position; + std::vectorm_color; + std::vectorm_size; + std::vectorm_velocity; + std::vectorm_age; - int m_number; - - t_outlet *out_num, *out_pos, *out_col, *out_vel, *out_siz, *out_age; + t_outlet *out_num, *out_position, *out_color, *out_velocity, *out_size, *out_age; t_atom m_alist[13]; }; From 36e938568e7df5cd01188b526e912759ba69dfcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 15:23:16 +0100 Subject: [PATCH 239/387] (Updated) help-patches for [part_info], [part_information] and [part_move] --- help/part_info-help.pd | 70 +++++++++++++++++++++------------ help/part_information-help.pd | 43 ++++++++++++++++++++ help/part_move-help.pd | 74 +++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+), 26 deletions(-) create mode 100644 help/part_information-help.pd create mode 100644 help/part_move-help.pd diff --git a/help/part_info-help.pd b/help/part_info-help.pd index 33b7d4c75..83941e126 100644 --- a/help/part_info-help.pd +++ b/help/part_info-help.pd @@ -1,8 +1,8 @@ -#N canvas 469 318 684 479 10; +#N canvas 232 183 782 536 10; #X declare -lib Gem; #X obj 539 58 declare -lib Gem; #X obj 7 115 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 468 114 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 468 114 cnv 15 200 400 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 468 246 cnv 15 200 120 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 8 226 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 464 58 GEM object; @@ -11,32 +11,50 @@ #X obj 481 140 gemhead; #X obj 481 161 part_head; #X obj 481 118 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 481 250 part_info, f 18; -#X text 24 130 [part_info] gives you all available information of all the particles in the system draws a particle system set up with [part_head] and other [part_]-objects.; +#X obj 508 250 part_info, f 18; #X text 25 179 If your system contains 15 particles \, then you will get the information on the outlets 15 times per rendering circle.; #X text 39 88 Class: Particle System; -#X text 39 58 Synopsis [part_render]; -#X floatatom 633 270 5 0 0 3 age - - 0; -#X listbox 590 275 6 0 0 3 size - - 0; -#X listbox 551 338 20 0 0 3 velocity - - 0; -#X listbox 533 272 8 0 0 3 color - - 0; -#X listbox 516 304 20 0 0 3 position - - 0; -#X floatatom 498 335 5 0 0 3 id - - 0; -#X obj 481 370 part_killold 10; -#X obj 481 204 part_velocity point 0 0.1 0; +#X floatatom 639 271 5 0 0 3 age - - 0; +#X listbox 595 271 6 0 0 3 size - - 0; +#X listbox 541 338 20 0 0 3 velocity - - 0; +#X listbox 533 271 8 0 0 3 color - - 0; +#X listbox 543 304 20 0 0 3 position - - 0; +#X floatatom 498 321 5 0 0 3 id - - 0; +#X obj 481 480 part_killold 10; #X obj 481 184 part_source 1; -#X obj 481 224 part_draw; -#X obj 487 402 _gemwin; +#X obj 257 402 _gemwin; +#X text 26 123 [part_info] gives you all available information of all the particles in the particle system set up with [part_head] and other [part_]-objects.; +#X text 39 58 Synopsis [part_info]; +#X text 34 277 Note \, that [part_info] moves the particles (just like [part_draw] and [part_render].; +#X text 36 309 This is convenient if you use it directly to control the rendering \, but makes problems if you use it together with [part_draw] resp [part_render]; +#X obj 481 227 t a a; +#X obj 508 421 translate 1 0 0 0; +#X obj 639 423 /; +#X msg 639 400 0.2 \$1; +#X obj 481 204 part_velocity point 0 0.05 0; +#X obj 508 441 cube \; draw line; +#X obj 508 396 colorRGB 1 1 1; +#X obj 548 371 != 3; #X connect 8 0 9 0; -#X connect 9 0 24 0; +#X connect 9 0 21 0; #X connect 10 0 8 0; -#X connect 11 0 22 0; -#X connect 11 1 21 0; -#X connect 11 2 20 0; -#X connect 11 3 19 0; -#X connect 11 4 18 0; -#X connect 11 5 17 0; -#X connect 11 6 16 0; -#X connect 23 0 25 0; -#X connect 24 0 23 0; -#X connect 25 0 11 0; +#X connect 11 0 33 0; +#X connect 11 1 19 0; +#X connect 11 2 18 0; +#X connect 11 3 17 0; +#X connect 11 4 16 0; +#X connect 11 5 15 0; +#X connect 11 6 14 0; +#X connect 14 0 30 0; +#X connect 18 0 28 2; +#X connect 19 0 34 0; +#X connect 21 0 31 0; +#X connect 27 0 20 0; +#X connect 27 1 11 0; +#X connect 28 0 32 0; +#X connect 29 0 32 1; +#X connect 30 0 29 0; +#X connect 31 0 27 0; +#X connect 33 0 28 0; +#X connect 34 0 33 2; +#X connect 34 0 33 3; diff --git a/help/part_information-help.pd b/help/part_information-help.pd new file mode 100644 index 000000000..c516b3ede --- /dev/null +++ b/help/part_information-help.pd @@ -0,0 +1,43 @@ +#N canvas 469 318 684 479 10; +#X declare -lib Gem; +#X obj 539 58 declare -lib Gem; +#X obj 7 115 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 114 cnv 15 200 280 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 468 246 cnv 15 200 120 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 8 226 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 464 58 GEM object; +#X text 467 95 Example:; +#X obj 7 265 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 481 140 gemhead; +#X obj 481 161 part_head; +#X obj 481 118 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 25 179 If your system contains 15 particles \, then you will get the information on the outlets 15 times per rendering circle.; +#X text 39 88 Class: Particle System; +#X floatatom 633 270 5 0 0 3 age - - 0; +#X listbox 590 275 6 0 0 3 size - - 0; +#X listbox 551 338 20 0 0 3 velocity - - 0; +#X listbox 533 272 8 0 0 3 color - - 0; +#X listbox 516 304 20 0 0 3 position - - 0; +#X floatatom 498 335 5 0 0 3 id - - 0; +#X obj 481 370 part_killold 10; +#X obj 481 204 part_velocity point 0 0.1 0; +#X obj 481 184 part_source 1; +#X obj 481 224 part_draw; +#X obj 487 402 _gemwin; +#X obj 481 250 part_information, f 18; +#X text 39 58 Synopsis [part_information]; +#X text 24 130 [part_information] gives you all available information of all the particles in the particle system set up with [part_head] and other [part_]-objects.; +#X text 19 271 This is very similar to [part_info] \, but it doesn't move the particles \, so you can use it together with [part_draw] or [part_render].; +#X connect 8 0 9 0; +#X connect 9 0 21 0; +#X connect 10 0 8 0; +#X connect 20 0 22 0; +#X connect 21 0 20 0; +#X connect 22 0 24 0; +#X connect 24 0 19 0; +#X connect 24 1 18 0; +#X connect 24 2 17 0; +#X connect 24 3 16 0; +#X connect 24 4 15 0; +#X connect 24 5 14 0; +#X connect 24 6 13 0; diff --git a/help/part_move-help.pd b/help/part_move-help.pd new file mode 100644 index 000000000..23ef11576 --- /dev/null +++ b/help/part_move-help.pd @@ -0,0 +1,74 @@ +#N canvas 469 318 747 550 10; +#X declare -lib Gem; +#X obj 539 58 declare -lib Gem; +#X obj 7 115 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 468 114 cnv 15 200 400 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 8 226 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 464 58 GEM object; +#X text 467 95 Example:; +#X obj 7 265 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 481 140 gemhead; +#X obj 481 181 part_head; +#X obj 481 118 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 39 88 Class: Particle System; +#X obj 481 222 part_velocity point 0 0.1 0; +#X obj 481 202 part_source 1; +#X obj 277 402 _gemwin; +#X obj 508 341 part_information, f 24; +#X text 39 58 Synopsis [part_move]; +#X text 28 266 [part_draw] and [part_render] do the movement by themselves \, so you won't need this object if you use them.; +#X text 29 300 otoh \, [part_information] will not move the particles.; +#X text 31 321 the misnomed [part_info] combines [part_move] and [part_information] (and is built as an abstraction from the two objects).; +#X obj 173 494 part_info, f 11; +#X obj 481 280 part_move; +#X obj 481 490 part_killold 10; +#X obj 508 431 translate 1 0 0 0; +#X obj 508 406 colorRGB 1 1 1; +#X obj 558 381 != 3; +#X obj 481 311 t a a; +#N canvas 735 461 450 300 demux 0; +#X obj 51 152 t a a; +#X obj 96 177 == 0; +#X obj 51 71 inlet; +#X obj 51 228 outlet; +#X obj 51 205 spigot 1; +#X obj 156 174 spigot 0; +#X obj 156 197 outlet; +#X obj 174 66 inlet; +#X obj 100 100 hradio 18 1 0 2 \$0-demux \$0-demux empty 0 -9 0 10 #fcfcfc #000000 #000000 0; +#X obj 174 89 s \$0-demux; +#X obj 96 136 r \$0-demux; +#X obj 196 136 r \$0-demux; +#X connect 0 0 4 0; +#X connect 0 1 5 0; +#X connect 1 0 4 1; +#X connect 2 0 0 0; +#X connect 4 0 3 0; +#X connect 5 0 6 0; +#X connect 7 0 9 0; +#X connect 10 0 1 0; +#X connect 11 0 5 1; +#X coords 0 -1 1 1 36 18 2 100 100; +#X restore 481 243 pd demux; +#X text 24 130 [part_move] moves the particles according to their current velocity and constraints \, and updates their ages!; +#X obj 508 451 cube 0.2 \; draw line; +#X obj 481 161 translateXYZ 0 -3 0; +#X text 104 494 see also; +#X connect 7 0 29 0; +#X connect 8 0 12 0; +#X connect 9 0 7 0; +#X connect 11 0 26 0; +#X connect 12 0 11 0; +#X connect 14 0 23 0; +#X connect 14 1 24 0; +#X connect 14 2 22 2; +#X connect 20 0 25 0; +#X connect 22 0 28 0; +#X connect 23 0 22 0; +#X connect 24 0 23 2; +#X connect 24 0 23 3; +#X connect 25 0 21 0; +#X connect 25 1 14 0; +#X connect 26 0 20 0; +#X connect 26 1 25 0; +#X connect 29 0 8 0; From 5235e17d44f4f53e6939db02e73a58923b6cc44b Mon Sep 17 00:00:00 2001 From: Timothy Schoen <44585538+timothyschoen@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:58:31 +0200 Subject: [PATCH 240/387] Prevent deleting a non-existent framebuffer --- src/Controls/gemframebuffer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index 2604bf125..f341e79e7 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -469,6 +469,7 @@ void gemframebuffer :: initFBO() ///////////////////////////////////////////////////////// void gemframebuffer :: destroyFBO() { + if(!m_haveinit) return; //if(!GLEW_EXT_framebuffer_object)return; // Release all resources. From ac626a84ebf9aa3007de65e94b0f585ae8aa10ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 15:43:44 +0100 Subject: [PATCH 241/387] gemframebuffer-help: use [_gemwin] --- help/gemframebuffer-help.pd | 69 +++++++++++++------------------------ 1 file changed, 23 insertions(+), 46 deletions(-) diff --git a/help/gemframebuffer-help.pd b/help/gemframebuffer-help.pd index 8f64ded85..969363228 100644 --- a/help/gemframebuffer-help.pd +++ b/help/gemframebuffer-help.pd @@ -1,4 +1,4 @@ -#N canvas 125 98 896 632 10; +#N canvas 617 195 896 632 10; #X declare -lib Gem; #X obj 465 39 cnv 15 420 570 empty empty empty 20 12 0 14 #dce4fc #404040 0; #X obj 472 321 cnv 15 100 30 empty empty empty 20 12 0 14 #b8b8b8 #404040 0; @@ -86,36 +86,11 @@ #X floatatom 520 391 5 0 0 0 - - - 0; #X obj 495 184 t a; #X obj 470 544 cnv 15 410 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X msg 757 574 color 0 0 0 0; -#X msg 746 552 color 0 1 1 0; -#X msg 637 555 lighting \$1; -#X obj 615 556 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#N canvas 0 50 450 300 gemwin 0; -#X obj 132 136 gemwin; -#X obj 67 89 outlet; -#X obj 67 10 inlet; -#X msg 67 70 set destroy; -#X msg 142 68 set create; -#X msg 198 112 destroy; -#X msg 132 112 create \, 1; -#X obj 67 40 route create destroy; -#X obj 20 217 gemhead 1; -#X obj 20 237 world_light; -#X connect 2 0 7 0; -#X connect 3 0 1 0; -#X connect 4 0 1 0; -#X connect 5 0 0 0; -#X connect 6 0 0 0; -#X connect 7 0 3 0; -#X connect 7 0 6 0; -#X connect 7 1 4 0; -#X connect 7 1 5 0; -#X connect 7 2 0 0; -#X connect 8 0 9 0; -#X restore 473 584 pd gemwin; -#X msg 473 559 create; -#X text 471 543 Create window:; -#X obj 637 582 t a; +#X msg 717 574 color 0 0 0 0; +#X msg 706 552 color 0 1 1 0; +#X msg 597 555 lighting \$1; +#X obj 575 556 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 597 582 t a; #X text 476 52 Example:; #X text 699 10 GEM object; #X obj 7 71 cnv 15 450 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -168,6 +143,9 @@ #X text 22 512 Inlet 1: message: perspec , f 66; #X msg 685 270 format RGBA32F; #X text 27 310 Inlet 1: message: format [RGB|RGBA|RGB32|RGBA32F|YUV]; +#X obj 475 553 _gemwin; +#X obj 809 577 world_light; +#X obj 809 554 gemhead 1; #X connect 3 0 18 0; #X connect 4 0 19 0; #X connect 5 0 38 0; @@ -184,7 +162,7 @@ #X connect 15 0 40 0; #X connect 16 0 4 0; #X connect 17 0 36 0; -#X connect 18 0 84 0; +#X connect 18 0 81 0; #X connect 18 1 19 1; #X connect 19 0 20 0; #X connect 20 0 29 0; @@ -213,18 +191,17 @@ #X connect 42 0 17 3; #X connect 43 0 17 1; #X connect 44 0 18 0; -#X connect 46 0 53 0; -#X connect 47 0 53 0; -#X connect 48 0 53 0; +#X connect 46 0 50 0; +#X connect 47 0 50 0; +#X connect 48 0 50 0; #X connect 49 0 48 0; -#X connect 50 0 51 0; -#X connect 51 0 50 0; -#X connect 53 0 50 0; -#X connect 82 0 3 0; -#X connect 83 0 84 1; -#X connect 84 0 17 0; -#X connect 85 0 84 3; -#X connect 86 0 84 2; -#X connect 87 0 38 0; -#X connect 88 0 38 0; -#X connect 95 0 37 0; +#X connect 50 0 94 0; +#X connect 79 0 3 0; +#X connect 80 0 81 1; +#X connect 81 0 17 0; +#X connect 82 0 81 3; +#X connect 83 0 81 2; +#X connect 84 0 38 0; +#X connect 85 0 38 0; +#X connect 92 0 37 0; +#X connect 96 0 95 0; From 7fff48376208aaa9dbe5c54b9bc5d976d08e774f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 17:35:30 +0100 Subject: [PATCH 242/387] Add help-patches for [part_information] and [part_move] to buildsystem --- help/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/help/Makefile.am b/help/Makefile.am index 83f0d2307..efc9fa9f9 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -80,8 +80,10 @@ dist_gemhelp_DATA += \ part_gravity-help.pd \ part_head-help.pd \ part_info-help.pd \ + part_information-help.pd \ part_killold-help.pd \ part_killslow-help.pd \ + part_move-help.pd \ part_orbitpoint-help.pd \ part_render-help.pd \ part_sink-help.pd \ From 9ca46dc07f6cfdfdd09699f76692173f97108dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 17:46:55 +0100 Subject: [PATCH 243/387] simple floating-point framebuffer example LATER make it better (with shaders,...) --- .../11.floatingpoint_framebuffer.pd | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 examples/07.texture/11.floatingpoint_framebuffer.pd diff --git a/examples/07.texture/11.floatingpoint_framebuffer.pd b/examples/07.texture/11.floatingpoint_framebuffer.pd new file mode 100644 index 000000000..bfa467416 --- /dev/null +++ b/examples/07.texture/11.floatingpoint_framebuffer.pd @@ -0,0 +1,73 @@ +#N canvas 589 308 889 620 12; +#X obj 54 142 _gemwin; +#X obj 549 390 pix_texture; +#X obj 549 455 square 4; +#X obj 408 182 translateXYZ 0 0 -4; +#X obj 408 266 t a a; +#X obj 408 352 t a b; +#X obj 549 423 colorRGB 1 1 1; +#X obj 427 524 output~; +#X obj 548 267 +~ 1; +#X obj 548 292 *~ 0.5; +#X msg 82 210 \; pd dsp 1; +#X obj 598 105 gemhead; +#X obj 598 130 pix_texture; +#X obj 598 155 square 3; +#X floatatom 656 393 5 0 0 0 - - - 0; +#X obj 548 242 osc~ 750; +#X obj 408 99 gemframebuffer \; dimen 64 64 \; type FLOAT \; format RGBA32F; +#X obj 673 249 sig~ 180.5; +#X obj 673 274 /~ 255; +#X obj 562 513 snapshot~; +#X obj 672 474 loadbang; +#X obj 672 499 metro 50; +#X obj 736 473 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X obj 562 490 *~ 255; +#X obj 676 198 hsl 170 20 100 255 0 0 empty empty empty -2 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X floatatom 673 223 5 0 0 0 - - - 0; +#X obj 408 377 pix_snap 64 1 \; type FLOAT; +#X text 82 21 RGBA32F is needed for floating point pixels; +#X obj 549 320 pix_sig2pix~ 64 1 \; type FLOAT; +#X obj 408 447 pix_pix2sig~; +#X obj 408 29 bang~; +#X obj 408 55 gemhead 20 \; 0; +#X floatatom 549 208 5 0 0 0 - - - 0; +#X obj 562 538 nbx 5 18 -1e+37 1e+37 0 0 empty empty empty 0 -10 0 12 #c6ffc7 #000000 #000000 0 256; +#X obj 146 38 cnv 20 133 80 empty empty empty 20 12 0 12 #c6ffc7 #404040 0; +#X msg 157 79 format RGBA; +#X msg 157 54 format RGBA32F; +#X connect 1 0 6 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 4 1 28 0; +#X connect 5 0 26 0; +#X connect 5 1 26 0; +#X connect 6 0 2 0; +#X connect 8 0 9 0; +#X connect 9 0 28 0; +#X connect 9 0 28 1; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 14 0 6 1; +#X connect 15 0 8 0; +#X connect 16 0 3 0; +#X connect 16 1 12 1; +#X connect 17 0 18 0; +#X connect 18 0 28 2; +#X connect 19 0 33 0; +#X connect 20 0 21 0; +#X connect 21 0 19 0; +#X connect 22 0 21 0; +#X connect 23 0 19 0; +#X connect 24 0 25 0; +#X connect 25 0 17 0; +#X connect 26 0 29 0; +#X connect 28 0 1 0; +#X connect 29 1 7 0; +#X connect 29 2 7 1; +#X connect 29 3 23 0; +#X connect 30 0 31 0; +#X connect 31 0 16 0; +#X connect 32 0 15 0; +#X connect 35 0 16 0; +#X connect 36 0 16 0; From 7311593ff90750d830a628561f34a74040fec0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 13 Feb 2025 19:25:35 +0100 Subject: [PATCH 244/387] examples/glsl/audio: make sure that [gemframebuffer] uses RGBA32F --- examples/10.glsl/18.additive_audio_synthesis.pd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index 81bbd0c98..a856883ea 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -20,7 +20,7 @@ #X floatatom 463 357 5 0 0 0 - - - 0; #X obj 451 332 + 1; #X msg 451 264 0; -#X obj 361 126 s rendered_sound; +#X obj 361 136 s rendered_sound; #X obj 654 130 s input_image; #X obj 567 40 gemhead 10; #X obj 274 322 pix_texture \; rectangle 1 \; quality 0; @@ -252,7 +252,7 @@ #X connect 31 0 26 0; #X restore 274 223 pd shader; #X obj 284 198 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X obj 274 63 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; type FLOAT; +#X obj 274 63 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; type FLOAT \; format RGBA32F; #X obj 301 458 pix_snap 0 0 4096 1 \; type FLOAT; #X msg 123 197 render; #X obj 40 245 gemwin \; color 0.3 0.3 0.3; From 59a7f43a5915e2ab8c8813174b245239afeb1582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 14 Feb 2025 08:16:59 +0100 Subject: [PATCH 245/387] Rename floatpoint_framebuffer example and add it to the build-system --- ...atingpoint_framebuffer.pd => 12.floatingpoint_framebuffer.pd} | 0 examples/Makefile.am | 1 + 2 files changed, 1 insertion(+) rename examples/07.texture/{11.floatingpoint_framebuffer.pd => 12.floatingpoint_framebuffer.pd} (100%) diff --git a/examples/07.texture/11.floatingpoint_framebuffer.pd b/examples/07.texture/12.floatingpoint_framebuffer.pd similarity index 100% rename from examples/07.texture/11.floatingpoint_framebuffer.pd rename to examples/07.texture/12.floatingpoint_framebuffer.pd diff --git a/examples/Makefile.am b/examples/Makefile.am index 24598c3a2..5fe171155 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -106,6 +106,7 @@ nobase_dist_gemexamples_DATA = \ 07.texture/09.sharedTextures.pd \ 07.texture/10.framebuffer.pd \ 07.texture/11.multiples_gemhead_in_a_framebuffer.pd \ + 07.texture/12.floatingpoint_framebuffer.pd \ 08.io/01.Mouse.pd \ 08.io/02.Tablet.pd \ 08.io/03.Orb.pd \ From 0282f3aa5953c69d8707ac3a952aae74d11c9786 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 17 Mar 2025 09:53:48 +0100 Subject: [PATCH 246/387] adding the bbox information on text examples --- help/text2d-help.pd | 119 +++++++++++++++++++++++++++----- help/text3d-help.pd | 138 +++++++++++++++++++++++++++++++------- help/textextruded-help.pd | 117 ++++++++++++++++++++++++++++---- help/textoutline-help.pd | 105 ++++++++++++++++++++++++++--- 4 files changed, 419 insertions(+), 60 deletions(-) diff --git a/help/text2d-help.pd b/help/text2d-help.pd index 5d15bdf52..da9c752d1 100644 --- a/help/text2d-help.pd +++ b/help/text2d-help.pd @@ -1,10 +1,10 @@ -#N canvas 91 80 658 655 10; +#N canvas 74 125 655 703 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 465 65 cnv 15 170 370 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 465 452 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 465 65 cnv 15 170 400 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 465 472 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 8 335 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 335 cnv 15 450 200 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 340 Inlets:; #X obj 8 295 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 294 Arguments:; @@ -33,17 +33,17 @@ #X text 27 380 Inlet 1: message: text [] : render the given text; #X text 27 395 Inlet 1: message: list [] : render the given text, f 59; #X text 27 410 Inlet 1: message: alias 1|0 : anti-aliasing on/off (default:1), f 66; -#X obj 30 535 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; -#X text 43 539 Note: on some systems it might be necessary to turn rendering ON before loading a font.; +#X obj 30 565 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; +#X text 43 569 Note: on some systems it might be necessary to turn rendering ON before loading a font.; #X text 33 14 Synopsis: [text2d]; #X text 10 123 Any TrueType-font can be rendered. Per default a file "vera.ttf" is searched in the paths. If it is not found you will not see anything unless you load a valid font via the "font"-message. The font-loader uses Pd's search-paths \, so you could specify your path on the command-line and load fonts with just "font times.ttf".; -#X obj 538 530 text3d; -#X text 468 529 see also:; -#X obj 538 553 textextruded; -#X obj 538 576 textoutline; -#X obj 30 591 cnv 15 400 40 empty empty empty 20 12 0 14 #fc8000 #404040 0; -#X text 43 595 Note2: The text will disappear completely once the pivot point of the text moves out of the window; -#X obj 459 591 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 538 560 text3d; +#X text 468 559 see also:; +#X obj 538 583 textextruded; +#X obj 538 606 textoutline; +#X obj 30 621 cnv 15 400 40 empty empty empty 20 12 0 14 #fc8000 #404040 0; +#X text 43 625 Note2: The text will disappear completely once the pivot point of the text moves out of the window; +#X obj 459 621 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #N canvas 822 665 450 369 disappearing 0; #X obj 43 27 inlet; #X obj 43 306 s \$0-X; @@ -81,7 +81,7 @@ #X connect 15 0 16 0; #X connect 16 0 1 0; #X connect 16 1 17 0; -#X restore 459 611 pd disappearing text; +#X restore 459 641 pd disappearing text; #X text 27 454 Inlet 2: float: size (in points) default:20, f 56; #X text 27 425 Inlet 1: message: justify []: horizontal&vertical justification; #N canvas 484 243 450 300 META 0; @@ -108,7 +108,93 @@ #X obj 540 138 / 10; #X floatatom 545 115 5 0 0 0 - - - 0; #X floatatom 581 116 5 0 0 0 - - - 0; -#X obj 472 455 _gemwin; +#X obj 472 475 _gemwin; +#X text 19 509 Outlet 2: information about the text; +#N canvas 15 180 585 372 more_informations 0; +#X text 33 24 for now the outlet 2 outputs for each frame :; +#X text 45 47 - ascender : size over the pivot point (pixels); +#X text 45 66 - descender : size under the pivot point (pixels); +#X text 45 85 - bbox : bounding box of the text; +#X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); +#X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; +#X restore 260 508 pd more_informations; +#N canvas 205 65 1030 787 bounding_box 0; +#X obj 32 243 polygon 4 \; draw line; +#X obj 117 124 route bbox; +#X msg 117 150 \$1 \$2 \$3; +#X obj 32 15 inlet; +#X obj 117 15 inlet; +#X obj 214 16 inlet; +#X obj 32 50 spigot; +#X text 201 123 global bounding box; +#X obj 32 156 color 1 0 0; +#X obj 412 187 route bboxline; +#X obj 120 461 route 0; +#X msg 128 173 \$1 \$5 \$3; +#X msg 144 195 \$4 \$5 \$3; +#X msg 160 220 \$4 \$2 \$3; +#X obj 32 593 polygon 4 \; draw line; +#X msg 117 500 \$1 \$2 \$3; +#X msg 128 523 \$1 \$5 \$3; +#X msg 144 545 \$4 \$5 \$3; +#X msg 160 570 \$4 \$2 \$3; +#X obj 323 605 polygon 4 \; draw line; +#X msg 408 512 \$1 \$2 \$3; +#X msg 419 535 \$1 \$5 \$3; +#X msg 435 557 \$4 \$5 \$3; +#X msg 451 582 \$4 \$2 \$3; +#X obj 32 506 color 0 1 0; +#X obj 323 518 color 0 0 1; +#X obj 412 471 route 1; +#X obj 32 305 spigot; +#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 323 319 spigot; +#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 181 460 comment; +#X text 111 303 bbox line 1; +#X text 400 318 bbox line 2; +#X connect 0 0 27 0; +#X connect 0 0 29 0; +#X connect 1 0 2 0; +#X connect 1 0 11 0; +#X connect 1 0 12 0; +#X connect 1 0 13 0; +#X connect 1 1 9 0; +#X connect 2 0 0 1; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 5 0 6 1; +#X connect 6 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 10 0; +#X connect 9 0 26 0; +#X connect 10 0 15 0; +#X connect 10 0 18 0; +#X connect 10 0 17 0; +#X connect 10 0 16 0; +#X connect 11 0 0 2; +#X connect 12 0 0 3; +#X connect 13 0 0 4; +#X connect 15 0 14 1; +#X connect 16 0 14 2; +#X connect 17 0 14 3; +#X connect 18 0 14 4; +#X connect 20 0 19 1; +#X connect 21 0 19 2; +#X connect 22 0 19 3; +#X connect 23 0 19 4; +#X connect 24 0 14 0; +#X connect 25 0 19 0; +#X connect 26 0 20 0; +#X connect 26 0 23 0; +#X connect 26 0 22 0; +#X connect 26 0 21 0; +#X connect 27 0 24 0; +#X connect 28 0 27 1; +#X connect 29 0 25 0; +#X connect 30 0 29 1; +#X restore 479 442 pd bounding_box; +#X obj 582 442 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X connect 14 0 49 0; #X connect 15 0 50 1; #X connect 16 0 50 0; @@ -122,6 +208,8 @@ #X connect 28 0 49 1; #X connect 43 0 44 0; #X connect 49 0 56 0; +#X connect 50 0 65 0; +#X connect 50 1 65 1; #X connect 51 0 20 0; #X connect 52 0 17 0; #X connect 53 0 50 0; @@ -131,3 +219,4 @@ #X connect 58 0 59 0; #X connect 59 0 57 1; #X connect 60 0 56 2; +#X connect 66 0 65 2; diff --git a/help/text3d-help.pd b/help/text3d-help.pd index 5f70a8a89..63117da31 100644 --- a/help/text3d-help.pd +++ b/help/text3d-help.pd @@ -1,10 +1,10 @@ -#N canvas 108 62 817 669 10; +#N canvas 822 168 822 715 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 465 65 cnv 15 180 510 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 467 433 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 465 65 cnv 15 180 600 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 467 513 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 260 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 8 374 cnv 15 450 190 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 374 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 379 Inlets:; #X obj 8 335 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 334 Arguments:; @@ -13,20 +13,20 @@ #X text 9 533 Outlets:; #X text 21 546 Outlet 1: gemlist; #X text 471 47 Example:; -#X obj 468 112 cnv 15 170 310 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 468 112 cnv 15 170 360 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 471 70 gemhead; -#X floatatom 510 379 5 0 100 1 size - - 0; +#X floatatom 510 429 5 0 100 1 size - - 0; #X msg 481 154 font \$1; #X obj 481 135 openpanel; #X obj 481 118 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X msg 489 180 text hello world!; -#X msg 493 199 1 2 3 4; +#X msg 509 242 1 2 3 4; #X text 7 69 Description: Renders a line of text; #X text 63 346 initial text (defaults to "gem"); #X text 7 248 Justification:; #X text 32 263 horizontal justification can be one of "left" \, "right" \, "center"(default) and "base"(none); #X text 32 293 vertical justification can be one of "top" \, "bottom" \, "middle"(default) and "base"(none); -#X msg 488 246 justify left base; +#X msg 519 289 justify left base; #X floatatom 575 74 5 0 0 0 - - - 0; #X floatatom 534 69 4 0 0 0 - - - 0; #X text 27 405 Inlet 1: message: font <.TTF-file> : load a TrueType-font; @@ -34,18 +34,18 @@ #X text 27 432 Inlet 1: message: list [] : render the given text; #X text 27 475 Inlet 1: message: justify [] : horizontal&vertical justification; #X obj 471 91 rotateXYZ; -#X obj 471 400 text3d; +#X obj 471 450 text3d; #X text 10 94 [text3d] renders one line of a text with the current color \, and all 3D-transformation; #X text 33 14 Synopsis: [text3d]; -#X obj 30 611 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; -#X text 43 615 Note: on some systems it might be necessary to turn rendering ON before loading a font.; -#X msg 499 221 string 48 49 32 51 52; +#X obj 30 641 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; +#X text 43 645 Note: on some systems it might be necessary to turn rendering ON before loading a font.; +#X msg 515 264 string 48 49 32 51 52; #X text 27 444 Inlet 1: message: string [] : render the given text \, given as a list of unicode code points (similar to ASCII); #X text 10 123 Any TrueType-font can be rendered. Per default a file "vera.ttf" is searched in the paths. If it is not found you will not see anything unless you load a valid font via the "font"-message. The font-loader uses Pd's search-paths \, so you could specify your path on the command-line and load fonts with just "font times.ttf".; -#X obj 541 509 text2d; -#X text 470 507 see also:; -#X obj 541 532 textextruded; -#X obj 541 555 textoutline; +#X obj 541 589 text2d; +#X text 470 587 see also:; +#X obj 541 612 textextruded; +#X obj 541 635 textoutline; #X text 27 514 Inlet 2: float: size (in points) (default:20); #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; @@ -57,15 +57,103 @@ #X text 10 145 AUTHOR IOhannes m zmölnig; #X text 10 165 LICENSE GPL v2; #X restore 528 8 pd META; -#X msg 506 273 string 20320 10 22909 10 19990 10 30028, f 17; -#X msg 503 327 text مرحبا بالعالم; +#X msg 522 316 string 20320 10 22909 10 19990 10 30028, f 17; +#X msg 521 366 text مرحبا بالعالم; #X text 15 204 Note that text is rendered using only the given font. Therefore \, your font must have the glyphs you want to display (or you will only see placeholders); #X text 27 502 Inlet 1: message: alias 1|0 : anti-aliasing on/off (default:1), f 66; -#X msg 503 352 alias \$1; -#X obj 562 352 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 30 567 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; -#X text 43 571 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X obj 473 440 _gemwin; +#X msg 518 393 alias \$1; +#X obj 577 393 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 30 597 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; +#X text 43 601 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; +#X obj 473 520 _gemwin; +#X msg 501 205 text multi +line; +#N canvas 205 65 1030 787 bounding_box 0; +#X obj 32 243 polygon 4 \; draw line; +#X obj 117 124 route bbox; +#X msg 117 150 \$1 \$2 \$3; +#X obj 32 15 inlet; +#X obj 117 15 inlet; +#X obj 214 16 inlet; +#X obj 32 50 spigot; +#X text 201 123 global bounding box; +#X obj 32 156 color 1 0 0; +#X obj 412 187 route bboxline; +#X obj 120 461 route 0; +#X msg 128 173 \$1 \$5 \$3; +#X msg 144 195 \$4 \$5 \$3; +#X msg 160 220 \$4 \$2 \$3; +#X obj 32 593 polygon 4 \; draw line; +#X msg 117 500 \$1 \$2 \$3; +#X msg 128 523 \$1 \$5 \$3; +#X msg 144 545 \$4 \$5 \$3; +#X msg 160 570 \$4 \$2 \$3; +#X obj 323 605 polygon 4 \; draw line; +#X msg 408 512 \$1 \$2 \$3; +#X msg 419 535 \$1 \$5 \$3; +#X msg 435 557 \$4 \$5 \$3; +#X msg 451 582 \$4 \$2 \$3; +#X obj 32 506 color 0 1 0; +#X obj 323 518 color 0 0 1; +#X obj 412 471 route 1; +#X obj 32 305 spigot; +#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 323 319 spigot; +#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 181 460 comment; +#X text 111 303 bbox line 1; +#X text 400 318 bbox line 2; +#X connect 0 0 27 0; +#X connect 0 0 29 0; +#X connect 1 0 2 0; +#X connect 1 0 11 0; +#X connect 1 0 12 0; +#X connect 1 0 13 0; +#X connect 1 1 9 0; +#X connect 2 0 0 1; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 5 0 6 1; +#X connect 6 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 10 0; +#X connect 9 0 26 0; +#X connect 10 0 15 0; +#X connect 10 0 18 0; +#X connect 10 0 17 0; +#X connect 10 0 16 0; +#X connect 11 0 0 2; +#X connect 12 0 0 3; +#X connect 13 0 0 4; +#X connect 15 0 14 1; +#X connect 16 0 14 2; +#X connect 17 0 14 3; +#X connect 18 0 14 4; +#X connect 20 0 19 1; +#X connect 21 0 19 2; +#X connect 22 0 19 3; +#X connect 23 0 19 4; +#X connect 24 0 14 0; +#X connect 25 0 19 0; +#X connect 26 0 20 0; +#X connect 26 0 23 0; +#X connect 26 0 22 0; +#X connect 26 0 21 0; +#X connect 27 0 24 0; +#X connect 28 0 27 1; +#X connect 29 0 25 0; +#X connect 30 0 29 1; +#X restore 471 481 pd bounding_box; +#X text 21 561 Outlet 2: information about the text; +#N canvas 15 180 585 372 more_informations 0; +#X text 33 24 for now the outlet 2 outputs for each frame :; +#X text 45 47 - ascender : size over the pivot point (pixels); +#X text 45 66 - descender : size under the pivot point (pixels); +#X text 45 85 - bbox : bounding box of the text; +#X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); +#X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; +#X restore 262 560 pd more_informations; +#X obj 574 481 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X connect 14 0 33 0; #X connect 15 0 34 1; #X connect 16 0 34 0; @@ -77,8 +165,12 @@ #X connect 27 0 33 3; #X connect 28 0 33 1; #X connect 33 0 34 0; +#X connect 34 0 58 0; +#X connect 34 1 58 1; #X connect 39 0 34 0; #X connect 48 0 34 0; #X connect 49 0 34 0; #X connect 52 0 34 0; #X connect 53 0 52 0; +#X connect 57 0 34 0; +#X connect 61 0 58 2; diff --git a/help/textextruded-help.pd b/help/textextruded-help.pd index 94ba22606..a62a926e5 100644 --- a/help/textextruded-help.pd +++ b/help/textextruded-help.pd @@ -1,10 +1,10 @@ -#N canvas 26 90 645 670 10; +#N canvas 24 118 647 697 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 466 65 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 466 341 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 466 65 cnv 15 170 310 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 466 391 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 8 336 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 336 cnv 15 450 190 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 341 Inlets:; #X obj 8 295 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 17 294 Arguments:; @@ -35,19 +35,19 @@ #X text 27 394 Inlet 1: message: list [] : render the given text; #X text 27 428 Inlet 1: message: justify [] : horizontal&vertical justification; #X obj 472 89 rotateXYZ; -#X obj 20 573 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; -#X text 33 577 Note: on some systems it might be necessary to turn rendering ON before loading a font.; +#X obj 20 583 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; +#X text 33 587 Note: on some systems it might be necessary to turn rendering ON before loading a font.; #X obj 472 308 textextruded; #X text 33 14 Synopsis: [textextruded]; #X msg 497 268 depth \$1; #X floatatom 497 249 5 0 0 1 depth - - 0; #X text 10 94 [textextruded] renders one line of a extruded text with the current color \, and all 3D-transformation; #X text 27 408 Inlet 1: message: depth : extrusion depth; -#X obj 20 618 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; -#X text 32 623 Note: GEM needs to be compiled with FTGL-support for this to work; -#X text 472 418 see also:; -#X obj 545 418 text2d; -#X obj 592 418 text3d; +#X obj 20 628 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; +#X text 32 633 Note: GEM needs to be compiled with FTGL-support for this to work; +#X text 472 468 see also:; +#X obj 545 468 text2d; +#X obj 592 468 text3d; #X text 27 457 Inlet 2: float: size (in points). (default:20); #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; @@ -59,9 +59,95 @@ #X text 10 145 AUTHOR IOhannes m zmölnig; #X text 10 165 LICENSE GPL v2; #X restore 531 8 pd META; -#X obj 20 527 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; -#X text 33 531 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X obj 472 344 _gemwin; +#X obj 20 537 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; +#X text 33 541 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; +#X obj 472 394 _gemwin; +#X text 20 504 Outlet 2: information about the text; +#N canvas 15 180 585 372 more_informations 0; +#X text 33 24 for now the outlet 2 outputs for each frame :; +#X text 45 47 - ascender : size over the pivot point (pixels); +#X text 45 66 - descender : size under the pivot point (pixels); +#X text 45 85 - bbox : bounding box of the text; +#X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); +#X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; +#X restore 261 503 pd more_informations; +#N canvas 205 65 1030 787 bounding_box 0; +#X obj 32 243 polygon 4 \; draw line; +#X obj 117 124 route bbox; +#X msg 117 150 \$1 \$2 \$3; +#X obj 32 15 inlet; +#X obj 117 15 inlet; +#X obj 214 16 inlet; +#X obj 32 50 spigot; +#X text 201 123 global bounding box; +#X obj 32 156 color 1 0 0; +#X obj 412 187 route bboxline; +#X obj 120 461 route 0; +#X msg 128 173 \$1 \$5 \$3; +#X msg 144 195 \$4 \$5 \$3; +#X msg 160 220 \$4 \$2 \$3; +#X obj 32 593 polygon 4 \; draw line; +#X msg 117 500 \$1 \$2 \$3; +#X msg 128 523 \$1 \$5 \$3; +#X msg 144 545 \$4 \$5 \$3; +#X msg 160 570 \$4 \$2 \$3; +#X obj 323 605 polygon 4 \; draw line; +#X msg 408 512 \$1 \$2 \$3; +#X msg 419 535 \$1 \$5 \$3; +#X msg 435 557 \$4 \$5 \$3; +#X msg 451 582 \$4 \$2 \$3; +#X obj 32 506 color 0 1 0; +#X obj 323 518 color 0 0 1; +#X obj 412 471 route 1; +#X obj 32 305 spigot; +#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 323 319 spigot; +#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 181 460 comment; +#X text 111 303 bbox line 1; +#X text 400 318 bbox line 2; +#X connect 0 0 27 0; +#X connect 0 0 29 0; +#X connect 1 0 2 0; +#X connect 1 0 11 0; +#X connect 1 0 12 0; +#X connect 1 0 13 0; +#X connect 1 1 9 0; +#X connect 2 0 0 1; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 5 0 6 1; +#X connect 6 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 10 0; +#X connect 9 0 26 0; +#X connect 10 0 15 0; +#X connect 10 0 18 0; +#X connect 10 0 17 0; +#X connect 10 0 16 0; +#X connect 11 0 0 2; +#X connect 12 0 0 3; +#X connect 13 0 0 4; +#X connect 15 0 14 1; +#X connect 16 0 14 2; +#X connect 17 0 14 3; +#X connect 18 0 14 4; +#X connect 20 0 19 1; +#X connect 21 0 19 2; +#X connect 22 0 19 3; +#X connect 23 0 19 4; +#X connect 24 0 14 0; +#X connect 25 0 19 0; +#X connect 26 0 20 0; +#X connect 26 0 23 0; +#X connect 26 0 22 0; +#X connect 26 0 21 0; +#X connect 27 0 24 0; +#X connect 28 0 27 1; +#X connect 29 0 25 0; +#X connect 30 0 29 1; +#X restore 472 351 pd bounding_box; +#X obj 575 351 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X connect 14 0 34 0; #X connect 15 0 37 1; #X connect 16 0 37 0; @@ -73,5 +159,8 @@ #X connect 28 0 34 3; #X connect 29 0 34 1; #X connect 34 0 37 0; +#X connect 37 0 55 0; +#X connect 37 1 55 1; #X connect 39 0 37 0; #X connect 40 0 39 0; +#X connect 56 0 55 2; diff --git a/help/textoutline-help.pd b/help/textoutline-help.pd index e6df0272a..e8631b574 100644 --- a/help/textoutline-help.pd +++ b/help/textoutline-help.pd @@ -1,8 +1,8 @@ -#N canvas 26 90 653 630 10; +#N canvas 166 150 653 630 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 466 66 cnv 15 170 270 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 468 346 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 466 66 cnv 15 170 310 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 468 386 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 335 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 340 Inlets:; @@ -40,10 +40,10 @@ #X text 43 576 Note: on some systems it might be necessary to turn rendering ON before loading a font.; #X obj 474 312 textoutline; #X text 10 94 [textoutline] renders one line of a outlined text with the current color \, and all 3D-transformation; -#X text 473 421 see also:; -#X obj 487 486 textextruded; -#X obj 489 441 text2d; -#X obj 488 463 text3d; +#X text 473 461 see also:; +#X obj 487 526 textextruded; +#X obj 489 481 text2d; +#X obj 488 503 text3d; #X text 27 446 Inlet 2: float: size (in points). (default:20); #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; @@ -57,7 +57,93 @@ #X restore 528 8 pd META; #X obj 30 527 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 43 531 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X obj 472 353 _gemwin; +#X obj 472 393 _gemwin; +#X text 21 495 Outlet 2: information about the text; +#N canvas 15 180 585 372 more_informations 0; +#X text 33 24 for now the outlet 2 outputs for each frame :; +#X text 45 47 - ascender : size over the pivot point (pixels); +#X text 45 66 - descender : size under the pivot point (pixels); +#X text 45 85 - bbox : bounding box of the text; +#X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); +#X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; +#X restore 262 494 pd more_informations; +#N canvas 205 65 1030 787 bounding_box 0; +#X obj 32 243 polygon 4 \; draw line; +#X obj 117 124 route bbox; +#X msg 117 150 \$1 \$2 \$3; +#X obj 32 15 inlet; +#X obj 117 15 inlet; +#X obj 214 16 inlet; +#X obj 32 50 spigot; +#X text 201 123 global bounding box; +#X obj 32 156 color 1 0 0; +#X obj 412 187 route bboxline; +#X obj 120 461 route 0; +#X msg 128 173 \$1 \$5 \$3; +#X msg 144 195 \$4 \$5 \$3; +#X msg 160 220 \$4 \$2 \$3; +#X obj 32 593 polygon 4 \; draw line; +#X msg 117 500 \$1 \$2 \$3; +#X msg 128 523 \$1 \$5 \$3; +#X msg 144 545 \$4 \$5 \$3; +#X msg 160 570 \$4 \$2 \$3; +#X obj 323 605 polygon 4 \; draw line; +#X msg 408 512 \$1 \$2 \$3; +#X msg 419 535 \$1 \$5 \$3; +#X msg 435 557 \$4 \$5 \$3; +#X msg 451 582 \$4 \$2 \$3; +#X obj 32 506 color 0 1 0; +#X obj 323 518 color 0 0 1; +#X obj 412 471 route 1; +#X obj 32 305 spigot; +#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 323 319 spigot; +#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 181 460 comment; +#X text 111 303 bbox line 1; +#X text 400 318 bbox line 2; +#X connect 0 0 27 0; +#X connect 0 0 29 0; +#X connect 1 0 2 0; +#X connect 1 0 11 0; +#X connect 1 0 12 0; +#X connect 1 0 13 0; +#X connect 1 1 9 0; +#X connect 2 0 0 1; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 5 0 6 1; +#X connect 6 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 10 0; +#X connect 9 0 26 0; +#X connect 10 0 15 0; +#X connect 10 0 18 0; +#X connect 10 0 17 0; +#X connect 10 0 16 0; +#X connect 11 0 0 2; +#X connect 12 0 0 3; +#X connect 13 0 0 4; +#X connect 15 0 14 1; +#X connect 16 0 14 2; +#X connect 17 0 14 3; +#X connect 18 0 14 4; +#X connect 20 0 19 1; +#X connect 21 0 19 2; +#X connect 22 0 19 3; +#X connect 23 0 19 4; +#X connect 24 0 14 0; +#X connect 25 0 19 0; +#X connect 26 0 20 0; +#X connect 26 0 23 0; +#X connect 26 0 22 0; +#X connect 26 0 21 0; +#X connect 27 0 24 0; +#X connect 28 0 27 1; +#X connect 29 0 25 0; +#X connect 30 0 29 1; +#X restore 474 351 pd bounding_box; +#X obj 577 351 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X connect 14 0 34 0; #X connect 15 0 38 1; #X connect 16 0 38 0; @@ -69,3 +155,6 @@ #X connect 28 0 34 3; #X connect 29 0 34 1; #X connect 34 0 38 0; +#X connect 38 0 51 0; +#X connect 38 1 51 1; +#X connect 52 0 51 2; From 128a49361dbc8bce5c81fb30fcd1083c66ef990e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 11:51:19 +0100 Subject: [PATCH 247/387] slightly simplify stencilBuffer example --- examples/09.openGL/03.stencilBuffer.pd | 261 +++++++++++-------------- 1 file changed, 116 insertions(+), 145 deletions(-) diff --git a/examples/09.openGL/03.stencilBuffer.pd b/examples/09.openGL/03.stencilBuffer.pd index 94f49674d..219c342ad 100644 --- a/examples/09.openGL/03.stencilBuffer.pd +++ b/examples/09.openGL/03.stencilBuffer.pd @@ -1,73 +1,54 @@ #N canvas 431 61 849 900 10; #X declare -lib Gem; -#X obj 39 337 GEMglEnable; -#X floatatom 125 339 5 0 0 0 - - -; -#X obj 111 289 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 111 312 GLdefine GL_STENCIL_TEST; -#X obj 129 287 loadbang; #X obj 104 389 GLdefine GL_STENCIL_BUFFER_BIT; -#X obj 166 368 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X floatatom 119 414 5 0 0 0 - - -; +#X obj 166 368 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X floatatom 229 415 5 0 0 0 - - - 0; #X obj 104 366 loadbang; #X obj 39 256 GEMglClearStencil 0; #X obj 39 414 GEMglClear; #X obj 39 40 gemhead 45; #X obj 39 513 GEMglStencilFunc; #X msg 146 487 1; -#X obj 75 443 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 75 443 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 74 466 GLdefine GL_ALWAYS; #X obj 96 443 loadbang; -#X floatatom 100 487 5 0 0 0 - - -; +#X floatatom 100 487 5 0 0 0 - - - 0; #X obj 39 593 GEMglStencilOp; -#X floatatom 156 588 5 0 0 0 - - -; -#X obj 70 493 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X floatatom 156 588 5 0 0 0 - - - 0; +#X obj 70 493 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 70 559 GLdefine GL_REPLACE; #X obj 95 537 loadbang; -#X obj 239 750 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 239 750 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 170 749 loadbang; #X obj 39 817 GEMglClear; -#X floatatom 156 819 5 0 0 0 - - -; +#X floatatom 156 819 5 0 0 0 - - - 0; #X obj 145 795 GLdefine GL_DEPTH_BUFFER_BIT; #X obj 126 750 t b b; #X obj 490 294 GEMglStencilFunc; #X msg 597 270 1; -#X obj 525 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 525 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 546 225 loadbang; -#X floatatom 535 271 5 0 0 0 - - -; +#X floatatom 535 271 5 0 0 0 - - - 0; #X obj 525 248 GLdefine GL_NOTEQUAL; #X obj 490 403 color 1 0 0; #X obj 490 666 GEMglStencilFunc; #X msg 597 641 1; -#X obj 525 601 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X obj 525 601 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 547 599 loadbang; -#X floatatom 536 645 5 0 0 0 - - -; +#X floatatom 536 645 5 0 0 0 - - - 0; #X obj 490 716 rotateXYZ 0 0 45; #X obj 525 622 GLdefine GL_EQUAL; #X obj 490 692 color 1 1 0; #X obj 126 773 GLdefine GL_COLOR_BUFFER_BIT; #X obj 490 372 GEMglStencilOp; -#X floatatom 601 371 5 0 0 0 - - -; -#X obj 521 317 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; +#X floatatom 601 371 5 0 0 0 - - - 0; +#X obj 521 317 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 544 314 loadbang; #X obj 521 338 GLdefine GL_KEEP; -#X floatatom 58 151 5 0 0 0 - - -; -#X floatatom 97 151 5 0 0 0 - - -; +#X floatatom 58 151 5 0 0 0 - - - 0; +#X floatatom 97 151 5 0 0 0 - - - 0; #X obj 39 194 colorRGB 0 0 1; #X obj 126 817 |; -#X floatatom 587 837 5 0 0 0 - - -; -#X obj 569 789 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 569 812 GLdefine GL_STENCIL_TEST; -#X obj 587 787 loadbang; -#X obj 490 837 GEMglDisable; #X text 67 219 allow \, clear and configure stencil buffer; #X obj 39 702 circle 1.5; #X text 131 692 draw in all buffer; @@ -76,9 +57,9 @@ #X obj 490 430 square 3; #X text 522 572 draw where the stencil buffer is 1; #X obj 529 28 gemhead 10; -#X floatatom 562 48 5 0 0 0 - - -; -#X floatatom 602 48 5 0 0 0 - - -; -#X floatatom 642 48 5 0 0 0 - - -; +#X floatatom 562 48 5 0 0 0 - - - 0; +#X floatatom 602 48 5 0 0 0 - - - 0; +#X floatatom 642 48 5 0 0 0 - - - 0; #X obj 529 94 world_light; #X obj 529 69 rotateXYZ 0 0 0; #X obj 39 174 rotateXYZ; @@ -86,8 +67,7 @@ #X text 238 865 (c) Cyrille Henry 2006; #X obj 39 63 t a b; #X obj 74 85 i; -#X obj 122 63 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 122 63 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 103 85 + 0; #X obj 74 130 t f f; #X obj 74 107 spigot; @@ -95,14 +75,12 @@ #X obj 39 664 spigot; #X obj 104 661 spigot; #X obj 79 617 loadbang; -#X obj 147 639 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 147 639 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 82 641 == 0; #X msg 147 618 0; #X obj 131 84 % 360; #X obj 490 761 sphere 1.2 25; -#X obj 39 13 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 39 13 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X obj 118 113 outlet; @@ -111,8 +89,7 @@ #X connect 2 0 1 0; #X restore 372 45 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -151,104 +128,98 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 342 62 pd gemwin; #X obj 716 16 declare -lib Gem; -#X connect 0 0 10 0; -#X connect 2 0 3 0; -#X connect 3 0 1 0; -#X connect 3 0 0 1; -#X connect 4 0 3 0; +#X obj 39 337 GEMglEnable GL_STENCIL_TEST; +#X obj 490 827 GEMglDisable GL_STENCIL_TEST; +#X connect 0 0 2 0; +#X connect 0 0 5 1; +#X connect 1 0 0 0; +#X connect 3 0 0 0; +#X connect 4 0 84 0; #X connect 5 0 7 0; -#X connect 5 0 10 1; -#X connect 6 0 5 0; -#X connect 8 0 5 0; -#X connect 9 0 0 0; +#X connect 6 0 65 0; +#X connect 7 0 13 0; +#X connect 8 0 7 3; +#X connect 8 0 7 2; +#X connect 9 0 10 0; +#X connect 9 0 8 0; +#X connect 10 0 7 1; #X connect 10 0 12 0; -#X connect 11 0 75 0; -#X connect 12 0 18 0; -#X connect 13 0 12 3; -#X connect 13 0 12 2; -#X connect 14 0 15 0; -#X connect 14 0 13 0; -#X connect 15 0 12 1; -#X connect 15 0 17 0; -#X connect 16 0 13 0; -#X connect 16 0 15 0; -#X connect 18 0 82 0; -#X connect 18 0 83 0; -#X connect 20 0 21 0; -#X connect 21 0 19 0; -#X connect 21 0 18 1; -#X connect 21 0 18 2; -#X connect 21 0 18 3; -#X connect 22 0 20 0; -#X connect 23 0 28 0; -#X connect 24 0 28 0; -#X connect 25 0 29 0; -#X connect 27 0 53 1; -#X connect 28 0 44 0; -#X connect 28 1 27 0; -#X connect 29 0 45 0; -#X connect 30 0 29 3; -#X connect 30 0 29 2; -#X connect 31 0 34 0; -#X connect 32 0 30 0; -#X connect 32 0 34 0; -#X connect 34 0 29 1; -#X connect 34 0 33 0; -#X connect 35 0 64 0; -#X connect 36 0 43 0; -#X connect 37 0 36 3; -#X connect 37 0 36 2; -#X connect 38 0 42 0; -#X connect 39 0 37 0; -#X connect 39 0 42 0; -#X connect 41 0 89 0; -#X connect 42 0 36 1; -#X connect 42 0 40 0; -#X connect 43 0 41 0; -#X connect 44 0 53 0; -#X connect 45 0 35 0; -#X connect 47 0 49 0; -#X connect 48 0 47 0; -#X connect 49 0 46 0; -#X connect 49 0 45 1; -#X connect 49 0 45 2; -#X connect 49 0 45 3; -#X connect 50 0 72 1; -#X connect 51 0 72 2; -#X connect 52 0 9 0; -#X connect 53 0 26 0; -#X connect 53 0 25 1; -#X connect 55 0 56 0; -#X connect 56 0 54 0; -#X connect 56 0 58 1; -#X connect 57 0 56 0; -#X connect 60 0 25 0; -#X connect 64 0 36 0; -#X connect 66 0 71 0; -#X connect 67 0 71 1; -#X connect 68 0 71 2; -#X connect 69 0 71 3; -#X connect 71 0 70 0; -#X connect 72 0 52 0; -#X connect 75 0 72 0; -#X connect 75 1 76 0; -#X connect 76 0 78 0; -#X connect 76 0 80 0; -#X connect 77 0 78 1; -#X connect 77 0 80 1; -#X connect 78 0 88 0; -#X connect 79 0 50 0; -#X connect 79 1 51 0; -#X connect 80 0 79 0; -#X connect 81 0 25 0; -#X connect 82 0 60 0; -#X connect 83 0 81 0; -#X connect 84 0 87 0; -#X connect 85 0 83 1; -#X connect 85 0 86 0; -#X connect 86 0 82 1; -#X connect 87 0 85 0; -#X connect 88 0 76 1; -#X connect 89 0 58 0; -#X connect 90 0 11 0; -#X connect 91 0 92 0; +#X connect 11 0 8 0; +#X connect 11 0 10 0; +#X connect 13 0 72 0; +#X connect 13 0 73 0; +#X connect 15 0 16 0; +#X connect 16 0 14 0; +#X connect 16 0 13 1; +#X connect 16 0 13 2; +#X connect 16 0 13 3; +#X connect 17 0 15 0; +#X connect 18 0 23 0; +#X connect 19 0 23 0; +#X connect 20 0 24 0; +#X connect 22 0 48 1; +#X connect 23 0 39 0; +#X connect 23 1 22 0; +#X connect 24 0 40 0; +#X connect 25 0 24 3; +#X connect 25 0 24 2; +#X connect 26 0 29 0; +#X connect 27 0 25 0; +#X connect 27 0 29 0; +#X connect 29 0 24 1; +#X connect 29 0 28 0; +#X connect 30 0 54 0; +#X connect 31 0 38 0; +#X connect 32 0 31 3; +#X connect 32 0 31 2; +#X connect 33 0 37 0; +#X connect 34 0 32 0; +#X connect 34 0 37 0; +#X connect 36 0 79 0; +#X connect 37 0 31 1; +#X connect 37 0 35 0; +#X connect 38 0 36 0; +#X connect 39 0 48 0; +#X connect 40 0 30 0; +#X connect 42 0 44 0; +#X connect 43 0 42 0; +#X connect 44 0 41 0; +#X connect 44 0 40 1; +#X connect 44 0 40 2; +#X connect 44 0 40 3; +#X connect 45 0 62 1; +#X connect 46 0 62 2; +#X connect 47 0 4 0; +#X connect 48 0 21 0; +#X connect 48 0 20 1; +#X connect 50 0 20 0; +#X connect 54 0 31 0; +#X connect 56 0 61 0; +#X connect 57 0 61 1; +#X connect 58 0 61 2; +#X connect 59 0 61 3; +#X connect 61 0 60 0; +#X connect 62 0 47 0; +#X connect 65 0 62 0; +#X connect 65 1 66 0; +#X connect 66 0 68 0; +#X connect 66 0 70 0; +#X connect 67 0 68 1; +#X connect 67 0 70 1; +#X connect 68 0 78 0; +#X connect 69 0 45 0; +#X connect 69 1 46 0; +#X connect 70 0 69 0; +#X connect 71 0 20 0; +#X connect 72 0 50 0; +#X connect 73 0 71 0; +#X connect 74 0 77 0; +#X connect 75 0 73 1; +#X connect 75 0 76 0; +#X connect 76 0 72 1; +#X connect 77 0 75 0; +#X connect 78 0 66 1; +#X connect 79 0 85 0; +#X connect 80 0 6 0; +#X connect 81 0 82 0; +#X connect 84 0 5 0; From 156e96bd5ed05e036cb25a6d4b2417bc5a9ee458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 11:52:24 +0100 Subject: [PATCH 248/387] Generic help-patch for [GEMgl...] objects --- help/GEMgl-help.pd | 54 +++++++++++++++++++++++++++++++++++++++++ help/GEMglBegin-help.pd | 14 ----------- help/Makefile.am | 2 +- 3 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 help/GEMgl-help.pd delete mode 100644 help/GEMglBegin-help.pd diff --git a/help/GEMgl-help.pd b/help/GEMgl-help.pd new file mode 100644 index 000000000..e59ee0eb0 --- /dev/null +++ b/help/GEMgl-help.pd @@ -0,0 +1,54 @@ +#N canvas 1032 163 577 707 10; +#X text 52 31 [GEMgl...] - wrappers for openGL functions; +#X text 32 64 you can use "any" openGL-command (like "glBegin") as a Gem-object with a prepended "GEM" (like [GEMglBegin]); +#N canvas 735 461 450 300 online 0; +#X obj 41 26 inlet; +#X obj 41 49 t b; +#X msg 41 87 browse https://registry.khronos.org/OpenGL-Refpages/gl2.1/; +#X obj 41 110 pdcontrol; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X restore 397 142 pd online reference; +#X msg 397 121 bang; +#X text 44 116 as there are several hundred such objects \, they do not documented separately. Instead please consult your openGL book \, or the online reference:, f 55; +#X obj 61 352 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 67 358 _gemwin; +#X obj 290 277 gemhead; +#X obj 290 366 GEMglBegin GL_POLYGON; +#X obj 290 592 GEMglEnd; +#X obj 290 406 GEMglColor4f 1 0 0 1; +#X obj 290 466 GEMglColor4f 0 1 0 1; +#X obj 290 526 GEMglColor4f 0 0 1 1; +#X obj 290 336 GEMglShadeModel GL_SMOOTH; +#X obj 290 622 GEMglShadeModel GL_FLAT; +#X obj 290 429 GEMglVertex3f -2 -1 0; +#X obj 290 549 GEMglVertex3f 2 -1 0; +#X obj 290 490 GEMglVertex3f 0 2 0; +#X msg 397 190 bang; +#N canvas 1059 494 450 300 examples/09.openGL 0; +#X obj 41 26 inlet; +#X obj 41 49 t b; +#X obj 41 160 pdcontrol; +#X msg 41 72 dir; +#X obj 41 95 pdcontrol; +#X msg 41 118 browse \$1/../examples/09.openGL; +#X connect 0 0 1 0; +#X connect 1 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 5 0 2 0; +#X restore 397 211 pd examples/09.openGL; +#X text 49 186 Gem also comes with some examples on how to use those low-level wrappers:; +#X connect 3 0 2 0; +#X connect 7 0 13 0; +#X connect 8 0 10 0; +#X connect 9 0 14 0; +#X connect 10 0 15 0; +#X connect 11 0 17 0; +#X connect 12 0 16 0; +#X connect 13 0 8 0; +#X connect 15 0 11 0; +#X connect 16 0 9 0; +#X connect 17 0 12 0; +#X connect 18 0 19 0; diff --git a/help/GEMglBegin-help.pd b/help/GEMglBegin-help.pd deleted file mode 100644 index b2e875dbc..000000000 --- a/help/GEMglBegin-help.pd +++ /dev/null @@ -1,14 +0,0 @@ -#N canvas 144 70 497 292 10; -#X text 21 22 GEMglBegin - delimit the vertices of a primitive or a -group of like primitives; -#X text 21 61 C Specification: void glBegin( GLenum mode ); -#X text 21 91 Parameters; -#X text 42 115 mode; -#X text 77 116 Specifies the primitive or primitives that will be created -from vertices presented between glBegin and the subsequent glEnd. Ten -symbolic constants are accepted: GL_POINTS \, GL_LINES \, GL_LINE_STRIP -\, GL_LINE_LOOP \, GL_TRIANGLES \, GL_TRIANGLE_STRIP \, GL_TRIANGLE_FAN -\, GL_QUADS \, GL_QUAD_STRIP \, and GL_POLYGON.; -#X text 71 244 http://www.glprogramming.com/blue/ch05.html#id5450783 -; -#X text 22 228 OpenGL Reference page:; diff --git a/help/Makefile.am b/help/Makefile.am index efc9fa9f9..c3bba19e9 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -35,7 +35,7 @@ dist_gemhelp_DATA += \ cubemaptosphere.frag \ cubemaptocube.vert \ cubemaptocube.frag \ - GEMglBegin-help.pd \ + GEMgl-help.pd \ gemhead-help.pd \ gemkeyboard-help.pd \ gemkeyname-help.pd \ From 0fe638c04fd743048865403229b80678098af7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 11:53:57 +0100 Subject: [PATCH 249/387] Use a generic GEMgl-help for all [GEMgl...] wrappers See: https://github.com/umlaeute/Gem/issues/466#issuecomment-2728960968 --- src/Base/GemGLBase.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Base/GemGLBase.h b/src/Base/GemGLBase.h index 6a3d319fa..fa2a91738 100644 --- a/src/Base/GemGLBase.h +++ b/src/Base/GemGLBase.h @@ -11,6 +11,9 @@ #ifndef _INCLUDE__GEM_BASE_GEMGLBASE_H_ #define _INCLUDE__GEM_BASE_GEMGLBASE_H_ +#define HELPSYMBOL "GEMgl" + + #include "Utils/GLUtil.h" #include "Base/GemBase.h" From dcc52622cd4d07fcc8b9da6e25f8e6ce4dc2ec6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 15:35:43 +0100 Subject: [PATCH 250/387] ony output error for unknown shaderID if the input number could be valid Closes: https://github.com/umlaeute/Gem/issues/467 --- src/Manips/glsl_program.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Manips/glsl_program.cpp b/src/Manips/glsl_program.cpp index b262b0668..dcc5b883c 100644 --- a/src/Manips/glsl_program.cpp +++ b/src/Manips/glsl_program.cpp @@ -655,7 +655,8 @@ void glsl_program :: shaderMess(int argc, t_atom *argv) try { ui=m_shadermapper.get(f); } catch(GemException&x) { - error("unable to get shaderID for %f...skipping!", f); + if(f) + error("unable to get shaderID for %f...skipping!", f); continue; } m_shaderObj[m_numShaders] = ui; From deabba6f43975f675b9a69fd3d05b38d6b001877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 15:52:28 +0100 Subject: [PATCH 251/387] drop *some* of too early linking of GLSL shaders simply getting rid of the [t b b] that triggered a re-linking when any of the shaders changed, even if the other is not ready yet... older versions of Gem complained when linking a "0"-shader --- examples/10.glsl/03.texture_distortion.pd | 83 ++++++----- examples/10.glsl/04.game_of_life.pd | 73 +++++----- examples/10.glsl/05.multitexture.pd | 131 +++++++++--------- examples/10.glsl/05.multitexture_basic.pd | 93 ++++++------- examples/10.glsl/05.multitexture_bis.pd | 125 ++++++++--------- examples/10.glsl/06.rectangle_multitexture.pd | 101 +++++++------- 6 files changed, 294 insertions(+), 312 deletions(-) diff --git a/examples/10.glsl/03.texture_distortion.pd b/examples/10.glsl/03.texture_distortion.pd index c3237b6c8..5bec487ba 100644 --- a/examples/10.glsl/03.texture_distortion.pd +++ b/examples/10.glsl/03.texture_distortion.pd @@ -4,16 +4,15 @@ #X obj 74 -1 gemhead; #X msg 29 80 print; #X obj 74 382 glsl_program; -#X obj 147 281 pack 0 0; +#X obj 149 281 pack 0 0; #X msg 31 162 print; -#X obj 168 261 t b f; -#X obj 168 216 change; -#X obj 146 121 change; -#X msg 147 304 link \$1 \$2; +#X obj 149 219 change; +#X obj 194 121 change; +#X msg 149 304 link \$1 \$2; #X msg 98 353 print; -#X floatatom 168 242 2 0 0 0 ID - - 0; -#X floatatom 146 144 2 0 0 0 ID - - 0; -#X obj 165 325 print linking; +#X floatatom 149 245 2 0 0 0 ID - - 0; +#X floatatom 194 144 2 0 0 0 ID - - 0; +#X obj 167 325 print linking; #X obj 74 196 glsl_fragment; #X obj 74 102 glsl_vertex; #X obj 74 571 pix_texture; @@ -101,42 +100,40 @@ #X msg 88 80 open \$1.vert; #X msg 85 166 open \$1.frag; #X msg 146 32 symbol shader/T_distord; -#X connect 1 0 17 0; -#X connect 2 0 15 0; -#X connect 3 0 30 0; -#X connect 3 1 23 0; -#X connect 4 0 9 0; -#X connect 5 0 14 0; -#X connect 6 0 4 0; -#X connect 6 1 4 1; +#X connect 1 0 16 0; +#X connect 2 0 14 0; +#X connect 3 0 29 0; +#X connect 3 1 22 0; +#X connect 4 0 8 0; +#X connect 5 0 13 0; +#X connect 6 0 10 0; #X connect 7 0 11 0; +#X connect 8 0 3 0; #X connect 8 0 12 0; #X connect 9 0 3 0; -#X connect 9 0 13 0; -#X connect 10 0 3 0; -#X connect 11 0 6 0; -#X connect 12 0 4 0; -#X connect 14 0 3 0; +#X connect 10 0 4 0; +#X connect 11 0 4 1; +#X connect 13 0 3 0; +#X connect 13 1 6 0; +#X connect 14 0 13 0; #X connect 14 1 7 0; -#X connect 15 0 14 0; -#X connect 15 1 8 0; -#X connect 16 0 31 0; -#X connect 17 0 15 0; -#X connect 18 0 35 0; -#X connect 19 0 27 0; -#X connect 20 0 29 0; -#X connect 21 0 18 0; -#X connect 22 0 39 0; -#X connect 23 0 28 0; -#X connect 24 0 21 0; -#X connect 26 0 30 0; -#X connect 27 0 3 0; -#X connect 28 0 19 0; -#X connect 29 0 3 0; -#X connect 30 0 16 0; -#X connect 33 0 34 0; -#X connect 35 0 16 0; -#X connect 37 0 15 0; -#X connect 38 0 14 0; -#X connect 39 0 37 0; -#X connect 39 0 38 0; +#X connect 15 0 30 0; +#X connect 16 0 14 0; +#X connect 17 0 34 0; +#X connect 18 0 26 0; +#X connect 19 0 28 0; +#X connect 20 0 17 0; +#X connect 21 0 38 0; +#X connect 22 0 27 0; +#X connect 23 0 20 0; +#X connect 25 0 29 0; +#X connect 26 0 3 0; +#X connect 27 0 18 0; +#X connect 28 0 3 0; +#X connect 29 0 15 0; +#X connect 32 0 33 0; +#X connect 34 0 15 0; +#X connect 36 0 14 0; +#X connect 37 0 13 0; +#X connect 38 0 36 0; +#X connect 38 0 37 0; diff --git a/examples/10.glsl/04.game_of_life.pd b/examples/10.glsl/04.game_of_life.pd index 36df4ba79..e6f2244dd 100644 --- a/examples/10.glsl/04.game_of_life.pd +++ b/examples/10.glsl/04.game_of_life.pd @@ -11,16 +11,15 @@ #X obj 356 419 loadbang; #X msg 271 95 print; #X obj 316 370 glsl_program; -#X obj 389 296 pack 0 0; +#X obj 391 296 pack 0 0; #X msg 273 177 print; -#X obj 410 276 t b f; -#X obj 410 231 change; -#X obj 388 136 change; -#X msg 389 321 link \$1 \$2; +#X obj 391 234 change; +#X obj 436 136 change; +#X msg 391 321 link \$1 \$2; #X msg 272 333 print; -#X floatatom 410 257 2 0 0 0 ID - - 0; -#X floatatom 388 159 2 0 0 0 ID - - 0; -#X obj 407 342 print linking; +#X floatatom 391 260 2 0 0 0 ID - - 0; +#X floatatom 436 159 2 0 0 0 ID - - 0; +#X obj 409 342 print linking; #X obj 316 211 glsl_fragment; #X obj 316 117 glsl_vertex; #X obj 338 68 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; @@ -95,42 +94,40 @@ #X connect 2 0 0 2; #X connect 3 0 1 0; #X connect 3 1 2 0; -#X connect 4 0 25 0; -#X connect 6 0 42 0; +#X connect 4 0 24 0; +#X connect 6 0 41 0; #X connect 7 0 6 0; #X connect 8 0 3 0; -#X connect 9 0 22 0; -#X connect 10 0 34 0; -#X connect 11 0 16 0; -#X connect 12 0 21 0; -#X connect 13 0 11 0; -#X connect 13 1 11 1; +#X connect 9 0 21 0; +#X connect 10 0 33 0; +#X connect 11 0 15 0; +#X connect 12 0 20 0; +#X connect 13 0 17 0; #X connect 14 0 18 0; +#X connect 15 0 10 0; #X connect 15 0 19 0; #X connect 16 0 10 0; -#X connect 16 0 20 0; -#X connect 17 0 10 0; -#X connect 18 0 13 0; -#X connect 19 0 11 0; -#X connect 21 0 10 0; +#X connect 17 0 11 0; +#X connect 18 0 11 1; +#X connect 20 0 10 0; +#X connect 20 1 13 0; +#X connect 21 0 20 0; #X connect 21 1 14 0; -#X connect 22 0 21 0; -#X connect 22 1 15 0; -#X connect 23 0 44 0; -#X connect 23 0 45 0; -#X connect 24 0 22 0; -#X connect 25 0 5 0; +#X connect 22 0 43 0; +#X connect 22 0 44 0; +#X connect 23 0 21 0; +#X connect 24 0 5 0; +#X connect 25 0 26 0; #X connect 26 0 27 0; #X connect 27 0 28 0; -#X connect 28 0 29 0; -#X connect 30 0 31 0; -#X connect 31 0 26 0; -#X connect 34 0 0 0; -#X connect 34 1 0 0; +#X connect 29 0 30 0; +#X connect 30 0 25 0; +#X connect 33 0 0 0; +#X connect 33 1 0 0; +#X connect 34 0 36 0; #X connect 35 0 37 0; -#X connect 36 0 38 0; -#X connect 37 0 29 1; -#X connect 38 0 29 2; -#X connect 41 0 42 0; -#X connect 44 0 22 0; -#X connect 45 0 21 0; +#X connect 36 0 28 1; +#X connect 37 0 28 2; +#X connect 40 0 41 0; +#X connect 43 0 21 0; +#X connect 44 0 20 0; diff --git a/examples/10.glsl/05.multitexture.pd b/examples/10.glsl/05.multitexture.pd index f69ab3073..f4c3f758e 100644 --- a/examples/10.glsl/05.multitexture.pd +++ b/examples/10.glsl/05.multitexture.pd @@ -2,13 +2,12 @@ #X declare -lib Gem; #X obj 76 5 gemhead; #X obj 75 429 glsl_program; -#X obj 149 268 pack 0 0; -#X obj 170 248 t b f; -#X obj 164 203 change; -#X msg 149 294 link \$1 \$2; -#X floatatom 170 229 2 0 0 0 ID - - 0; -#X floatatom 148 121 2 0 0 0 ID - - 0; -#X obj 167 315 print linking; +#X obj 151 268 pack 0 0; +#X obj 151 207 change; +#X msg 151 294 link \$1 \$2; +#X floatatom 151 233 2 0 0 0 ID - - 0; +#X floatatom 196 121 2 0 0 0 ID - - 0; +#X obj 169 315 print linking; #X msg 365 23 color 1 0 0; #X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 79 glsl_vertex; @@ -72,7 +71,7 @@ #X msg 704 318 open ../data/img3.jpg; #X msg 153 544 open ../data/img1.jpg; #X obj 75 613 pix_image ../data/img1.jpg; -#X obj 148 98 change; +#X obj 196 98 change; #X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -129,67 +128,65 @@ #X obj 793 7 declare -lib Gem; #X msg 90 57 open shader/multitexture.vert; #X msg 86 153 open shader/multitexture.frag; -#X connect 0 0 11 0; -#X connect 1 0 54 0; -#X connect 1 1 37 0; -#X connect 2 0 5 0; -#X connect 3 0 2 0; -#X connect 3 1 2 1; -#X connect 4 0 6 0; -#X connect 5 0 1 0; -#X connect 5 0 8 0; -#X connect 6 0 3 0; -#X connect 7 0 2 0; -#X connect 9 0 58 0; -#X connect 10 0 66 0; -#X connect 10 0 67 0; -#X connect 11 0 12 0; -#X connect 11 1 55 0; -#X connect 12 0 1 0; -#X connect 12 1 4 0; -#X connect 13 0 25 0; -#X connect 14 0 38 0; -#X connect 15 0 14 0; -#X connect 16 0 50 0; -#X connect 17 0 16 0; -#X connect 19 0 13 0; -#X connect 20 0 26 0; -#X connect 21 0 41 0; -#X connect 22 0 21 0; -#X connect 23 0 47 0; -#X connect 24 0 20 0; -#X connect 27 0 1 0; -#X connect 28 0 59 0; -#X connect 29 0 40 0; -#X connect 30 0 29 0; +#X connect 0 0 10 0; +#X connect 1 0 53 0; +#X connect 1 1 36 0; +#X connect 2 0 4 0; +#X connect 3 0 5 0; +#X connect 4 0 1 0; +#X connect 4 0 7 0; +#X connect 5 0 2 0; +#X connect 6 0 2 1; +#X connect 8 0 57 0; +#X connect 9 0 65 0; +#X connect 9 0 66 0; +#X connect 10 0 11 0; +#X connect 10 1 54 0; +#X connect 11 0 1 0; +#X connect 11 1 3 0; +#X connect 12 0 24 0; +#X connect 13 0 37 0; +#X connect 14 0 13 0; +#X connect 15 0 49 0; +#X connect 16 0 15 0; +#X connect 18 0 12 0; +#X connect 19 0 25 0; +#X connect 20 0 40 0; +#X connect 21 0 20 0; +#X connect 22 0 46 0; +#X connect 23 0 19 0; +#X connect 26 0 1 0; +#X connect 27 0 58 0; +#X connect 28 0 39 0; +#X connect 29 0 28 0; +#X connect 30 0 1 0; #X connect 31 0 1 0; #X connect 32 0 1 0; #X connect 33 0 1 0; #X connect 34 0 1 0; -#X connect 35 0 1 0; -#X connect 36 0 10 0; -#X connect 37 0 31 0; -#X connect 37 0 27 0; -#X connect 38 0 49 0; -#X connect 39 0 63 0; -#X connect 40 0 53 0; -#X connect 41 0 52 0; -#X connect 42 0 49 0; -#X connect 43 0 53 0; -#X connect 44 0 52 0; -#X connect 45 0 62 0; -#X connect 46 0 64 0; -#X connect 47 0 51 0; -#X connect 49 0 50 0; -#X connect 50 0 13 0; -#X connect 51 0 20 0; -#X connect 52 0 51 0; -#X connect 53 0 54 0; -#X connect 54 0 28 0; -#X connect 55 0 7 0; -#X connect 57 0 58 0; -#X connect 62 0 28 0; -#X connect 63 0 13 0; -#X connect 64 0 20 0; +#X connect 35 0 9 0; +#X connect 36 0 30 0; +#X connect 36 0 26 0; +#X connect 37 0 48 0; +#X connect 38 0 62 0; +#X connect 39 0 52 0; +#X connect 40 0 51 0; +#X connect 41 0 48 0; +#X connect 42 0 52 0; +#X connect 43 0 51 0; +#X connect 44 0 61 0; +#X connect 45 0 63 0; +#X connect 46 0 50 0; +#X connect 48 0 49 0; +#X connect 49 0 12 0; +#X connect 50 0 19 0; +#X connect 51 0 50 0; +#X connect 52 0 53 0; +#X connect 53 0 27 0; +#X connect 54 0 6 0; +#X connect 56 0 57 0; +#X connect 61 0 27 0; +#X connect 62 0 12 0; +#X connect 63 0 19 0; +#X connect 65 0 10 0; #X connect 66 0 11 0; -#X connect 67 0 12 0; diff --git a/examples/10.glsl/05.multitexture_basic.pd b/examples/10.glsl/05.multitexture_basic.pd index 87d8b872f..31a5c5c64 100644 --- a/examples/10.glsl/05.multitexture_basic.pd +++ b/examples/10.glsl/05.multitexture_basic.pd @@ -2,13 +2,12 @@ #X declare -lib Gem; #X obj 76 5 gemhead; #X obj 76 339 glsl_program; -#X obj 149 268 pack 0 0; -#X obj 170 248 t b f; -#X obj 164 203 change; -#X msg 149 294 link \$1 \$2; -#X floatatom 170 229 2 0 0 0 ID - - 0; -#X floatatom 148 121 2 0 0 0 ID - - 0; -#X obj 167 315 print linking; +#X obj 151 268 pack 0 0; +#X obj 151 206 change; +#X msg 151 294 link \$1 \$2; +#X floatatom 151 232 2 0 0 0 ID - - 0; +#X floatatom 196 121 2 0 0 0 ID - - 0; +#X obj 169 315 print linking; #X msg 365 63 color 1 0 0; #X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 79 glsl_vertex; @@ -31,7 +30,7 @@ #X obj 95 389 loadbang; #X msg 95 414 open ../data/img2.jpg; #X obj 76 443 pix_image ../data/img2.jpg; -#X obj 148 98 change; +#X obj 196 98 change; #X text 343 187 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -95,45 +94,43 @@ #X msg 104 658 rectangle 0 \, texunit 1; #X msg 104 489 rectangle 0 \, texunit 0; #X msg 170 341 MyTex 0 \, MyTex 1; -#X connect 0 0 11 0; -#X connect 1 0 21 0; -#X connect 1 1 41 0; -#X connect 2 0 5 0; -#X connect 3 0 2 0; -#X connect 3 1 2 1; -#X connect 4 0 6 0; -#X connect 5 0 1 0; -#X connect 5 0 8 0; -#X connect 6 0 3 0; -#X connect 7 0 2 0; -#X connect 9 0 25 0; -#X connect 10 0 37 0; -#X connect 10 0 38 0; -#X connect 11 0 12 0; -#X connect 11 1 22 0; -#X connect 12 0 1 0; -#X connect 12 1 4 0; -#X connect 13 0 17 0; -#X connect 14 0 13 0; -#X connect 16 0 10 0; -#X connect 17 0 20 0; -#X connect 18 0 40 0; +#X connect 0 0 10 0; +#X connect 1 0 20 0; +#X connect 1 1 40 0; +#X connect 2 0 4 0; +#X connect 3 0 5 0; +#X connect 4 0 1 0; +#X connect 4 0 7 0; +#X connect 5 0 2 0; +#X connect 6 0 2 1; +#X connect 8 0 24 0; +#X connect 9 0 36 0; +#X connect 9 0 37 0; +#X connect 10 0 11 0; +#X connect 10 1 21 0; +#X connect 11 0 1 0; +#X connect 11 1 3 0; +#X connect 12 0 16 0; +#X connect 13 0 12 0; +#X connect 15 0 9 0; +#X connect 16 0 19 0; +#X connect 17 0 39 0; +#X connect 18 0 19 0; #X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 21 0 27 0; -#X connect 22 0 7 0; -#X connect 24 0 25 0; -#X connect 27 0 35 0; -#X connect 28 0 30 0; -#X connect 29 0 28 0; -#X connect 30 0 34 0; -#X connect 31 0 39 0; -#X connect 32 0 34 0; -#X connect 33 0 26 0; -#X connect 34 0 35 0; -#X connect 35 0 33 0; +#X connect 20 0 26 0; +#X connect 21 0 6 0; +#X connect 23 0 24 0; +#X connect 26 0 34 0; +#X connect 27 0 29 0; +#X connect 28 0 27 0; +#X connect 29 0 33 0; +#X connect 30 0 38 0; +#X connect 31 0 33 0; +#X connect 32 0 25 0; +#X connect 33 0 34 0; +#X connect 34 0 32 0; +#X connect 36 0 10 0; #X connect 37 0 11 0; -#X connect 38 0 12 0; -#X connect 39 0 33 0; -#X connect 40 0 27 0; -#X connect 41 0 1 0; +#X connect 38 0 32 0; +#X connect 39 0 26 0; +#X connect 40 0 1 0; diff --git a/examples/10.glsl/05.multitexture_bis.pd b/examples/10.glsl/05.multitexture_bis.pd index 4be10c9e0..720bbf4fc 100644 --- a/examples/10.glsl/05.multitexture_bis.pd +++ b/examples/10.glsl/05.multitexture_bis.pd @@ -2,13 +2,12 @@ #X declare -lib Gem; #X obj 76 5 gemhead; #X obj 75 429 glsl_program; -#X obj 149 268 pack 0 0; -#X obj 170 248 t b f; -#X obj 164 203 change; -#X msg 149 294 link \$1 \$2; -#X floatatom 170 229 2 0 0 0 ID - - 0; -#X floatatom 148 121 2 0 0 0 ID - - 0; -#X obj 167 315 print linking; +#X obj 151 268 pack 0 0; +#X obj 151 206 change; +#X msg 151 294 link \$1 \$2; +#X floatatom 151 232 2 0 0 0 ID - - 0; +#X floatatom 196 121 2 0 0 0 ID - - 0; +#X obj 169 315 print linking; #X msg 365 23 color 1 0 0; #X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 79 glsl_vertex; @@ -58,7 +57,7 @@ #X obj 666 340 pix_image ../data/img2.jpg; #X obj 890 337 pix_image ../data/img3.jpg; #X msg 907 309 open ../data/img3.jpg; -#X obj 148 98 change; +#X obj 196 98 change; #X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -126,68 +125,66 @@ #X obj 983 7 declare -lib Gem; #X msg 90 57 open shader/multitexture.vert; #X msg 86 153 open shader/multitexture.frag; -#X connect 0 0 11 0; -#X connect 1 0 46 0; -#X connect 1 1 28 0; -#X connect 2 0 5 0; -#X connect 3 0 2 0; -#X connect 3 1 2 1; -#X connect 4 0 6 0; -#X connect 5 0 1 0; -#X connect 5 0 8 0; -#X connect 6 0 3 0; -#X connect 7 0 2 0; -#X connect 9 0 44 0; -#X connect 10 0 63 0; -#X connect 10 0 64 0; -#X connect 11 0 12 0; -#X connect 11 1 41 0; -#X connect 12 0 1 0; -#X connect 12 1 4 0; -#X connect 13 0 29 0; -#X connect 14 0 13 0; -#X connect 15 0 38 0; -#X connect 16 0 15 0; -#X connect 18 0 31 0; -#X connect 19 0 18 0; -#X connect 20 0 35 0; +#X connect 0 0 10 0; +#X connect 1 0 45 0; +#X connect 1 1 27 0; +#X connect 2 0 4 0; +#X connect 3 0 5 0; +#X connect 4 0 1 0; +#X connect 4 0 7 0; +#X connect 5 0 2 0; +#X connect 6 0 2 1; +#X connect 8 0 43 0; +#X connect 9 0 62 0; +#X connect 9 0 63 0; +#X connect 10 0 11 0; +#X connect 10 1 40 0; +#X connect 11 0 1 0; +#X connect 11 1 3 0; +#X connect 12 0 28 0; +#X connect 13 0 12 0; +#X connect 14 0 37 0; +#X connect 15 0 14 0; +#X connect 17 0 30 0; +#X connect 18 0 17 0; +#X connect 19 0 34 0; +#X connect 20 0 1 0; #X connect 21 0 1 0; #X connect 22 0 1 0; #X connect 23 0 1 0; #X connect 24 0 1 0; #X connect 25 0 1 0; -#X connect 26 0 1 0; -#X connect 27 0 10 0; -#X connect 28 0 22 0; -#X connect 28 0 21 0; -#X connect 29 0 37 0; -#X connect 30 0 49 0; -#X connect 31 0 40 0; -#X connect 32 0 37 0; -#X connect 33 0 40 0; -#X connect 34 0 50 0; -#X connect 35 0 39 0; -#X connect 37 0 38 0; +#X connect 26 0 9 0; +#X connect 27 0 21 0; +#X connect 27 0 20 0; +#X connect 28 0 36 0; +#X connect 29 0 48 0; +#X connect 30 0 39 0; +#X connect 31 0 36 0; +#X connect 32 0 39 0; +#X connect 33 0 49 0; +#X connect 34 0 38 0; +#X connect 36 0 37 0; +#X connect 37 0 46 0; #X connect 38 0 47 0; -#X connect 39 0 48 0; -#X connect 40 0 39 0; -#X connect 41 0 7 0; -#X connect 43 0 44 0; -#X connect 46 0 45 0; -#X connect 47 1 46 2; -#X connect 48 1 46 3; +#X connect 39 0 38 0; +#X connect 40 0 6 0; +#X connect 42 0 43 0; +#X connect 45 0 44 0; +#X connect 46 1 45 2; +#X connect 47 1 45 3; +#X connect 48 0 46 0; #X connect 49 0 47 0; -#X connect 50 0 48 0; -#X connect 51 0 55 0; -#X connect 52 0 51 0; -#X connect 53 0 61 0; -#X connect 54 0 53 0; -#X connect 55 0 60 0; +#X connect 50 0 54 0; +#X connect 51 0 50 0; +#X connect 52 0 60 0; +#X connect 53 0 52 0; +#X connect 54 0 59 0; +#X connect 55 0 58 0; #X connect 56 0 59 0; -#X connect 57 0 60 0; -#X connect 58 1 46 1; -#X connect 59 0 58 0; -#X connect 60 0 61 0; -#X connect 61 0 58 0; +#X connect 57 1 45 1; +#X connect 58 0 57 0; +#X connect 59 0 60 0; +#X connect 60 0 57 0; +#X connect 62 0 10 0; #X connect 63 0 11 0; -#X connect 64 0 12 0; diff --git a/examples/10.glsl/06.rectangle_multitexture.pd b/examples/10.glsl/06.rectangle_multitexture.pd index 203e54a20..71e6469f4 100644 --- a/examples/10.glsl/06.rectangle_multitexture.pd +++ b/examples/10.glsl/06.rectangle_multitexture.pd @@ -38,13 +38,12 @@ #X text 280 274 Create window:; #X obj 101 358 cnv 15 100 120 empty empty empty 20 12 0 14 #00fc04 #404040 0; #X obj 37 538 glsl_program; -#X obj 100 259 pack 0 0; -#X obj 118 236 t b f; -#X obj 118 194 change; -#X msg 100 285 link \$1 \$2; -#X floatatom 118 217 2 0 0 0 ID - - 0; -#X floatatom 100 133 2 0 0 0 ID - - 0; -#X obj 105 309 print linking; +#X obj 112 259 pack 0 0; +#X obj 112 214 change; +#X msg 112 285 link \$1 \$2; +#X floatatom 112 237 2 0 0 0 ID - - 0; +#X floatatom 145 130 2 0 0 0 ID - - 0; +#X obj 117 309 print linking; #X obj 124 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 37 88 glsl_vertex; #X obj 37 174 glsl_fragment; @@ -58,7 +57,7 @@ #X connect 3 0 1 0; #X connect 3 1 0 0; #X restore 124 21 pd load_shader; -#X obj 100 110 change; +#X obj 145 107 change; #X obj 106 581 loadbang; #X obj 37 21 gemhead 51; #X msg 109 371 add; @@ -130,60 +129,58 @@ #X obj 543 647 declare -lib Gem; #X msg 51 66 open shader/GLSL_mix.vert; #X msg 51 151 open shader/GLSL_mix.frag; -#X connect 0 0 59 0; +#X connect 0 0 58 0; #X connect 1 0 3 0; #X connect 3 0 2 0; #X connect 4 0 5 0; -#X connect 5 0 59 0; +#X connect 5 0 58 0; #X connect 6 0 4 0; -#X connect 7 0 60 0; +#X connect 7 0 59 0; #X connect 8 0 13 0; #X connect 10 0 11 0; -#X connect 11 0 60 0; +#X connect 11 0 59 0; #X connect 12 0 10 0; #X connect 13 0 9 0; #X connect 15 0 16 0; #X connect 16 0 15 0; -#X connect 19 0 44 0; -#X connect 19 1 55 0; -#X connect 20 0 23 0; -#X connect 21 0 20 0; -#X connect 21 1 20 1; -#X connect 22 0 24 0; -#X connect 23 0 19 0; -#X connect 23 0 26 0; -#X connect 24 0 21 0; -#X connect 25 0 20 0; -#X connect 27 0 65 0; -#X connect 27 0 66 0; -#X connect 28 0 29 0; -#X connect 28 1 31 0; -#X connect 29 0 19 0; -#X connect 29 1 22 0; -#X connect 30 0 27 0; -#X connect 31 0 25 0; -#X connect 32 0 43 0; -#X connect 33 0 28 0; -#X connect 34 0 37 0; -#X connect 35 0 37 0; -#X connect 36 0 37 0; -#X connect 37 0 40 0; +#X connect 19 0 43 0; +#X connect 19 1 54 0; +#X connect 20 0 22 0; +#X connect 21 0 23 0; +#X connect 22 0 19 0; +#X connect 22 0 25 0; +#X connect 23 0 20 0; +#X connect 24 0 20 1; +#X connect 26 0 64 0; +#X connect 26 0 65 0; +#X connect 27 0 28 0; +#X connect 27 1 30 0; +#X connect 28 0 19 0; +#X connect 28 1 21 0; +#X connect 29 0 26 0; +#X connect 30 0 24 0; +#X connect 31 0 42 0; +#X connect 32 0 27 0; +#X connect 33 0 36 0; +#X connect 34 0 36 0; +#X connect 35 0 36 0; +#X connect 36 0 39 0; +#X connect 37 0 19 0; #X connect 38 0 19 0; #X connect 39 0 19 0; -#X connect 40 0 19 0; -#X connect 41 0 34 0; -#X connect 42 0 63 0; -#X connect 43 0 42 0; -#X connect 44 0 42 0; -#X connect 45 0 62 0; -#X connect 46 0 37 0; -#X connect 49 0 37 0; -#X connect 55 0 38 0; -#X connect 55 0 39 0; -#X connect 57 0 9 0; -#X connect 58 0 2 0; -#X connect 59 0 58 0; -#X connect 60 0 57 0; -#X connect 62 0 19 0; +#X connect 40 0 33 0; +#X connect 41 0 62 0; +#X connect 42 0 41 0; +#X connect 43 0 41 0; +#X connect 44 0 61 0; +#X connect 45 0 36 0; +#X connect 48 0 36 0; +#X connect 54 0 37 0; +#X connect 54 0 38 0; +#X connect 56 0 9 0; +#X connect 57 0 2 0; +#X connect 58 0 57 0; +#X connect 59 0 56 0; +#X connect 61 0 19 0; +#X connect 64 0 27 0; #X connect 65 0 28 0; -#X connect 66 0 29 0; From 47637356b838eac8a2ce334feaf163e2421efa95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 17:06:01 +0100 Subject: [PATCH 252/387] helper to render text's bboxes --- help/Makefile.am | 2 + help/_textbbox-help.pd | 88 ++++++++++++++++++++++++++++++++++++++++++ help/_textbbox.pd | 54 ++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 help/_textbbox-help.pd create mode 100644 help/_textbbox.pd diff --git a/help/Makefile.am b/help/Makefile.am index efc9fa9f9..fb7560e7f 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -247,4 +247,6 @@ dist_gemhelp_DATA += \ _backendinfo.pd \ _gemwin.pd \ _pix2rectangle.pd \ + _textbbox.pd \ + _textbbox-help.pd \ $(empty) diff --git a/help/_textbbox-help.pd b/help/_textbbox-help.pd new file mode 100644 index 000000000..c76ea8764 --- /dev/null +++ b/help/_textbbox-help.pd @@ -0,0 +1,88 @@ +#N canvas 940 184 822 678 10; +#X declare -lib Gem; +#X text 54 30 Class: geometric object; +#X obj 465 65 cnv 15 180 600 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 53 434 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 7 65 cnv 15 450 330 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 453 11 GEM object; +#X text 471 47 Example:; +#X obj 470 473 cnv 15 170 180 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 471 70 gemhead; +#X floatatom 510 389 5 0 100 1 size - - 0; +#X msg 481 154 font \$1; +#X obj 481 135 openpanel; +#X obj 481 118 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X msg 489 180 text hello world!; +#X msg 509 202 1 2 3 4; +#X msg 519 249 justify left base; +#X floatatom 575 74 5 0 0 0 - - - 0; +#X floatatom 534 69 4 0 0 0 - - - 0; +#X obj 471 91 rotateXYZ; +#X msg 515 224 string 48 49 32 51 52; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION Renders a line of text; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist font text list string justify alias; +#X text 20 105 INLET_1 float; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X restore 528 8 pd META; +#X msg 522 276 string 20320 10 22909 10 19990 10 30028, f 17; +#X msg 521 326 text مرحبا بالعالم; +#X msg 518 353 alias \$1; +#X obj 577 353 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 59 441 _gemwin; +#X obj 471 410 text3d; +#X obj 553 631 - 1; +#X obj 471 451 color 1 0 0; +#X text 33 14 Synopsis: [_textbbox]; +#X text 7 69 Description: helper to draw a bounding box around [text*] output; +#X text 12 107 Gem's [text*] objects output boundbox information via their last outlet.; +#X text 14 137 Use [_textbbox] to quickly visualise this bounding box; +#X obj 553 481 vradio 18 1 0 8 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0; +#X text 572 479 no bbox; +#X text 572 497 global bbox; +#X text 571 516 line#1; +#X text 571 535 line#2; +#X text 571 554 line#3; +#X text 571 573 line#4; +#X text 577 595 ...; +#X obj 471 616 _textbbox 1 \; width 2; +#X text 16 205 Arguments:; +#X text 35 223 initial bbox selection (see Inlet#3); +#X text 19 247 Inlets:; +#X text 36 302 Inlet 2: bbox messages (from [text...]); +#X text 36 322 Inlet 3: bbox selection; +#X text 102 339 0...global bbox; +#X text 102 353 1...line#1 bbox; +#X text 102 366 2...line#2 bbox; +#X text 15 154 You can select whether to display the global bounding box for all lines \, or a specific line. Out of bound lines (e.g. negative lines) will disable rendering; +#X msg 482 558 width \$1; +#X floatatom 482 534 5 0 0 0 - - - 0; +#X text 36 262 Inlet 1: gemlist; +#X text 36 282 Inlet 1: message: width ; +#X connect 7 0 17 0; +#X connect 8 0 25 1; +#X connect 9 0 25 0; +#X connect 10 0 9 0; +#X connect 11 0 10 0; +#X connect 12 0 25 0; +#X connect 13 0 25 0; +#X connect 14 0 25 0; +#X connect 15 0 17 3; +#X connect 16 0 17 1; +#X connect 17 0 25 0; +#X connect 18 0 25 0; +#X connect 20 0 25 0; +#X connect 21 0 25 0; +#X connect 22 0 25 0; +#X connect 23 0 22 0; +#X connect 25 0 27 0; +#X connect 25 1 40 1; +#X connect 26 0 40 2; +#X connect 27 0 40 0; +#X connect 32 0 26 0; +#X connect 50 0 40 0; +#X connect 51 0 50 0; diff --git a/help/_textbbox.pd b/help/_textbbox.pd new file mode 100644 index 000000000..fe77563ef --- /dev/null +++ b/help/_textbbox.pd @@ -0,0 +1,54 @@ +#N canvas 2076 404 880 589 12; +#X obj 234 146 inlet; +#X obj 32 270 spigot; +#X text 97 283 global bounding box; +#X obj 32 403 polygon 4 \; draw line; +#X msg 233 405 \$1 \$2 \$3 \$1 \$5 \$3 \$4 \$5 \$3 \$4 \$2 \$3; +#X obj 233 373 route 0; +#X obj 32 145 inlet gemlist; +#X obj 137 145 inlet bbox; +#X obj 233 196 >= 0; +#X obj 280 308 - 1; +#X obj 137 309 list prepend -1; +#X msg 284 436 0 0 0 0 0 0 0 0 0 0 0 0; +#X obj 137 244 route bbox bboxline ascender; +#X obj 233 436 t a a; +#X text 487 438 clear for out-of-range lines; +#X text 47 31 helper for drawing boundingboxes for [text*] objects; +#X obj 537 59 loadbang; +#X obj 537 124 gemargs; +#X msg 482 59 bang; +#X obj 234 171 t f f; +#X obj 32 170 route width; +#X obj 537 267 t f; +#X msg 537 292 width \$1; +#X obj 537 242 route width; +#X obj 537 84 t b; +#X obj 583 151 route float; +#X connect 0 0 19 0; +#X connect 1 0 3 0; +#X connect 4 0 13 0; +#X connect 5 0 4 0; +#X connect 6 0 20 0; +#X connect 7 0 12 0; +#X connect 8 0 1 1; +#X connect 9 0 5 1; +#X connect 10 0 5 0; +#X connect 11 0 13 0; +#X connect 12 0 10 0; +#X connect 12 1 5 0; +#X connect 12 2 11 0; +#X connect 13 0 3 0; +#X connect 16 0 24 0; +#X connect 17 0 23 0; +#X connect 17 1 25 0; +#X connect 18 0 24 0; +#X connect 19 0 8 0; +#X connect 19 1 9 0; +#X connect 20 0 21 0; +#X connect 20 1 1 0; +#X connect 21 0 22 0; +#X connect 22 0 3 0; +#X connect 23 0 21 0; +#X connect 24 0 17 0; +#X connect 25 0 19 0; From b6260e805151570fe1f52746374e76ead16aa85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 17:06:26 +0100 Subject: [PATCH 253/387] use [_textbbox] for displaying text's bboxes --- help/text2d-help.pd | 95 ++++-------------------------- help/text3d-help.pd | 120 ++++++++++---------------------------- help/textextruded-help.pd | 101 +++++--------------------------- help/textoutline-help.pd | 101 +++++--------------------------- 4 files changed, 72 insertions(+), 345 deletions(-) diff --git a/help/text2d-help.pd b/help/text2d-help.pd index da9c752d1..bdaaa1986 100644 --- a/help/text2d-help.pd +++ b/help/text2d-help.pd @@ -1,8 +1,8 @@ -#N canvas 74 125 655 703 10; +#N canvas 948 87 655 703 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 465 65 cnv 15 170 400 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 465 472 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 465 65 cnv 15 170 420 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 465 490 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 335 cnv 15 450 200 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 340 Inlets:; @@ -108,7 +108,7 @@ #X obj 540 138 / 10; #X floatatom 545 115 5 0 0 0 - - - 0; #X floatatom 581 116 5 0 0 0 - - - 0; -#X obj 472 475 _gemwin; +#X obj 472 493 _gemwin; #X text 19 509 Outlet 2: information about the text; #N canvas 15 180 585 372 more_informations 0; #X text 33 24 for now the outlet 2 outputs for each frame :; @@ -118,83 +118,10 @@ #X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); #X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; #X restore 260 508 pd more_informations; -#N canvas 205 65 1030 787 bounding_box 0; -#X obj 32 243 polygon 4 \; draw line; -#X obj 117 124 route bbox; -#X msg 117 150 \$1 \$2 \$3; -#X obj 32 15 inlet; -#X obj 117 15 inlet; -#X obj 214 16 inlet; -#X obj 32 50 spigot; -#X text 201 123 global bounding box; -#X obj 32 156 color 1 0 0; -#X obj 412 187 route bboxline; -#X obj 120 461 route 0; -#X msg 128 173 \$1 \$5 \$3; -#X msg 144 195 \$4 \$5 \$3; -#X msg 160 220 \$4 \$2 \$3; -#X obj 32 593 polygon 4 \; draw line; -#X msg 117 500 \$1 \$2 \$3; -#X msg 128 523 \$1 \$5 \$3; -#X msg 144 545 \$4 \$5 \$3; -#X msg 160 570 \$4 \$2 \$3; -#X obj 323 605 polygon 4 \; draw line; -#X msg 408 512 \$1 \$2 \$3; -#X msg 419 535 \$1 \$5 \$3; -#X msg 435 557 \$4 \$5 \$3; -#X msg 451 582 \$4 \$2 \$3; -#X obj 32 506 color 0 1 0; -#X obj 323 518 color 0 0 1; -#X obj 412 471 route 1; -#X obj 32 305 spigot; -#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 323 319 spigot; -#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X text 181 460 comment; -#X text 111 303 bbox line 1; -#X text 400 318 bbox line 2; -#X connect 0 0 27 0; -#X connect 0 0 29 0; -#X connect 1 0 2 0; -#X connect 1 0 11 0; -#X connect 1 0 12 0; -#X connect 1 0 13 0; -#X connect 1 1 9 0; -#X connect 2 0 0 1; -#X connect 3 0 6 0; -#X connect 4 0 1 0; -#X connect 5 0 6 1; -#X connect 6 0 8 0; -#X connect 8 0 0 0; -#X connect 9 0 10 0; -#X connect 9 0 26 0; -#X connect 10 0 15 0; -#X connect 10 0 18 0; -#X connect 10 0 17 0; -#X connect 10 0 16 0; -#X connect 11 0 0 2; -#X connect 12 0 0 3; -#X connect 13 0 0 4; -#X connect 15 0 14 1; -#X connect 16 0 14 2; -#X connect 17 0 14 3; -#X connect 18 0 14 4; -#X connect 20 0 19 1; -#X connect 21 0 19 2; -#X connect 22 0 19 3; -#X connect 23 0 19 4; -#X connect 24 0 14 0; -#X connect 25 0 19 0; -#X connect 26 0 20 0; -#X connect 26 0 23 0; -#X connect 26 0 22 0; -#X connect 26 0 21 0; -#X connect 27 0 24 0; -#X connect 28 0 27 1; -#X connect 29 0 25 0; -#X connect 30 0 29 1; -#X restore 479 442 pd bounding_box; -#X obj 582 442 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 479 428 color 1 0 0; +#X obj 479 449 _textbbox \; width 2; +#X obj 559 452 - 1; +#X obj 559 429 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X connect 14 0 49 0; #X connect 15 0 50 1; #X connect 16 0 50 0; @@ -209,7 +136,7 @@ #X connect 43 0 44 0; #X connect 49 0 56 0; #X connect 50 0 65 0; -#X connect 50 1 65 1; +#X connect 50 1 66 1; #X connect 51 0 20 0; #X connect 52 0 17 0; #X connect 53 0 50 0; @@ -219,4 +146,6 @@ #X connect 58 0 59 0; #X connect 59 0 57 1; #X connect 60 0 56 2; -#X connect 66 0 65 2; +#X connect 65 0 66 0; +#X connect 67 0 66 2; +#X connect 68 0 67 0; diff --git a/help/text3d-help.pd b/help/text3d-help.pd index 63117da31..db1373a50 100644 --- a/help/text3d-help.pd +++ b/help/text3d-help.pd @@ -1,8 +1,8 @@ -#N canvas 822 168 822 715 10; +#N canvas 574 154 822 715 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; #X obj 465 65 cnv 15 180 600 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 467 513 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 467 531 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 260 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 374 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 379 Inlets:; @@ -42,10 +42,10 @@ #X msg 515 264 string 48 49 32 51 52; #X text 27 444 Inlet 1: message: string [] : render the given text \, given as a list of unicode code points (similar to ASCII); #X text 10 123 Any TrueType-font can be rendered. Per default a file "vera.ttf" is searched in the paths. If it is not found you will not see anything unless you load a valid font via the "font"-message. The font-loader uses Pd's search-paths \, so you could specify your path on the command-line and load fonts with just "font times.ttf".; -#X obj 541 589 text2d; -#X text 470 587 see also:; -#X obj 541 612 textextruded; -#X obj 541 635 textoutline; +#X obj 541 597 text2d; +#X text 470 595 see also:; +#X obj 541 620 textextruded; +#X obj 541 643 textoutline; #X text 27 514 Inlet 2: float: size (in points) (default:20); #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; @@ -65,85 +65,7 @@ #X obj 577 393 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 30 597 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 43 601 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X obj 473 520 _gemwin; -#X msg 501 205 text multi -line; -#N canvas 205 65 1030 787 bounding_box 0; -#X obj 32 243 polygon 4 \; draw line; -#X obj 117 124 route bbox; -#X msg 117 150 \$1 \$2 \$3; -#X obj 32 15 inlet; -#X obj 117 15 inlet; -#X obj 214 16 inlet; -#X obj 32 50 spigot; -#X text 201 123 global bounding box; -#X obj 32 156 color 1 0 0; -#X obj 412 187 route bboxline; -#X obj 120 461 route 0; -#X msg 128 173 \$1 \$5 \$3; -#X msg 144 195 \$4 \$5 \$3; -#X msg 160 220 \$4 \$2 \$3; -#X obj 32 593 polygon 4 \; draw line; -#X msg 117 500 \$1 \$2 \$3; -#X msg 128 523 \$1 \$5 \$3; -#X msg 144 545 \$4 \$5 \$3; -#X msg 160 570 \$4 \$2 \$3; -#X obj 323 605 polygon 4 \; draw line; -#X msg 408 512 \$1 \$2 \$3; -#X msg 419 535 \$1 \$5 \$3; -#X msg 435 557 \$4 \$5 \$3; -#X msg 451 582 \$4 \$2 \$3; -#X obj 32 506 color 0 1 0; -#X obj 323 518 color 0 0 1; -#X obj 412 471 route 1; -#X obj 32 305 spigot; -#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 323 319 spigot; -#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X text 181 460 comment; -#X text 111 303 bbox line 1; -#X text 400 318 bbox line 2; -#X connect 0 0 27 0; -#X connect 0 0 29 0; -#X connect 1 0 2 0; -#X connect 1 0 11 0; -#X connect 1 0 12 0; -#X connect 1 0 13 0; -#X connect 1 1 9 0; -#X connect 2 0 0 1; -#X connect 3 0 6 0; -#X connect 4 0 1 0; -#X connect 5 0 6 1; -#X connect 6 0 8 0; -#X connect 8 0 0 0; -#X connect 9 0 10 0; -#X connect 9 0 26 0; -#X connect 10 0 15 0; -#X connect 10 0 18 0; -#X connect 10 0 17 0; -#X connect 10 0 16 0; -#X connect 11 0 0 2; -#X connect 12 0 0 3; -#X connect 13 0 0 4; -#X connect 15 0 14 1; -#X connect 16 0 14 2; -#X connect 17 0 14 3; -#X connect 18 0 14 4; -#X connect 20 0 19 1; -#X connect 21 0 19 2; -#X connect 22 0 19 3; -#X connect 23 0 19 4; -#X connect 24 0 14 0; -#X connect 25 0 19 0; -#X connect 26 0 20 0; -#X connect 26 0 23 0; -#X connect 26 0 22 0; -#X connect 26 0 21 0; -#X connect 27 0 24 0; -#X connect 28 0 27 1; -#X connect 29 0 25 0; -#X connect 30 0 29 1; -#X restore 471 481 pd bounding_box; +#X obj 473 538 _gemwin; #X text 21 561 Outlet 2: information about the text; #N canvas 15 180 585 372 more_informations 0; #X text 33 24 for now the outlet 2 outputs for each frame :; @@ -153,7 +75,23 @@ line; #X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); #X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; #X restore 262 560 pd more_informations; -#X obj 574 481 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 471 477 color 1 0 0; +#X obj 471 498 _textbbox \; width 2; +#X obj 551 478 hradio 18 1 0 4 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0; +#X obj 551 501 - 1; +#N canvas 735 461 450 300 multiline 0; +#X obj 100 101 bng 18 250 50 0 \$0-multiline \$0-multiline empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 240 192 outlet; +#X obj 242 95 r \$0-multiline; +#X msg 242 118 10; +#X obj 240 142 makefilename %c; +#X msg 240 165 text multi\$1line; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 5 0 1 0; +#X coords 0 -1 1 1 85 20 1 100 100; +#X restore 502 210 pd multiline; #X connect 14 0 33 0; #X connect 15 0 34 1; #X connect 16 0 34 0; @@ -165,12 +103,14 @@ line; #X connect 27 0 33 3; #X connect 28 0 33 1; #X connect 33 0 34 0; -#X connect 34 0 58 0; -#X connect 34 1 58 1; +#X connect 34 0 59 0; +#X connect 34 1 60 1; #X connect 39 0 34 0; #X connect 48 0 34 0; #X connect 49 0 34 0; #X connect 52 0 34 0; #X connect 53 0 52 0; -#X connect 57 0 34 0; -#X connect 61 0 58 2; +#X connect 59 0 60 0; +#X connect 61 0 62 0; +#X connect 62 0 60 2; +#X connect 63 0 34 0; diff --git a/help/textextruded-help.pd b/help/textextruded-help.pd index a62a926e5..1eb53de56 100644 --- a/help/textextruded-help.pd +++ b/help/textextruded-help.pd @@ -1,8 +1,8 @@ -#N canvas 24 118 647 697 10; +#N canvas 547 139 647 697 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 466 65 cnv 15 170 310 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 466 391 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 466 65 cnv 15 170 330 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 466 451 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 336 cnv 15 450 190 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 341 Inlets:; @@ -45,9 +45,9 @@ #X text 27 408 Inlet 1: message: depth : extrusion depth; #X obj 20 628 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 32 633 Note: GEM needs to be compiled with FTGL-support for this to work; -#X text 472 468 see also:; -#X obj 545 468 text2d; -#X obj 592 468 text3d; +#X text 472 528 see also:; +#X obj 545 528 text2d; +#X obj 592 528 text3d; #X text 27 457 Inlet 2: float: size (in points). (default:20); #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; @@ -61,7 +61,7 @@ #X restore 531 8 pd META; #X obj 20 537 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 33 541 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X obj 472 394 _gemwin; +#X obj 472 454 _gemwin; #X text 20 504 Outlet 2: information about the text; #N canvas 15 180 585 372 more_informations 0; #X text 33 24 for now the outlet 2 outputs for each frame :; @@ -71,83 +71,10 @@ #X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); #X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; #X restore 261 503 pd more_informations; -#N canvas 205 65 1030 787 bounding_box 0; -#X obj 32 243 polygon 4 \; draw line; -#X obj 117 124 route bbox; -#X msg 117 150 \$1 \$2 \$3; -#X obj 32 15 inlet; -#X obj 117 15 inlet; -#X obj 214 16 inlet; -#X obj 32 50 spigot; -#X text 201 123 global bounding box; -#X obj 32 156 color 1 0 0; -#X obj 412 187 route bboxline; -#X obj 120 461 route 0; -#X msg 128 173 \$1 \$5 \$3; -#X msg 144 195 \$4 \$5 \$3; -#X msg 160 220 \$4 \$2 \$3; -#X obj 32 593 polygon 4 \; draw line; -#X msg 117 500 \$1 \$2 \$3; -#X msg 128 523 \$1 \$5 \$3; -#X msg 144 545 \$4 \$5 \$3; -#X msg 160 570 \$4 \$2 \$3; -#X obj 323 605 polygon 4 \; draw line; -#X msg 408 512 \$1 \$2 \$3; -#X msg 419 535 \$1 \$5 \$3; -#X msg 435 557 \$4 \$5 \$3; -#X msg 451 582 \$4 \$2 \$3; -#X obj 32 506 color 0 1 0; -#X obj 323 518 color 0 0 1; -#X obj 412 471 route 1; -#X obj 32 305 spigot; -#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 323 319 spigot; -#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X text 181 460 comment; -#X text 111 303 bbox line 1; -#X text 400 318 bbox line 2; -#X connect 0 0 27 0; -#X connect 0 0 29 0; -#X connect 1 0 2 0; -#X connect 1 0 11 0; -#X connect 1 0 12 0; -#X connect 1 0 13 0; -#X connect 1 1 9 0; -#X connect 2 0 0 1; -#X connect 3 0 6 0; -#X connect 4 0 1 0; -#X connect 5 0 6 1; -#X connect 6 0 8 0; -#X connect 8 0 0 0; -#X connect 9 0 10 0; -#X connect 9 0 26 0; -#X connect 10 0 15 0; -#X connect 10 0 18 0; -#X connect 10 0 17 0; -#X connect 10 0 16 0; -#X connect 11 0 0 2; -#X connect 12 0 0 3; -#X connect 13 0 0 4; -#X connect 15 0 14 1; -#X connect 16 0 14 2; -#X connect 17 0 14 3; -#X connect 18 0 14 4; -#X connect 20 0 19 1; -#X connect 21 0 19 2; -#X connect 22 0 19 3; -#X connect 23 0 19 4; -#X connect 24 0 14 0; -#X connect 25 0 19 0; -#X connect 26 0 20 0; -#X connect 26 0 23 0; -#X connect 26 0 22 0; -#X connect 26 0 21 0; -#X connect 27 0 24 0; -#X connect 28 0 27 1; -#X connect 29 0 25 0; -#X connect 30 0 29 1; -#X restore 472 351 pd bounding_box; -#X obj 575 351 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 472 337 color 1 0 0; +#X obj 472 358 _textbbox \; width 2; +#X obj 552 361 - 1; +#X obj 552 338 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X connect 14 0 34 0; #X connect 15 0 37 1; #X connect 16 0 37 0; @@ -160,7 +87,9 @@ #X connect 29 0 34 1; #X connect 34 0 37 0; #X connect 37 0 55 0; -#X connect 37 1 55 1; +#X connect 37 1 56 1; #X connect 39 0 37 0; #X connect 40 0 39 0; -#X connect 56 0 55 2; +#X connect 55 0 56 0; +#X connect 57 0 56 2; +#X connect 58 0 57 0; diff --git a/help/textoutline-help.pd b/help/textoutline-help.pd index e8631b574..68b3fa3f3 100644 --- a/help/textoutline-help.pd +++ b/help/textoutline-help.pd @@ -1,8 +1,8 @@ #N canvas 166 150 653 630 10; #X declare -lib Gem; #X text 54 30 Class: geometric object; -#X obj 466 66 cnv 15 170 310 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 468 386 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 466 66 cnv 15 170 330 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 468 446 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X obj 7 65 cnv 15 450 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 8 335 cnv 15 450 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 9 340 Inlets:; @@ -40,10 +40,10 @@ #X text 43 576 Note: on some systems it might be necessary to turn rendering ON before loading a font.; #X obj 474 312 textoutline; #X text 10 94 [textoutline] renders one line of a outlined text with the current color \, and all 3D-transformation; -#X text 473 461 see also:; -#X obj 487 526 textextruded; -#X obj 489 481 text2d; -#X obj 488 503 text3d; +#X text 473 521 see also:; +#X obj 487 586 textextruded; +#X obj 489 541 text2d; +#X obj 488 563 text3d; #X text 27 446 Inlet 2: float: size (in points). (default:20); #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; @@ -57,7 +57,7 @@ #X restore 528 8 pd META; #X obj 30 527 cnv 15 400 40 empty empty empty 20 12 0 14 #fce0c0 #404040 0; #X text 43 531 Note: changing the fontsize will re-generate the glyphs \, which can be slow. [scale] is much faster.; -#X obj 472 393 _gemwin; +#X obj 472 453 _gemwin; #X text 21 495 Outlet 2: information about the text; #N canvas 15 180 585 372 more_informations 0; #X text 33 24 for now the outlet 2 outputs for each frame :; @@ -67,83 +67,10 @@ #X text 59 103 (x1 \, y1 \, z1 \, x2 \, y2 \, z2); #X text 41 126 - bboxline : line number + bounding box of this specific line, f 62; #X restore 262 494 pd more_informations; -#N canvas 205 65 1030 787 bounding_box 0; -#X obj 32 243 polygon 4 \; draw line; -#X obj 117 124 route bbox; -#X msg 117 150 \$1 \$2 \$3; -#X obj 32 15 inlet; -#X obj 117 15 inlet; -#X obj 214 16 inlet; -#X obj 32 50 spigot; -#X text 201 123 global bounding box; -#X obj 32 156 color 1 0 0; -#X obj 412 187 route bboxline; -#X obj 120 461 route 0; -#X msg 128 173 \$1 \$5 \$3; -#X msg 144 195 \$4 \$5 \$3; -#X msg 160 220 \$4 \$2 \$3; -#X obj 32 593 polygon 4 \; draw line; -#X msg 117 500 \$1 \$2 \$3; -#X msg 128 523 \$1 \$5 \$3; -#X msg 144 545 \$4 \$5 \$3; -#X msg 160 570 \$4 \$2 \$3; -#X obj 323 605 polygon 4 \; draw line; -#X msg 408 512 \$1 \$2 \$3; -#X msg 419 535 \$1 \$5 \$3; -#X msg 435 557 \$4 \$5 \$3; -#X msg 451 582 \$4 \$2 \$3; -#X obj 32 506 color 0 1 0; -#X obj 323 518 color 0 0 1; -#X obj 412 471 route 1; -#X obj 32 305 spigot; -#X obj 79 304 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 323 319 spigot; -#X obj 370 318 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X text 181 460 comment; -#X text 111 303 bbox line 1; -#X text 400 318 bbox line 2; -#X connect 0 0 27 0; -#X connect 0 0 29 0; -#X connect 1 0 2 0; -#X connect 1 0 11 0; -#X connect 1 0 12 0; -#X connect 1 0 13 0; -#X connect 1 1 9 0; -#X connect 2 0 0 1; -#X connect 3 0 6 0; -#X connect 4 0 1 0; -#X connect 5 0 6 1; -#X connect 6 0 8 0; -#X connect 8 0 0 0; -#X connect 9 0 10 0; -#X connect 9 0 26 0; -#X connect 10 0 15 0; -#X connect 10 0 18 0; -#X connect 10 0 17 0; -#X connect 10 0 16 0; -#X connect 11 0 0 2; -#X connect 12 0 0 3; -#X connect 13 0 0 4; -#X connect 15 0 14 1; -#X connect 16 0 14 2; -#X connect 17 0 14 3; -#X connect 18 0 14 4; -#X connect 20 0 19 1; -#X connect 21 0 19 2; -#X connect 22 0 19 3; -#X connect 23 0 19 4; -#X connect 24 0 14 0; -#X connect 25 0 19 0; -#X connect 26 0 20 0; -#X connect 26 0 23 0; -#X connect 26 0 22 0; -#X connect 26 0 21 0; -#X connect 27 0 24 0; -#X connect 28 0 27 1; -#X connect 29 0 25 0; -#X connect 30 0 29 1; -#X restore 474 351 pd bounding_box; -#X obj 577 351 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 474 337 color 1 0 0; +#X obj 474 358 _textbbox \; width 2; +#X obj 554 361 - 1; +#X obj 554 338 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X connect 14 0 34 0; #X connect 15 0 38 1; #X connect 16 0 38 0; @@ -156,5 +83,7 @@ #X connect 29 0 34 1; #X connect 34 0 38 0; #X connect 38 0 51 0; -#X connect 38 1 51 1; -#X connect 52 0 51 2; +#X connect 38 1 52 1; +#X connect 51 0 52 0; +#X connect 53 0 52 2; +#X connect 54 0 53 0; From 3d88c087a1ac4bb461598042bfeaacd60f6a07dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 1 Mar 2025 16:12:27 +0100 Subject: [PATCH 254/387] pix_artoolkit: fix image member "not owned" --- extra/pix_artoolkit/pix_artoolkit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/pix_artoolkit/pix_artoolkit.cpp b/extra/pix_artoolkit/pix_artoolkit.cpp index f23d0ed2b..bb55a9921 100644 --- a/extra/pix_artoolkit/pix_artoolkit.cpp +++ b/extra/pix_artoolkit/pix_artoolkit.cpp @@ -287,7 +287,7 @@ void pix_artoolkit :: processRGBAImage(imageStruct &image) m_image.ysize = image.ysize; m_image.fromGray(image.data); image.data = m_image.data; - image.notowned = 0; + image.not_owned = 0; image.setFormat(m_image.format); } @@ -303,7 +303,7 @@ void pix_artoolkit :: processYUVImage(imageStruct &image) m_image.ysize = image.ysize; m_image.fromUYVY(image.data); image.data = m_image.data; - image.notowned = 0; + image.not_owned = 0; image.setFormat(m_image.format); } From 7350809d198912e225a33174198e63af049886fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 18:40:16 +0100 Subject: [PATCH 255/387] V4L2: stop enumerating private ctrls on error Closes: https://github.com/umlaeute/Gem/issues/468 --- plugins/V4L2/videoV4L2.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/V4L2/videoV4L2.cpp b/plugins/V4L2/videoV4L2.cpp index 046899dd1..efae6cb99 100644 --- a/plugins/V4L2/videoV4L2.cpp +++ b/plugins/V4L2/videoV4L2.cpp @@ -960,11 +960,24 @@ bool videoV4L2 :: enumProperties(gem::Properties&readable, } for (__u32 id = V4L2_CID_PRIVATE_BASE;;id++) { + int ret = 0; queryctrl.id = id; - if (0 == xioctl (m_tvfd, VIDIOC_QUERYCTRL, &queryctrl)) { + ret = xioctl (m_tvfd, VIDIOC_QUERYCTRL, &queryctrl); + if (0 == ret) { addProperties(queryctrl, readable, writeable); } else { - if (errno == EINVAL) { + /* we practically always fail here and could just 'break' + * https://github.com/gjasny/v4l-utils/blob/371537d1bcf03146682005a858af1b3e02900cc1/utils/v4l2-compliance/v4l2-test-controls.cpp#L344-L350 + */ + if (errno == ENOTTY) { + break; + } + if (errno && errno != EINVAL) { + /* invalid return code */ + break; + } + if (errno) { + /* EINVAL */ break; } } From 75e4d4a0c7c7a7e35c1694711e527be214c211ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 23:47:11 +0100 Subject: [PATCH 256/387] v4l2: if STREAMON fails, close device --- plugins/V4L2/videoV4L2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/V4L2/videoV4L2.cpp b/plugins/V4L2/videoV4L2.cpp index efae6cb99..4485f2428 100644 --- a/plugins/V4L2/videoV4L2.cpp +++ b/plugins/V4L2/videoV4L2.cpp @@ -720,6 +720,7 @@ bool videoV4L2 :: startTransfer() type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (-1 == xioctl (m_tvfd, VIDIOC_STREAMON, &type)) { perror("[GEM:videoV4L2] VIDIOC_STREAMON");//exit + goto closit; } m_frameSize=fmt.fmt.pix.sizeimage; From d5bede502aa6b3b4811b6c394efb55b221fbba5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 23:48:30 +0100 Subject: [PATCH 257/387] V4L2: initialize fd to -1 --- plugins/V4L2/videoV4L2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/V4L2/videoV4L2.cpp b/plugins/V4L2/videoV4L2.cpp index 4485f2428..80d651ae7 100644 --- a/plugins/V4L2/videoV4L2.cpp +++ b/plugins/V4L2/videoV4L2.cpp @@ -83,7 +83,7 @@ REGISTER_VIDEOFACTORY("v4l2", videoV4L2); videoV4L2 :: videoV4L2() : videoBase("v4l2", 0) , m_gotFormat(0), m_colorConvert(0), - m_tvfd(0), + m_tvfd(-1), m_buffers(NULL), m_nbuffers(0), m_currentBuffer(NULL), m_frame(0), m_last_frame(0), From 0f55a517a5a1f73a2477890f64c3e04168ac9047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 23:49:34 +0100 Subject: [PATCH 258/387] V4L2: move decorations to debugPrint() --- plugins/V4L2/videoV4L2.cpp | 70 ++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/plugins/V4L2/videoV4L2.cpp b/plugins/V4L2/videoV4L2.cpp index 80d651ae7..351ebeee8 100644 --- a/plugins/V4L2/videoV4L2.cpp +++ b/plugins/V4L2/videoV4L2.cpp @@ -42,14 +42,14 @@ using namespace gem::plugins; #undef debugIOCTL #if 0 -# define debugPost ::startpost("%s:%s[%d]", __FILE__, __FUNCTION__, __LINE__); ::post +# define debugPost ::startpost("%s:%s[%d] v4l2@%p/%d:", __FILE__, __FUNCTION__, __LINE__, this, this->m_tvfd); ::post #else # include "Utils/nop.h" # define debugPost nop_post #endif #if 0 -# define debugThread ::startpost("%s:%s[%d]", __FILE__, __FUNCTION__, __LINE__); ::post +# define debugThread ::startpost("%s:%s[%d] v4l2@%p/%d: ", __FILE__, __FUNCTION__, __LINE__, this, this->m_tvfd); ::post #else # include "Utils/nop.h" # define debugThread nop_post @@ -192,7 +192,7 @@ int videoV4L2::init_mmap (void) buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; buf.index = m_nbuffers; - debugPost("v4l2: buf.index==%d", buf.index); + debugPost("buf.index==%d", buf.index); if (-1 == xioctl (m_tvfd, VIDIOC_QUERYBUF, &buf)) { perror("[GEM:videoV4L2] VIDIOC_QUERYBUF"); @@ -244,7 +244,7 @@ void *videoV4L2 :: capturing(void) m_capturing=true; - debugThread("V4L2: memset"); + debugThread("memset", this); memset(&(buf), 0, sizeof (buf)); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; @@ -255,7 +255,7 @@ void *videoV4L2 :: capturing(void) FD_ZERO (&fds); FD_SET (m_tvfd, &fds); - debugThread("V4L2: grab"); + debugThread("grab", this); m_frame++; m_frame%=nbuf; @@ -265,7 +265,7 @@ void *videoV4L2 :: capturing(void) tv.tv_sec = 0; tv.tv_usec = 100; int r = select(0,0,0,0,&tv); - debugThread("V4L2: waited..."); + debugThread("waited...", this); if (-1 == r) { @@ -276,7 +276,7 @@ void *videoV4L2 :: capturing(void) } memset(&(buf), 0, sizeof (buf)); - debugThread("V4L2: memset..."); + debugThread("memset...", this); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; @@ -298,7 +298,7 @@ void *videoV4L2 :: capturing(void) } } - debugThread("V4L2: grabbed %d", buf.index); + debugThread("grabbed %d", this, buf.index); gotSize=buf.bytesused; currentBuffer=buffers[buf.index].start; @@ -309,7 +309,7 @@ void *videoV4L2 :: capturing(void) captureerror=true; } - debugThread("V4L2: dequeueued"); + debugThread("dequeueued", this); if(expectedSize<=gotSize) { m_frame_ready = 1; @@ -336,7 +336,7 @@ void *videoV4L2 :: capturing(void) // stop capturing m_capturing=false; - debugThread("V4L2: thread finished"); + debugThread("thread finished"); return NULL; } @@ -353,7 +353,7 @@ pixBlock *videoV4L2 :: getFrame() m_rendering=rendering; return NULL; } - //debugPost("v4l2: getting frame %d", m_frame_ready); + //debugPost("getting frame %d", m_frame_ready); m_image.newfilm=0; if (!m_frame_ready) { m_image.newimage = 0; @@ -461,7 +461,7 @@ bool videoV4L2 :: openDevice(gem::Properties&props) const char*dev_name=devname.c_str(); - debugPost("v4l2: device: %s", dev_name); + debugPost("device: %s", dev_name); // try to open the device m_tvfd = v4l2_open (dev_name, O_RDWR /* required */, 0); @@ -545,15 +545,15 @@ void videoV4L2 :: closeDevice() bool videoV4L2 :: restartTransfer() { bool rendering=m_rendering; - debugPost("v4l2: restart transfer"); + debugPost("restart transfer"); if(m_capturing) { stopTransfer(); } - debugPost("v4l2: restart stopped"); + debugPost("restart stopped"); if (rendering) { startTransfer(); } - debugPost("v4l2: restart started"); + debugPost("restart started"); return true; } @@ -567,11 +567,11 @@ bool videoV4L2 :: startTransfer() if(m_tvfd<0) { return false; } - debugPost("v4l2: startTransfer: %d", m_capturing); + debugPost("startTransfer: %d", m_capturing); if(m_capturing) { stopTransfer(); // just in case we are already running! } - debugPost("v4l2: start transfer"); + debugPost("start transfer"); m_stopTransfer=false; m_rendering=true; logpost(0, 3+1, "[GEM:videoV4L2] starting transfer"); @@ -637,19 +637,19 @@ bool videoV4L2 :: startTransfer() m_gotFormat=fmt.fmt.pix.pixelformat; switch(m_gotFormat) { case V4L2_PIX_FMT_RGB32: - debugPost("v4l2: ARGB"); + debugPost("ARGB"); break; case V4L2_PIX_FMT_RGB24: - debugPost("v4l2: RGB"); + debugPost("RGB"); break; case V4L2_PIX_FMT_UYVY: - debugPost("v4l2: YUV "); + debugPost("YUV "); break; case V4L2_PIX_FMT_GREY: - debugPost("v4l2: gray"); + debugPost("gray"); break; case V4L2_PIX_FMT_YUV420: - debugPost("v4l2: YUV 4:2:0"); + debugPost("YUV 4:2:0"); break; default: /* hmm, we don't know how to handle this @@ -732,7 +732,7 @@ bool videoV4L2 :: startTransfer() m_image.image.setFormat(m_reqFormat); m_image.image.reallocate(); - debugPost("v4l2: format: %c%c%c%c -> 0x%X", + debugPost("format: %c%c%c%c -> 0x%X", (char)(m_gotFormat), (char)(m_gotFormat>>8), (char)(m_gotFormat>>16), @@ -758,7 +758,7 @@ bool videoV4L2 :: startTransfer() m_colorConvert=true; } - debugPost("v4l2: colorconvert=%d", m_colorConvert); + debugPost("colorconvert=%d", m_colorConvert); /* create thread */ m_continue_thread = 1; @@ -766,17 +766,18 @@ bool videoV4L2 :: startTransfer() pthread_create(&m_thread_id, 0, capturing_, this); while(!m_capturing) { usleep(10); - debugPost("v4l2: waiting for thread to come up"); + debugPost("waiting for thread to come up"); } + debugPost("thread running"); logpost(0, 3+1, "[GEM:videoV4L2] Opened video connection 0x%X", m_tvfd); return(1); closit: - debugPost("v4l2: closing it!"); + debugPost("closing it!"); stopTransfer(); - debugPost("v4l2: closed it"); + debugPost("closed it"); return(0); } @@ -786,7 +787,7 @@ bool videoV4L2 :: startTransfer() ///////////////////////////////////////////////////////// bool videoV4L2 :: stopTransfer() { - debugPost("v4l2: stoptransfer"); + debugPost("stoptransfer: %d/%d", m_capturing, m_continue_thread); if(!m_capturing) { return false; } @@ -797,23 +798,24 @@ bool videoV4L2 :: stopTransfer() m_continue_thread = 0; pthread_join (m_thread_id, &dummy); } + debugPost("thread wait %d", m_capturing); while(m_capturing) { usleep(10); - debugPost("v4l2: waiting for thread to finish"); + debugPost("waiting for thread to finish"); } // unmap the mmap - debugPost("v4l2: unmapping %d buffers: %x", m_nbuffers, m_buffers); + debugPost("unmapping %d buffers: %x", m_nbuffers, m_buffers); if(m_buffers) { for (int i = 0; i < m_nbuffers; ++i) if (-1 == v4l2_munmap (m_buffers[i].start, m_buffers[i].length)) { // oops: couldn't unmap the memory } - debugPost("v4l2: freeing buffers: %x", m_buffers); + debugPost("freeing buffers: %x", m_buffers); free (m_buffers); } m_buffers=NULL; - debugPost("v4l2: freed"); + debugPost("freed"); // stop streaming if(m_tvfd) { @@ -823,12 +825,12 @@ bool videoV4L2 :: stopTransfer() } } - debugPost("v4l2: de-requesting buffers"); + debugPost("de-requesting buffers"); reqbufs(m_tvfd, 0); m_frame_ready = 0; m_rendering=false; - debugPost("v4l2: stoppedTransfer"); + debugPost("stoppedTransfer"); return true; } From 92089a6fff7bd5cb1bc79308359d990c1de39f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 17 Mar 2025 23:50:39 +0100 Subject: [PATCH 259/387] V4L2: exit if format could not be negotiated --- plugins/V4L2/videoV4L2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/V4L2/videoV4L2.cpp b/plugins/V4L2/videoV4L2.cpp index 351ebeee8..cb9fb184c 100644 --- a/plugins/V4L2/videoV4L2.cpp +++ b/plugins/V4L2/videoV4L2.cpp @@ -691,6 +691,7 @@ bool videoV4L2 :: startTransfer() (char)(m_gotFormat>>16), (char)(m_gotFormat>>24)); /* we should really return here! */ + goto closit; } logpost(0, 3+1, "[GEM:videoV4L2] got '%c%c%c%c'", From 212a8b9c1b9388c315e937b3b462a4f393c02629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 26 Mar 2025 15:49:37 +0100 Subject: [PATCH 260/387] properly pass a *pointer* to the old pixBlock Closes: https://github.com/umlaeute/Gem/issues/473 --- src/Pixes/pix_set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pixes/pix_set.cpp b/src/Pixes/pix_set.cpp index 48b285e91..b09caae0c 100644 --- a/src/Pixes/pix_set.cpp +++ b/src/Pixes/pix_set.cpp @@ -106,7 +106,7 @@ void pix_set :: startRendering() void pix_set :: postrender(GemState *state) { m_pixBlock.newimage = false; - state->set(GemState::_PIX,&m_pixels); + state->set(GemState::_PIX, m_pixels); } From 17efdee89ff1d4ffec8bd3cf83e19f30b6c0a53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 26 Mar 2025 15:51:13 +0100 Subject: [PATCH 261/387] consistent naming: m_pix -> m_pixBlock --- src/Pixes/pix_test.cpp | 60 +++++++++++++++++++++--------------------- src/Pixes/pix_test.h | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/Pixes/pix_test.cpp b/src/Pixes/pix_test.cpp index 14cb42dc6..45553e04f 100644 --- a/src/Pixes/pix_test.cpp +++ b/src/Pixes/pix_test.cpp @@ -259,13 +259,13 @@ void makeSMPTE_Grey(unsigned int cols, unsigned int rows, pix_test :: pix_test(int argc, t_atom*argv) : m_noise(true) { - m_pix.image.xsize=m_pix.image.ysize=128; + m_pixBlock.image.xsize=m_pixBlock.image.ysize=128; switch(argc) { case 0: break; case 1: if(A_FLOAT == argv->a_type && ((int)atom_getfloat(argv))>0) { - m_pix.image.xsize=m_pix.image.ysize=atom_getfloat(argv); + m_pixBlock.image.xsize=m_pixBlock.image.ysize=atom_getfloat(argv); } else { error("usage: pix_test ]"); } @@ -274,11 +274,11 @@ pix_test :: pix_test(int argc, t_atom*argv) if(A_FLOAT == argv[0].a_type && A_FLOAT == argv[1].a_type) { int i = atom_getfloat(argv); if(i>0) { - m_pix.image.xsize = i; + m_pixBlock.image.xsize = i; } i = atom_getfloat(argv+1); if(i>0) { - m_pix.image.ysize = i; + m_pixBlock.image.ysize = i; } } else { error("usage: pix_test [ ]"); @@ -289,14 +289,14 @@ pix_test :: pix_test(int argc, t_atom*argv) break; } - m_pix.image.setFormat(GEM_RGBA); - m_pix.image.reallocate(); + m_pixBlock.image.setFormat(GEM_RGBA); + m_pixBlock.image.reallocate(); } pix_test :: pix_test() { - m_pix.image.xsize=m_pix.image.ysize=128; - m_pix.image.setFormat(GEM_RGBA); - m_pix.image.reallocate(); + m_pixBlock.image.xsize=m_pixBlock.image.ysize=128; + m_pixBlock.image.setFormat(GEM_RGBA); + m_pixBlock.image.reallocate(); } ///////////////////////////////////////////////////////// @@ -314,31 +314,31 @@ void pix_test :: render(GemState*state) { bool noise = m_noise; float scale=1.; - int rows=m_pix.image.xsize; - int cols=m_pix.image.ysize; + int rows=m_pixBlock.image.xsize; + int cols=m_pixBlock.image.ysize; int datasize; - unsigned char* data=m_pix.image.data; - switch (m_pix.image.format) { + unsigned char* data=m_pixBlock.image.data; + switch (m_pixBlock.image.format) { case GEM_RGBA: - makeSMPTE_RGBA(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_RGBA(m_pixBlock.image.xsize, m_pixBlock.image.ysize, m_pixBlock.image.data, scale, noise); break; case GEM_RGB: - makeSMPTE_RGB(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_RGB(m_pixBlock.image.xsize, m_pixBlock.image.ysize, m_pixBlock.image.data, scale, noise); break; case GEM_YUV: - makeSMPTE_YUV(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_YUV(m_pixBlock.image.xsize, m_pixBlock.image.ysize, m_pixBlock.image.data, scale, noise); break; case GEM_GRAY: - makeSMPTE_Grey(m_pix.image.xsize, m_pix.image.ysize, m_pix.image.data, + makeSMPTE_Grey(m_pixBlock.image.xsize, m_pixBlock.image.ysize, m_pixBlock.image.data, scale, noise); break; } - //post("image=%d\tfilm=%d", m_pix.newimage,m_pix.newfilm); - m_pix.newimage=true; - state->set(GemState::_PIX, &m_pix); + //post("image=%d\tfilm=%d", m_pixBlock.newimage,m_pixBlock.newfilm); + m_pixBlock.newimage=true; + state->set(GemState::_PIX, &m_pixBlock); } @@ -373,25 +373,25 @@ void pix_test :: csMess(std::string cs) cs.c_str()); return; } - m_pix.image.setFormat(fmt); - dimenMess(m_pix.image.xsize, m_pix.image.ysize); + m_pixBlock.image.setFormat(fmt); + dimenMess(m_pixBlock.image.xsize, m_pixBlock.image.ysize); } void pix_test :: postrender(GemState *state) { - m_pix.newimage = false; - m_pix.newfilm = false; + m_pixBlock.newimage = false; + m_pixBlock.newfilm = false; state->set(GemState::_PIX, static_cast(0)); } void pix_test :: dimenMess(unsigned int w, unsigned int h) { - m_pix.image.xsize=w; - m_pix.image.ysize=h; - if(GEM_YUV == m_pix.image.format && m_pix.image.xsize%2) - m_pix.image.xsize+=1; - m_pix.image.reallocate(); - m_pix.newfilm=true; + m_pixBlock.image.xsize=w; + m_pixBlock.image.ysize=h; + if(GEM_YUV == m_pixBlock.image.format && m_pixBlock.image.xsize%2) + m_pixBlock.image.xsize+=1; + m_pixBlock.image.reallocate(); + m_pixBlock.newfilm=true; } void pix_test :: noiseMess(bool noise) { m_noise = noise; diff --git a/src/Pixes/pix_test.h b/src/Pixes/pix_test.h index 376d618e7..5254ece50 100644 --- a/src/Pixes/pix_test.h +++ b/src/Pixes/pix_test.h @@ -57,7 +57,7 @@ class GEM_EXTERN pix_test : public GemPixObj virtual void render(GemState*); virtual void postrender(GemState*); - pixBlock m_pix; + pixBlock m_pixBlock; void dimenMess(unsigned int, unsigned int); void csMess(std::string); From b79ceb685f01f146264e2111eafa4954f31ce513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 26 Mar 2025 15:59:50 +0100 Subject: [PATCH 262/387] whitespace --- src/Pixes/pix_multiimage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pixes/pix_multiimage.h b/src/Pixes/pix_multiimage.h index 455a3b32e..3b85b27f2 100644 --- a/src/Pixes/pix_multiimage.h +++ b/src/Pixes/pix_multiimage.h @@ -68,7 +68,7 @@ class GEM_EXTERN pix_multiimage : public GemBase int refCount; multiImageCache *next; imageStruct **images; - unsigned int *textBind; + unsigned int *textBind; int numImages; char *imageName; int baseImage; From 6d6b3f58426d7a2ac27197901840a74533eef6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 20 Mar 2025 13:36:15 +0100 Subject: [PATCH 263/387] replace AC_HELP_STRING with AS_HELP_STRING --- configure.ac | 8 ++++---- m4/gem.m4 | 36 ++++++++++++++++++++---------------- plugins/HALCON/halcon.m4 | 4 ++-- plugins/PYLON/pylon.m4 | 2 +- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index bc598688a..d4de9246a 100644 --- a/configure.ac +++ b/configure.ac @@ -187,7 +187,7 @@ AS_CASE([$enable_debug], ]) -AC_ARG_WITH([GLU], AC_HELP_STRING([--without-GLU], [force building without GLU (*not* recommended!)])) +AC_ARG_WITH([GLU], AS_HELP_STRING([--without-GLU], [force building without GLU (*not* recommended!)])) GEM_ARG_ENABLE([mmx], [MMX-support]) dnl disabled SSE2 by default, since there are still few chips around that fully support it dnl unlike MMX or SSE @@ -210,7 +210,7 @@ GEM_TARGET(openGL) GEM_TARGET_DISABLED(Vertex) GEM_ARG_ENABLE([plugins], [configure/build/install optional parts]) -AC_ARG_ENABLE([experimental], AC_HELP_STRING([--enable-experimental], [enable experimental objects (if any)])) +AC_ARG_ENABLE([experimental], AS_HELP_STRING([--enable-experimental], [enable experimental objects (if any)])) AM_CONDITIONAL(EXPERIMENTAL, [test "x$enable_experimental" = "xyes"]) @@ -601,7 +601,7 @@ AC_SUBST([GEM_DECKLINK_USE_DLOPEN]) # NDI-support AC_ARG_WITH([ndi], - AC_HELP_STRING([--with-ndi=], + AS_HELP_STRING([--with-ndi=], [enable NDI video capturing (use 'local' to use an embedded copy of the SDK)])) have_ndi="no" @@ -735,7 +735,7 @@ AC_CONFIG_FILES([abstractions/gemdefaultwindow.pd]) ## allow us to override the build date string AC_ARG_WITH([build-date], - AC_HELP_STRING([--with-build-date=], + AS_HELP_STRING([--with-build-date=], [alternative date string])) AC_MSG_CHECKING([build-date]) AS_IF([test "x$with_build_date" = "xyes" ],[with_build_date=""]) diff --git a/m4/gem.m4 b/m4/gem.m4 index f12c2c3ee..17e1cab49 100644 --- a/m4/gem.m4 +++ b/m4/gem.m4 @@ -9,7 +9,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([GEM_ARG_WITH], [ AC_ARG_WITH([$1], - AC_HELP_STRING([--without-$1], [disable $1-lib ($2)]),,[ + AS_HELP_STRING([--without-$1], [disable $1-lib ($2)]),,[ AS_IF([ test "x$3" != "x" ], [ with_$1="yes" ]) ]) AS_IF([ test "x${with_$1}" = "x" ], [ with_$1="${with_ALL}" ]) @@ -18,7 +18,7 @@ AC_DEFUN([GEM_ARG_WITH], # inverse of GEM_ARG_WITH AC_DEFUN([GEM_ARG_WITHOUT], [AC_ARG_WITH([$1], - AC_HELP_STRING([--with-$1], [enable $1-lib ($2)]),,[ + AS_HELP_STRING([--with-$1], [enable $1-lib ($2)]),,[ AS_IF([ test "x$3" = "xforce" ], [ with_$1="no" ]) ]) ])# GEM_ARG_WITHOUT @@ -26,7 +26,7 @@ AC_DEFUN([GEM_ARG_WITHOUT], # same as GEM_ARG_WITH but with "enable" AC_DEFUN([GEM_ARG_ENABLE], [AC_ARG_ENABLE([$1], - AC_HELP_STRING([--disable-$1], [disable $1 ($2)]), + AS_HELP_STRING([--disable-$1], [disable $1 ($2)]), , [enable_$1="yes"]) ])# GEM_ARG_ENABLE @@ -34,7 +34,7 @@ AC_DEFUN([GEM_ARG_ENABLE], # inverse of GEM_ARG_ENABLE AC_DEFUN([GEM_ARG_DISABLE], [AC_ARG_ENABLE([$1], - AC_HELP_STRING([--enable-$1], [enable $1 ($2)]), + AS_HELP_STRING([--enable-$1], [enable $1 ($2)]), , [enable_$1="no"]) ])# GEM_ARG_DISABLE @@ -46,7 +46,7 @@ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], AC_CONFIG_FILES([src/$1/Makefile]) AC_ARG_ENABLE([$1], - AC_HELP_STRING([--disable-$1], [disable $1-objects]), + AS_HELP_STRING([--disable-$1], [disable $1-objects]), [ AS_IF([ test "x$enableval" != "xno" ], [ AC_MSG_RESULT([building Gem with $1-objects]) @@ -70,7 +70,7 @@ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], AC_CONFIG_FILES([src/$1/Makefile]) AC_ARG_ENABLE([$1], - AC_HELP_STRING([--enable-$1], [enable $1-objects]), + AS_HELP_STRING([--enable-$1], [enable $1-objects]), [ AS_IF([ test "x$enableval" != "xyes" ], [ AC_MSG_RESULT([building Gem without $1-objects]) @@ -110,15 +110,19 @@ AC_DEFUN([GEM_CHECK_LIB], AC_SUBST(GEM_LIB_[]NAME[]_CFLAGS) AC_SUBST(GEM_LIB_[]NAME[]_LIBS) -AC_ARG_WITH([Name], - AC_HELP_STRING([--without-[]Name], [disable Name ($8)])) +AS_IF([ test "$9" = "no"], +[AC_ARG_WITH([Name], + AS_HELP_STRING([--with-[]Name], [disable Name ($8)]))], +[AC_ARG_WITH([Name], + AS_HELP_STRING([--without-[]Name], [disable Name ($8)]))] +) AC_ARG_WITH([]Name-CFLAGS, - AC_HELP_STRING([--with-[]Name-CFLAGS="-I/path/to/[]Name/include/"], [compiler flags for Name])) + AS_HELP_STRING([--with-[]Name-CFLAGS="-I/path/to/[]Name/include/"], [compiler flags for Name])) AC_ARG_WITH([]Name-LIBS, - AC_HELP_STRING([--with-[]Name-LIBS="-L/path/to/[]Name/lib/ -l$2"], [linker flags for Name])) + AS_HELP_STRING([--with-[]Name-LIBS="-L/path/to/[]Name/lib/ -l$2"], [linker flags for Name])) - AS_IF([ test "x$with_[]Name" = "x" ], [ with_[]Name="$9" ]) - AS_IF([ test "x$with_[]Name" = "x" ], [ with_[]Name="$with_ALL" ]) +AS_IF([ test "x$with_[]Name" = "x" ], [ with_[]Name="$with_ALL" ]) +AS_IF([ test "x$with_[]Name" = "x" ], [ with_[]Name="$9" ]) tmp_gem_check_lib_cppflags="$CPPFLAGS" tmp_gem_check_lib_cflags="$CFLAGS" @@ -354,11 +358,11 @@ AC_DEFUN([GEM_CHECK_FRAMEWORK], AC_SUBST(GEM_FRAMEWORK_[]NAME[]_LIBS) AC_ARG_WITH([]Name[]-framework, - AC_HELP_STRING([--without-[]Name[]-framework], [disable Name-framework])) + AS_HELP_STRING([--without-[]Name[]-framework], [disable Name-framework])) AC_ARG_WITH([]Name[]-framework-CFLAGS, - AC_HELP_STRING([--with-[]Name[]-framework-CFLAGS="-I/path/to/[]Name/include/"], [compiler flags for Name-framework])) + AS_HELP_STRING([--with-[]Name[]-framework-CFLAGS="-I/path/to/[]Name/include/"], [compiler flags for Name-framework])) AC_ARG_WITH([]Name[]-framework-LIBS, - AC_HELP_STRING([--with-[]Name[]-framework-LIBS="-L/path/to/[]Name/lib/ -l$2"], [linker flags for Name-framework])) + AS_HELP_STRING([--with-[]Name[]-framework-LIBS="-L/path/to/[]Name/lib/ -l$2"], [linker flags for Name-framework])) AS_IF([ test "x$with_[]Name[]_framework" = "x" ], [ with_[]Name="$with_ALL" ]) @@ -522,7 +526,7 @@ GEM_RTE="Pure Data" AC_ARG_WITH([floatsize], - AC_HELP_STRING([--with-floatsize=], + AS_HELP_STRING([--with-floatsize=], [use a given floatsize (32, 64)])) AC_MSG_CHECKING([floatsize]) tmp_rte_pd="pd${with_floatsize}" diff --git a/plugins/HALCON/halcon.m4 b/plugins/HALCON/halcon.m4 index c0d2651c0..75ce82409 100644 --- a/plugins/HALCON/halcon.m4 +++ b/plugins/HALCON/halcon.m4 @@ -12,9 +12,9 @@ AC_DEFUN([GEM_CHECK_HALCON], AC_ARG_VAR([HALCONROOT], [root-directory where you installed HALCON (override this with '--with-halcon=${HALCONROOT}'])dnl AC_ARG_VAR([HALCONARCH], [architecture for you HALCON-installation (e.g. 'x86-linux2.4-gcc40'])dnl AC_ARG_WITH([halcon], - AC_HELP_STRING([--with-halcon], [enable HALCON video capturing (overrides $HALCONROOT)])) + AS_HELP_STRING([--with-halcon], [enable HALCON video capturing (overrides $HALCONROOT)])) AC_ARG_WITH([halconarch], - AC_HELP_STRING([--with-halconarch], [set halcon-arch (overrides $HALCONARCH])) + AS_HELP_STRING([--with-halconarch], [set halcon-arch (overrides $HALCONARCH])) have_halcon="no" if test "x$with_halcon" != "xno"; then diff --git a/plugins/PYLON/pylon.m4 b/plugins/PYLON/pylon.m4 index 1089c22ad..295cf163e 100644 --- a/plugins/PYLON/pylon.m4 +++ b/plugins/PYLON/pylon.m4 @@ -11,7 +11,7 @@ AC_DEFUN([GEM_CHECK_PYLON], [ AC_ARG_VAR([PYLON_ROOT], [root-directory where you installed PYLON (override this with '--with-pylon=${PYLON_ROOT}'])dnl AC_ARG_WITH([pylon], - AC_HELP_STRING([--with-pylon], [enable PYLON video capturing (overrides $PYLON_ROOT)])) + AS_HELP_STRING([--with-pylon], [enable PYLON video capturing (overrides $PYLON_ROOT)])) tmp_pylon_rpath="" have_pylon="no" From e6cc2241b9882c62b3527defc10e0b468b8cc993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 08:56:11 +0100 Subject: [PATCH 264/387] GemBase: use private date into PIMPL --- src/Base/GemBase.cpp | 61 ++++++++++++++++++++++++++++---------------- src/Base/GemBase.h | 7 ++--- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/src/Base/GemBase.cpp b/src/Base/GemBase.cpp index 594b99a65..0ca42a4ad 100644 --- a/src/Base/GemBase.cpp +++ b/src/Base/GemBase.cpp @@ -60,6 +60,23 @@ #include "GemBase.h" #include "Gem/Cache.h" +struct GemBase::PIMPL { + + /* whether the object is internally disabled or not + * objects are to be disabled, if the system cannot make use of them, e.g. because of unsupported openGL features + */ + gem::ContextDataenabled; + gem::ContextDatastate; + PIMPL(void) + : enabled(true) + , state(INIT) + { } + PIMPL(PIMPL *p) + : enabled(p->enabled) + , state(p->state) + { } +}; + ///////////////////////////////////////////////////////// // // GemBase @@ -69,9 +86,9 @@ // ///////////////////////////////////////////////////////// GemBase :: GemBase(void) - : gem_amRendering(false), m_cache(NULL), m_modified(true), - m_out1(NULL), - m_enabled(true), m_state(INIT) + : gem_amRendering(false), m_cache(NULL), m_modified(true) + , m_out1(NULL) + , m_pimpl(new PIMPL()) { m_out1 = outlet_new(this->x_obj, 0); pd_bind(&this->x_obj->ob_pd, gensym("__gemBase")); @@ -103,15 +120,15 @@ void GemBase :: gem_startstopMess(int state) // for now, this is important, as it is the only way to call the stopRendering #if 1 if (state && !gem_amRendering) { - m_enabled = isRunnable(); - if(m_enabled) { + m_pimpl->enabled = isRunnable(); + if(m_pimpl->enabled) { startRendering(); - m_state=RENDERING; + m_pimpl->state=RENDERING; } } else if (!state && gem_amRendering) { - if(m_enabled) { + if(m_pimpl->enabled) { stopRendering(); - m_state=ENABLED; + m_pimpl->state=ENABLED; } } @@ -138,22 +155,22 @@ void GemBase :: gem_renderMess(GemCache* cache, GemState*state) if(m_cache && m_cache->m_magic!=GEMCACHE_MAGIC) { m_cache=NULL; } - if(INIT==m_state) { + if(INIT==m_pimpl->state) { if(isRunnable()) { - m_state=ENABLED; + m_pimpl->state=ENABLED; } else { - m_state=DISABLED; + m_pimpl->state=DISABLED; } } - if(MODIFIED==m_state) { + if(MODIFIED==m_pimpl->state) { stopRendering(); - m_state=ENABLED; + m_pimpl->state=ENABLED; } - if(ENABLED==m_state) { + if(ENABLED==m_pimpl->state) { startRendering(); - m_state=RENDERING; + m_pimpl->state=RENDERING; } - if(RENDERING==m_state) { + if(RENDERING==m_pimpl->state) { gem_amRendering=true; if(state) { render(state); @@ -191,12 +208,12 @@ void GemBase :: setModified(void) m_cache->dirty = true; } m_modified=true; - switch(m_state) { + switch(m_pimpl->state) { case DISABLED: case INIT: break; default: - m_state=MODIFIED; + m_pimpl->state=MODIFIED; } } @@ -210,7 +227,7 @@ void GemBase :: realStopRendering(void) post("realStopRendering() called...please report this to the upstream developers"); stopRendering(); m_cache = NULL; - m_state=ENABLED; + m_pimpl->state=ENABLED; } @@ -226,7 +243,7 @@ bool GemBase :: isRunnable(void) enum GemBase::RenderState GemBase::getState(void) { - return m_state; + return m_pimpl->state; } #include "Base/GemWindow.h" @@ -255,10 +272,10 @@ void GemBase :: obj_setupCallback(t_class *classPtr) GemBase*obj=GetMyClass(data); bool state=(bool)v0; if(!state && obj->gem_amRendering) { - if(obj->m_enabled) { + if(obj->m_pimpl->enabled) { //obj->post("stop rendering"); obj->stopRendering(); - obj->m_state=obj->ENABLED; + obj->m_pimpl->state=obj->ENABLED; } } obj->gem_amRendering=(!state); diff --git a/src/Base/GemBase.h b/src/Base/GemBase.h index 0e4799127..2d32af13a 100644 --- a/src/Base/GemBase.h +++ b/src/Base/GemBase.h @@ -128,11 +128,8 @@ class GEM_EXTERN GemBase : public CPPExtern static void obj_setupCallback(t_class *classPtr); static void gem_MessCallback(void *, t_symbol*,int, t_atom*); - /* whether the object is internally disabled or not - * objects are to be disabled, if the system cannot make use of them, e.g. because of unsupported openGL features - */ - gem::ContextDatam_enabled; - gem::ContextDatam_state; + class PIMPL; + PIMPL*m_pimpl; protected: enum RenderState getState(void); From eec13a7b2379d20aefeab0dea303a0e905aa1d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 09:09:07 +0100 Subject: [PATCH 265/387] remove GemBase::gem_MessCallback() from header --- src/Base/GemBase.cpp | 42 +++++++++++++++++++++++------------------- src/Base/GemBase.h | 1 - 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/Base/GemBase.cpp b/src/Base/GemBase.cpp index 0ca42a4ad..94154d398 100644 --- a/src/Base/GemBase.cpp +++ b/src/Base/GemBase.cpp @@ -263,9 +263,29 @@ void GemBase::beforeDeletion(void) ///////////////////////////////////////////////////////// void GemBase :: obj_setupCallback(t_class *classPtr) { - class_addmethod(classPtr, - reinterpret_cast(&GemBase::gem_MessCallback), - gensym("gem_state"), A_GIMME, A_NULL); + struct _CallbackClass_gemState { + static void callback(void *data, t_symbol* s, int argc, t_atom *argv) + { + if (argc==2 && argv->a_type==A_POINTER && (argv+1)->a_type==A_POINTER) { + GetMyClass(data)->gem_renderMess( + reinterpret_cast(argv->a_w.w_gpointer), + reinterpret_cast((argv+1)->a_w.w_gpointer)); +#if 1 + } else if (argc==1 && argv->a_type==A_FLOAT) { + GetMyClass(data)->gem_startstopMess(atom_getint(argv)); // start rendering (forget this !?) +#endif + } else { + GetMyClass(data)->error("wrong arguments in GemTrigger..."); + } + } + explicit _CallbackClass_gemState (struct _class*c) + { + class_addmethod(c, reinterpret_cast(callback), + gensym("gem_state"), A_GIMME, A_NULL); + } + }; + _CallbackClass_gemState _CallbackClassInstance_gemState (classPtr); + struct _CallbackClass_gemContext { static void callback(void*data, t_float v0) { @@ -289,19 +309,3 @@ void GemBase :: obj_setupCallback(t_class *classPtr) _CallbackClass_gemContext _CallbackClassInstance_gemContext (classPtr); } -void GemBase :: gem_MessCallback(void *data, t_symbol* s, int argc, - t_atom *argv) -{ - if (argc==2 && argv->a_type==A_POINTER && (argv+1)->a_type==A_POINTER) { - GetMyClass(data)->gem_renderMess( - reinterpret_cast(argv->a_w.w_gpointer), - reinterpret_cast((argv+1)->a_w.w_gpointer)); -#if 1 - } else if (argc==1 && argv->a_type==A_FLOAT) { - GetMyClass(data)->gem_startstopMess(atom_getint( - argv)); // start rendering (forget this !?) -#endif - } else { - GetMyClass(data)->error("wrong arguments in GemTrigger..."); - } -} diff --git a/src/Base/GemBase.h b/src/Base/GemBase.h index 2d32af13a..a674c4185 100644 --- a/src/Base/GemBase.h +++ b/src/Base/GemBase.h @@ -126,7 +126,6 @@ class GEM_EXTERN GemBase : public CPPExtern friend class gemhead; static void obj_setupCallback(t_class *classPtr); - static void gem_MessCallback(void *, t_symbol*,int, t_atom*); class PIMPL; PIMPL*m_pimpl; From d6c471a24264f16793a103a9dddb8cab9397fb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 09:12:26 +0100 Subject: [PATCH 266/387] GemBase: reference to parent in PIMPL --- src/Base/GemBase.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Base/GemBase.cpp b/src/Base/GemBase.cpp index 94154d398..5e32118ec 100644 --- a/src/Base/GemBase.cpp +++ b/src/Base/GemBase.cpp @@ -65,14 +65,17 @@ struct GemBase::PIMPL { /* whether the object is internally disabled or not * objects are to be disabled, if the system cannot make use of them, e.g. because of unsupported openGL features */ + GemBase *parent; gem::ContextDataenabled; gem::ContextDatastate; - PIMPL(void) - : enabled(true) + PIMPL(GemBase *_parent) + : parent(_parent) + , enabled(true) , state(INIT) { } PIMPL(PIMPL *p) - : enabled(p->enabled) + : parent(p->parent) + , enabled(p->enabled) , state(p->state) { } }; @@ -88,7 +91,7 @@ struct GemBase::PIMPL { GemBase :: GemBase(void) : gem_amRendering(false), m_cache(NULL), m_modified(true) , m_out1(NULL) - , m_pimpl(new PIMPL()) + , m_pimpl(new PIMPL(this)) { m_out1 = outlet_new(this->x_obj, 0); pd_bind(&this->x_obj->ob_pd, gensym("__gemBase")); From 4958c44688a6dadc98e7e6491c967342de42200a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 09:41:40 +0100 Subject: [PATCH 267/387] glErrorString() helpers --- src/Utils/GLUtil.cpp | 23 +++++++++++++++++------ src/Utils/GLUtil.h | 9 +++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/Utils/GLUtil.cpp b/src/Utils/GLUtil.cpp index 880cc6d5e..dacc94032 100644 --- a/src/Utils/GLUtil.cpp +++ b/src/Utils/GLUtil.cpp @@ -71,18 +71,29 @@ static const char* _gemglErrorString(GLenum err) { } }; +const char* gem::utils::gl::glErrorString(GLenum err) { +#ifdef GEM_HAVE_GLU + return (const char*)gluErrorString(err); +#else + return _gemglErrorString(err)); +#endif +} + + +const char* gem::utils::gl::glErrorString(void) { + GLenum err = glGetError(); + if(err != GL_NO_ERROR) + return gem::utils::gl::glErrorString(err); + return 0; +} // if error dump gl errors to debugger string, return error GLenum gem::utils::gl::glReportError (bool verbose) { GLenum err = glGetError(); if (verbose && GL_NO_ERROR != err) { -#ifdef GEM_HAVE_GLU - post("GL[0x%X]: %s", err, (char*)gluErrorString(err)); -#else - post("GL[0x%X]: %s", err, _gemglErrorString(err)); -#endif - + const char *errStr = gem::utils::gl::glErrorString(err); + post("GL[0x%X]: %s", err, errStr); } // ensure we are returning an OSStatus noErr if no error condition if (err == GL_NO_ERROR) { diff --git a/src/Utils/GLUtil.h b/src/Utils/GLUtil.h index ae63fe66b..c29edaefb 100644 --- a/src/Utils/GLUtil.h +++ b/src/Utils/GLUtil.h @@ -36,7 +36,16 @@ namespace utils { namespace gl { + /* returns a string representation for the given error. + * no error (GL_NO_ERROR) might return a string saying so + */ + GEM_EXTERN const char* glErrorString(GLenum err); + /* checks if there's a pending openGL error, and returns the error description if fo + * returns NULL if there's no error + */ + GEM_EXTERN const char* glErrorString(void); GEM_EXTERN extern GLenum glReportError (bool verbose=true); + GEM_EXTERN extern int getGLdefine(const char *name); GEM_EXTERN extern int getGLdefine(const struct _symbol *name); GEM_EXTERN extern int getGLdefine(const struct _atom *name); From d7b7b9bd91fe650e3dc0fa4325e7e7cb97d42ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 11:58:08 +0100 Subject: [PATCH 268/387] whitespace --- src/Gem/Manager.h | 173 ++++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 90 deletions(-) diff --git a/src/Gem/Manager.h b/src/Gem/Manager.h index 651980b17..9e7ba1388 100644 --- a/src/Gem/Manager.h +++ b/src/Gem/Manager.h @@ -50,75 +50,75 @@ class GEM_EXTERN GemMan ////////// // Should only be called once (usually by GemSetup) - static void initGem(void); + static void initGem(void); ////////// - static void addObj(gemhead *obj, float priority); + static void addObj(gemhead *obj, float priority); ////////// - static void removeObj(gemhead *obj, float priority); + static void removeObj(gemhead *obj, float priority); ////////// // Is there a window. - static int windowExists(void); + static int windowExists(void); ////////// // Are we rendering. - static int getRenderState(void); + static int getRenderState(void); ////////// // is there a context (has its meaning under X) - static void createContext(const char* disp); - static int contextExists(void); + static void createContext(const char* disp); + static int contextExists(void); ////////// // If an object needs to know if the window changed. // This is important for display lists. - static int windowNumber(void); + static int windowNumber(void); ////////// // reset to the initial state - static void resetState(void); + static void resetState(void); ////////// // Just send out one frame (if double buffered, will swap buffers) - static void render(void *); + static void render(void *); - static void renderChain(struct _symbol *head, bool start); - static void renderChain(struct _symbol *head, GemState *state); + static void renderChain(struct _symbol *head, bool start); + static void renderChain(struct _symbol *head, GemState *state); ////////// // Start a clock to do rendering. - static void startRendering(void); + static void startRendering(void); ////////// // Stop the clock to do rendering. - static void stopRendering(void); + static void stopRendering(void); ////////// // Create the window with the current parameters - static int createWindow(const char* disp = 0); + static int createWindow(const char* disp = 0); ////////// // Destroy the window - static void destroyWindow(void); + static void destroyWindow(void); // Destroy the window after a minimal delay - static void destroyWindowSoon(void); + static void destroyWindowSoon(void); ////////// // Swap the buffers. // If single buffered, just clears the window - static void swapBuffers(void); + static void swapBuffers(void); ////////// // Set the frame rate - static void frameRate(float framespersecond); + static void frameRate(float framespersecond); ////////// // Get the frame rate - static float getFramerate(void); + static float getFramerate(void); - static int getProfileLevel(void); + static int getProfileLevel(void); static void getDimen(int*width, int*height); static void getRealDimen(int*width, int*height); @@ -127,84 +127,79 @@ class GEM_EXTERN GemMan ////////// // Turn on/off lighting - static void lightingOnOff(int state); + static void lightingOnOff(int state); ////////// // Turn on/off cursor - static void cursorOnOff(int state); + static void cursorOnOff(int state); ////////// // Turn on/off topmost position - static void topmostOnOff(int state); + static void topmostOnOff(int state); ////////// // Request a lighting value - it is yours until you free it. // The return can be 0, in which there are too many lights // [in] specific - If you want a specific light. == 0 means that you don't care. - static GLenum requestLight(int specific = 0); + static GLenum requestLight(int specific = 0); ////////// // Free a lighting value - static void freeLight(GLenum lightNum); + static void freeLight(GLenum lightNum); ////////// // Print out information - static void printInfo(void); + static void printInfo(void); ////////// - static void fillGemState(GemState &); + static void fillGemState(GemState &); - static int texture_rectangle_supported; + static int texture_rectangle_supported; enum GemStackId { STACKMODELVIEW, STACKCOLOR, STACKTEXTURE, STACKPROJECTION }; - static GLint maxStackDepth[4]; // for push/pop of matrix-stacks + static GLint maxStackDepth[4]; // for push/pop of matrix-stacks - static float m_perspect[6]; // values for the perspective matrix - static float m_lookat[9]; // values for the lookat matrix + static float m_perspect[6]; // values for the perspective matrix + static float m_lookat[9]; // values for the lookat matrix // LATER make this private (right now it is needed in gem2pdp) - static int m_buffer; // single(1) or double(2) + static int m_buffer; // single(1) or double(2) private: ////////// // computer and window information - static std::string m_title; // title to be displayed - static int m_fullscreen; // fullscreen (1) or not (0!) - static int - m_menuBar; // hide (0), show(1), hide but autoshow(-1) - static int m_secondscreen; // set the second screen - static int m_height; // window height - static int m_width; // window width - static int - m_w; // the real window width (reported by gemCreateWindow()) - static int m_h; // the real window height - static int m_xoffset; // window offset (x) - static int m_yoffset; // window offset (y) - - static int m_border; // window border - static int m_stereo; // stereoscopic - - static int - m_profile; // off(0), on(1), w/o image caching(2) - static int m_rendering; - - static float m_fog; // fog density - enum FOG_TYPE - { FOG_OFF = 0, FOG_LINEAR, FOG_EXP, FOG_EXP2 }; - static FOG_TYPE m_fogMode; // what kind of fog we have - static GLfloat m_fogColor[4]; // colour of the fog - static float m_fogStart; // start of the linear fog - static float m_fogEnd; // start of the linear fog - - static float - m_motionBlur; // motion-blur factor in double-buffer mode - - static float fps; - static int fsaa; - static bool pleaseDestroy; + static std::string m_title; // title to be displayed + static int m_fullscreen; // fullscreen (1) or not (0!) + static int m_menuBar; // hide (0), show(1), hide but autoshow(-1) + static int m_secondscreen; // set the second screen + static int m_height; // window height + static int m_width; // window width + static int m_w; // the real window width (reported by gemCreateWindow()) + static int m_h; // the real window height + static int m_xoffset; // window offset (x) + static int m_yoffset; // window offset (y) + + static int m_border; // window border + static int m_stereo; // stereoscopic + + static int m_profile; // off(0), on(1), w/o image caching(2) + static int m_rendering; + + static float m_fog; // fog density + enum FOG_TYPE { FOG_OFF = 0, FOG_LINEAR, FOG_EXP, FOG_EXP2 }; + static FOG_TYPE m_fogMode; // what kind of fog we have + static GLfloat m_fogColor[4]; // colour of the fog + static float m_fogStart; // start of the linear fog + static float m_fogEnd; // start of the linear fog + + static float m_motionBlur; // motion-blur factor in double-buffer mode + + static float fps; + static int fsaa; + static bool pleaseDestroy; #ifndef GEM_MULTICONTEXT ////////// @@ -212,44 +207,42 @@ class GEM_EXTERN GemMan // This is current rendering window information // The window is created and destroyed by the user, so // if there is no window, this will contain NULL pointers. - static WindowInfo &getWindowInfo(void); + static WindowInfo &getWindowInfo(void); ////////// // Changing these variables is likely to crash GEM // This is constant rendering window information // This window is always available (although not visible) - static WindowInfo &getConstWindowInfo(void); + static WindowInfo &getConstWindowInfo(void); #endif /* GEM_MULTICONTEXT */ - static int createConstWindow(const char* disp = 0); + static int createConstWindow(const char* disp = 0); // gemwin is allowed to modifying "global" window attributes friend class gemwin; friend class gem::Context; - static GLfloat m_clear_color[4]; // the frame buffer clear - static GLbitfield m_clear_mask; // the clear bitmask - static GLfloat m_mat_ambient[4]; // default ambient material - static GLfloat m_mat_specular[4]; // default specular material - static GLfloat m_mat_shininess; // default shininess material + static GLfloat m_clear_color[4]; // the frame buffer clear + static GLbitfield m_clear_mask; // the clear bitmask + static GLfloat m_mat_ambient[4]; // default ambient material + static GLfloat m_mat_specular[4]; // default specular material + static GLfloat m_mat_shininess; // default shininess material - static GLfloat m_stereoSep; // stereo separation - static GLfloat m_stereoFocal; // distance to focal point - static bool - m_stereoLine; // draw a line between 2 stereo-screens + static GLfloat m_stereoSep; // stereo separation + static GLfloat m_stereoFocal; // distance to focal point + static bool m_stereoLine; // draw a line between 2 stereo-screens - static double - m_lastRenderTime; // the time of the last rendered frame + static double m_lastRenderTime; // the time of the last rendered frame // gemwin should not touch the following member variables and member functions - static int m_windowState; - static int m_windowNumber; - static int m_windowContext; - static int m_cursor; - static int m_topmost; - - static void windowInit(void); - static void windowCleanup(void); - static void resetValues(void); + static int m_windowState; + static int m_windowNumber; + static int m_windowContext; + static int m_cursor; + static int m_topmost; + + static void windowInit(void); + static void windowCleanup(void); + static void resetValues(void); static void resizeCallback(int xsize, int ysize, void*); static void dispatchWinmessCallback(void *owner); From 2fd9f4f8069ef1f7e7f12a470a2221208ea04ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 12:00:13 +0100 Subject: [PATCH 269/387] per-object "debugGL" message to track down openGL errors Related: https://github.com/umlaeute/Gem/issues/475 --- src/Base/GemBase.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/Base/GemBase.cpp b/src/Base/GemBase.cpp index 5e32118ec..380f20571 100644 --- a/src/Base/GemBase.cpp +++ b/src/Base/GemBase.cpp @@ -59,6 +59,7 @@ #include "GemBase.h" #include "Gem/Cache.h" +#include "Utils/GLUtil.h" struct GemBase::PIMPL { @@ -68,16 +69,26 @@ struct GemBase::PIMPL { GemBase *parent; gem::ContextDataenabled; gem::ContextDatastate; + bool debugGL; PIMPL(GemBase *_parent) : parent(_parent) , enabled(true) , state(INIT) + , debugGL(false) { } PIMPL(PIMPL *p) : parent(p->parent) , enabled(p->enabled) , state(p->state) + , debugGL(p->debugGL) { } + void debugGLerror(const char*prefix=0) { + if(debugGL) { + const char*errStr = gem::utils::gl::glErrorString(); + if(errStr) + parent->error("%s%s", prefix?prefix:"", errStr); + } + } }; ///////////////////////////////////////////////////////// @@ -126,11 +137,13 @@ void GemBase :: gem_startstopMess(int state) m_pimpl->enabled = isRunnable(); if(m_pimpl->enabled) { startRendering(); + m_pimpl->debugGLerror("start() "); m_pimpl->state=RENDERING; } } else if (!state && gem_amRendering) { if(m_pimpl->enabled) { stopRendering(); + m_pimpl->debugGLerror("stop() "); m_pimpl->state=ENABLED; } } @@ -167,20 +180,24 @@ void GemBase :: gem_renderMess(GemCache* cache, GemState*state) } if(MODIFIED==m_pimpl->state) { stopRendering(); + m_pimpl->debugGLerror("autostop() "); m_pimpl->state=ENABLED; } if(ENABLED==m_pimpl->state) { startRendering(); + m_pimpl->debugGLerror("autostart() "); m_pimpl->state=RENDERING; } if(RENDERING==m_pimpl->state) { gem_amRendering=true; if(state) { render(state); + m_pimpl->debugGLerror(); } continueRender(state); if(state) { postrender(state); + m_pimpl->debugGLerror("post() "); } } m_modified=false; @@ -266,6 +283,11 @@ void GemBase::beforeDeletion(void) ///////////////////////////////////////////////////////// void GemBase :: obj_setupCallback(t_class *classPtr) { + /* callback for the generic 'gem_state' message: + - startRender() + - render() + - stopRender() + */ struct _CallbackClass_gemState { static void callback(void *data, t_symbol* s, int argc, t_atom *argv) { @@ -289,6 +311,9 @@ void GemBase :: obj_setupCallback(t_class *classPtr) }; _CallbackClass_gemState _CallbackClassInstance_gemState (classPtr); + /* callback for multicontext + (mostly: clean up if a context gets destroyed) + */ struct _CallbackClass_gemContext { static void callback(void*data, t_float v0) { @@ -311,4 +336,23 @@ void GemBase :: obj_setupCallback(t_class *classPtr) }; _CallbackClass_gemContext _CallbackClassInstance_gemContext (classPtr); + /* debugging GL errors */ + struct _CallbackClass_debugGL { + static void callback(void*data, t_float v0) + { + bool b = (bool)v0; + GemBase*obj=GetMyClass(data); + if(obj) { + obj->m_pimpl->debugGL = b; + } + } + explicit _CallbackClass_debugGL (struct _class*c) + { + class_addmethod(c, reinterpret_cast(callback), + gensym("debugGL"), A_FLOAT, A_NULL); + } + }; + _CallbackClass_debugGL _CallbackClassInstance_debugGL (classPtr); + + } From 8902fadfa09beb26a45109500480ec1654e85edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 12:00:47 +0100 Subject: [PATCH 270/387] Gem: forward [debugGL( messages to all Gem objects Closes: https://github.com/umlaeute/Gem/issues/475 --- src/Geos/GemSplash.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Geos/GemSplash.cpp b/src/Geos/GemSplash.cpp index 43f98bc18..c0c31fa4a 100644 --- a/src/Geos/GemSplash.cpp +++ b/src/Geos/GemSplash.cpp @@ -59,4 +59,29 @@ void GemSplash :: obj_setupCallback(t_class *classPtr) { class_addcreator(reinterpret_cast(create_GemSplash), gensym("Gem"), A_GIMME, A_NULL); + + /* debugging GL errors */ + struct _CallbackClass_debugGL { + static void callback(void*data, t_float v0) + { + static bool sending = false; + if(!sending) { + sending = true; + t_symbol*s = gensym("__gemBase"); + if(s->s_thing) { + t_atom a[1]; + SETFLOAT(a+0, v0); + pd_typedmess(s->s_thing, gensym("debugGL"), 1, a); + } + } + sending = false; + + } + explicit _CallbackClass_debugGL (struct _class*c) + { + class_addmethod(c, reinterpret_cast(callback), + gensym("debugGL"), A_FLOAT, A_NULL); + } + }; + _CallbackClass_debugGL _CallbackClassInstance_debugGL (classPtr); } From 6d8daa48a358320b8c3daa1b39c41181a362437c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 12:01:35 +0100 Subject: [PATCH 271/387] document debugGL message and use "Gem-help" as the helppatch for the [Gem] objects (aka [GemSplash]) --- help/Gem-help.pd | 53 +++++++++++++++++++++++++++++++++++------- src/Geos/GemSplash.cpp | 1 + 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/help/Gem-help.pd b/help/Gem-help.pd index b73a472e1..e132af758 100644 --- a/help/Gem-help.pd +++ b/help/Gem-help.pd @@ -1,8 +1,8 @@ -#N canvas 85 65 472 375 12; -#X text 54 38 idiosyncracies in Gem objects; -#X text 54 53 =============================; -#X text 33 106 most (if not all) Gem objects share some common behaviour \, that you might want to be aware of \, in order to correctly and efficiently use them.; -#N canvas 2803 369 624 486 init-messages 0; +#N canvas 85 65 578 389 12; +#X declare -lib Gem; +#X text 54 118 idiosyncrasies in Gem objects; +#X text 33 176 most (if not all) Gem objects share some common behaviour \, that you might want to be aware of \, in order to correctly and efficiently use them.; +#N canvas 251 126 624 486 init-messages 0; #X obj 85 146 rectangle 4 3 \; draw line \; width 3; #X text 53 53 Gem objects accept additional creation arguments \, that can be used to send initial messages to the object.; #X obj 377 181 rectangle 4 3; @@ -16,9 +16,44 @@ #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 8 0 7 0; -#X restore 61 204 pd init-messages; -#N canvas 2655 474 670 343 "gem_state" 0; -#X text 31 101 These messages can be created by [gemhead] and are then passed to downstream objects. You cannot (and shoud not attempt to) create such messages yourself.; +#X restore 61 274 pd init-messages; +#N canvas 269 117 510 275 "gem_state" 0; +#X text 31 101 These messages can be created by [gemhead] and are then passed to downstream objects. You cannot (and should not attempt to) create such messages yourself.; #X text 31 163 Typically these messages occur once per rendering tick (e.g. every 50ms) \, so it's easy to flood your Pd-console with printing them (or connecting the 1st outlet of a Gem object to an object that does not understand these messages), f 61; #X text 31 25 Any Gem-object that can be used within a render-chain accepts a special Gem message with the selector "gem_state" on the 1st inlet \, and will also output such special Gem message on the 1st outlet.; -#X restore 61 171 pd "gem_state" messages; +#X restore 61 241 pd "gem_state" messages; +#N canvas 375 374 585 541 debugging 0; +#X text 27 114 This indicates a bug \, either in a Gem object or your patch.; +#X text 74 80 GL[0x504]: stack underflow; +#X text 32 35 Every now and then you might see openGL error messages when rendering:; +#X text 23 161 The error is only emitted at the end of a render cycle (once all objects have been executed).; +#X text 26 198 If you want to track down the object that triggered the error \, you must enable the "debugGL" mode via the [Gem] object:; +#X obj 159 257 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X msg 159 282 debugGL \$1; +#X obj 159 307 Gem; +#X text 259 265 <- turn on/off per-object debugging; +#X text 257 307 <- turn it on/off for *all* Gem objects; +#X text 37 357 Tracking down openGL errors can be rather costly \, so it's not enabled by default.; +#X text 38 407 You can also turn debugging GL on/off for individual objects:; +#X obj 130 434 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X msg 130 459 debugGL \$1; +#X obj 130 484 cube; +#X connect 5 0 6 0; +#X connect 6 0 7 0; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X restore 61 311 pd debugging GL; +#X text 44 38 Gem - Graphics Environment for Multimedia; +#X text 44 48 =========================================; +#X text 54 133 -----------------------------; +#X obj 123 81 Gem; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 145 AUTHOR IOhannes m zmölnig; +#X text 10 165 LICENSE GPL v2; +#X text 10 45 DESCRIPTION Gem meta object; +#X text 10 65 KEYWORDS Gem; +#X text 20 105 INLET_0 debugGL ; +#X restore 498 18 pd META; diff --git a/src/Geos/GemSplash.cpp b/src/Geos/GemSplash.cpp index c0c31fa4a..a0e2e0888 100644 --- a/src/Geos/GemSplash.cpp +++ b/src/Geos/GemSplash.cpp @@ -13,6 +13,7 @@ // WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. // ///////////////////////////////////////////////////////// +#define HELPSYMBOL "Gem" #include "GemSplash.h" From d75ca6ab6e361bb7c47236f1caf81279bb7aa89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 12:22:00 +0100 Subject: [PATCH 272/387] fix re-entrancy for GemSplash::debugGL --- src/Geos/GemSplash.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Geos/GemSplash.cpp b/src/Geos/GemSplash.cpp index a0e2e0888..03bb02e92 100644 --- a/src/Geos/GemSplash.cpp +++ b/src/Geos/GemSplash.cpp @@ -66,17 +66,16 @@ void GemSplash :: obj_setupCallback(t_class *classPtr) static void callback(void*data, t_float v0) { static bool sending = false; - if(!sending) { - sending = true; - t_symbol*s = gensym("__gemBase"); - if(s->s_thing) { - t_atom a[1]; - SETFLOAT(a+0, v0); - pd_typedmess(s->s_thing, gensym("debugGL"), 1, a); - } + if(sending) + return; + sending = true; + t_symbol*s = gensym("__gemBase"); + if(s->s_thing) { + t_atom a[1]; + SETFLOAT(a+0, v0); + pd_typedmess(s->s_thing, gensym("debugGL"), 1, a); } sending = false; - } explicit _CallbackClass_debugGL (struct _class*c) { From 1618aad327538a5205cd330382649a1c5f1793db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 12:22:14 +0100 Subject: [PATCH 273/387] [GEMglReportError] make error trackable --- src/openGL/GEMglReportError.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openGL/GEMglReportError.cpp b/src/openGL/GEMglReportError.cpp index 115261375..788223a78 100644 --- a/src/openGL/GEMglReportError.cpp +++ b/src/openGL/GEMglReportError.cpp @@ -43,7 +43,11 @@ GEMglReportError :: ~GEMglReportError () // void GEMglReportError :: render(GemState *state) { - GLenum err=glReportError(); + GLenum err=glReportError(false); + if(err) { + const char*errStr = glErrorString(err); + error("GL[0x%X]: %s", err, errStr?errStr:"generic error"); + } outlet_float(m_outlet, static_cast(err)); } From 2373fc50a86c1ca9e1d325e7447b4c28e4e20e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 14:31:58 +0100 Subject: [PATCH 274/387] use helper to initialize maxStackDepth in GemContext --- src/Base/GemContext.cpp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/Base/GemContext.cpp b/src/Base/GemContext.cpp index ff2207e41..7b4eae393 100644 --- a/src/Base/GemContext.cpp +++ b/src/Base/GemContext.cpp @@ -29,6 +29,18 @@ using namespace gem; class Context::PIMPL { + void initMaxDepth(int id) { + GLenum pname = 0; + switch (id) { + case GemMan::STACKMODELVIEW: pname = GL_MAX_MODELVIEW_STACK_DEPTH; break; + case GemMan::STACKTEXTURE: pname = GL_MAX_TEXTURE_STACK_DEPTH; break; + case GemMan::STACKPROJECTION: pname = GL_MAX_PROJECTION_STACK_DEPTH; break; + case GemMan::STACKCOLOR: pname = GL_MAX_COLOR_MATRIX_STACK_DEPTH; break; + default: + return; + } + glGetIntegerv(pname, maxStackDepth+id); + } public: PIMPL(void) : #ifdef GEM_MULTICONTEXT @@ -42,12 +54,9 @@ class Context::PIMPL contextid(makeID()) { /* check the stack-sizes */ - glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, - maxStackDepth+GemMan::STACKMODELVIEW); - glGetIntegerv(GL_MAX_TEXTURE_STACK_DEPTH, - maxStackDepth+GemMan::STACKTEXTURE); - glGetIntegerv(GL_MAX_PROJECTION_STACK_DEPTH, - maxStackDepth+GemMan::STACKPROJECTION); + initMaxDepth(GemMan::STACKMODELVIEW); + initMaxDepth(GemMan::STACKTEXTURE); + initMaxDepth(GemMan::STACKPROJECTION); maxStackDepth[GemMan::STACKCOLOR]=0; } @@ -64,14 +73,10 @@ class Context::PIMPL contextid(makeID()) { /* check the stack-sizes */ - glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, - maxStackDepth+GemMan::STACKMODELVIEW); - glGetIntegerv(GL_MAX_COLOR_MATRIX_STACK_DEPTH, - maxStackDepth+GemMan::STACKCOLOR); - glGetIntegerv(GL_MAX_TEXTURE_STACK_DEPTH, - maxStackDepth+GemMan::STACKTEXTURE); - glGetIntegerv(GL_MAX_PROJECTION_STACK_DEPTH, - maxStackDepth+GemMan::STACKPROJECTION); + initMaxDepth(GemMan::STACKMODELVIEW); + initMaxDepth(GemMan::STACKCOLOR); + initMaxDepth(GemMan::STACKTEXTURE); + initMaxDepth(GemMan::STACKPROJECTION); } ~PIMPL(void) @@ -154,12 +159,10 @@ Context::Context(void) errstring="failed to init GLEW"; } } else { - GLint colorstack = 0; if(GLEW_ARB_imaging) { - glGetIntegerv(GL_MAX_COLOR_MATRIX_STACK_DEPTH, &colorstack); + pimpl->initMaxDepth(GemMan::STACKCOLOR); + } } - - m_pimpl->maxStackDepth[GemMan::STACKCOLOR]=colorstack; } pop(); @@ -226,6 +229,7 @@ bool Context::push(void) m_pimpl->s_xcontext=m_pimpl->xcontext; #endif /* GemGlewXContext */ m_pimpl->s_contextid=m_pimpl->contextid; + return true; } From 3a1cf8a8cd0980fb9cdca97d0cb62eb8274b50c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 14:58:48 +0100 Subject: [PATCH 275/387] cleanup PIMPL --- src/Base/GemContext.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Base/GemContext.cpp b/src/Base/GemContext.cpp index 7b4eae393..7bcc351e8 100644 --- a/src/Base/GemContext.cpp +++ b/src/Base/GemContext.cpp @@ -27,7 +27,7 @@ using namespace gem; -class Context::PIMPL +struct Context::PIMPL { void initMaxDepth(int id) { GLenum pname = 0; @@ -41,17 +41,18 @@ class Context::PIMPL } glGetIntegerv(pname, maxStackDepth+id); } -public: - PIMPL(void) : + bool initialized; /* just a dummy variable at the beginning... */ + PIMPL(void) + : initialized(false) #ifdef GEM_MULTICONTEXT - context(new GLEWContext), + , context(new GLEWContext) #else - context(NULL), + , context(NULL) #endif #ifdef GemGlewXContext - xcontext(new GemGlewXContext), + , xcontext(new GemGlewXContext) #endif /* GemGlewXContext */ - contextid(makeID()) + , contextid(makeID()) { /* check the stack-sizes */ initMaxDepth(GemMan::STACKMODELVIEW); @@ -61,16 +62,17 @@ class Context::PIMPL maxStackDepth[GemMan::STACKCOLOR]=0; } - PIMPL(const PIMPL&p) : + PIMPL(const PIMPL&p) + : initialized(p.initialized) #ifdef GEM_MULTICONTEXT - context(new GLEWContext(*p.context)), + , context(new GLEWContext(*p.context)) #else - context(NULL), + , context(NULL) #endif #ifdef GemGlewXContext - xcontext(new GemGlewXContext(*p.xcontext)), + , xcontext(new GemGlewXContext(*p.xcontext)) #endif /* GemGlewXContext */ - contextid(makeID()) + , contextid(makeID()) { /* check the stack-sizes */ initMaxDepth(GemMan::STACKMODELVIEW); From 3cbdc22de51f30f3f83d869e4f4f5529ca9d528e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 14:33:05 +0100 Subject: [PATCH 276/387] GemContext: initialize set active texture fixes the "stack underflow" issue in the GLSL examples Related: https://github.com/umlaeute/Gem/issues/476 --- src/Base/GemContext.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Base/GemContext.cpp b/src/Base/GemContext.cpp index 7bcc351e8..90b36e242 100644 --- a/src/Base/GemContext.cpp +++ b/src/Base/GemContext.cpp @@ -53,6 +53,7 @@ struct Context::PIMPL , xcontext(new GemGlewXContext) #endif /* GemGlewXContext */ , contextid(makeID()) + , oldTexture(0) { /* check the stack-sizes */ initMaxDepth(GemMan::STACKMODELVIEW); @@ -73,6 +74,7 @@ struct Context::PIMPL , xcontext(new GemGlewXContext(*p.xcontext)) #endif /* GemGlewXContext */ , contextid(makeID()) + , oldTexture(0) { /* check the stack-sizes */ initMaxDepth(GemMan::STACKMODELVIEW); @@ -106,6 +108,7 @@ struct Context::PIMPL #endif /* GemGlewXContext */ unsigned int contextid; + GLint oldTexture; // LATER: reusing IDs prevents a memleak in gem::ContextData // LATER: reusing IDs might make us re-use invalid gem::ContextData! @@ -161,9 +164,15 @@ Context::Context(void) errstring="failed to init GLEW"; } } else { - if(GLEW_ARB_imaging) { - pimpl->initMaxDepth(GemMan::STACKCOLOR); + m_pimpl->initialized = true; + if(GLEW_VERSION_1_3) { + glGetIntegerv(GL_ACTIVE_TEXTURE, &m_pimpl->oldTexture); + glActiveTexture(GL_TEXTURE0_ARB); } + m_pimpl->initMaxDepth(GemMan::STACKTEXTURE); + + if(GLEW_ARB_imaging) { + m_pimpl->initMaxDepth(GemMan::STACKCOLOR); } } @@ -232,6 +241,11 @@ bool Context::push(void) #endif /* GemGlewXContext */ m_pimpl->s_contextid=m_pimpl->contextid; + if(m_pimpl->initialized && GLEW_VERSION_1_3) { + glGetIntegerv(GL_ACTIVE_TEXTURE, &m_pimpl->oldTexture); + glActiveTexture(GL_TEXTURE0_ARB); + } + return true; } @@ -242,6 +256,9 @@ bool Context::isActive(void) bool Context::pop(void) { + if(m_pimpl->oldTexture && GLEW_VERSION_1_3) { + glActiveTexture(m_pimpl->oldTexture); + } return true; } From 32bbc6e6d15de277db15a78e8de695c0dc85de22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 27 Mar 2025 15:39:10 +0100 Subject: [PATCH 277/387] [glsl_program] unlink program on stopRendering Closes: https://github.com/umlaeute/Gem/issues/476 --- src/Manips/glsl_program.cpp | 38 ++++++++++++++++++++++--------------- src/Manips/glsl_program.h | 2 ++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/Manips/glsl_program.cpp b/src/Manips/glsl_program.cpp index dcc5b883c..50529f938 100644 --- a/src/Manips/glsl_program.cpp +++ b/src/Manips/glsl_program.cpp @@ -450,17 +450,7 @@ glsl_program :: glsl_program() ///////////////////////////////////////////////////////// glsl_program :: ~glsl_program() { - m_programmapper.del(m_programmapped); - m_programmapped=0.; - - if(m_program) { - glDeleteProgram( m_program ); - } - m_program=0; - if(m_programARB) { - glDeleteObjectARB( m_programARB ); - } - m_programARB=0; + UnlinkProgram(); } @@ -505,7 +495,10 @@ void glsl_program :: startRendering() { LinkProgram(); } - +void glsl_program :: stopRendering() +{ + UnlinkProgram(); +} void glsl_program :: render(GemState *state) { @@ -682,8 +675,9 @@ bool glsl_program :: LinkGL2() int numGeometryShaders = 0; int numFragmentShaders = 0; - if(m_program) { - glDeleteProgram( m_program ); + GLuint program = m_program; + if(program) { + glDeleteProgram( program ); m_programmapper.del(m_programmapped); m_programmapped=0.; m_program = 0; @@ -857,13 +851,14 @@ void glsl_program :: LinkProgram() return; } + UnlinkProgram(); + if(GLEW_VERSION_2_0) { success=LinkGL2(); } else { success=LinkARB(); } - if(!success) { return; } @@ -907,7 +902,20 @@ void glsl_program :: LinkProgram() } SETFLOAT(&a, m_programmapped); outlet_list(m_outProgramID, 0, 1, &a); +} +void glsl_program :: UnlinkProgram() +{ + m_programmapper.del(m_programmapped); + m_programmapped=0.; + if(m_program) { + glDeleteProgram( m_program ); + } + m_program=0; + if(m_programARB) { + glDeleteObjectARB( m_programARB ); + } + m_programARB=0; } ///////////////////////////////////////////////////////// diff --git a/src/Manips/glsl_program.h b/src/Manips/glsl_program.h index 812c4ea50..a1f43513a 100644 --- a/src/Manips/glsl_program.h +++ b/src/Manips/glsl_program.h @@ -60,6 +60,7 @@ class GEM_EXTERN glsl_program : public GemBase // check openGL-extensions virtual bool isRunnable(void); virtual void startRendering(void); + virtual void stopRendering(void); ////////// // Do the rendering @@ -89,6 +90,7 @@ class GEM_EXTERN glsl_program : public GemBase virtual bool LinkGL2(void); virtual bool LinkARB(void); virtual void LinkProgram(void); + virtual void UnlinkProgram(void); ////////// // What can we play with? From 28a5ae03f554c848f20e1ccb528ef6a12e154d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 28 Mar 2025 11:59:09 +0100 Subject: [PATCH 278/387] minor improviements for examples --- examples/02.advanced/04.Fog.pd | 61 +++-- examples/02.advanced/05.Stereo.pd | 26 +- examples/02.advanced/23.SplitScreen.pd | 353 ++++++++++++++----------- 3 files changed, 248 insertions(+), 192 deletions(-) diff --git a/examples/02.advanced/04.Fog.pd b/examples/02.advanced/04.Fog.pd index 327fdb943..32d68bcbc 100644 --- a/examples/02.advanced/04.Fog.pd +++ b/examples/02.advanced/04.Fog.pd @@ -1,8 +1,8 @@ -#N canvas 275 99 721 506 10; +#N canvas 659 128 721 506 10; #X declare -lib Gem; -#X floatatom 414 85 0 0 0 0 - - -; +#X floatatom 414 85 0 0 0 0 - - - 0; #X obj 385 44 gemhead; -#X floatatom 403 165 0 0 0 0 - - -; +#X floatatom 403 165 0 0 0 0 - - - 0; #X obj 268 149 gemhead 1; #X obj 268 187 world_light; #X obj 385 279 model ../data/venus.obj; @@ -10,24 +10,18 @@ #X obj 385 205 rotateXYZ; #X obj 385 238 scale 3; #X obj 40 198 r fogmess; -#X msg 335 395 \; fogmess fogmode 2 \; fogmess fog 0.1; -#X msg 11 394 \; fogmess fogmode 0; -#X msg 172 393 \; fogmess fogmode 1 \; fogmess fog 0.7; #X text 39 349 no fog; #X text 190 354 linear fog; #X text 371 353 exp fog; #X text 520 357 exp^2 fog; -#X msg 485 399 \; fogmess fogmode 3 \; fogmess fog 0.1; #X text 184 21 various fog types; -#X obj 522 132 gemhead; -#X floatatom 458 97 5 0 0 0 - - -; -#X obj 522 170 rotateXYZ 0 -117 0; -#X obj 522 189 square 5; -#X obj 522 151 translateXYZ -3.5 0 -6.57; -#X obj 385 22 tgl 15 1 empty empty empty 20 8 0 8 -262144 -1 -1 1 1 -; -#X obj 522 113 tgl 15 1 empty empty empty 20 8 0 8 -262144 -1 -1 1 -1; +#X obj 552 212 gemhead; +#X floatatom 458 97 5 0 0 0 - - - 0; +#X obj 552 250 rotateXYZ 0 -117 0; +#X obj 552 269 square 5; +#X obj 552 231 translateXYZ -3.5 0 -6.57; +#X obj 385 22 tgl 15 1 empty empty empty 20 8 0 8 #fcfcfc #000000 #000000 1 1; +#X obj 552 193 tgl 15 1 empty empty empty 20 8 0 8 #fcfcfc #000000 #000000 1 1; #N canvas 26 40 290 300 Gem.init 0; #X obj 71 191 outlet; #X obj 71 81 loadbang; @@ -44,8 +38,7 @@ #X connect 5 0 0 0; #X restore 59 219 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -84,6 +77,16 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 40 258 pd gemwin; #X obj 608 8 declare -lib Gem; +#X msg 11 394 \; fogmess fogmode 0; +#X msg 505 393 \; fogmess fogcolor 0 0 1 \; fogmess fogmode 3 \; fogmess fog 0.1; +#X msg 335 393 \; fogmess fogcolor 0 1 0 \; fogmess fogmode 2 \; fogmess fog 0.1; +#X msg 172 393 \; fogmess fogcolor 1 0 0 \; fogmess fogmode 1 \; fogmess fog 0.7; +#X obj 536 10 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 536 33 metro 2000; +#X obj 536 56 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 536 79 * -8; +#X msg 536 102 \$1 1000; +#X obj 536 125 line; #X connect 0 0 6 3; #X connect 1 0 6 0; #X connect 2 0 7 1; @@ -91,11 +94,17 @@ #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 5 0; -#X connect 9 0 27 0; -#X connect 19 0 23 0; -#X connect 20 0 6 1; -#X connect 21 0 22 0; -#X connect 23 0 21 0; -#X connect 24 0 1 0; -#X connect 25 0 19 0; -#X connect 26 0 27 0; +#X connect 9 0 23 0; +#X connect 15 0 19 0; +#X connect 16 0 6 1; +#X connect 17 0 18 0; +#X connect 19 0 17 0; +#X connect 20 0 1 0; +#X connect 21 0 15 0; +#X connect 22 0 23 0; +#X connect 29 0 30 0; +#X connect 30 0 31 0; +#X connect 31 0 32 0; +#X connect 32 0 33 0; +#X connect 33 0 34 0; +#X connect 34 0 0 0; diff --git a/examples/02.advanced/05.Stereo.pd b/examples/02.advanced/05.Stereo.pd index f2e9113df..97ca09659 100644 --- a/examples/02.advanced/05.Stereo.pd +++ b/examples/02.advanced/05.Stereo.pd @@ -1,7 +1,7 @@ -#N canvas 31 61 600 504 10; +#N canvas 1237 37 600 504 10; #X declare -lib Gem; #X obj 426 54 gemhead; -#X floatatom 464 134 0 0 0 0 - - -; +#X floatatom 464 134 0 0 0 0 - - - 0; #X obj 464 307 gemhead 1; #X obj 464 332 world_light; #X obj 426 181 model ../data/venus.obj; @@ -9,13 +9,12 @@ #X obj 426 81 translateXYZ 0 0 2; #X obj 426 157 rotateXYZ; #X text 149 40 and display it stereoscopically; -#X msg 221 130 stereoSep \$1; -#X msg 318 129 stereoFoc \$1; -#X floatatom 221 92 0 0 0 0 - - -; -#X floatatom 318 87 0 0 0 0 - - -; +#X msg 221 113 stereoSep \$1; +#X msg 318 112 stereoFoc \$1; +#X floatatom 221 92 0 0 0 0 - - - 0; +#X floatatom 318 87 0 0 0 0 - - - 0; #X text 23 295 The default stereoSep is -15; -#X text 23 315 The model may appear inside out depending on what viewing -method you use.; +#X text 23 315 The model may appear inside out depending on what viewing method you use.; #X text 23 350 If it does \, change the stereoSep to 15; #N canvas 30 60 290 300 Gem.init 0; #X obj 71 191 outlet; @@ -40,11 +39,9 @@ method you use.; #X text 336 273 no stereo; #X msg 271 248 stereo 3; #X text 338 250 crystal eyes stereo; -#X text 32 402 NOTE: you need special hardware to use "crystal eyes -stereo"; +#X text 32 402 NOTE: you need special hardware to use "crystal eyes stereo"; #N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -83,6 +80,9 @@ stereo"; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 58 207 pd gemwin; #X obj 488 8 declare -lib Gem; +#X obj 230 149 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X msg 230 172 stereoLine \$1; +#X text 255 154 for mode#1; #X connect 0 0 6 0; #X connect 1 0 7 2; #X connect 2 0 3 0; @@ -97,3 +97,5 @@ stereo"; #X connect 18 0 26 0; #X connect 19 0 26 0; #X connect 23 0 26 0; +#X connect 28 0 29 0; +#X connect 29 0 26 0; diff --git a/examples/02.advanced/23.SplitScreen.pd b/examples/02.advanced/23.SplitScreen.pd index a1f6406aa..7e115c10c 100644 --- a/examples/02.advanced/23.SplitScreen.pd +++ b/examples/02.advanced/23.SplitScreen.pd @@ -1,4 +1,4 @@ -#N canvas 26 61 799 698 10; +#N canvas 26 61 920 708 10; #X declare -lib Gem; #N canvas 22 50 213 300 Gem.init 0; #X obj 71 191 outlet; @@ -13,8 +13,7 @@ #X connect 4 0 0 0; #X restore 24 75 pd Gem.init; #N canvas 330 97 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 --1 -1 0 1; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; @@ -55,15 +54,13 @@ #X connect 18 0 7 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 24 99 pd gemwin; -#X obj 36 576 rotateXYZ; -#X obj 36 499 t a b; #X obj 88 501 i; #X obj 141 501 + 1; #X obj 141 523 % 360; #X obj 36 669 teapot; #X obj 142 101 gemhead; #X obj 142 123 world_light; -#X obj 36 417 gemreceive framehead 50; +#X obj 36 407 gemreceive framehead 50; #X obj 36 648 scale 1; #N canvas 223 51 450 300 scale 0; #X obj 114 26 inlet bang; @@ -101,18 +98,17 @@ #X obj 88 523 t f f; #X obj 88 545 t f f; #X obj 120 574 select 0; -#X obj 36 439 separator; -#X obj 246 459 separator; -#X obj 246 525 t a b; -#X obj 298 527 i; -#X obj 351 527 + 1; -#X obj 351 549 % 360; -#X obj 298 549 t f f; -#X obj 298 571 t f f; -#X obj 246 437 gemreceive framehead 60; -#X obj 246 602 rotateXYZ 45 0 0; -#X obj 246 481 color 0 0 1; -#X obj 36 461 color 1 1 1; +#X obj 36 429 separator; +#X obj 246 499 separator; +#X obj 298 567 i; +#X obj 351 567 + 1; +#X obj 351 589 % 360; +#X obj 298 589 t f f; +#X obj 298 611 t f f; +#X obj 246 477 gemreceive framehead 60; +#X obj 246 642 rotateXYZ 45 0 0; +#X obj 246 521 color 0 0 1; +#X obj 36 451 color 1 1 1; #X obj 423 474 gemreceive framehead 70; #X obj 423 496 separator; #X obj 423 518 color 0 1 0; @@ -140,13 +136,12 @@ #X msg 255 187 0; #X msg 290 185 0; #X obj 133 78 loadbang; -#X obj 202 83 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; #X obj 133 122 random 6; #X obj 133 100 metro 500; #X msg 129 251 \$1 1000; #X msg 223 223 \$1 1000; #X msg 297 222 \$1 1000; +#X obj 202 78 inlet; #X connect 1 0 3 0; #X connect 1 1 4 0; #X connect 1 2 5 0; @@ -168,19 +163,19 @@ #X connect 12 3 15 0; #X connect 12 4 17 0; #X connect 12 5 18 0; -#X connect 13 0 23 0; -#X connect 14 0 24 0; -#X connect 15 0 25 0; -#X connect 16 0 24 0; -#X connect 17 0 23 0; -#X connect 18 0 25 0; -#X connect 19 0 22 0; -#X connect 20 0 22 0; -#X connect 21 0 12 0; -#X connect 22 0 21 0; -#X connect 23 0 6 0; -#X connect 24 0 8 0; -#X connect 25 0 10 0; +#X connect 13 0 22 0; +#X connect 14 0 23 0; +#X connect 15 0 24 0; +#X connect 16 0 23 0; +#X connect 17 0 22 0; +#X connect 18 0 24 0; +#X connect 19 0 21 0; +#X connect 20 0 12 0; +#X connect 21 0 20 0; +#X connect 22 0 6 0; +#X connect 23 0 8 0; +#X connect 24 0 10 0; +#X connect 25 0 21 0; #X restore 517 558 pd move; #X obj 423 584 translateXYZ; #X obj 517 580 unpack 0 0 0; @@ -190,25 +185,26 @@ #X obj 630 522 gemreceive framehead1; #X obj 630 544 separator; #X text 38 23 split-screen; -#X obj 260 13 cnv 15 500 240 empty empty SplitScreen1 20 12 0 14 -233017 --66577 0; -#X obj 260 260 cnv 15 500 140 empty empty SplitScreen2 20 12 0 14 -233017 --66577 0; -#X obj 276 286 gemhead 1; -#X obj 588 346 pix_texture; -#X obj 276 308 gemframebuffer; -#X obj 276 372 s framehead; -#X obj 588 301 gemhead 60; -#X obj 588 322 translateXYZ 2 0 0; -#X obj 276 330 rotateXYZ 90 0 0; -#X obj 276 350 translateXYZ 0 -4 0; -#X obj 588 368 square 1.9; -#X obj 277 41 gemhead 1; -#X obj 588 117 pix_texture; -#X obj 277 141 translateXYZ 0 0 -4; -#X obj 588 71 gemhead 50; -#X obj 588 93 translateXYZ -2 0 0; -#X obj 309 185 s framehead; +#X obj 260 166 cnv 15 300 140 empty empty SplitScreenY 20 12 0 14 #e0e0e0 #404040 0; +#X obj 276 192 gemhead 1; +#X obj 428 252 pix_texture; +#X obj 276 214 gemframebuffer; +#X obj 276 278 s framehead; +#X obj 428 207 gemhead 60; +#X obj 428 274 square 1.9; +#X obj 263 169 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 428 184 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 423 540 ortho; +#X obj 246 664 square 1; +#X obj 246 543 translateXYZ 3 -2 0; +#X floatatom 141 549 5 0 0 0 - - - 0; +#X obj 38 298 declare -lib Gem; +#X obj 600 43 cnv 15 300 240 empty empty SplitScreenXYZ 20 12 0 14 #e0e0e0 #404040 0; +#X obj 617 71 gemhead 1; +#X obj 768 217 pix_texture; +#X obj 617 171 translateXYZ 0 0 -4; +#X obj 768 171 gemhead 50; +#X obj 649 215 s framehead; #N canvas 1 51 450 300 view 0; #X obj 89 284 outlet rotate; #X obj 237 283 outlet translate; @@ -220,125 +216,174 @@ #X obj 81 94 pack 0 0 0 0 0; #X obj 89 222 f; #X obj 89 199 t b f; +#X obj 139 173 + 12; #X connect 2 0 3 0; #X connect 3 0 7 0; #X connect 4 0 5 0; #X connect 4 1 5 1; #X connect 4 2 5 2; #X connect 4 3 9 0; -#X connect 4 4 8 1; +#X connect 4 4 10 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 4 0; #X connect 8 0 6 0; #X connect 9 0 8 0; #X connect 9 1 6 1; -#X restore 454 64 pd view; -#X obj 277 63 gemframebuffer; -#X obj 588 139 square 1.9; -#X obj 277 163 t a a; -#X obj 326 121 unpack 0 0 0; -#X obj 305 82 unpack 0 0 0; -#X obj 277 102 rotateXYZ 0 0 0; -#X msg 454 40 view 0 0 -4 \$1; -#X obj 277 213 s framehead1; -#X obj 588 50 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 263 17 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 263 263 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 588 278 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 423 540 ortho; -#X obj 246 664 square 1; -#X obj 246 503 translateXYZ 3 -2 0; -#X text 14 161 this will render a single scene; -#X text 13 189 from two different view-points; -#X text 13 175 into two framebuffers.; -#X text 16 224 the red sphere is only rendered; -#X text 18 240 in the left-hand "screen".; -#X obj 454 23 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 --262144 -1 -1 0 256; -#X floatatom 141 549 5 0 0 0 - - -; -#X obj 38 298 declare -lib Gem; +#X connect 10 0 8 1; +#X restore 764 94 pd view; +#X obj 617 93 gemframebuffer; +#X obj 768 239 square 1.9; +#X obj 617 193 t a a; +#X obj 666 151 unpack 0 0 0; +#X obj 645 112 unpack 0 0 0; +#X obj 617 132 rotateXYZ 0 0 0; +#X obj 617 243 s framehead1; +#X obj 768 150 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 603 47 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 764 53 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 260 20 cnv 15 300 140 empty empty SplitScreenX 20 12 0 14 #e0e0e0 #404040 0; +#X obj 276 46 gemhead 1; +#X obj 428 106 pix_texture; +#X obj 276 68 gemframebuffer; +#X obj 276 132 s framehead; +#X obj 428 61 gemhead 60; +#X obj 428 128 square 1.9; +#X obj 263 23 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 428 38 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 260 311 cnv 15 300 140 empty empty SplitScreenZ 20 12 0 14 #e0e0e0 #404040 0; +#X obj 276 337 gemhead 1; +#X obj 428 397 pix_texture; +#X obj 276 359 gemframebuffer; +#X obj 276 423 s framehead; +#X obj 428 352 gemhead 60; +#X obj 428 419 square 1.9; +#X obj 263 314 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 428 329 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 428 82 translateXYZ -2 2 0; +#X obj 428 228 translateXYZ 2 2 0; +#X obj 428 373 translateXYZ -2 -2 0; +#X obj 276 110 translateXYZ -4 0 0; +#X obj 276 401 translateXYZ 0 0 -4; +#X obj 768 193 translateXYZ 2 -2 0; +#X obj 276 381 rotateXYZ 0 0 0; +#X floatatom 352 42 5 0 0 0 - - - 0; +#X obj 36 576 rotateXYZ; +#X obj 276 90 rotateXYZ 0 -90 0; +#X obj 276 256 translateXYZ 0 -4 0; +#X obj 276 236 rotateXYZ 90 0 0; +#X obj 170 502 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X msg 765 71 view 0 -2 8 200 \$1; +#X obj 377 567 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 568 557 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 14 161 this will render a single scene into multiple framebuffers from different viewpoints., f 31; +#X text 16 224 the red sphere is only rendered in the XYZ "screen", f 33; +#X obj 675 346 gemhead 1; +#X obj 675 369 t b; +#X obj 675 392 s rendertick; +#X obj 88 477 r rendertick; +#X obj 321 521 r rendertick; #X connect 0 0 1 0; -#X connect 2 0 11 0; -#X connect 3 0 2 0; -#X connect 3 1 4 0; -#X connect 4 0 14 0; -#X connect 5 0 6 0; -#X connect 6 0 4 1; -#X connect 8 0 9 0; -#X connect 10 0 17 0; -#X connect 11 0 7 0; -#X connect 12 0 11 1; -#X connect 13 0 12 0; -#X connect 14 0 15 0; -#X connect 14 1 5 0; -#X connect 15 0 2 1; -#X connect 15 1 16 0; -#X connect 16 0 13 0; -#X connect 17 0 28 0; -#X connect 18 0 27 0; -#X connect 19 0 26 0; -#X connect 19 1 20 0; -#X connect 20 0 23 0; -#X connect 21 0 22 0; -#X connect 22 0 20 1; -#X connect 23 0 24 0; -#X connect 23 1 21 0; -#X connect 24 0 26 3; -#X connect 25 0 18 0; -#X connect 26 0 75 0; -#X connect 27 0 76 0; -#X connect 28 0 3 0; -#X connect 29 0 30 0; -#X connect 30 0 31 0; -#X connect 31 0 74 0; -#X connect 33 0 36 0; -#X connect 34 0 32 0; -#X connect 35 0 37 0; -#X connect 36 0 34 0; -#X connect 37 0 36 1; -#X connect 37 1 36 2; -#X connect 37 2 36 3; -#X connect 39 0 38 0; -#X connect 40 0 39 0; -#X connect 41 0 42 0; -#X connect 42 0 40 0; -#X connect 46 0 48 0; -#X connect 47 0 54 0; -#X connect 48 0 52 0; -#X connect 48 1 47 1; -#X connect 50 0 51 0; -#X connect 51 0 47 0; -#X connect 52 0 53 0; -#X connect 53 0 49 0; -#X connect 55 0 62 0; -#X connect 56 0 63 0; -#X connect 57 0 64 0; -#X connect 58 0 59 0; -#X connect 59 0 56 0; +#X connect 2 0 12 0; +#X connect 3 0 4 0; +#X connect 4 0 2 1; +#X connect 6 0 7 0; +#X connect 8 0 15 0; +#X connect 9 0 5 0; +#X connect 10 0 9 1; +#X connect 11 0 10 0; +#X connect 12 0 13 0; +#X connect 12 1 3 0; +#X connect 13 0 98 1; +#X connect 13 1 14 0; +#X connect 14 0 11 0; +#X connect 15 0 25 0; +#X connect 16 0 24 0; +#X connect 17 0 20 0; +#X connect 18 0 19 0; +#X connect 19 0 17 1; +#X connect 20 0 21 0; +#X connect 20 1 18 0; +#X connect 21 0 23 3; +#X connect 22 0 16 0; +#X connect 23 0 51 0; +#X connect 24 0 52 0; +#X connect 25 0 98 0; +#X connect 26 0 27 0; +#X connect 27 0 28 0; +#X connect 28 0 50 0; +#X connect 30 0 33 0; +#X connect 31 0 29 0; +#X connect 32 0 34 0; +#X connect 33 0 31 0; +#X connect 34 0 33 1; +#X connect 34 1 33 2; +#X connect 34 2 33 3; +#X connect 36 0 35 0; +#X connect 37 0 36 0; +#X connect 38 0 39 0; +#X connect 39 0 37 0; +#X connect 42 0 44 0; +#X connect 43 0 47 0; +#X connect 44 0 101 0; +#X connect 44 1 43 1; +#X connect 46 0 91 0; +#X connect 48 0 42 0; +#X connect 49 0 46 0; +#X connect 50 0 30 0; +#X connect 52 0 23 0; +#X connect 53 0 98 2; +#X connect 56 0 62 0; +#X connect 57 0 63 0; +#X connect 58 0 64 0; +#X connect 59 0 95 0; #X connect 61 0 66 0; #X connect 61 1 65 0; #X connect 62 0 67 0; -#X connect 62 1 56 1; -#X connect 64 0 69 0; +#X connect 62 1 57 1; +#X connect 64 0 68 0; #X connect 64 1 60 0; -#X connect 65 0 57 1; -#X connect 65 1 57 2; -#X connect 65 2 57 3; +#X connect 65 0 58 1; +#X connect 65 1 58 2; +#X connect 65 2 58 3; #X connect 66 0 67 1; #X connect 66 1 67 2; #X connect 66 2 67 3; -#X connect 67 0 57 0; -#X connect 68 0 61 0; -#X connect 70 0 58 0; -#X connect 71 0 55 0; -#X connect 72 0 46 0; -#X connect 73 0 50 0; -#X connect 74 0 33 0; -#X connect 76 0 19 0; -#X connect 82 0 68 0; -#X connect 83 0 2 2; +#X connect 67 0 58 0; +#X connect 69 0 59 0; +#X connect 70 0 56 0; +#X connect 71 0 103 0; +#X connect 73 0 75 0; +#X connect 74 0 78 0; +#X connect 75 0 99 0; +#X connect 75 1 74 1; +#X connect 77 0 90 0; +#X connect 79 0 73 0; +#X connect 80 0 77 0; +#X connect 82 0 84 0; +#X connect 83 0 87 0; +#X connect 84 0 96 0; +#X connect 84 1 83 1; +#X connect 86 0 92 0; +#X connect 88 0 82 0; +#X connect 89 0 86 0; +#X connect 90 0 74 0; +#X connect 91 0 43 0; +#X connect 92 0 83 0; +#X connect 93 0 76 0; +#X connect 94 0 85 0; +#X connect 95 0 57 0; +#X connect 96 0 94 0; +#X connect 97 0 99 1; +#X connect 98 0 9 0; +#X connect 99 0 93 0; +#X connect 100 0 45 0; +#X connect 101 0 100 0; +#X connect 102 0 3 1; +#X connect 103 0 61 0; +#X connect 104 0 18 1; +#X connect 105 0 32 0; +#X connect 108 0 109 0; +#X connect 109 0 110 0; +#X connect 111 0 2 0; +#X connect 112 0 17 0; From 573d25d0bdcce96c2c52ff5ef89bd1f48a8f459d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 28 Mar 2025 11:59:35 +0100 Subject: [PATCH 279/387] GL/GLU suffix for our own openGL error messages --- src/Utils/GLUtil.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Utils/GLUtil.cpp b/src/Utils/GLUtil.cpp index dacc94032..8f2135a46 100644 --- a/src/Utils/GLUtil.cpp +++ b/src/Utils/GLUtil.cpp @@ -36,35 +36,35 @@ namespace { static const char* _gemglErrorString(GLenum err) { switch(err) { default: break; - case GL_NO_ERROR: return "no error"; - case GL_INVALID_ENUM: return "invalid enumerant"; - case GL_INVALID_VALUE: return "invalid value"; - case GL_INVALID_OPERATION: return "invalid operation"; - case GL_STACK_OVERFLOW: return "stack overflow"; - case GL_STACK_UNDERFLOW: return "stack underflow"; - case GL_OUT_OF_MEMORY: return "out of memory"; - case GL_TABLE_TOO_LARGE: return "table too large"; - case GL_INVALID_FRAMEBUFFER_OPERATION: return "invalid framebuffer operation"; + case GL_NO_ERROR: return "no error (GL)"; + case GL_INVALID_ENUM: return "invalid enumerant (GL)"; + case GL_INVALID_VALUE: return "invalid value (GL)"; + case GL_INVALID_OPERATION: return "invalid operation (GL)"; + case GL_STACK_OVERFLOW: return "stack overflow (GL)"; + case GL_STACK_UNDERFLOW: return "stack underflow (GL)"; + case GL_OUT_OF_MEMORY: return "out of memory (GL)"; + case GL_TABLE_TOO_LARGE: return "table too large (GL)"; + case GL_INVALID_FRAMEBUFFER_OPERATION: return "invalid framebuffer operation (GL)"; //case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: return "invalid framebuffer operation"; - case GL_CONTEXT_LOST: return "context lost"; - case GL_RELATIVE_LINE_TO_NV: return "relative line to nv"; + case GL_CONTEXT_LOST: return "context lost (GL)"; + case GL_RELATIVE_LINE_TO_NV: return "relative line to nv (GL)"; /* GLU */ #ifdef GLU_INVALID_ENUM - case GLU_INVALID_ENUM: return "invalid enumerant"; + case GLU_INVALID_ENUM: return "invalid enumerant (GLU)"; #endif #ifdef GLU_INVALID_VALUE - case GLU_INVALID_VALUE: return "invalid value"; + case GLU_INVALID_VALUE: return "invalid value (GLU)"; #endif #ifdef GLU_OUT_OF_MEMORY - case GLU_OUT_OF_MEMORY: return "out of memory"; + case GLU_OUT_OF_MEMORY: return "out of memory (GLU)"; #endif #ifdef GLU_INCOMPATIBLE_GL_VERSION - case GLU_INCOMPATIBLE_GL_VERSION: return "incompatible gl version"; + case GLU_INCOMPATIBLE_GL_VERSION: return "incompatible gl version (GLU)"; #endif #ifdef GLU_INVALID_OPERATION - case GLU_INVALID_OPERATION: return "invalid operation"; + case GLU_INVALID_OPERATION: return "invalid operation (GLU)"; #endif /* GLU */ } return "unknown error"; From 625a2d9863e075823b8ad224daff338c977d295b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 28 Mar 2025 11:59:57 +0100 Subject: [PATCH 280/387] clear the entire error-queue --- src/Base/GemBase.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Base/GemBase.cpp b/src/Base/GemBase.cpp index 380f20571..91209e098 100644 --- a/src/Base/GemBase.cpp +++ b/src/Base/GemBase.cpp @@ -84,9 +84,14 @@ struct GemBase::PIMPL { { } void debugGLerror(const char*prefix=0) { if(debugGL) { - const char*errStr = gem::utils::gl::glErrorString(); - if(errStr) - parent->error("%s%s", prefix?prefix:"", errStr); + GLenum errNum; + while ((errNum = gem::utils::gl::glReportError(false))) { + const char*errStr = gem::utils::gl::glErrorString(errNum); + if(errStr) + parent->error("%s%s [%d]", prefix?prefix:"", errStr, errNum); + else + parent->error("%sopenGL error 0x%X", prefix?prefix:"", errNum); + } } } }; From 28dfb26c568e7bc6f7b3c84b31d9d970124b2d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 28 Mar 2025 12:49:42 +0100 Subject: [PATCH 281/387] [gemwin]: use [polygon] to draw line this somehow gets rid of an openGL error... --- abstractions/gemwin.pd | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/abstractions/gemwin.pd b/abstractions/gemwin.pd index 20fd2bf67..2d4c67a88 100644 --- a/abstractions/gemwin.pd +++ b/abstractions/gemwin.pd @@ -1441,13 +1441,15 @@ #X obj 118 222 GEMglFrustum -1 1 -1 1 1 20; #X obj 118 274 GEMglLoadIdentity; #X obj 118 254 GEMglMatrixMode GL_MODELVIEW; -#X obj 118 330 GEMglLineWidth 2; -#X obj 118 353 GEMglColor3f 1 1 1; -#X obj 118 374 GEMglBegin GL_LINES; -#X obj 118 399 GEMglVertex2f 0 -6; -#X obj 118 419 GEMglVertex2f 0 6; -#X obj 118 448 GEMglEnd; -#X obj 118 475 GEMglLineWidth 1; +#X obj 118 323 GEMglColor3f 1 1 1; +#X obj 118 351 polygon 2 \; draw line \; width 2 \; 0 -6 0 0 6 0; +#X obj 258 387 GEMglLineWidth 2; +#X obj 258 410 GEMglNormal3f 0 0 1; +#X obj 258 433 GEMglBegin GL_LINES; +#X obj 258 456 GEMglVertex2f 0 -6; +#X obj 258 479 GEMglVertex2f 0 6; +#X obj 258 502 GEMglEnd; +#X obj 258 525 GEMglLineWidth 1; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 5 0; @@ -1461,11 +1463,12 @@ #X connect 9 0 7 0; #X connect 10 0 9 0; #X connect 11 0 12 0; -#X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 17 0; +#X connect 17 0 18 0; +#X connect 18 0 19 0; #X restore 95 360 pd stereoline; #X obj 163 120 t l l; #X obj 156 312 r \$0-stereoLine; From 200f36a68b0c56a762bc9c7eeb702fd2d178dde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 28 Mar 2025 12:50:12 +0100 Subject: [PATCH 282/387] [GEMglReportError] report all errors in the queue --- src/openGL/GEMglReportError.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/openGL/GEMglReportError.cpp b/src/openGL/GEMglReportError.cpp index 788223a78..25aa1995c 100644 --- a/src/openGL/GEMglReportError.cpp +++ b/src/openGL/GEMglReportError.cpp @@ -43,12 +43,14 @@ GEMglReportError :: ~GEMglReportError () // void GEMglReportError :: render(GemState *state) { - GLenum err=glReportError(false); - if(err) { + GLenum result=0, err; + while ((err = glReportError(false))) { const char*errStr = glErrorString(err); error("GL[0x%X]: %s", err, errStr?errStr:"generic error"); + if (err) + result = err; } - outlet_float(m_outlet, static_cast(err)); + outlet_float(m_outlet, static_cast(result)); } From 26b376eb8709178bf4d89deed05019e6fd3b677f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 28 Mar 2025 13:49:35 +0100 Subject: [PATCH 283/387] and clear openGL errors when triggering render in [gemwin] --- src/Base/GemWindow.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Base/GemWindow.cpp b/src/Base/GemWindow.cpp index e2119f8ce..3c7838b95 100644 --- a/src/Base/GemWindow.cpp +++ b/src/Base/GemWindow.cpp @@ -19,12 +19,32 @@ #include "GemContext.h" #include "Gem/Exception.h" #include "GemBase.h" +#include "Utils/GLUtil.h" #include #include namespace { +void reportGLerrors(GemWindow*obj) +{ + GLenum errNum; + while ((errNum = gem::utils::gl::glReportError(false))) { + const char*errStr = gem::utils::gl::glErrorString(errNum); + if(obj) { + if(errStr) + obj->error("%s [%d]", errStr, errNum); + else + obj->error("openGL error 0x%X", errNum); + } else { + if(errStr) + pd_error(0, "%s [%d]", errStr, errNum); + else + pd_error(0, "openGL error 0x%X", errNum); + + } + } +} bool sendContextDestroyedMsg(t_pd*x) { if(!x) { @@ -34,6 +54,9 @@ bool sendContextDestroyedMsg(t_pd*x) t_atom a[1]; SETFLOAT(a+0, 0); pd_typedmess(x, s, 1, a); + + /* clear all openGL errors */ + reportGLerrors(NULL); return true; } }; @@ -197,6 +220,9 @@ class GemWindow::PIMPL goto fail; } + /* check for openGL errors */ + reportGLerrors(parent); + if(dispatch) parent->dispatch(); From ca9e3e064ad6900132e825e11ef50c27a56de2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 13:22:41 +0200 Subject: [PATCH 284/387] Pass lod to textureSize2DRect otherwise the shader won't compile... --- examples/10.glsl/shader/GLSL_mix.frag | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/10.glsl/shader/GLSL_mix.frag b/examples/10.glsl/shader/GLSL_mix.frag index c3a38d305..7ab878f69 100644 --- a/examples/10.glsl/shader/GLSL_mix.frag +++ b/examples/10.glsl/shader/GLSL_mix.frag @@ -7,9 +7,9 @@ uniform sampler2DRect tex0; uniform float style; uniform float mix_factor; varying vec2 texcoord0; -ivec2 size1 = textureSize2DRect(Ttex1); -ivec2 size2 = textureSize2DRect(Ttex2); -ivec2 size0 = textureSize2DRect(tex0); +ivec2 size1 = textureSize2DRect(Ttex1,0); +ivec2 size2 = textureSize2DRect(Ttex2,0); +ivec2 size0 = textureSize2DRect(tex0,0); void main (void) { From a23d1197672e8df86f9ab31a793277d01533ca8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 13:23:13 +0200 Subject: [PATCH 285/387] Cleaned up GLSL examples --- examples/10.glsl/01.simple_texture.pd | 18 +- examples/10.glsl/02.primitive_distortion.pd | 115 +-- examples/10.glsl/03.texture_distortion.pd | 121 +--- examples/10.glsl/04.game_of_life.pd | 97 +-- examples/10.glsl/05.multitexture.pd | 191 ++--- examples/10.glsl/05.multitexture_basic.pd | 119 +-- examples/10.glsl/05.multitexture_bis.pd | 169 ++--- examples/10.glsl/06.rectangle_multitexture.pd | 222 ++---- examples/10.glsl/07.framebuffer_and_shader.pd | 445 ++++-------- examples/10.glsl/08.multi_pass_rendering.pd | 345 ++------- .../10.glsl/09.vertex_texture_fetching.pd | 106 +-- examples/10.glsl/10.GPGPU_Physical_model.pd | 92 ++- examples/10.glsl/11.geometry.pd | 91 +-- examples/10.glsl/12.tri2fan.pd | 170 ++--- examples/10.glsl/13.panoramique.pd | 685 ++++++------------ examples/10.glsl/14.blur.pd | 104 ++- .../10.glsl/15.bicubic_image_interpolation.pd | 6 +- .../10.glsl/16.vertexbuffer_attributes.pd | 123 +--- examples/10.glsl/17.light.pd | 63 +- .../10.glsl/18.additive_audio_synthesis.pd | 133 +--- examples/10.glsl/_glsl.pd | 136 ++-- examples/10.glsl/_glsl_f.pd | 45 ++ examples/10.glsl/_glsl_vgf.pd | 78 ++ examples/10.glsl/single_blur.pd | 60 +- 24 files changed, 1248 insertions(+), 2486 deletions(-) create mode 100644 examples/10.glsl/_glsl_f.pd create mode 100644 examples/10.glsl/_glsl_vgf.pd diff --git a/examples/10.glsl/01.simple_texture.pd b/examples/10.glsl/01.simple_texture.pd index 782eb7f04..32a2d5cb2 100644 --- a/examples/10.glsl/01.simple_texture.pd +++ b/examples/10.glsl/01.simple_texture.pd @@ -11,11 +11,11 @@ #X msg 548 116 color 1 0 0; #X obj 106 69 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 76 197 glsl_fragment; -#X text 215 459 <- load texture; +#X text 245 459 <- load texture; #X obj 106 535 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 76 489 pix_image ../data/img1.jpg; #X msg 103 460 open ../data/img2.jpg; -#X msg 114 114 0; +#X msg 114 113 0; #X obj 283 72 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 315 70 <-load an other shader; #X text 319 84 (using rectangular texturing); @@ -76,16 +76,16 @@ #X restore 548 163 pd gemwin; #X msg 106 555 rectangle \$1; #X obj 294 134 s rectangle; -#X obj 114 135 s rectangle; +#X obj 114 134 s rectangle; #X obj 106 512 r rectangle; #X msg 32 167 print; #X msg 39 340 print; #X floatatom 192 372 0 0 0 0 - - - 0; #X msg 151 308 link \$1; -#X obj 151 259 change; #X obj 604 13 declare -lib Gem; #X msg 106 154 open shader/texture.frag; #X msg 283 154 open shader/texture_rect.frag; +#X obj 106 46 loadbang; #X connect 0 0 10 0; #X connect 1 0 3 0; #X connect 1 1 36 0; @@ -95,15 +95,15 @@ #X connect 6 0 3 3; #X connect 7 0 27 0; #X connect 8 0 29 0; -#X connect 9 0 40 0; +#X connect 9 0 39 0; #X connect 9 0 15 0; #X connect 10 0 1 0; -#X connect 10 1 38 0; +#X connect 10 1 37 0; #X connect 12 0 30 0; #X connect 13 0 7 0; #X connect 14 0 13 0; #X connect 15 0 32 0; -#X connect 16 0 41 0; +#X connect 16 0 40 0; #X connect 16 0 19 0; #X connect 19 0 31 0; #X connect 20 0 1 0; @@ -117,6 +117,6 @@ #X connect 35 0 1 0; #X connect 37 0 1 0; #X connect 37 0 2 0; -#X connect 38 0 37 0; +#X connect 39 0 10 0; #X connect 40 0 10 0; -#X connect 41 0 10 0; +#X connect 41 0 9 0; diff --git a/examples/10.glsl/02.primitive_distortion.pd b/examples/10.glsl/02.primitive_distortion.pd index 4c7632bf5..e7ee5420a 100644 --- a/examples/10.glsl/02.primitive_distortion.pd +++ b/examples/10.glsl/02.primitive_distortion.pd @@ -1,46 +1,16 @@ -#N canvas 228 61 587 690 10; +#N canvas 228 61 587 514 10; #X declare -lib Gem; #X obj 74 19 gemhead; -#X msg 29 100 print; -#X obj 74 362 glsl_program; -#X obj 215 141 change; -#X msg 98 333 print; -#X floatatom 215 164 2 0 0 0 ID - - 0; -#X obj 164 312 print linking; -#X obj 74 122 glsl_vertex; -#X obj 74 551 pix_texture; #X obj 74 44 alpha; -#X obj 101 497 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X floatatom 292 302 5 0 0 0 - - - 0; -#X msg 101 475 0; -#X msg 292 323 K \$1; -#X obj 74 594 sphere 2 30; -#N canvas 0 50 450 300 load_shader 0; -#X obj 89 99 t b b; -#X msg 119 126 0; -#X obj 89 154 outlet; -#X obj 89 71 gemhead 1; -#X connect 0 0 2 0; -#X connect 0 1 1 0; -#X connect 1 0 3 0; -#X connect 3 0 0 0; -#X restore 166 14 pd load_shader; -#N canvas 50 82 450 300 init_shader 0; -#X obj 89 154 outlet; -#X obj 89 45 inlet; -#X obj 89 73 change; -#X obj 89 100 t b; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 0 0; -#X restore 153 386 pd init_shader; -#X obj 101 454 loadbang; -#X text 347 301 <- 2; -#X msg 103 405 open texture.jpg; -#X obj 74 571 rotateXYZ -90 0 0; -#X msg 292 277 0.1; -#X obj 74 428 pix_image ../data/img3.jpg; -#X text 69 627 this shader create a dirty pseudo random value \, and move all vertices separately; +#X floatatom 203 160 5 0 0 0 - - - 0; +#X msg 203 181 K \$1; +#X obj 74 394 sphere 2 30; +#X text 258 159 <- 2; +#X msg 103 255 open texture.jpg; +#X obj 74 371 rotateXYZ -90 0 0; +#X msg 203 135 0.1; +#X obj 74 278 pix_image ../data/img3.jpg; +#X text 69 427 this shader create a dirty pseudo random value \, and move all vertices separately; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -87,51 +57,22 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 359 78 pd gemwin; -#X msg 101 517 rectangle \$1; -#X obj 74 180 glsl_fragment; -#X obj 162 202 change; -#X floatatom 162 225 2 0 0 0 ID - - 0; -#X obj 162 244 pack 0 0; -#X msg 162 291 link \$1 \$2; -#X msg 198 100 open \$1.frag; -#X obj 166 63 t s s; -#X text 423 651 ch 2007; +#X text 423 451 ch 2007; #X obj 389 43 declare -lib Gem; -#X msg 88 100 open \$1.vert; -#X msg 166 43 symbol shader/P_distord; -#X connect 0 0 9 0; -#X connect 1 0 7 0; -#X connect 2 0 22 0; -#X connect 2 1 16 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 30 1; -#X connect 7 0 27 0; -#X connect 7 1 3 0; -#X connect 8 0 20 0; -#X connect 9 0 7 0; -#X connect 10 0 26 0; -#X connect 11 0 13 0; -#X connect 12 0 10 0; -#X connect 13 0 2 0; -#X connect 15 0 37 0; -#X connect 16 0 21 0; -#X connect 17 0 12 0; -#X connect 19 0 22 0; -#X connect 20 0 14 0; -#X connect 21 0 11 0; -#X connect 22 0 8 0; -#X connect 24 0 25 0; -#X connect 26 0 8 0; -#X connect 27 0 2 0; -#X connect 27 1 28 0; -#X connect 28 0 29 0; -#X connect 29 0 30 0; -#X connect 30 0 31 0; -#X connect 31 0 2 0; -#X connect 31 0 6 0; -#X connect 32 0 27 0; -#X connect 33 0 36 0; -#X connect 33 1 32 0; -#X connect 36 0 7 0; -#X connect 37 0 33 0; +#X obj 74 201 _glsl shader/P_distord; +#X msg 84 178 print; +#X obj 74 311 pix_texture \; rectangle 0; +#X obj 203 110 loadbang; +#X connect 0 0 1 0; +#X connect 1 0 15 0; +#X connect 2 0 3 0; +#X connect 3 0 15 1; +#X connect 6 0 9 0; +#X connect 7 0 4 0; +#X connect 8 0 2 0; +#X connect 9 0 17 0; +#X connect 11 0 12 0; +#X connect 15 0 9 0; +#X connect 16 0 15 0; +#X connect 17 0 7 0; +#X connect 18 0 8 0; diff --git a/examples/10.glsl/03.texture_distortion.pd b/examples/10.glsl/03.texture_distortion.pd index 5bec487ba..60804cdec 100644 --- a/examples/10.glsl/03.texture_distortion.pd +++ b/examples/10.glsl/03.texture_distortion.pd @@ -1,54 +1,17 @@ -#N canvas 10 61 552 667 10; +#N canvas 10 61 552 547 10; #X declare -lib Gem; -#X text 381 660 ch 20007; -#X obj 74 -1 gemhead; -#X msg 29 80 print; -#X obj 74 382 glsl_program; -#X obj 149 281 pack 0 0; -#X msg 31 162 print; -#X obj 149 219 change; -#X obj 194 121 change; -#X msg 149 304 link \$1 \$2; -#X msg 98 353 print; -#X floatatom 149 245 2 0 0 0 ID - - 0; -#X floatatom 194 144 2 0 0 0 ID - - 0; -#X obj 167 325 print linking; -#X obj 74 196 glsl_fragment; -#X obj 74 102 glsl_vertex; -#X obj 74 571 pix_texture; -#X obj 74 24 alpha; -#X obj 124 522 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X floatatom 361 352 5 0 0 0 - - - 0; -#X floatatom 476 353 5 0 0 0 - - - 0; -#X msg 124 500 0; -#N canvas 0 0 450 300 load_shader 0; -#X obj 89 99 t b b; -#X msg 119 126 0; -#X obj 89 154 outlet; -#X obj 89 71 gemhead 1; -#X connect 0 0 2 0; -#X connect 0 1 1 0; -#X connect 1 0 3 0; -#X connect 3 0 0 0; -#X restore 146 6 pd load_shader; -#N canvas 0 0 450 300 init_shader 0; -#X obj 89 154 outlet; -#X obj 89 45 inlet; -#X obj 89 73 change; -#X obj 89 100 t b; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 0 0; -#X restore 155 405 pd init_shader; -#X obj 124 479 loadbang; -#X text 416 351 <- 2; -#X msg 92 431 open texture.jpg; -#X msg 361 373 K1 \$1; -#X msg 361 327 1; -#X msg 476 375 seed \$1; -#X obj 74 458 pix_image ../data/img3.jpg; -#X obj 74 596 rectangle 4 4; -#X text 73 627 This shader compute a dirty pseudo random number \, and distort the texture this with value; +#X obj 74 189 gemhead; +#X obj 74 214 alpha; +#X floatatom 203 170 5 0 0 0 - - - 0; +#X floatatom 318 171 5 0 0 0 - - - 0; +#X text 258 169 <- 2; +#X msg 92 331 open texture.jpg; +#X msg 203 191 K1 \$1; +#X msg 203 145 1; +#X msg 318 193 seed \$1; +#X obj 74 358 pix_image ../data/img3.jpg; +#X obj 74 446 rectangle 4 4; +#X text 73 487 This shader compute a dirty pseudo random number \, and distort the texture this with value; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -95,45 +58,21 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 354 58 pd gemwin; -#X msg 124 542 rectangle \$1; #X obj 384 23 declare -lib Gem; -#X msg 88 80 open \$1.vert; -#X msg 85 166 open \$1.frag; -#X msg 146 32 symbol shader/T_distord; -#X connect 1 0 16 0; -#X connect 2 0 14 0; -#X connect 3 0 29 0; -#X connect 3 1 22 0; -#X connect 4 0 8 0; -#X connect 5 0 13 0; -#X connect 6 0 10 0; -#X connect 7 0 11 0; -#X connect 8 0 3 0; -#X connect 8 0 12 0; -#X connect 9 0 3 0; -#X connect 10 0 4 0; -#X connect 11 0 4 1; -#X connect 13 0 3 0; -#X connect 13 1 6 0; -#X connect 14 0 13 0; -#X connect 14 1 7 0; -#X connect 15 0 30 0; -#X connect 16 0 14 0; -#X connect 17 0 34 0; -#X connect 18 0 26 0; -#X connect 19 0 28 0; -#X connect 20 0 17 0; -#X connect 21 0 38 0; -#X connect 22 0 27 0; -#X connect 23 0 20 0; -#X connect 25 0 29 0; -#X connect 26 0 3 0; -#X connect 27 0 18 0; -#X connect 28 0 3 0; -#X connect 29 0 15 0; -#X connect 32 0 33 0; -#X connect 34 0 15 0; -#X connect 36 0 14 0; -#X connect 37 0 13 0; -#X connect 38 0 36 0; -#X connect 38 0 37 0; +#X obj 74 257 _glsl shader/T_distord; +#X obj 203 119 loadbang; +#X obj 74 391 pix_texture \; rectangle 0; +#X text 431 480 ch 2007; +#X connect 0 0 1 0; +#X connect 1 0 15 0; +#X connect 2 0 6 0; +#X connect 3 0 8 0; +#X connect 5 0 9 0; +#X connect 6 0 15 1; +#X connect 7 0 2 0; +#X connect 8 0 15 1; +#X connect 9 0 17 0; +#X connect 12 0 13 0; +#X connect 15 0 9 0; +#X connect 16 0 7 0; +#X connect 17 0 10 0; diff --git a/examples/10.glsl/04.game_of_life.pd b/examples/10.glsl/04.game_of_life.pd index e6f2244dd..f629c26f3 100644 --- a/examples/10.glsl/04.game_of_life.pd +++ b/examples/10.glsl/04.game_of_life.pd @@ -1,30 +1,12 @@ -#N canvas 713 71 599 681 10; +#N canvas 713 71 599 512 10; #X declare -lib Gem; -#X obj 316 488 pix_snap2tex; -#X msg 356 461 0 0; -#X msg 402 460 500 500; -#X obj 356 438 t b b; -#X obj 316 513 alpha; -#X obj 316 563 square 4; +#X obj 316 323 alpha; +#X obj 316 373 square 4; #X msg 52 75 frame \$1; #X floatatom 52 57 5 0 0 0 - - - 0; -#X obj 356 419 loadbang; -#X msg 271 95 print; -#X obj 316 370 glsl_program; -#X obj 391 296 pack 0 0; -#X msg 273 177 print; -#X obj 391 234 change; -#X obj 436 136 change; -#X msg 391 321 link \$1 \$2; -#X msg 272 333 print; -#X floatatom 391 260 2 0 0 0 ID - - 0; -#X floatatom 436 159 2 0 0 0 ID - - 0; -#X obj 409 342 print linking; -#X obj 316 211 glsl_fragment; -#X obj 316 117 glsl_vertex; -#X obj 338 68 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X msg 328 84 print; #X obj 316 37 gemhead -1; -#X obj 316 537 colorRGB 1 1 1 1; +#X obj 316 347 colorRGB 1 1 1 1; #X obj 39 259 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 39 281 gemhead 50; #X obj 39 311 translateXYZ 0 0 1; @@ -32,13 +14,12 @@ #X obj 39 216 loadbang; #X msg 39 237 0; #X text 157 261 <- 3; -#X text 375 69 <- 2 : load shader; -#X obj 316 392 t b a; +#X obj 316 202 t b a; #X floatatom 69 362 5 0 0 0 - - - 0; #X floatatom 124 363 5 0 0 0 - - - 0; #X obj 69 381 / 100; #X obj 124 384 / 100; -#X text 13 634 This is an example of iterative process : the output of the shader is used for next frame input; +#X text 13 454 This is an example of iterative process : the output of the shader is used for next frame input; #X text 145 140 <----- 1; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -87,47 +68,25 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 52 117 pd gemwin; #X obj 484 13 declare -lib Gem; -#X msg 330 95 open shader/game.vert; -#X msg 327 181 open shader/game.frag; -#X connect 0 0 4 0; -#X connect 1 0 0 1; -#X connect 2 0 0 2; -#X connect 3 0 1 0; -#X connect 3 1 2 0; +#X obj 316 106 _glsl shader/game; +#X obj 316 298 pix_snap2tex 500 500; +#X connect 0 0 6 0; +#X connect 2 0 22 0; +#X connect 3 0 2 0; #X connect 4 0 24 0; -#X connect 6 0 41 0; -#X connect 7 0 6 0; -#X connect 8 0 3 0; -#X connect 9 0 21 0; -#X connect 10 0 33 0; -#X connect 11 0 15 0; -#X connect 12 0 20 0; -#X connect 13 0 17 0; -#X connect 14 0 18 0; -#X connect 15 0 10 0; -#X connect 15 0 19 0; -#X connect 16 0 10 0; -#X connect 17 0 11 0; -#X connect 18 0 11 1; -#X connect 20 0 10 0; -#X connect 20 1 13 0; -#X connect 21 0 20 0; -#X connect 21 1 14 0; -#X connect 22 0 43 0; -#X connect 22 0 44 0; -#X connect 23 0 21 0; -#X connect 24 0 5 0; -#X connect 25 0 26 0; -#X connect 26 0 27 0; -#X connect 27 0 28 0; -#X connect 29 0 30 0; -#X connect 30 0 25 0; -#X connect 33 0 0 0; -#X connect 33 1 0 0; -#X connect 34 0 36 0; -#X connect 35 0 37 0; -#X connect 36 0 28 1; -#X connect 37 0 28 2; -#X connect 40 0 41 0; -#X connect 43 0 21 0; -#X connect 44 0 20 0; +#X connect 5 0 24 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 11 0 12 0; +#X connect 12 0 7 0; +#X connect 14 0 25 0; +#X connect 14 1 25 0; +#X connect 15 0 17 0; +#X connect 16 0 18 0; +#X connect 17 0 10 1; +#X connect 18 0 10 2; +#X connect 21 0 22 0; +#X connect 24 0 14 0; +#X connect 25 0 0 0; diff --git a/examples/10.glsl/05.multitexture.pd b/examples/10.glsl/05.multitexture.pd index f4c3f758e..683eeaf4d 100644 --- a/examples/10.glsl/05.multitexture.pd +++ b/examples/10.glsl/05.multitexture.pd @@ -1,77 +1,32 @@ -#N canvas 563 91 925 703 10; +#N canvas 562 91 926 563 10; #X declare -lib Gem; #X obj 76 5 gemhead; -#X obj 75 429 glsl_program; -#X obj 151 268 pack 0 0; -#X obj 151 207 change; -#X msg 151 294 link \$1 \$2; -#X floatatom 151 233 2 0 0 0 ID - - 0; -#X floatatom 196 121 2 0 0 0 ID - - 0; -#X obj 169 315 print linking; #X msg 365 23 color 1 0 0; -#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; -#X obj 76 79 glsl_vertex; -#X obj 76 183 glsl_fragment; -#X obj 463 464 pix_texture; #X obj 546 271 openpanel; #X obj 546 248 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 463 230 gemhead 11; #X obj 463 204 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 463 90 1) turn on rendering; -#X msg 503 432 texunit 1; -#X obj 687 467 pix_texture; #X obj 768 271 openpanel; #X obj 768 250 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 687 204 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X msg 725 430 texunit 0; -#X obj 462 488 translateXYZ -2 0 0; -#X obj 685 490 translateXYZ 2 0 0; -#X msg 187 406 MyTex 0; -#X obj 75 644 pix_texture; -#X obj 218 498 openpanel; -#X obj 218 477 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X msg 254 381 MyTex1 1; -#X msg 255 406 MyTex 1; -#X msg 186 381 MyTex1 0; -#X msg 321 382 MyTex1 2; -#X msg 326 407 MyTex 2; -#N canvas 0 0 450 300 load_shader 0; -#X obj 89 99 t b b; -#X msg 119 126 0; -#X obj 89 154 outlet; -#X obj 89 71 gemhead 1; -#X connect 0 0 2 0; -#X connect 0 1 1 0; -#X connect 1 0 3 0; -#X connect 3 0 0 0; -#X restore 142 5 pd load_shader; -#N canvas 0 0 450 300 init_shader 0; -#X obj 89 154 outlet; -#X obj 89 45 inlet; -#X obj 89 73 change; -#X obj 89 100 t b; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 0 0; -#X restore 156 450 pd init_shader; +#X obj 463 488 translateXYZ -2 0 0; +#X obj 687 490 translateXYZ 2 0 0; +#X obj 219 298 openpanel; +#X obj 219 277 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X msg 546 296 set open \$1 \, bang; -#X obj 491 387 loadbang; -#X msg 218 519 set open \$1 \, bang; +#X msg 219 319 set open \$1 \, bang; #X msg 768 294 set open \$1 \, bang; #X obj 482 295 loadbang; -#X obj 153 519 loadbang; +#X obj 154 319 loadbang; #X obj 704 294 loadbang; -#X obj 220 569 loadbang; -#X obj 716 388 loadbang; #X obj 687 229 gemhead 22; -#X text 187 360 2) change shader texunit; #X msg 482 320 open ../data/img2.jpg; #X obj 463 349 pix_image ../data/img2.jpg; #X obj 687 346 pix_image ../data/img3.jpg; #X msg 704 318 open ../data/img3.jpg; -#X msg 153 544 open ../data/img1.jpg; -#X obj 75 613 pix_image ../data/img1.jpg; -#X obj 196 98 change; +#X msg 154 344 open ../data/img1.jpg; +#X obj 76 373 pix_image ../data/img1.jpg; #X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -119,74 +74,64 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 365 64 pd gemwin; -#X obj 75 670 rectangle 3 3; -#X obj 462 514 square 2; -#X obj 685 516 square 2; -#X msg 220 591 texunit 2 \, rectangle 0; -#X msg 491 409 texunit 0 \, rectangle 0; -#X msg 716 409 texunit 1 \, rectangle 0; +#X obj 76 470 rectangle 3 3; +#X obj 463 514 square 2; +#X obj 687 516 square 2; #X obj 793 7 declare -lib Gem; -#X msg 90 57 open shader/multitexture.vert; -#X msg 86 153 open shader/multitexture.frag; -#X connect 0 0 10 0; -#X connect 1 0 53 0; -#X connect 1 1 36 0; -#X connect 2 0 4 0; -#X connect 3 0 5 0; -#X connect 4 0 1 0; -#X connect 4 0 7 0; -#X connect 5 0 2 0; -#X connect 6 0 2 1; -#X connect 8 0 57 0; -#X connect 9 0 65 0; -#X connect 9 0 66 0; -#X connect 10 0 11 0; -#X connect 10 1 54 0; -#X connect 11 0 1 0; -#X connect 11 1 3 0; -#X connect 12 0 24 0; -#X connect 13 0 37 0; -#X connect 14 0 13 0; -#X connect 15 0 49 0; -#X connect 16 0 15 0; -#X connect 18 0 12 0; -#X connect 19 0 25 0; -#X connect 20 0 40 0; -#X connect 21 0 20 0; -#X connect 22 0 46 0; -#X connect 23 0 19 0; -#X connect 26 0 1 0; -#X connect 27 0 58 0; -#X connect 28 0 39 0; -#X connect 29 0 28 0; -#X connect 30 0 1 0; -#X connect 31 0 1 0; -#X connect 32 0 1 0; -#X connect 33 0 1 0; -#X connect 34 0 1 0; -#X connect 35 0 9 0; -#X connect 36 0 30 0; -#X connect 36 0 26 0; -#X connect 37 0 48 0; -#X connect 38 0 62 0; -#X connect 39 0 52 0; -#X connect 40 0 51 0; -#X connect 41 0 48 0; -#X connect 42 0 52 0; -#X connect 43 0 51 0; -#X connect 44 0 61 0; -#X connect 45 0 63 0; -#X connect 46 0 50 0; +#X obj 463 424 pix_texture \; rectangle 0 \; texunit 0; +#X obj 687 427 pix_texture \; rectangle 0 \; texunit 1; +#X msg 473 402 texunit \$1; +#X obj 473 379 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X msg 698 403 texunit \$1; +#X obj 698 380 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 76 414 pix_texture \; rectangle 0 \; texunit 2; +#X obj 76 179 _glsl shader/multitexture \; MyTex 0 \; MyTex1 1; +#X msg 143 82 0; +#X msg 143 105 1; +#X msg 143 128 2; +#X msg 133 151 MyTex \$1; +#X msg 203 82 0; +#X msg 203 105 1; +#X msg 203 128 2; +#X msg 193 151 MyTex1 \$1; +#X connect 0 0 41 0; +#X connect 1 0 29 0; +#X connect 2 0 14 0; +#X connect 3 0 2 0; +#X connect 4 0 22 0; +#X connect 5 0 4 0; +#X connect 7 0 16 0; +#X connect 8 0 7 0; +#X connect 9 0 20 0; +#X connect 12 0 15 0; +#X connect 13 0 12 0; +#X connect 14 0 21 0; +#X connect 15 0 25 0; +#X connect 16 0 24 0; +#X connect 17 0 21 0; +#X connect 18 0 25 0; +#X connect 19 0 24 0; +#X connect 20 0 23 0; +#X connect 21 0 22 0; +#X connect 22 0 34 0; +#X connect 23 0 35 0; +#X connect 24 0 23 0; +#X connect 25 0 26 0; +#X connect 26 0 40 0; +#X connect 28 0 29 0; +#X connect 34 0 10 0; +#X connect 35 0 11 0; +#X connect 36 0 34 0; +#X connect 37 0 36 0; +#X connect 38 0 35 0; +#X connect 39 0 38 0; +#X connect 40 0 30 0; +#X connect 41 0 26 0; +#X connect 42 0 45 0; +#X connect 43 0 45 0; +#X connect 44 0 45 0; +#X connect 45 0 41 1; +#X connect 46 0 49 0; +#X connect 47 0 49 0; #X connect 48 0 49 0; -#X connect 49 0 12 0; -#X connect 50 0 19 0; -#X connect 51 0 50 0; -#X connect 52 0 53 0; -#X connect 53 0 27 0; -#X connect 54 0 6 0; -#X connect 56 0 57 0; -#X connect 61 0 27 0; -#X connect 62 0 12 0; -#X connect 63 0 19 0; -#X connect 65 0 10 0; -#X connect 66 0 11 0; +#X connect 49 0 41 1; diff --git a/examples/10.glsl/05.multitexture_basic.pd b/examples/10.glsl/05.multitexture_basic.pd index 31a5c5c64..b30f8bd44 100644 --- a/examples/10.glsl/05.multitexture_basic.pd +++ b/examples/10.glsl/05.multitexture_basic.pd @@ -1,36 +1,14 @@ -#N canvas 507 4 759 759 10; +#N canvas 507 4 716 614 10; #X declare -lib Gem; #X obj 76 5 gemhead; -#X obj 76 339 glsl_program; -#X obj 151 268 pack 0 0; -#X obj 151 206 change; -#X msg 151 294 link \$1 \$2; -#X floatatom 151 232 2 0 0 0 ID - - 0; -#X floatatom 196 121 2 0 0 0 ID - - 0; -#X obj 169 315 print linking; #X msg 365 63 color 1 0 0; -#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; -#X obj 76 79 glsl_vertex; -#X obj 76 183 glsl_fragment; -#X obj 159 365 openpanel; -#X obj 137 367 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 159 195 openpanel; +#X obj 137 197 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 463 130 1) turn on rendering; -#N canvas 0 0 450 300 load_shader 0; -#X obj 89 99 t b b; -#X msg 119 126 0; -#X obj 89 154 outlet; -#X obj 89 71 gemhead 1; -#X connect 0 0 2 0; -#X connect 0 1 1 0; -#X connect 1 0 3 0; -#X connect 3 0 0 0; -#X restore 142 5 pd load_shader; -#X msg 159 390 set open \$1 \, bang; -#X obj 104 467 loadbang; -#X obj 95 389 loadbang; -#X msg 95 414 open ../data/img2.jpg; -#X obj 76 443 pix_image ../data/img2.jpg; -#X obj 196 98 change; +#X msg 159 220 set open \$1 \, bang; +#X obj 95 219 loadbang; +#X msg 95 244 open ../data/img2.jpg; +#X obj 76 273 pix_image ../data/img2.jpg; #X text 343 187 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -78,59 +56,36 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 365 104 pd gemwin; -#X obj 76 708 rectangle 3 3; -#X obj 76 514 pix_texture; -#X obj 159 536 openpanel; -#X obj 139 537 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X msg 159 561 set open \$1 \, bang; -#X obj 104 636 loadbang; -#X obj 95 560 loadbang; -#X obj 76 683 pix_texture; -#X msg 95 585 open ../data/img1.jpg; -#X obj 76 614 pix_image ../data/img1.jpg; +#X obj 76 568 rectangle 3 3; +#X obj 159 406 openpanel; +#X obj 139 407 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X msg 159 431 set open \$1 \, bang; +#X obj 95 430 loadbang; +#X msg 95 455 open ../data/img1.jpg; +#X obj 76 484 pix_image ../data/img1.jpg; #X obj 365 21 declare -lib Gem; -#X msg 90 57 open shader/multitexture.vert; -#X msg 86 153 open shader/multitexture.frag; -#X msg 104 658 rectangle 0 \, texunit 1; -#X msg 104 489 rectangle 0 \, texunit 0; -#X msg 170 341 MyTex 0 \, MyTex 1; -#X connect 0 0 10 0; -#X connect 1 0 20 0; -#X connect 1 1 40 0; -#X connect 2 0 4 0; -#X connect 3 0 5 0; -#X connect 4 0 1 0; -#X connect 4 0 7 0; -#X connect 5 0 2 0; -#X connect 6 0 2 1; +#X msg 223 81 MyTex 0 \, MyTex 1; +#X obj 76 104 _glsl shader/multitexture; +#X obj 223 59 loadbang; +#X obj 76 513 pix_texture \; rectangle 0 \; texunit 1; +#X obj 76 344 pix_texture \; rectangle 0 \; texunit 0; +#X connect 0 0 21 0; +#X connect 1 0 11 0; +#X connect 2 0 5 0; +#X connect 3 0 2 0; +#X connect 5 0 7 0; +#X connect 6 0 7 0; +#X connect 7 0 8 0; #X connect 8 0 24 0; -#X connect 9 0 36 0; -#X connect 9 0 37 0; #X connect 10 0 11 0; -#X connect 10 1 21 0; -#X connect 11 0 1 0; -#X connect 11 1 3 0; -#X connect 12 0 16 0; -#X connect 13 0 12 0; -#X connect 15 0 9 0; -#X connect 16 0 19 0; -#X connect 17 0 39 0; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 26 0; -#X connect 21 0 6 0; -#X connect 23 0 24 0; -#X connect 26 0 34 0; -#X connect 27 0 29 0; -#X connect 28 0 27 0; -#X connect 29 0 33 0; -#X connect 30 0 38 0; -#X connect 31 0 33 0; -#X connect 32 0 25 0; -#X connect 33 0 34 0; -#X connect 34 0 32 0; -#X connect 36 0 10 0; -#X connect 37 0 11 0; -#X connect 38 0 32 0; -#X connect 39 0 26 0; -#X connect 40 0 1 0; +#X connect 13 0 15 0; +#X connect 14 0 13 0; +#X connect 15 0 17 0; +#X connect 16 0 17 0; +#X connect 17 0 18 0; +#X connect 18 0 23 0; +#X connect 20 0 21 1; +#X connect 21 0 8 0; +#X connect 22 0 20 0; +#X connect 23 0 12 0; +#X connect 24 0 18 0; diff --git a/examples/10.glsl/05.multitexture_bis.pd b/examples/10.glsl/05.multitexture_bis.pd index 720bbf4fc..89212a493 100644 --- a/examples/10.glsl/05.multitexture_bis.pd +++ b/examples/10.glsl/05.multitexture_bis.pd @@ -1,17 +1,7 @@ #N canvas 619 198 1100 637 10; #X declare -lib Gem; #X obj 76 5 gemhead; -#X obj 75 429 glsl_program; -#X obj 151 268 pack 0 0; -#X obj 151 206 change; -#X msg 151 294 link \$1 \$2; -#X floatatom 151 232 2 0 0 0 ID - - 0; -#X floatatom 196 121 2 0 0 0 ID - - 0; -#X obj 169 315 print linking; #X msg 365 23 color 1 0 0; -#X obj 142 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; -#X obj 76 79 glsl_vertex; -#X obj 76 183 glsl_fragment; #X obj 749 262 openpanel; #X obj 749 239 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 666 221 gemhead 11; @@ -20,44 +10,16 @@ #X obj 971 262 openpanel; #X obj 971 241 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 890 195 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X msg 187 406 MyTex 0; -#X msg 254 381 MyTex1 1; -#X msg 255 406 MyTex 1; -#X msg 186 381 MyTex1 0; -#X msg 321 382 MyTex1 2; -#X msg 326 407 MyTex 2; -#N canvas 0 0 450 300 load_shader 0; -#X obj 89 99 t b b; -#X msg 119 126 0; -#X obj 89 154 outlet; -#X obj 89 71 gemhead 1; -#X connect 0 0 2 0; -#X connect 0 1 1 0; -#X connect 1 0 3 0; -#X connect 3 0 0 0; -#X restore 142 5 pd load_shader; -#N canvas 0 0 450 300 init_shader 0; -#X obj 89 154 outlet; -#X obj 89 45 inlet; -#X obj 89 73 change; -#X obj 89 100 t b; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 0 0; -#X restore 156 450 pd init_shader; #X msg 749 287 set open \$1 \, bang; -#X obj 694 378 loadbang; #X msg 971 285 set open \$1 \, bang; #X obj 685 286 loadbang; #X obj 907 285 loadbang; -#X obj 919 379 loadbang; #X obj 890 220 gemhead 22; -#X text 187 360 2) change shader texunit; +#X text 197 320 2) change shader texunit; #X msg 685 311 open ../data/img2.jpg; #X obj 666 340 pix_image ../data/img2.jpg; #X obj 890 337 pix_image ../data/img3.jpg; #X msg 907 309 open ../data/img3.jpg; -#X obj 196 98 change; #X text 343 147 This is an example of multitexturing \, this shader mixes 2 textures; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; @@ -107,84 +69,69 @@ #X restore 365 64 pd gemwin; #X obj 75 550 rectangle 3 3; #X obj 75 520 pix_multitexture 3; -#X obj 666 425 pix_texture; -#X obj 890 428 pix_texture; -#X msg 694 400 rectangle 0; -#X msg 919 400 rectangle 0; #X obj 526 264 openpanel; #X obj 526 241 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 443 223 gemhead 11; #X obj 443 197 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X msg 526 289 set open \$1 \, bang; -#X obj 471 380 loadbang; #X obj 462 288 loadbang; -#X obj 443 427 pix_texture; -#X msg 471 402 rectangle 0; #X msg 462 313 open ../data/img1.jpg; #X obj 443 342 pix_image ../data/img1.jpg; #X obj 983 7 declare -lib Gem; -#X msg 90 57 open shader/multitexture.vert; -#X msg 86 153 open shader/multitexture.frag; -#X connect 0 0 10 0; -#X connect 1 0 45 0; -#X connect 1 1 27 0; -#X connect 2 0 4 0; -#X connect 3 0 5 0; -#X connect 4 0 1 0; -#X connect 4 0 7 0; -#X connect 5 0 2 0; -#X connect 6 0 2 1; -#X connect 8 0 43 0; -#X connect 9 0 62 0; -#X connect 9 0 63 0; -#X connect 10 0 11 0; -#X connect 10 1 40 0; -#X connect 11 0 1 0; -#X connect 11 1 3 0; -#X connect 12 0 28 0; -#X connect 13 0 12 0; -#X connect 14 0 37 0; -#X connect 15 0 14 0; -#X connect 17 0 30 0; -#X connect 18 0 17 0; -#X connect 19 0 34 0; -#X connect 20 0 1 0; -#X connect 21 0 1 0; -#X connect 22 0 1 0; -#X connect 23 0 1 0; -#X connect 24 0 1 0; -#X connect 25 0 1 0; -#X connect 26 0 9 0; -#X connect 27 0 21 0; -#X connect 27 0 20 0; -#X connect 28 0 36 0; -#X connect 29 0 48 0; -#X connect 30 0 39 0; -#X connect 31 0 36 0; -#X connect 32 0 39 0; -#X connect 33 0 49 0; -#X connect 34 0 38 0; -#X connect 36 0 37 0; -#X connect 37 0 46 0; -#X connect 38 0 47 0; -#X connect 39 0 38 0; -#X connect 40 0 6 0; -#X connect 42 0 43 0; -#X connect 45 0 44 0; -#X connect 46 1 45 2; -#X connect 47 1 45 3; -#X connect 48 0 46 0; -#X connect 49 0 47 0; -#X connect 50 0 54 0; -#X connect 51 0 50 0; -#X connect 52 0 60 0; -#X connect 53 0 52 0; -#X connect 54 0 59 0; -#X connect 55 0 58 0; -#X connect 56 0 59 0; -#X connect 57 1 45 1; -#X connect 58 0 57 0; -#X connect 59 0 60 0; -#X connect 60 0 57 0; -#X connect 62 0 10 0; -#X connect 63 0 11 0; +#X obj 187 267 loadbang; +#X obj 75 429 _glsl shader/multitexture; +#X obj 187 290 t b b, f 12; +#X obj 443 427 pix_texture \; rectangle 0; +#X obj 666 425 pix_texture \; rectangle 0; +#X obj 890 428 pix_texture \; rectangle 0; +#X msg 113 389 MyTex \$1; +#X msg 113 328 0; +#X msg 123 348 1; +#X msg 123 368 2; +#X msg 222 340 0; +#X msg 232 360 1; +#X msg 232 380 2; +#X msg 222 401 MyTex1 \$1; +#X connect 0 0 35 0; +#X connect 1 0 22 0; +#X connect 2 0 10 0; +#X connect 3 0 2 0; +#X connect 4 0 17 0; +#X connect 5 0 4 0; +#X connect 7 0 11 0; +#X connect 8 0 7 0; +#X connect 9 0 14 0; +#X connect 10 0 16 0; +#X connect 11 0 19 0; +#X connect 12 0 16 0; +#X connect 13 0 19 0; +#X connect 14 0 18 0; +#X connect 16 0 17 0; +#X connect 17 0 38 0; +#X connect 18 0 39 0; +#X connect 19 0 18 0; +#X connect 21 0 22 0; +#X connect 24 0 23 0; +#X connect 25 0 29 0; +#X connect 26 0 25 0; +#X connect 27 0 32 0; +#X connect 28 0 27 0; +#X connect 29 0 31 0; +#X connect 30 0 31 0; +#X connect 31 0 32 0; +#X connect 32 0 37 0; +#X connect 34 0 36 0; +#X connect 35 0 24 0; +#X connect 36 0 41 0; +#X connect 36 1 45 0; +#X connect 37 1 24 1; +#X connect 38 1 24 2; +#X connect 39 1 24 3; +#X connect 40 0 35 1; +#X connect 41 0 40 0; +#X connect 42 0 40 0; +#X connect 43 0 40 0; +#X connect 44 0 47 0; +#X connect 45 0 47 0; +#X connect 46 0 47 0; +#X connect 47 0 35 1; diff --git a/examples/10.glsl/06.rectangle_multitexture.pd b/examples/10.glsl/06.rectangle_multitexture.pd index 71e6469f4..e3166e6ce 100644 --- a/examples/10.glsl/06.rectangle_multitexture.pd +++ b/examples/10.glsl/06.rectangle_multitexture.pd @@ -1,20 +1,14 @@ -#N canvas 684 111 648 675 10; +#N canvas 953 0 648 785 10; #X declare -lib Gem; -#X obj 279 76 gemhead; -#X obj 295 208 loadbang; -#X obj 279 251 pix_texture; -#X msg 295 231 rectangle 1 \, texunit 1; -#X obj 334 97 openpanel; -#X msg 334 118 open \$1; -#X obj 334 76 bng 15 250 50 0 empty empty empty 17 7 0 10 #f8fc00 #000000 #000000; -#X obj 459 76 gemhead; -#X obj 475 208 loadbang; -#X obj 459 251 pix_texture; -#X obj 514 97 openpanel; -#X msg 514 118 open \$1; -#X obj 514 76 bng 15 250 50 0 empty empty empty 17 7 0 10 #f8fc00 #000000 #000000; -#X msg 475 231 rectangle 1 \, texunit 2; -#X obj 279 275 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X obj 163 518 gemhead; +#X obj 218 539 openpanel; +#X msg 218 560 open \$1; +#X obj 218 518 bng 15 250 50 0 empty empty empty 17 7 0 10 #f8fc00 #000000 #000000; +#X obj 343 518 gemhead; +#X obj 398 539 openpanel; +#X msg 398 560 open \$1; +#X obj 398 518 bng 15 250 50 0 empty empty empty 17 7 0 10 #f8fc00 #000000 #000000; +#X obj 383 79 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #N canvas 0 0 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; @@ -33,36 +27,14 @@ #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 0 0; -#X restore 284 314 pd gemwin; -#X msg 284 295 create; -#X text 280 274 Create window:; -#X obj 101 358 cnv 15 100 120 empty empty empty 20 12 0 14 #00fc04 #404040 0; -#X obj 37 538 glsl_program; -#X obj 112 259 pack 0 0; -#X obj 112 214 change; -#X msg 112 285 link \$1 \$2; -#X floatatom 112 237 2 0 0 0 ID - - 0; -#X floatatom 145 130 2 0 0 0 ID - - 0; -#X obj 117 309 print linking; -#X obj 124 43 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; -#X obj 37 88 glsl_vertex; -#X obj 37 174 glsl_fragment; -#N canvas 0 0 450 300 load_shader 0; -#X msg 116 126 0; -#X obj 89 154 outlet; -#X obj 89 71 gemhead 1; -#X obj 89 100 t b b; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 1 0; -#X connect 3 1 0 0; -#X restore 124 21 pd load_shader; -#X obj 145 107 change; -#X obj 106 581 loadbang; -#X obj 37 21 gemhead 51; -#X msg 109 371 add; -#X msg 109 431 multiply; -#X msg 109 451 mix; +#X restore 388 118 pd gemwin; +#X msg 388 99 destroy; +#X text 384 78 Create window:; +#X obj 113 147 cnv 15 120 120 empty empty empty 20 12 0 14 #00fc04 #404040 0; +#X obj 37 111 gemhead 51; +#X msg 125 160 add; +#X msg 125 220 multiply; +#X msg 125 240 mix; #N canvas 0 0 450 300 route 0; #X obj 113 53 inlet; #X msg 113 95 0; @@ -83,104 +55,60 @@ #X connect 7 2 3 0; #X connect 7 3 4 0; #X connect 7 4 6 0; -#X restore 72 486 pd route; -#X msg 184 540 Ttex1 1; -#X msg 240 540 Ttex2 2; -#X msg 72 507 style \$1; -#X obj 109 337 loadbang; -#X obj 37 625 pix_texture; -#X msg 106 603 rectangle 1 \, texunit 0; -#X obj 37 598 pix_set; -#X obj 142 457 hsl 50 10 0 1 0 0 empty empty MIX_FACTOR -2 -4 0 7 #fcfcfc #000000 #000000 0 1; -#X msg 109 411 diff; -#X text 383 295 <- 1 : create GEM window; -#X text 248 375 add : add two texture together (it is easy to get a white out); -#X msg 109 391 subtract; -#X text 277 16 This shader program give you the possibility to mix two sources of different size. You can add \, subtract \, diff \, multiply and mix the two sources.; -#X text 248 401 subtract : subtract two texture together (it is easy to get a black out); -#X text 248 427 diff : subtract two texture together (get absolute value); -#X text 248 441 multiply : multiply two texture together; -#X text 248 455 mix : mix two texture together (use the mix factor for crossfading); -#N canvas 242 260 450 300 onebang 0; -#X obj 120 71 inlet; -#X obj 120 151 outlet; -#X obj 120 120 t b; -#X obj 120 100 change; -#X msg 161 71 set -1; -#X obj 161 11 gemhead; -#X obj 161 51 route 0; -#X obj 161 31 route gem_state; -#X connect 0 0 3 0; -#X connect 2 0 1 0; -#X connect 3 0 2 0; -#X connect 4 0 3 0; -#X connect 5 0 7 0; -#X connect 6 0 4 0; -#X connect 7 0 6 0; -#X restore 106 559 pd onebang; -#X text 206 357 <- 2 : test different mix; -#X obj 459 167 pix_resize 512 512; -#X obj 279 167 pix_resize 234 543; -#X obj 279 147 pix_image ../data/img3.jpg; -#X obj 459 147 pix_image ../data/img2.jpg; -#X text 292 186 images have different sizes; -#X msg 139 507 mix_factor \$1; -#X obj 37 646 square 4; -#X obj 543 647 declare -lib Gem; -#X msg 51 66 open shader/GLSL_mix.vert; -#X msg 51 151 open shader/GLSL_mix.frag; -#X connect 0 0 58 0; -#X connect 1 0 3 0; -#X connect 3 0 2 0; -#X connect 4 0 5 0; -#X connect 5 0 58 0; -#X connect 6 0 4 0; -#X connect 7 0 59 0; -#X connect 8 0 13 0; -#X connect 10 0 11 0; -#X connect 11 0 59 0; -#X connect 12 0 10 0; -#X connect 13 0 9 0; -#X connect 15 0 16 0; -#X connect 16 0 15 0; -#X connect 19 0 43 0; -#X connect 19 1 54 0; -#X connect 20 0 22 0; -#X connect 21 0 23 0; -#X connect 22 0 19 0; -#X connect 22 0 25 0; -#X connect 23 0 20 0; -#X connect 24 0 20 1; -#X connect 26 0 64 0; -#X connect 26 0 65 0; -#X connect 27 0 28 0; -#X connect 27 1 30 0; -#X connect 28 0 19 0; -#X connect 28 1 21 0; -#X connect 29 0 26 0; -#X connect 30 0 24 0; -#X connect 31 0 42 0; -#X connect 32 0 27 0; -#X connect 33 0 36 0; -#X connect 34 0 36 0; -#X connect 35 0 36 0; -#X connect 36 0 39 0; -#X connect 37 0 19 0; -#X connect 38 0 19 0; -#X connect 39 0 19 0; -#X connect 40 0 33 0; -#X connect 41 0 62 0; -#X connect 42 0 41 0; -#X connect 43 0 41 0; -#X connect 44 0 61 0; -#X connect 45 0 36 0; -#X connect 48 0 36 0; -#X connect 54 0 37 0; -#X connect 54 0 38 0; -#X connect 56 0 9 0; -#X connect 57 0 2 0; -#X connect 58 0 57 0; -#X connect 59 0 56 0; -#X connect 61 0 19 0; -#X connect 64 0 27 0; -#X connect 65 0 28 0; +#X restore 88 275 pd route; +#X msg 88 296 style \$1; +#X obj 125 126 loadbang; +#X obj 37 508 pix_set; +#X obj 169 246 hsl 50 10 0 1 0 1 empty empty MIX_FACTOR -2 -4 0 7 #fcfcfc #000000 #000000 2400 1; +#X msg 125 200 diff; +#X text 487 99 <- 1 : create GEM window; +#X text 276 209 add : add two texture together (it is easy to get a white out); +#X msg 125 180 subtract; +#X text 29 24 This shader program give you the possibility to mix two sources of different size. You can add \, subtract \, diff \, multiply and mix the two sources.; +#X text 276 235 subtract : subtract two texture together (it is easy to get a black out); +#X text 276 261 diff : subtract two texture together (get absolute value); +#X text 276 275 multiply : multiply two texture together; +#X text 276 289 mix : mix two texture together (use the mix factor for crossfading); +#X text 234 191 <- 2 : test different mix; +#X obj 343 609 pix_resize 512 512; +#X obj 163 609 pix_resize 234 543; +#X obj 163 589 pix_image ../data/img3.jpg; +#X obj 343 589 pix_image ../data/img2.jpg; +#X text 176 628 images have different sizes; +#X msg 166 296 mix_factor \$1; +#X obj 37 586 square 4; +#X obj 533 6 declare -lib Gem; +#X obj 37 535 pix_texture \; rectangle 1 \; texunit 0; +#X obj 163 693 pix_texture \; rectangle 1 \; texunit 1; +#X obj 343 693 pix_texture \; rectangle 1 \; texunit 2; +#X msg 60 417 bang; +#X obj 37 452 _glsl shader/GLSL_mix \; Ttex1 1 \; Ttex2 2; +#X connect 0 0 34 0; +#X connect 1 0 2 0; +#X connect 2 0 34 0; +#X connect 3 0 1 0; +#X connect 4 0 35 0; +#X connect 5 0 6 0; +#X connect 6 0 35 0; +#X connect 7 0 5 0; +#X connect 9 0 10 0; +#X connect 10 0 9 0; +#X connect 13 0 44 0; +#X connect 14 0 17 0; +#X connect 15 0 17 0; +#X connect 16 0 17 0; +#X connect 17 0 18 0; +#X connect 18 0 44 1; +#X connect 19 0 14 0; +#X connect 20 0 40 0; +#X connect 21 0 37 0; +#X connect 22 0 17 0; +#X connect 25 0 17 0; +#X connect 32 0 42 0; +#X connect 33 0 41 0; +#X connect 34 0 33 0; +#X connect 35 0 32 0; +#X connect 37 0 44 1; +#X connect 40 0 38 0; +#X connect 43 0 44 0; +#X connect 44 0 20 0; diff --git a/examples/10.glsl/07.framebuffer_and_shader.pd b/examples/10.glsl/07.framebuffer_and_shader.pd index f02d84ffe..728e7d545 100644 --- a/examples/10.glsl/07.framebuffer_and_shader.pd +++ b/examples/10.glsl/07.framebuffer_and_shader.pd @@ -1,224 +1,60 @@ -#N canvas 472 147 1126 659 10; +#N canvas 686 69 1126 659 10; #X declare -lib Gem; #X obj 9 470 translateXYZ 0 0 -4; #X obj 9 234 ortho; -#X floatatom 83 538 5 0 0 0 - - - 0; -#X msg 83 515 \$1; -#X obj 9 365 gemframebuffer; -#X obj 9 494 pix_texture; +#X floatatom 93 518 5 0 0 0 - - - 0; +#X msg 93 495 \$1; #X obj 218 474 translateXYZ 0 0 -4; -#X obj 218 501 pix_texture; -#X floatatom 484 153 5 0 0 0 - - - 0; -#X msg 484 131 \$1; -#X floatatom 325 550 5 0 0 0 - - - 0; -#X msg 325 528 \$1; -#X floatatom 104 412 5 0 0 0 - - - 0; -#X msg 104 389 \$1; -#X floatatom 294 411 5 0 0 0 - - - 0; -#X msg 294 388 \$1; -#X obj 435 58 loadbang; -#X obj 199 364 gemframebuffer; -#N canvas 573 206 496 427 shader 0; -#X obj 32 294 glsl_program; -#X obj 126 137 change; -#X obj 126 183 print linking; -#X obj 32 117 glsl_fragment; -#X floatatom 130 239 5 0 0 0 - - - 0; -#X floatatom 232 239 5 0 0 0 - - - 0; -#X floatatom 181 239 5 0 0 0 - - - 0; -#X msg 130 260 K1 \$1; -#X msg 181 260 K3 \$1; -#X msg 232 260 D1 \$1; -#X msg 130 214 0.25; -#X msg 126 158 link \$1; -#N canvas 0 0 450 300 load_shader 0; -#X obj 89 99 t b b; -#X msg 119 126 0; -#X obj 89 154 outlet; -#X obj 89 71 gemhead 1; -#X connect 0 0 2 0; -#X connect 0 1 1 0; -#X connect 1 0 3 0; -#X connect 3 0 0 0; -#X restore 42 70 pd load_shader; -#X obj 32 36 inlet; -#X obj 32 363 outlet; -#X obj 304 38 inlet; -#X obj 139 343 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#N canvas 0 0 450 300 init_shader 0; -#X obj 89 154 outlet; -#X obj 89 45 inlet; -#X obj 89 73 change; -#X obj 89 100 t b; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 0 0; -#X restore 113 318 pd init_shader; -#X obj 112 341 t b; -#X obj 395 43 inlet; -#X msg 181 213 0; -#X msg 232 215 0; -#X msg 193 151 text 0; -#X msg 42 93 open shader/wave.frag; -#X connect 0 0 14 0; -#X connect 0 1 17 0; -#X connect 1 0 11 0; -#X connect 3 0 0 0; -#X connect 3 1 1 0; -#X connect 4 0 7 0; -#X connect 5 0 9 0; -#X connect 6 0 8 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X connect 9 0 0 0; -#X connect 10 0 4 0; -#X connect 11 0 0 0; -#X connect 11 0 2 0; -#X connect 12 0 23 0; -#X connect 13 0 3 0; -#X connect 15 0 23 0; -#X connect 16 0 18 0; -#X connect 17 0 18 0; -#X connect 18 0 10 0; -#X connect 18 0 20 0; -#X connect 18 0 21 0; -#X connect 18 0 22 0; -#X connect 19 0 16 0; -#X connect 20 0 6 0; -#X connect 21 0 5 0; -#X connect 22 0 0 0; -#X connect 23 0 3 0; -#X restore 9 274 pd shader; -#X obj 137 289 t a; -#X obj 137 197 t b; -#X obj 147 177 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 137 156 loadbang; +#X floatatom 504 130 5 0 0 0 - - - 0; +#X msg 504 108 \$1; +#X floatatom 305 523 5 0 0 0 - - - 0; +#X msg 305 501 \$1; +#X floatatom 96 404 5 0 0 0 - - - 0; +#X msg 96 381 \$1; +#X floatatom 317 371 5 0 0 0 - - - 0; +#X msg 317 348 \$1; #X obj 218 421 t a a; -#X obj 402 518 separator; +#X obj 390 518 separator; #X obj 218 447 separator; -#X obj 218 537 color 1 1 1; -#X obj 218 563 rectangle 4 4; +#X obj 218 547 color 1 1 1; +#X obj 218 573 rectangle 4 4; #X obj 9 563 rectangle 4 4; -#X obj 66 250 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 93 251 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 390 472 t a; -#N canvas 0 0 857 562 border 0; -#X obj 14 10 inlet; -#X obj 13 46 separator; -#X obj 13 68 translateXYZ 0 4 -3.9; -#X obj 13 115 rectangle 5 0.12; -#X obj 182 46 separator; -#X obj 182 115 rectangle 5 0.12; -#X obj 351 45 separator; -#X obj 182 68 translateXYZ 0 -4 -3.9; -#X obj 351 67 translateXYZ 4 0 -3.9; -#X obj 351 114 rectangle 0.12 5; -#X obj 528 39 separator; -#X obj 528 108 rectangle 0.12 5; -#X obj 528 61 translateXYZ -4 0 -3.9; -#X obj 528 85 color 0.5 0.5 0.5; -#X obj 351 91 color 0.5 0.5 0.5; -#X obj 181 93 color 0.5 0.5 0.5; -#X obj 13 92 color 0.5 0.5 0.5; -#X connect 0 0 1 0; -#X connect 0 0 4 0; -#X connect 0 0 6 0; -#X connect 0 0 10 0; +#N canvas 746 763 695 201 border 0; +#X obj 243 10 inlet; +#X obj 43 96 separator; +#X obj 43 118 translateXYZ 0 4 -3.9; +#X obj 43 165 rectangle 5 0.12; +#X obj 192 96 separator; +#X obj 351 95 separator; +#X obj 192 118 translateXYZ 0 -4 -3.9; +#X obj 351 117 translateXYZ 4 0 -3.9; +#X obj 351 164 rectangle 0.12 5; +#X obj 488 95 separator; +#X obj 488 117 translateXYZ -4 0 -3.9; +#X obj 243 53 t a a a a; +#X obj 243 32 color 0.5 0.5 0.5; +#X connect 0 0 12 0; #X connect 1 0 2 0; -#X connect 2 0 16 0; -#X connect 4 0 7 0; -#X connect 6 0 8 0; -#X connect 7 0 15 0; -#X connect 8 0 14 0; -#X connect 10 0 12 0; -#X connect 12 0 13 0; -#X connect 13 0 11 0; -#X connect 14 0 9 0; -#X connect 15 0 5 0; -#X connect 16 0 3 0; -#X restore 390 569 pd border; +#X connect 2 0 3 0; +#X connect 4 0 6 0; +#X connect 5 0 7 0; +#X connect 6 0 3 0; +#X connect 7 0 8 0; +#X connect 9 0 10 0; +#X connect 10 0 8 0; +#X connect 11 0 1 0; +#X connect 11 1 4 0; +#X connect 11 2 5 0; +#X connect 11 3 9 0; +#X connect 12 0 11 0; +#X restore 479 497 pd border; #X obj 774 148 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 774 172 gemhead 40; #X floatatom 825 519 5 0 0 0 - - - 0; -#X obj 774 484 pix_texture; #X floatatom 876 520 5 0 0 0 - - - 0; -#X obj 442 357 pix_texture; #X floatatom 867 236 5 0 0 0 - - - 0; -#X obj 653 216 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 454 308 loadbang; -#X obj 786 442 loadbang; -#N canvas 93 153 804 667 _glsl 0; -#X obj 80 426 glsl_program; -#X obj 261 238 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; -#N canvas 0 22 450 300 open 0; -#X obj 75 103 openpanel; -#X obj 75 173 outlet; -#X obj 75 127 t b s; -#X msg 105 152 set open \$1; -#X obj 75 80 inlet; -#X connect 0 0 2 0; -#X connect 2 0 1 0; -#X connect 2 1 3 0; -#X connect 3 0 1 0; -#X connect 4 0 0 0; -#X restore 204 237 pd open; -#X msg 33 296 print; -#X obj 166 331 change; -#X msg 34 420 print; -#X obj 80 310 glsl_fragment; -#X floatatom 166 355 2 0 0 0 ID - - 0; -#X obj 184 400 print linking; -#X obj 13 52 inlet; -#X obj 80 462 outlet; -#X msg 93 273 open \$1.frag; -#X msg 204 261 open \$1; -#X obj 422 77 inlet; -#X obj 13 75 route bang; -#X obj 140 83 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 140 109 t b b; -#X msg 140 202 symbol \$1/\$2; -#X obj 255 11 gemhead 1; -#X msg 255 33 1; -#X obj 255 57 change; -#X obj 255 81 t b; -#X obj 159 447 change; -#X obj 159 468 t b; -#X obj 159 491 outlet; -#X msg 166 379 link \$1; -#X obj 140 133 symbol shader/vague; -#X connect 0 0 10 0; -#X connect 0 1 22 0; -#X connect 1 0 2 0; -#X connect 2 0 12 0; -#X connect 3 0 6 0; -#X connect 4 0 7 0; -#X connect 5 0 0 0; -#X connect 6 0 0 0; -#X connect 6 1 4 0; -#X connect 7 0 25 0; -#X connect 9 0 14 0; -#X connect 11 0 6 0; -#X connect 12 0 6 0; -#X connect 13 0 0 0; -#X connect 14 0 16 0; -#X connect 14 1 6 0; -#X connect 15 0 16 0; -#X connect 16 0 26 0; -#X connect 17 0 11 0; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 21 0 16 0; -#X connect 22 0 23 0; -#X connect 23 0 24 0; -#X connect 25 0 0 0; -#X connect 25 0 8 0; -#X connect 26 0 11 0; -#X restore 774 326 pd _glsl; #X obj 743 302 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X msg 435 82 texunit 3; -#X obj 410 108 pix_texture; -#X obj 181 299 t a; +#X obj 182 240 t a; #N canvas 0 0 450 300 gouttes 0; #X obj 27 79 translateXYZ 0 0 -4; #X obj 27 101 t a b b; @@ -245,35 +81,22 @@ #X connect 8 0 2 2; #X connect 10 0 9 0; #X connect 11 0 0 0; -#X restore 402 542 pd gouttes; -#X msg 244 284 quality 0; +#X restore 390 542 pd gouttes; #X obj 774 541 rectangle 4 4; #X obj 9 155 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 220 180 delay 1000; -#N canvas 0 0 450 300 init 0; -#X obj 89 154 outlet; -#X obj 89 100 change; -#X obj 89 127 t b; -#X obj 91 52 gemhead; -#X msg 91 73 1; -#X connect 1 0 2 0; -#X connect 2 0 0 0; -#X connect 3 0 4 0; -#X connect 4 0 1 0; -#X restore 220 157 pd init; #X obj 410 34 gemhead 16; -#X obj 199 342 gemhead 12; +#X obj 218 322 gemhead 12; #X obj 442 214 gemhead 17; #X obj 9 177 gemhead 10; #X obj 442 240 pix_image ../data/img2.jpg; #X msg 867 215 111; #X text 33 612 This shader is rendered into a framebuffer \, in order to use it in the next frame for a simple physical modeling simulation; #X text 345 168 This creates a texture (texunit 3) from the shaders' output; -#X text 437 386 this loads a texture (texunit 2); +#X text 437 336 this loads a texture (texunit 2); #X text 691 411 not used \, just to set texture coordinate; #X text 633 594 This uses the two textures (texunit 2 and 3) in order to render the final images; #X text 201 9 This is an example of rendering to texture (using framebuffer) and multitextures; -#X obj 402 497 t a a a a a; +#X obj 390 497 t a a a a a; #X obj 774 393 pix_set 512 512; #N canvas 87 154 452 208 Gem.init 0; #X obj 118 46 loadbang; @@ -321,84 +144,106 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 730 64 pd gemwin; -#X msg 786 463 rectangle 1; -#X msg 454 331 texunit 2 \, quality 1 \, rectangle 1; -#X msg 137 222 type FLOAT \, dimen 512 512 \, rectangle 1; -#X msg 220 202 quality 1 \, rectangle 1; #X msg 867 255 K \$1 \, texture1 2 \, texture2 3; #X text 880 276 texture1==base; #X text 882 294 texture2==deformation; #X obj 1004 13 declare -lib Gem; -#X connect 0 0 5 0; -#X connect 1 0 18 0; +#X obj 442 267 pix_texture \; texunit 2 \; quality 1 \; rectangle 1; +#X obj 774 484 pix_texture \; rectangle 1; +#X obj 867 189 loadbang; +#X obj 9 315 gemframebuffer \; type FLOAT \; dimen 512 512 \; rectangle 1; +#X obj 218 344 gemframebuffer \; type FLOAT \; dimen 512 512 \; rectangle 1; +#X obj 774 326 _glsl_f shader/vague; +#X floatatom 90 109 5 0 0 0 - \$0-K1 - 0; +#X floatatom 192 109 5 0 0 0 - \$0-D1 - 0; +#X floatatom 141 109 5 0 0 0 - \$0-K3 - 0; +#X msg 90 130 K1 \$1; +#X msg 141 130 K3 \$1; +#X msg 192 130 D1 \$1; +#N canvas 735 461 450 300 init 0; +#X obj 55 74 list prepend \$0; +#X msg 55 97 \; \$1-K1 0.25 \; \$1-K3 0 \; \$1-D1 0; +#X obj 55 51 inlet; +#X connect 0 0 1 0; +#X connect 2 0 0 0; +#X restore 990 483 pd init; +#X obj 990 456 loadbang; +#X obj 9 269 _glsl_f shader/wave; +#X msg 182 216 quality \$1; +#X obj 182 192 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 9 494 pix_texture \; rectangle 1 \; quality 1; +#X obj 218 501 pix_texture \; rectangle 1 \; quality 1; +#X obj 410 108 pix_texture \; texunit 3; +#X obj 390 455 spigot 1; +#X obj 444 455 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 390 432 t a a; +#X obj 533 455 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 479 454 spigot 0; +#X connect 0 0 67 0; +#X connect 1 0 64 0; #X connect 3 0 2 0; -#X connect 4 0 0 0; -#X connect 4 1 7 1; -#X connect 4 1 13 0; -#X connect 5 0 28 0; -#X connect 5 1 3 0; -#X connect 6 0 7 0; -#X connect 7 0 26 0; -#X connect 7 1 11 0; -#X connect 7 1 46 1; -#X connect 9 0 8 0; -#X connect 11 0 10 0; -#X connect 13 0 12 0; -#X connect 15 0 14 0; -#X connect 16 0 45 0; -#X connect 17 0 23 0; -#X connect 17 1 5 1; -#X connect 17 1 15 0; -#X connect 18 0 4 0; -#X connect 19 0 4 0; -#X connect 19 0 17 0; -#X connect 20 0 72 0; -#X connect 21 0 20 0; -#X connect 22 0 20 0; -#X connect 23 0 25 0; -#X connect 23 1 31 0; -#X connect 24 0 48 0; -#X connect 25 0 6 0; -#X connect 26 0 27 0; -#X connect 29 0 18 1; -#X connect 30 0 18 2; -#X connect 31 0 66 0; -#X connect 33 0 34 0; -#X connect 34 0 43 0; -#X connect 35 0 50 1; -#X connect 36 0 50 0; -#X connect 37 0 50 2; -#X connect 39 0 74 0; -#X connect 40 0 59 0; -#X connect 41 0 71 0; -#X connect 42 0 70 0; -#X connect 43 0 67 0; -#X connect 43 1 40 0; -#X connect 44 0 43 0; -#X connect 45 0 46 0; -#X connect 46 1 9 0; -#X connect 47 0 5 0; -#X connect 47 0 46 0; -#X connect 47 0 7 0; -#X connect 49 0 47 0; -#X connect 51 0 57 0; -#X connect 52 0 73 0; -#X connect 53 0 52 0; -#X connect 54 0 46 0; -#X connect 55 0 17 0; -#X connect 56 0 58 0; -#X connect 57 0 1 0; -#X connect 58 0 38 0; -#X connect 59 0 39 0; -#X connect 66 0 24 0; -#X connect 66 1 24 0; -#X connect 66 2 24 0; -#X connect 66 3 24 0; -#X connect 66 4 24 0; -#X connect 67 0 36 0; -#X connect 68 0 69 0; -#X connect 70 0 36 0; -#X connect 71 0 38 0; -#X connect 72 0 19 0; -#X connect 73 0 47 0; -#X connect 74 0 43 1; +#X connect 4 0 68 0; +#X connect 6 0 5 0; +#X connect 8 0 7 0; +#X connect 10 0 9 0; +#X connect 12 0 11 0; +#X connect 13 0 15 0; +#X connect 13 1 72 0; +#X connect 14 0 27 0; +#X connect 15 0 4 0; +#X connect 16 0 17 0; +#X connect 20 0 21 0; +#X connect 21 0 55 0; +#X connect 22 0 28 1; +#X connect 23 0 28 2; +#X connect 24 0 46 0; +#X connect 25 0 55 0; +#X connect 26 0 67 0; +#X connect 26 0 68 0; +#X connect 26 0 69 0; +#X connect 29 0 33 0; +#X connect 30 0 69 0; +#X connect 31 0 54 0; +#X connect 32 0 34 0; +#X connect 33 0 1 0; +#X connect 34 0 50 0; +#X connect 35 0 24 0; +#X connect 42 0 14 0; +#X connect 42 1 14 0; +#X connect 42 2 14 0; +#X connect 42 3 14 0; +#X connect 42 4 14 0; +#X connect 43 0 51 0; +#X connect 44 0 45 0; +#X connect 46 0 55 1; +#X connect 51 0 28 0; +#X connect 52 0 35 0; +#X connect 53 0 0 0; +#X connect 53 1 10 0; +#X connect 53 1 68 1; +#X connect 54 0 13 0; +#X connect 54 1 12 0; +#X connect 54 1 67 1; +#X connect 55 0 43 0; +#X connect 56 0 59 0; +#X connect 57 0 61 0; +#X connect 58 0 60 0; +#X connect 59 0 64 1; +#X connect 60 0 64 1; +#X connect 61 0 64 1; +#X connect 63 0 62 0; +#X connect 64 0 53 0; +#X connect 65 0 26 0; +#X connect 66 0 65 0; +#X connect 67 0 18 0; +#X connect 67 1 3 0; +#X connect 68 0 16 0; +#X connect 68 1 8 0; +#X connect 68 1 69 1; +#X connect 69 1 6 0; +#X connect 70 0 42 0; +#X connect 71 0 70 1; +#X connect 72 0 70 0; +#X connect 72 1 74 0; +#X connect 73 0 74 1; +#X connect 74 0 19 0; diff --git a/examples/10.glsl/08.multi_pass_rendering.pd b/examples/10.glsl/08.multi_pass_rendering.pd index 2239cd32d..441844d3f 100644 --- a/examples/10.glsl/08.multi_pass_rendering.pd +++ b/examples/10.glsl/08.multi_pass_rendering.pd @@ -1,243 +1,26 @@ -#N canvas 388 198 980 477 10; +#N canvas 417 350 980 477 10; #X declare -lib Gem; -#X obj 42 315 square 4; -#X obj 42 199 translateXYZ 0 0 -4; -#X obj 671 399 pix_texture; -#X obj 671 419 square 4; -#N canvas 370 126 407 295 init 0; -#X obj 106 175 outlet; -#X msg 125 89 type FLOAT; -#X obj 124 68 loadbang; -#X msg 146 109 dimen 1024 1024; -#X msg 211 147 rectangle 0; -#X connect 1 0 0 0; -#X connect 2 0 1 0; -#X connect 2 0 3 0; -#X connect 2 0 4 0; -#X connect 3 0 0 0; -#X connect 4 0 0 0; -#X restore 56 157 pd init; -#X obj 650 230 pix_texture; -#X obj 650 252 square 4; -#X floatatom 724 255 5 0 0 0 - - - 0; -#N canvas 157 111 392 206 init 0; -#X obj 93 68 t b; -#X obj 93 47 loadbang; -#X obj 93 159 outlet; -#X msg 93 118 type FLOAT \, dimen 1024 1024 \, rectangle 0; -#X connect 0 0 3 0; -#X connect 1 0 0 0; -#X connect 3 0 2 0; -#X restore 669 120 pd init; -#X obj 353 199 translateXYZ 0 0 -4; -#N canvas 70 0 407 295 init 0; -#X obj 106 175 outlet; -#X obj 106 68 loadbang; -#X msg 106 118 type FLOAT \, dimen 1024 1024 \, rectangle 0; -#X connect 1 0 2 0; -#X connect 2 0 0 0; -#X restore 373 156 pd init; +#X obj 42 335 square 4; +#X obj 42 249 translateXYZ 0 0 -4; +#X obj 671 359 square 4; +#X obj 650 232 square 4; +#X floatatom 724 265 5 0 0 0 - - - 0; +#X obj 353 259 translateXYZ 0 0 -4; #X text 6 4 first input \, render whatever in a framebuffer; -#X obj 691 357 loadbang; -#X obj 42 222 pix_image ../data/img1.jpg; +#X obj 42 272 pix_image ../data/img1.jpg; #X obj 42 54 gemhead 11; -#X obj 666 187 loadbang; -#X obj 650 166 translateXYZ 0 0 -4; -#X obj 650 142 gemframebuffer; -#X obj 353 177 gemframebuffer; -#N canvas 330 106 589 635 shader1 0; -#X obj 94 500 glsl_program; -#X obj 94 340 glsl_fragment; -#X obj 94 160 glsl_vertex; -#X obj 172 400 pack 0 0; -#X obj 162 200 change; -#X obj 182 375 change; -#X msg 172 420 link \$1 \$2; -#X obj 162 220 t b f; -#X obj 176 444 print linking; -#X obj 94 66 inlet; -#X obj 94 530 outlet; -#X obj 464 245 inlet; -#X floatatom 182 179 0 0 0 0 - - - 0; -#X floatatom 234 377 0 0 0 0 - - - 0; -#X msg 56 472 print; -#X msg 246 65 1; -#X obj 246 106 t b; -#X obj 246 46 gemhead 1; -#X obj 175 548 t b; -#X obj 175 571 outlet; -#X obj 246 86 change -1; -#X obj 175 524 change; -#X msg 246 135 open shader/T_distord.vert; -#X msg 289 160 open shader/T_distord.frag; -#X connect 0 0 10 0; -#X connect 0 1 21 0; -#X connect 1 0 0 0; -#X connect 1 1 5 0; -#X connect 1 1 13 0; -#X connect 2 0 1 0; -#X connect 2 1 4 0; -#X connect 2 1 12 0; -#X connect 3 0 6 0; -#X connect 4 0 7 0; -#X connect 5 0 3 0; -#X connect 6 0 0 0; -#X connect 6 0 8 0; -#X connect 7 0 3 0; -#X connect 7 1 3 1; -#X connect 9 0 2 0; -#X connect 11 0 0 0; -#X connect 14 0 0 0; -#X connect 15 0 20 0; -#X connect 16 0 22 0; -#X connect 16 0 23 0; -#X connect 17 0 15 0; -#X connect 18 0 19 0; -#X connect 20 0 16 0; -#X connect 21 0 18 0; -#X connect 22 0 2 0; -#X connect 23 0 1 0; -#X restore 42 81 pd shader1; -#N canvas 476 68 589 635 shader2 0; -#X obj 94 500 glsl_program; -#X obj 94 340 glsl_fragment; -#X obj 94 160 glsl_vertex; -#X obj 172 400 pack 0 0; -#X obj 162 200 change; -#X obj 182 375 change; -#X msg 172 420 link \$1 \$2; -#X obj 162 220 t b f; -#X obj 176 444 print linking; -#X obj 94 66 inlet; -#X obj 94 530 outlet; -#X obj 464 245 inlet; -#X floatatom 182 179 0 0 0 0 - - - 0; -#X floatatom 234 377 0 0 0 0 - - - 0; -#X msg 56 472 print; -#X msg 246 65 1; -#X obj 246 106 t b; -#X obj 246 46 gemhead 1; -#X obj 175 548 t b; -#X obj 175 571 outlet; -#X obj 246 86 change -1; -#X obj 175 524 change; -#X msg 246 135 open shader/P_distord.vert; -#X msg 289 160 open shader/P_distord.frag; -#X connect 0 0 10 0; -#X connect 0 1 21 0; -#X connect 1 0 0 0; -#X connect 1 1 5 0; -#X connect 1 1 13 0; -#X connect 2 0 1 0; -#X connect 2 1 4 0; -#X connect 2 1 12 0; -#X connect 3 0 6 0; -#X connect 4 0 7 0; -#X connect 5 0 3 0; -#X connect 6 0 0 0; -#X connect 6 0 8 0; -#X connect 7 0 3 0; -#X connect 7 1 3 1; -#X connect 9 0 2 0; -#X connect 11 0 0 0; -#X connect 14 0 0 0; -#X connect 15 0 20 0; -#X connect 16 0 22 0; -#X connect 16 0 23 0; -#X connect 17 0 15 0; -#X connect 18 0 19 0; -#X connect 20 0 16 0; -#X connect 21 0 18 0; -#X connect 22 0 2 0; -#X connect 23 0 1 0; -#X restore 353 78 pd shader2; -#N canvas 60 91 589 635 shader3 0; -#X obj 94 500 glsl_program; -#X obj 94 340 glsl_fragment; -#X obj 94 160 glsl_vertex; -#X obj 172 400 pack 0 0; -#X obj 162 200 change; -#X obj 182 375 change; -#X msg 172 420 link \$1 \$2; -#X obj 162 220 t b f; -#X obj 176 444 print linking; -#X obj 94 66 inlet; -#X obj 94 530 outlet; -#X obj 464 245 inlet; -#X floatatom 182 179 0 0 0 0 - - - 0; -#X floatatom 234 377 0 0 0 0 - - - 0; -#X msg 56 472 print; -#X msg 246 65 1; -#X obj 246 106 t b; -#X obj 246 46 gemhead 1; -#X obj 175 548 t b; -#X obj 175 571 outlet; -#X msg 326 429 MyTex 1; -#X msg 336 451 MyTex1 2; -#X obj 246 86 change -1; -#X obj 175 524 change; -#X msg 247 135 open shader/multitexture.vert; -#X msg 292 160 open shader/multitexture.frag; -#X connect 0 0 10 0; -#X connect 0 1 23 0; -#X connect 1 0 0 0; -#X connect 1 1 5 0; -#X connect 1 1 13 0; -#X connect 2 0 1 0; -#X connect 2 1 4 0; -#X connect 2 1 12 0; -#X connect 3 0 6 0; -#X connect 4 0 7 0; -#X connect 5 0 3 0; -#X connect 6 0 0 0; -#X connect 6 0 8 0; -#X connect 7 0 3 0; -#X connect 7 1 3 1; -#X connect 9 0 2 0; -#X connect 11 0 0 0; -#X connect 14 0 0 0; -#X connect 15 0 22 0; -#X connect 16 0 24 0; -#X connect 16 0 25 0; -#X connect 17 0 15 0; -#X connect 18 0 19 0; -#X connect 18 0 20 0; -#X connect 18 0 21 0; -#X connect 20 0 0 0; -#X connect 21 0 0 0; -#X connect 22 0 16 0; -#X connect 23 0 18 0; -#X connect 24 0 2 0; -#X connect 25 0 1 0; -#X restore 650 79 pd shader3; +#X obj 650 206 translateXYZ 0 0 -4; #X obj 650 54 gemhead 31; -#X obj 671 314 gemhead 32; -#X obj 56 248 loadbang; -#X obj 367 245 loadbang; -#X msg 56 270 rectangle 0; -#X msg 367 267 rectangle 0; -#X obj 42 295 pix_texture; -#X msg 55 135 texunit 1; -#X obj 55 113 loadbang; -#X obj 366 115 loadbang; -#X msg 366 136 texunit 2; -#X msg 141 48 1; -#X floatatom 141 69 5 0 0 0 - - - 0; -#X msg 141 88 K1 \$1; -#X text 183 69 change effect; +#X obj 671 284 gemhead 32; #X text 347 1 second input : same as 1st.; #X text 7 22 put framebuffer as texunit 1 \, for future use; #X text 348 17 render an image in framebuffer.; #X text 350 31 put framebuffer in texunit 2; #X text 632 8 finally :; #X text 631 23 shader mixing 2 textures in a framebuffer; -#X floatatom 449 79 5 0 0 0 - - - 0; -#X text 491 79 change effect; -#X msg 449 98 K \$1; -#X msg 449 58 0.1; #X text 161 433 <-------------------; -#X text 569 442 draw the final framebuffer (without shader); -#X obj 671 335 rotateXYZ -20 0 0; +#X text 569 382 draw the final framebuffer (without shader); +#X obj 671 305 rotateXYZ -20 0 0; #N canvas 87 154 247 179 Gem.init 0; #X obj 58 46 loadbang; #X obj 58 113 outlet; @@ -283,60 +66,56 @@ #X connect 15 0 16 0; #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; -#X restore 69 411 pd gemwin; -#X obj 42 177 gemframebuffer; -#X obj 353 332 mesh_square 10 10; -#X obj 353 311 scaleXYZ 4 4 1; +#X restore 69 412 pd gemwin; +#X obj 353 372 mesh_square 10 10; +#X obj 353 351 scaleXYZ 4 4 1; #X obj 353 57 gemhead 21; -#X obj 353 222 pix_image ../data/img2.jpg; -#X obj 353 291 pix_texture; -#X msg 666 209 rectangle 0; -#X msg 691 378 rectangle 0; +#X obj 353 282 pix_image ../data/img2.jpg; #X obj 99 376 declare -lib Gem; -#X connect 1 0 13 0; -#X connect 2 0 3 0; -#X connect 4 0 52 0; -#X connect 5 0 6 0; -#X connect 5 1 7 0; -#X connect 8 0 17 0; -#X connect 9 0 56 0; -#X connect 10 0 18 0; -#X connect 12 0 59 0; -#X connect 13 0 28 0; -#X connect 14 0 19 0; -#X connect 15 0 58 0; -#X connect 16 0 5 0; -#X connect 17 0 16 0; -#X connect 17 1 2 1; -#X connect 18 0 9 0; -#X connect 19 0 52 0; -#X connect 19 1 33 0; -#X connect 20 0 18 0; -#X connect 20 1 46 0; -#X connect 21 0 17 0; -#X connect 22 0 21 0; -#X connect 23 0 49 0; -#X connect 24 0 26 0; -#X connect 25 0 27 0; -#X connect 26 0 28 0; -#X connect 27 0 57 0; +#X obj 42 295 pix_texture \; rectangle 0; +#X obj 42 177 gemframebuffer \; type FLOAT \; dimen 1024 1024 \; rectangle 0 \; texunit 1; +#X obj 353 311 pix_texture \; rectangle 0; +#X obj 353 177 gemframebuffer \; type FLOAT \; dimen 1024 1024 \; rectangle 0 \; texunit 2; +#X obj 650 142 gemframebuffer \; type FLOAT \; dimen 1024 1024 \; rectangle 0; +#X obj 671 326 pix_texture \; rectangle 0; +#X obj 42 154 _glsl shader/T_distord; +#X obj 171 56 loadbang; +#X msg 171 79 1; +#X floatatom 171 102 5 0 0 0 - - - 0; +#X msg 171 124 K1 \$1; +#X obj 482 56 loadbang; +#X floatatom 482 102 5 0 0 0 - - - 0; +#X obj 353 154 _glsl shader/P_distord; +#X msg 482 124 K \$1; +#X msg 482 79 0.1; +#X obj 650 87 _glsl shader/multitexture \; MyTex 1 \; MyTex1 2; +#X connect 1 0 7 0; +#X connect 5 0 26 0; +#X connect 7 0 28 0; +#X connect 8 0 34 0; +#X connect 9 0 3 0; +#X connect 10 0 44 0; +#X connect 11 0 20 0; +#X connect 20 0 33 0; +#X connect 21 0 22 0; +#X connect 24 0 23 0; +#X connect 25 0 41 0; +#X connect 26 0 30 0; #X connect 28 0 0 0; -#X connect 29 0 52 0; -#X connect 30 0 29 0; -#X connect 31 0 32 0; -#X connect 32 0 18 0; -#X connect 33 0 34 0; -#X connect 34 0 35 0; -#X connect 35 0 19 1; -#X connect 43 0 45 0; -#X connect 45 0 20 1; -#X connect 46 0 43 0; -#X connect 49 0 2 0; -#X connect 50 0 51 0; -#X connect 52 0 1 0; -#X connect 54 0 53 0; -#X connect 55 0 20 0; -#X connect 56 0 57 0; -#X connect 57 0 54 0; -#X connect 58 0 5 0; -#X connect 59 0 2 0; +#X connect 29 0 1 0; +#X connect 30 0 24 0; +#X connect 31 0 5 0; +#X connect 32 0 9 0; +#X connect 32 1 33 1; +#X connect 33 0 2 0; +#X connect 34 0 29 0; +#X connect 35 0 36 0; +#X connect 36 0 37 0; +#X connect 37 0 38 0; +#X connect 38 0 34 1; +#X connect 39 0 43 0; +#X connect 40 0 42 0; +#X connect 41 0 31 0; +#X connect 42 0 41 1; +#X connect 43 0 40 0; +#X connect 44 0 32 0; diff --git a/examples/10.glsl/09.vertex_texture_fetching.pd b/examples/10.glsl/09.vertex_texture_fetching.pd index e812da738..915350f2b 100644 --- a/examples/10.glsl/09.vertex_texture_fetching.pd +++ b/examples/10.glsl/09.vertex_texture_fetching.pd @@ -1,44 +1,17 @@ -#N canvas 239 61 690 677 10; +#N canvas 474 41 690 677 10; #X declare -lib Gem; -#X obj 504 69 gemhead; -#X obj 576 346 pack 0 0; -#X obj 597 326 t b f; -#X msg 576 369 link \$1 \$2; -#X floatatom 597 307 2 0 0 0 ID - - 0; -#X floatatom 576 206 2 0 0 0 ID - - 0; -#X obj 594 390 print linking; -#X obj 504 480 pix_texture; -#X obj 540 118 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 504 179 gemhead; #X obj 28 199 gemhead 1; -#X obj 28 311 gemframebuffer; -#X obj 28 485 pix_texture; -#X obj 28 336 translateXYZ 0 0 -4; -#X obj 28 510 square 4; -#X obj 504 261 glsl_fragment; -#X obj 504 164 glsl_vertex; -#X obj 576 183 change; -#X obj 597 281 change; -#X obj 504 409 glsl_program; +#X obj 28 396 translateXYZ 0 0 -4; +#X obj 28 600 square 4; #X floatatom 542 505 5 0 0 0 - - - 0; -#X obj 49 231 loadbang; -#X obj 44 419 loadbang; -#X msg 520 456 quality 0; -#N canvas 70 231 450 300 load_glsl 0; -#X obj 51 22 gemhead; -#X obj 51 98 outlet; -#X obj 51 50 route gem_state; -#X obj 51 74 route 1; -#X connect 0 0 2 0; -#X connect 2 0 3 0; -#X connect 3 0 1 0; -#X restore 540 93 pd load_glsl; #X obj 504 525 rotateXYZ -30 0 0; #X obj 504 551 scaleXYZ 3 3 1; -#X obj 28 388 pix_image ../data/img1.jpg; -#X msg 46 363 open ../data/img2.jpg; +#X obj 28 448 pix_image ../data/img1.jpg; +#X msg 46 423 open ../data/img2.jpg; #X text 137 11 This patch need a glsl 3 compliant hardware; -#X text 26 535 draw an image in a framebuffer; -#X text 49 274 this configuration is very important to have full hardware support for vertex texture fetching; +#X text 26 625 draw an image in a framebuffer; +#X text 123 344 this configuration is very important to have full hardware support for vertex texture fetching; #X text 306 603 this example uses the framebuffer image in the vertex shader in the same way you can do in the pixel shader. This is only possible in this specific configuration (it's a hardware limitation); #X text 137 56 (nvidia 7000 and 8000 series should work \, ati X1000 series does not \, but later should); #X obj 504 579 mesh_square 200; @@ -49,7 +22,7 @@ #X obj 118 113 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; -#X restore 56 77 pd Gem.init; +#X restore 56 76 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -89,47 +62,22 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 26 94 pd gemwin; -#X msg 49 255 rectangle 0 \, type BYTE \, format RGB32 \, dimen 1024 1024; -#X msg 44 439 rectangle 0 \, quality 0; -#X obj 520 437 loadbang; #X obj 563 7 declare -lib Gem; -#X msg 518 142 open shader/fetching.vert; -#X msg 514 231 open shader/fetching.frag; -#X connect 0 0 15 0; -#X connect 1 0 3 0; -#X connect 2 0 1 0; -#X connect 2 1 1 1; -#X connect 3 0 6 0; -#X connect 3 0 18 0; -#X connect 4 0 2 0; -#X connect 5 0 1 0; -#X connect 7 0 24 0; -#X connect 8 0 41 0; -#X connect 8 0 42 0; -#X connect 9 0 10 0; -#X connect 10 0 12 0; -#X connect 10 1 7 1; -#X connect 11 0 13 0; -#X connect 12 0 26 0; -#X connect 14 0 18 0; -#X connect 14 1 17 0; -#X connect 15 0 14 0; -#X connect 15 1 16 0; -#X connect 16 0 5 0; -#X connect 17 0 4 0; -#X connect 18 0 7 0; -#X connect 19 0 24 1; -#X connect 20 0 37 0; -#X connect 21 0 38 0; -#X connect 22 0 7 0; -#X connect 23 0 8 0; -#X connect 24 0 25 0; -#X connect 25 0 33 0; -#X connect 26 0 11 0; -#X connect 27 0 26 0; -#X connect 35 0 36 0; -#X connect 37 0 10 0; -#X connect 38 0 11 0; -#X connect 39 0 22 0; -#X connect 41 0 15 0; -#X connect 42 0 14 0; +#X obj 504 292 _glsl shader/fetching; +#X obj 28 310 gemframebuffer \; rectangle 0 \; type BYTE \; format RGB32 \; dimen 1024 1024; +#X obj 28 545 pix_texture \; rectangle 0 \; quality 0; +#X obj 504 450 pix_texture \; quality 0; +#X connect 0 0 19 0; +#X connect 1 0 20 0; +#X connect 2 0 7 0; +#X connect 4 0 5 1; +#X connect 5 0 6 0; +#X connect 6 0 14 0; +#X connect 7 0 21 0; +#X connect 8 0 7 0; +#X connect 16 0 17 0; +#X connect 19 0 22 0; +#X connect 20 0 2 0; +#X connect 20 1 22 1; +#X connect 21 0 3 0; +#X connect 22 0 5 0; diff --git a/examples/10.glsl/10.GPGPU_Physical_model.pd b/examples/10.glsl/10.GPGPU_Physical_model.pd index 859964da1..5534e4ea1 100644 --- a/examples/10.glsl/10.GPGPU_Physical_model.pd +++ b/examples/10.glsl/10.GPGPU_Physical_model.pd @@ -551,10 +551,8 @@ #N canvas 729 308 812 549 shader_render 0; #X obj 315 429 pix_texture; #X obj 67 256 gemframebuffer; -#X obj 67 443 pix_texture; #X obj 67 305 translateXYZ 0 0 -4; -#X obj 67 462 square 4; -#X obj 85 369 loadbang; +#X obj 67 502 square 4; #N canvas 224 312 1052 398 init 0; #X obj 14 130 outlet; #X obj 14 30 inlet; @@ -709,55 +707,53 @@ #X obj 327 365 loadbang; #X obj 67 198 t a b; #X msg 410 185 texture 4; -#X msg 85 396 rectangle 1 \, quality 0; #X obj 637 140 loadbang; #X msg 637 162 15; #X obj 637 184 s \$0-scale; -#X connect 0 0 22 0; -#X connect 1 0 3 0; +#X obj 67 443 pix_texture \; rectangle 1 \; quality 0; +#X connect 0 0 20 0; +#X connect 1 0 2 0; #X connect 1 1 0 1; -#X connect 1 1 2 1; -#X connect 1 1 16 0; -#X connect 2 0 4 0; -#X connect 3 0 2 0; -#X connect 5 0 35 0; -#X connect 6 0 1 0; -#X connect 7 0 33 0; -#X connect 7 1 15 0; -#X connect 8 0 7 1; -#X connect 9 0 10 0; -#X connect 10 0 7 2; -#X connect 11 0 25 0; -#X connect 11 1 13 0; -#X connect 12 0 11 1; -#X connect 13 0 34 0; -#X connect 14 0 19 0; -#X connect 15 0 9 0; -#X connect 17 0 14 0; -#X connect 18 0 7 0; -#X connect 19 0 23 0; -#X connect 20 0 21 0; -#X connect 20 0 12 0; -#X connect 20 0 8 0; -#X connect 21 0 34 0; -#X connect 23 0 11 0; +#X connect 1 1 14 0; +#X connect 1 1 36 1; +#X connect 2 0 36 0; +#X connect 4 0 1 0; +#X connect 5 0 31 0; +#X connect 5 1 13 0; +#X connect 6 0 5 1; +#X connect 7 0 8 0; +#X connect 8 0 5 2; +#X connect 9 0 23 0; +#X connect 9 1 11 0; +#X connect 10 0 9 1; +#X connect 11 0 32 0; +#X connect 12 0 17 0; +#X connect 13 0 7 0; +#X connect 15 0 12 0; +#X connect 16 0 5 0; +#X connect 17 0 21 0; +#X connect 18 0 19 0; +#X connect 18 0 10 0; +#X connect 18 0 6 0; +#X connect 19 0 32 0; +#X connect 21 0 9 0; +#X connect 22 0 0 0; +#X connect 23 0 22 0; #X connect 24 0 0 0; -#X connect 25 0 24 0; -#X connect 26 0 0 0; -#X connect 27 0 22 0; -#X connect 28 0 22 0; -#X connect 29 0 22 0; -#X connect 30 0 24 1; -#X connect 30 0 24 2; -#X connect 30 0 24 3; -#X connect 31 0 30 0; -#X connect 32 0 26 0; -#X connect 33 0 1 0; -#X connect 33 1 6 0; -#X connect 34 0 11 2; -#X connect 35 0 2 0; -#X connect 36 0 37 0; -#X connect 37 0 38 0; +#X connect 25 0 20 0; +#X connect 26 0 20 0; +#X connect 27 0 20 0; +#X connect 28 0 22 1; +#X connect 28 0 22 2; +#X connect 28 0 22 3; +#X connect 29 0 28 0; +#X connect 30 0 24 0; +#X connect 31 0 1 0; +#X connect 31 1 4 0; +#X connect 32 0 9 2; +#X connect 33 0 34 0; +#X connect 34 0 35 0; +#X connect 36 0 3 0; #X restore 27 304 pd shader_render ______________; #X text 12 6 "Potential Flag" \, by Samuel Bianchini; #X floatatom 606 304 5 0 0 0 - - - 0; @@ -1086,7 +1082,7 @@ #X obj 387 226 clip 0 1; #X obj 304 74 cnv 10 12 12 empty empty empty 20 12 0 14 #606060 #404040 0; #N canvas 493 264 450 300 \$0-work 0; -#X scalar 1003-xy-pad-knob-1 52.0866 45 900 \;; +#X scalar 1003-xy-pad-knob-1 45 45 900 \;; #X coords 0 100 100 0 100 100 1; #X restore 260 30 pd \$0-work; #X obj 451 532 wrap; diff --git a/examples/10.glsl/11.geometry.pd b/examples/10.glsl/11.geometry.pd index 443df4d27..6a7f07442 100644 --- a/examples/10.glsl/11.geometry.pd +++ b/examples/10.glsl/11.geometry.pd @@ -1,35 +1,17 @@ -#N canvas 811 124 552 632 10; +#N canvas 839 124 545 415 10; #X declare -lib Gem; -#X floatatom 132 447 9 0 0 0 ID - - 0; -#X floatatom 132 279 9 0 0 0 ID - - 0; -#X obj 150 506 print linking; -#X obj 132 465 pack 0 0 0; -#X floatatom 126 364 9 0 0 0 ID - - 0; -#X obj 44 139 gemhead; -#X msg 132 485 link \$1 \$2 \$3; -#X obj 44 319 glsl_vertex; -#X obj 44 403 glsl_fragment; -#X obj 44 237 glsl_geometry; -#X obj 44 158 alpha; -#X floatatom 122 531 5 0 0 0 - - - 0; -#X floatatom 164 531 5 0 0 0 - - - 0; -#X floatatom 209 532 5 0 0 0 - - - 0; -#X obj 44 512 glsl_program; -#X obj 182 156 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 132 258 change; -#X obj 126 341 change; -#X obj 132 426 change; -#X obj 44 552 translateXYZ 0 0 0; +#X obj 44 134 gemhead; +#X obj 44 155 alpha; +#X floatatom 122 281 5 0 0 0 - - - 0; +#X floatatom 164 281 5 0 0 0 - - - 0; +#X floatatom 209 282 5 0 0 0 - - - 0; +#X obj 44 302 translateXYZ 0 0 0; #X obj 44 197 colorRGB 1 1 1; #X floatatom 128 174 5 0 0 0 - - - 0; -#X obj 44 177 depth 1; -#X obj 44 576 circle; +#X obj 44 176 depth 1; +#X obj 44 326 circle; #X text 184 7 geometry shader; #X text 48 28 The geometry shader is useful to create new geometry; -#X text 51 47 Here is an example where 40 circles are draw with 1 single primitive.; -#X text 49 87 Be aware that the geometry shader is computed after the vertex shader. coordinate are in 2d.; -#X obj 182 136 loadbang; -#X text 205 155 load shaders; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -76,45 +58,18 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 336 264 pd gemwin; -#X msg 233 206 set -1; -#X obj 182 176 t b b b b; #X obj 444 13 declare -lib Gem; -#X msg 58 217 open shader/geo.geom; -#X msg 56 299 open shader/geo.vert; -#X msg 57 384 open shader/geo.frag; -#X connect 0 0 3 0; -#X connect 1 0 3 2; -#X connect 3 0 6 0; -#X connect 4 0 3 1; -#X connect 5 0 10 0; -#X connect 6 0 2 0; -#X connect 6 0 14 0; -#X connect 7 0 8 0; -#X connect 7 1 17 0; -#X connect 8 0 14 0; -#X connect 8 1 18 0; -#X connect 9 0 7 0; -#X connect 9 1 16 0; -#X connect 10 0 22 0; -#X connect 11 0 19 1; -#X connect 12 0 19 2; -#X connect 13 0 19 3; -#X connect 14 0 19 0; -#X connect 15 0 33 0; -#X connect 16 0 1 0; -#X connect 17 0 4 0; -#X connect 18 0 0 0; -#X connect 19 0 23 0; -#X connect 20 0 9 0; -#X connect 21 0 20 2; -#X connect 22 0 20 0; -#X connect 28 0 15 0; -#X connect 30 0 31 0; -#X connect 32 0 18 0; -#X connect 33 0 37 0; -#X connect 33 1 35 0; -#X connect 33 2 36 0; -#X connect 33 3 32 0; -#X connect 35 0 9 0; -#X connect 36 0 7 0; -#X connect 37 0 8 0; +#X obj 44 236 _glsl_vgf shader/geo; +#X text 51 47 Here is an example where 40 circles are drawn with 1 single primitive.; +#X text 49 87 Be aware that the geometry shader is computed after the vertex shader. coordinates are in 2d.; +#X connect 0 0 1 0; +#X connect 1 0 8 0; +#X connect 2 0 5 1; +#X connect 3 0 5 2; +#X connect 4 0 5 3; +#X connect 5 0 9 0; +#X connect 6 0 15 0; +#X connect 7 0 6 2; +#X connect 8 0 6 0; +#X connect 12 0 13 0; +#X connect 15 0 5 0; diff --git a/examples/10.glsl/12.tri2fan.pd b/examples/10.glsl/12.tri2fan.pd index 021cded8d..7814e590b 100644 --- a/examples/10.glsl/12.tri2fan.pd +++ b/examples/10.glsl/12.tri2fan.pd @@ -1,42 +1,19 @@ -#N canvas 427 37 836 790 10; +#N canvas 606 49 689 596 10; #X declare -lib Gem; -#X floatatom 286 440 9 0 0 0 ID - - 0; -#X floatatom 249 264 9 0 0 0 ID - - 0; -#X obj 296 500 print linking; -#X obj 286 458 pack 0 0 0; -#X floatatom 244 350 9 0 0 0 ID - - 0; -#X obj 161 78 gemhead; -#X msg 286 479 link \$1 \$2 \$3; -#X obj 161 151 alpha; -#X floatatom 202 578 5 0 0 0 - - - 0; -#X floatatom 244 578 5 0 0 0 - - - 0; -#X floatatom 289 579 5 0 0 0 - - - 0; -#X obj 161 526 glsl_program; -#X obj 42 117 t b b b b; -#X msg 286 157 -1; -#X obj 42 98 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#X obj 249 242 change; -#X obj 244 329 change; -#X obj 286 419 change; -#X obj 161 650 t a b; -#X obj 209 650 loadbang; -#X msg 340 672 2; -#X obj 161 217 glsl_geometry; -#X obj 161 307 glsl_vertex; -#X obj 161 394 glsl_fragment; -#X obj 42 76 loadbang; -#X text 65 97 reload; -#X msg 422 113 create \, 1; -#X msg 431 135 destroy; -#X obj 402 654 triangle; -#X msg 473 202 lighting 1; -#X obj 161 627 spigot 1; -#X obj 230 628 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 470 633 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 402 631 spigot 0; -#X msg 460 180 perspec -0.1 0.1 -0.1 0.1 1 110; -#X obj 422 229 gemwin; -#X obj 460 159 loadbang; +#X obj 61 78 gemhead; +#X floatatom 102 348 5 0 0 0 - - - 0; +#X floatatom 144 348 5 0 0 0 - - - 0; +#X floatatom 189 349 5 0 0 0 - - - 0; +#X obj 87 226 bng 15 250 50 0 empty empty reload 17 7 0 10 #fcfcfc #000000 #000000; +#X obj 61 420 t a b; +#X msg 240 484 2; +#X msg 322 113 create \, 1; +#X msg 331 135 destroy; +#X obj 302 424 triangle; +#X obj 61 397 spigot 1; +#X obj 130 398 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 370 403 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 302 401 spigot 0; #N canvas 5 51 877 520 light 0; #X obj 225 45 gemhead 10; #X floatatom 258 78 5 0 0 0 - - - 0; @@ -75,79 +52,44 @@ #X connect 17 0 12 1; #X connect 18 0 17 0; #X connect 18 0 16 0; -#X restore 421 253 pd light; -#X obj 161 595 rotateXYZ -55 20 0; -#X floatatom 298 537 5 0 0 0 - - - 0; -#X text 235 13 replace triangle with 3 triangles the orientations of which depend on the normal of the original primitive; -#X obj 161 554 scaleXYZ 0.2 0.2 0.2; -#X msg 172 129 auto 1; -#X obj 172 108 loadbang; -#X obj 161 724 newWave 25 25; -#X msg 209 671 D1 0.01 \, D2 0.1; -#X floatatom 520 593 5 0 25 0 - - - 0; -#X obj 552 635 pack f f; -#X obj 520 611 t f f; -#X msg 552 655 force \$1 \$2 0.3; -#X obj 674 13 declare -lib Gem; -#X msg 176 195 open shader/tri2fan.geom; -#X msg 177 286 open shader/tri2fan.vert; -#X msg 178 370 open shader/tri2fan.frag; -#X connect 0 0 3 0; -#X connect 1 0 3 2; -#X connect 3 0 6 0; -#X connect 4 0 3 1; -#X connect 5 0 7 0; -#X connect 6 0 2 0; -#X connect 6 0 11 0; -#X connect 7 0 21 0; -#X connect 8 0 38 1; -#X connect 9 0 38 2; -#X connect 10 0 38 3; -#X connect 11 0 41 0; -#X connect 12 0 53 0; -#X connect 12 1 52 0; -#X connect 12 2 51 0; -#X connect 12 3 13 0; -#X connect 13 0 17 0; -#X connect 14 0 12 0; -#X connect 15 0 1 0; -#X connect 16 0 4 0; -#X connect 17 0 0 0; -#X connect 18 0 44 0; -#X connect 18 1 44 0; -#X connect 19 0 45 0; -#X connect 20 0 44 3; -#X connect 21 0 22 0; -#X connect 21 1 15 0; -#X connect 22 0 23 0; -#X connect 22 1 16 0; -#X connect 23 0 11 0; -#X connect 23 1 17 0; -#X connect 24 0 14 0; -#X connect 26 0 35 0; -#X connect 27 0 35 0; -#X connect 29 0 35 0; -#X connect 30 0 18 0; -#X connect 31 0 30 1; -#X connect 32 0 33 1; -#X connect 33 0 28 0; -#X connect 34 0 35 0; -#X connect 36 0 34 0; -#X connect 36 0 29 0; -#X connect 38 0 30 0; -#X connect 38 0 33 0; -#X connect 39 0 41 2; -#X connect 39 0 41 3; -#X connect 39 0 41 1; -#X connect 41 0 38 0; -#X connect 42 0 7 0; -#X connect 43 0 42 0; -#X connect 45 0 44 0; -#X connect 46 0 48 0; -#X connect 47 0 49 0; -#X connect 48 0 47 1; -#X connect 48 1 47 0; -#X connect 49 0 44 0; -#X connect 51 0 21 0; -#X connect 52 0 22 0; -#X connect 53 0 23 0; +#X restore 321 223 pd light; +#X obj 61 365 rotateXYZ -55 20 0; +#X floatatom 198 307 5 0 0 0 - - - 0; +#X text 135 13 replace triangle with 3 triangles the orientations of which depend on the normal of the original primitive; +#X obj 61 324 scaleXYZ 0.2 0.2 0.2; +#X floatatom 450 360 5 0 25 0 - - - 0; +#X obj 452 405 pack f f; +#X obj 450 378 t f f; +#X msg 452 425 force \$1 \$2 0.3; +#X obj 574 13 declare -lib Gem; +#X obj 61 245 _glsl_vgf shader/tri2fan; +#X obj 61 151 alpha \; auto 1; +#X obj 61 494 newWave 25 25 \; D1 0.01 \; D2 0.1; +#X obj 322 169 gemwin \; perspec -0.1 0.1 -0.1 0.1 1 110 \; lighting 1; +#X connect 0 0 25 0; +#X connect 1 0 15 1; +#X connect 2 0 15 2; +#X connect 3 0 15 3; +#X connect 4 0 24 0; +#X connect 5 0 26 0; +#X connect 5 1 26 0; +#X connect 6 0 26 3; +#X connect 7 0 27 0; +#X connect 8 0 27 0; +#X connect 10 0 5 0; +#X connect 11 0 10 1; +#X connect 12 0 13 1; +#X connect 13 0 9 0; +#X connect 15 0 10 0; +#X connect 15 0 13 0; +#X connect 16 0 18 2; +#X connect 16 0 18 3; +#X connect 16 0 18 1; +#X connect 18 0 15 0; +#X connect 19 0 21 0; +#X connect 20 0 22 0; +#X connect 21 0 20 1; +#X connect 21 1 20 0; +#X connect 22 0 26 0; +#X connect 24 0 18 0; +#X connect 25 0 24 0; diff --git a/examples/10.glsl/13.panoramique.pd b/examples/10.glsl/13.panoramique.pd index cfe4ced9c..52bb24e4d 100644 --- a/examples/10.glsl/13.panoramique.pd +++ b/examples/10.glsl/13.panoramique.pd @@ -2,507 +2,226 @@ #X declare -lib Gem; #X msg 17 131 create \, 1; #X msg 30 154 0 \, destroy; -#X obj 160 445 pix_texture; #X obj 169 205 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#N canvas 38 51 792 790 glsl 0; -#X obj 78 339 glsl_vertex; -#X msg 32 338 print; -#X obj 78 626 glsl_program; -#X obj 163 555 pack 0 0; -#X msg 30 476 print; -#X obj 163 511 change; -#X obj 150 358 change; -#X msg 163 579 link \$1 \$2; -#X msg 32 620 print; -#X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - - 0; -#X floatatom 150 381 2 0 0 0 ID - - 0; -#X obj 181 600 print linking; -#X obj 15 21 inlet; -#X obj 78 662 outlet; -#X obj 577 95 inlet; -#X obj 15 44 route bang; -#X obj 255 11 gemhead 1; -#X msg 255 33 1; -#X obj 255 57 change; -#X obj 255 81 t b; -#X obj 157 647 change; -#X obj 157 668 t b; -#X obj 158 690 outlet; -#X obj 90 426 symbol; -#X obj 90 401 t b; -#X msg 287 598 0; -#X obj 15 65 t b b b; -#X msg 118 307 open shader/panoramique.vert; -#X msg 90 453 open shader/panoramique.frag; -#X connect 0 0 9 0; -#X connect 0 1 6 0; -#X connect 1 0 0 0; -#X connect 2 0 14 0; -#X connect 2 1 21 0; -#X connect 3 0 7 0; -#X connect 4 0 9 0; -#X connect 5 0 10 0; -#X connect 6 0 11 0; -#X connect 6 0 25 0; -#X connect 7 0 2 0; -#X connect 7 0 12 0; -#X connect 8 0 2 0; -#X connect 9 0 2 0; -#X connect 9 1 5 0; -#X connect 10 0 3 0; -#X connect 11 0 3 1; -#X connect 13 0 16 0; -#X connect 15 0 2 0; -#X connect 16 0 27 0; -#X connect 16 1 0 0; -#X connect 17 0 18 0; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 28 0; -#X connect 21 0 22 0; -#X connect 22 0 23 0; -#X connect 24 0 29 0; -#X connect 25 0 24 0; -#X connect 26 0 21 0; -#X connect 27 0 10 0; -#X connect 27 1 28 0; -#X connect 27 2 26 0; -#X connect 28 0 0 0; -#X connect 29 0 9 0; -#X restore 160 222 pd glsl; -#X obj 175 285 loadbang; -#X obj 160 328 pix_image; -#X msg 174 419 rectangle 1; -#X obj 174 398 loadbang; -#X obj 160 357 pix_info 0 0 0; -#X msg 238 188 sizeX \$1; -#X msg 253 209 sizeY \$1; -#X obj 353 446 pix_texture; #X obj 362 206 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#N canvas 38 51 792 790 glsl 0; -#X obj 78 339 glsl_vertex; -#X msg 32 338 print; -#X obj 78 626 glsl_program; -#X obj 163 555 pack 0 0; -#X msg 30 476 print; -#X obj 163 511 change; -#X obj 150 358 change; -#X msg 163 579 link \$1 \$2; -#X msg 32 620 print; -#X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - - 0; -#X floatatom 150 381 2 0 0 0 ID - - 0; -#X obj 181 600 print linking; -#X obj 15 21 inlet; -#X obj 78 662 outlet; -#X obj 577 95 inlet; -#X obj 15 44 route bang; -#X obj 255 11 gemhead 1; -#X msg 255 33 1; -#X obj 255 57 change; -#X obj 255 81 t b; -#X obj 157 647 change; -#X obj 157 668 t b; -#X obj 158 690 outlet; -#X obj 90 426 symbol; -#X obj 90 401 t b; -#X msg 287 598 0; -#X obj 15 65 t b b b; -#X msg 118 307 open shader/panoramique.vert; -#X msg 90 453 open shader/panoramique.frag; -#X connect 0 0 9 0; -#X connect 0 1 6 0; -#X connect 1 0 0 0; -#X connect 2 0 14 0; -#X connect 2 1 21 0; -#X connect 3 0 7 0; -#X connect 4 0 9 0; -#X connect 5 0 10 0; -#X connect 6 0 11 0; -#X connect 6 0 25 0; -#X connect 7 0 2 0; -#X connect 7 0 12 0; -#X connect 8 0 2 0; -#X connect 9 0 2 0; -#X connect 9 1 5 0; -#X connect 10 0 3 0; -#X connect 11 0 3 1; -#X connect 13 0 16 0; -#X connect 15 0 2 0; -#X connect 16 0 27 0; -#X connect 16 1 0 0; -#X connect 17 0 18 0; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 28 0; -#X connect 21 0 22 0; -#X connect 22 0 23 0; -#X connect 24 0 29 0; -#X connect 25 0 24 0; -#X connect 26 0 21 0; -#X connect 27 0 10 0; -#X connect 27 1 28 0; -#X connect 27 2 26 0; -#X connect 28 0 0 0; -#X connect 29 0 9 0; -#X restore 353 223 pd glsl; -#X obj 368 286 loadbang; -#X obj 353 329 pix_image; -#X msg 367 418 rectangle 1; -#X obj 367 399 loadbang; -#X obj 353 358 pix_info 0 0 0; -#X msg 431 184 sizeX \$1; -#X msg 446 210 sizeY \$1; -#X obj 552 447 pix_texture; #X obj 561 207 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#N canvas 38 51 792 790 glsl 0; -#X obj 78 339 glsl_vertex; -#X msg 32 338 print; -#X obj 78 626 glsl_program; -#X obj 163 555 pack 0 0; -#X msg 30 476 print; -#X obj 163 511 change; -#X obj 150 358 change; -#X msg 163 579 link \$1 \$2; -#X msg 32 620 print; -#X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - - 0; -#X floatatom 150 381 2 0 0 0 ID - - 0; -#X obj 181 600 print linking; -#X obj 15 21 inlet; -#X obj 78 662 outlet; -#X obj 577 95 inlet; -#X obj 15 44 route bang; -#X obj 255 11 gemhead 1; -#X msg 255 33 1; -#X obj 255 57 change; -#X obj 255 81 t b; -#X obj 157 647 change; -#X obj 157 668 t b; -#X obj 158 690 outlet; -#X obj 90 426 symbol; -#X obj 90 401 t b; -#X msg 287 598 0; -#X obj 15 65 t b b b; -#X msg 118 307 open shader/panoramique.vert; -#X msg 90 453 open shader/panoramique.frag; -#X connect 0 0 9 0; -#X connect 0 1 6 0; -#X connect 1 0 0 0; -#X connect 2 0 14 0; -#X connect 2 1 21 0; -#X connect 3 0 7 0; -#X connect 4 0 9 0; -#X connect 5 0 10 0; -#X connect 6 0 11 0; -#X connect 6 0 25 0; -#X connect 7 0 2 0; -#X connect 7 0 12 0; -#X connect 8 0 2 0; -#X connect 9 0 2 0; -#X connect 9 1 5 0; -#X connect 10 0 3 0; -#X connect 11 0 3 1; -#X connect 13 0 16 0; -#X connect 15 0 2 0; -#X connect 16 0 27 0; -#X connect 16 1 0 0; -#X connect 17 0 18 0; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 28 0; -#X connect 21 0 22 0; -#X connect 22 0 23 0; -#X connect 24 0 29 0; -#X connect 25 0 24 0; -#X connect 26 0 21 0; -#X connect 27 0 10 0; -#X connect 27 1 28 0; -#X connect 27 2 26 0; -#X connect 28 0 0 0; -#X connect 29 0 9 0; -#X restore 552 224 pd glsl; -#X obj 567 287 loadbang; -#X obj 552 330 pix_image; -#X msg 566 419 rectangle 1; -#X obj 566 400 loadbang; -#X obj 552 359 pix_info 0 0 0; -#X msg 614 188 sizeX \$1; -#X msg 633 206 sizeY \$1; #X obj 160 467 translateXYZ -3 0 0; -#X obj 352 466 translateXYZ -1 0 0; -#X obj 551 467 translateXYZ 1 0 0; -#X obj 747 448 pix_texture; +#X obj 353 466 translateXYZ -1 0 0; +#X obj 552 467 translateXYZ 1 0 0; #X obj 756 208 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; -#N canvas 38 51 792 790 glsl 0; -#X obj 78 339 glsl_vertex; -#X msg 32 338 print; -#X obj 78 626 glsl_program; -#X obj 163 555 pack 0 0; -#X msg 30 476 print; -#X obj 163 511 change; -#X obj 150 358 change; -#X msg 163 579 link \$1 \$2; -#X msg 32 620 print; -#X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - - 0; -#X floatatom 150 381 2 0 0 0 ID - - 0; -#X obj 181 600 print linking; -#X obj 15 21 inlet; -#X obj 78 662 outlet; -#X obj 577 95 inlet; -#X obj 15 44 route bang; -#X obj 255 11 gemhead 1; -#X msg 255 33 1; -#X obj 255 57 change; -#X obj 255 81 t b; -#X obj 157 647 change; -#X obj 157 668 t b; -#X obj 158 690 outlet; -#X obj 90 426 symbol; -#X obj 90 401 t b; -#X msg 287 598 0; -#X obj 15 65 t b b b; -#X msg 118 307 open shader/panoramique.vert; -#X msg 90 452 open shader/panoramique.frag; -#X connect 0 0 9 0; -#X connect 0 1 6 0; -#X connect 1 0 0 0; -#X connect 2 0 14 0; -#X connect 2 1 21 0; -#X connect 3 0 7 0; -#X connect 4 0 9 0; -#X connect 5 0 10 0; -#X connect 6 0 11 0; -#X connect 6 0 25 0; -#X connect 7 0 2 0; -#X connect 7 0 12 0; -#X connect 8 0 2 0; -#X connect 9 0 2 0; -#X connect 9 1 5 0; -#X connect 10 0 3 0; -#X connect 11 0 3 1; -#X connect 13 0 16 0; -#X connect 15 0 2 0; -#X connect 16 0 27 0; -#X connect 16 1 0 0; -#X connect 17 0 18 0; -#X connect 18 0 19 0; -#X connect 19 0 20 0; -#X connect 20 0 28 0; -#X connect 21 0 22 0; -#X connect 22 0 23 0; -#X connect 24 0 29 0; -#X connect 25 0 24 0; -#X connect 26 0 21 0; -#X connect 27 0 10 0; -#X connect 27 1 28 0; -#X connect 27 2 26 0; -#X connect 28 0 0 0; -#X connect 29 0 9 0; -#X restore 747 225 pd glsl; -#X obj 762 288 loadbang; -#X obj 747 331 pix_image; -#X msg 761 420 rectangle 1; -#X obj 761 401 loadbang; -#X obj 747 360 pix_info 0 0 0; -#X msg 825 186 sizeX \$1; -#X msg 840 212 sizeY \$1; -#X obj 746 468 translateXYZ 3 0 0; -#X floatatom 199 108 5 0 0 0 - - - 0; -#X msg 199 127 dZ \$1; -#X obj 17 470 s shaders; -#X obj 206 245 s init_shader; -#X obj 399 244 s init_shader; -#X obj 600 244 s init_shader; -#X obj 794 246 s init_shader; -#X obj 399 164 r shaders; -#X obj 598 166 r shaders; -#X obj 793 167 r shaders; +#X obj 747 468 translateXYZ 3 0 0; +#X floatatom 199 158 5 0 0 0 - - - 0; +#X msg 199 177 dZ \$1; +#X obj 18 470 s shaders; +#X obj 399 214 r shaders; +#X obj 598 216 r shaders; +#X obj 793 217 r shaders; #X obj 160 546 rectangle 1 0.75; -#X obj 352 547 rectangle 1 0.75; -#X obj 551 548 rectangle 1 0.75; -#X obj 746 549 rectangle 1 0.75; +#X obj 353 547 rectangle 1 0.75; +#X obj 552 548 rectangle 1 0.75; +#X obj 747 549 rectangle 1 0.75; #X obj 160 503 translateXYZ 0 0 0; #X obj 201 486 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0.12 256; #X obj 259 486 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.06 256; -#X obj 352 505 translateXYZ 0 0 0; -#X obj 393 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; -#X obj 451 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; -#X obj 551 506 translateXYZ 0 0 0; -#X obj 592 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.11 256; -#X obj 650 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.03 256; -#X obj 746 505 translateXYZ 0 0 0; -#X obj 787 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.18 256; -#X obj 845 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.05 256; -#X obj 160 10 gemhead 10; +#X obj 353 505 translateXYZ 0 0 0; +#X obj 394 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 452 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; +#X obj 552 506 translateXYZ 0 0 0; +#X obj 593 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.11 256; +#X obj 651 489 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.03 256; +#X obj 747 505 translateXYZ 0 0 0; +#X obj 788 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.18 256; +#X obj 846 488 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 -0.05 256; +#X obj 160 11 gemhead 10; #X obj 353 11 gemhead 20; -#X obj 552 12 gemhead 30; -#X obj 747 13 gemhead 40; -#X obj 160 144 alpha; -#X obj 353 143 alpha; -#X obj 552 139 alpha; -#X obj 747 142 alpha; -#X msg 256 153 ShadeL \$1; -#X obj 199 65 r init_shader; -#X obj 256 132 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; -#X msg 447 133 ShadeL \$1; -#X obj 447 112 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 39 256; -#X msg 634 135 ShadeL \$1; -#X obj 634 114 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 35 256; -#X msg 831 133 ShadeL \$1; -#X obj 831 112 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 23 256; +#X obj 552 11 gemhead 30; +#X obj 747 11 gemhead 40; +#X obj 160 53 alpha; +#X obj 353 53 alpha; +#X obj 552 53 alpha; +#X obj 747 53 alpha; +#X msg 276 183 ShadeL \$1; +#X obj 199 115 r init_shader; +#X obj 276 162 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256; +#X msg 447 183 ShadeL \$1; +#X obj 447 162 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 39 256; +#X msg 634 185 ShadeL \$1; +#X obj 634 164 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 35 256; +#X msg 831 183 ShadeL \$1; +#X obj 831 162 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 23 256; #X msg 212 526 -1; #X msg 269 525 -0.75; #X text 163 526 invert; -#X msg 406 525 -1; -#X msg 463 524 -0.75; -#X text 357 525 invert; -#X msg 605 528 -1; -#X msg 662 527 -0.75; -#X text 556 528 invert; -#X msg 800 529 -1; -#X msg 857 528 -0.75; -#X text 751 529 invert; -#X obj 17 258 gemwin; -#X obj 37 208 loadbang; +#X msg 407 525 -1; +#X msg 464 524 -0.75; +#X text 358 525 invert; +#X msg 606 528 -1; +#X msg 663 527 -0.75; +#X text 557 528 invert; +#X msg 801 529 -1; +#X msg 858 528 -0.75; +#X text 752 529 invert; #X obj 160 32 scaleXYZ 4 4 1; #X obj 353 32 scaleXYZ 4 4 1; -#X obj 552 36 scaleXYZ 4 4 1; -#X obj 747 35 scaleXYZ 4 4 1; +#X obj 552 32 scaleXYZ 4 4 1; +#X obj 747 32 scaleXYZ 4 4 1; #X text 21 588 This patch allow multiples images to be assembled in order to create a panoramic image.; #X text 20 615 A shader distord the image to correct distance distortion \, and allow a fade between 2 images; #X text 17 642 "dz" depend on the angles between images.; #X text 462 619 copyright cyrille Henry and iem.; #X text 463 636 This development was supported by the COMEDIA project; -#X floatatom 18 394 5 0 0 0 - - - 0; -#X msg 18 413 dZ \$1; -#X obj 18 351 r init_shader; -#X msg 18 373 1.62; -#X msg 199 87 1.38; -#X msg 37 232 dimen 1024 256; -#X msg 177 304 thread 0 \, open ../data/cam1.jpg; -#X msg 370 305 thread 0 \, open ../data/cam2.jpg; -#X msg 569 306 thread 0 \, open ../data/cam3.jpg; -#X msg 764 307 thread 0 \, open ../data/cam4.jpg; +#X floatatom 18 424 5 0 0 0 - - - 0; +#X msg 18 443 dZ \$1; +#X obj 18 381 r init_shader; +#X msg 18 403 1.62; +#X msg 199 137 1.38; #X obj 964 623 declare -lib Gem; -#X connect 0 0 101 0; -#X connect 1 0 101 0; -#X connect 2 0 32 0; -#X connect 3 0 4 0; -#X connect 4 0 6 0; -#X connect 4 1 49 0; -#X connect 4 1 82 0; -#X connect 5 0 118 0; -#X connect 6 0 9 0; -#X connect 7 0 2 0; -#X connect 8 0 7 0; -#X connect 9 0 2 0; -#X connect 9 1 10 0; -#X connect 9 2 11 0; -#X connect 10 0 4 1; -#X connect 11 0 4 1; -#X connect 12 0 33 0; -#X connect 13 0 14 0; -#X connect 14 0 16 0; -#X connect 14 1 50 0; -#X connect 14 1 84 0; -#X connect 15 0 119 0; -#X connect 16 0 19 0; -#X connect 17 0 12 0; -#X connect 18 0 17 0; -#X connect 19 0 12 0; -#X connect 19 1 20 0; -#X connect 19 2 21 0; -#X connect 20 0 14 1; -#X connect 21 0 14 1; -#X connect 22 0 34 0; -#X connect 23 0 24 0; -#X connect 24 0 26 0; -#X connect 24 1 51 0; -#X connect 24 1 86 0; -#X connect 25 0 120 0; -#X connect 26 0 29 0; -#X connect 27 0 22 0; -#X connect 28 0 27 0; -#X connect 29 0 22 0; -#X connect 29 1 30 0; -#X connect 29 2 31 0; -#X connect 30 0 24 1; -#X connect 31 0 24 1; -#X connect 32 0 60 0; -#X connect 33 0 63 0; -#X connect 34 0 66 0; -#X connect 35 0 45 0; -#X connect 36 0 37 0; -#X connect 37 0 39 0; -#X connect 37 1 52 0; -#X connect 37 1 88 0; -#X connect 38 0 121 0; -#X connect 39 0 42 0; -#X connect 40 0 35 0; -#X connect 41 0 40 0; -#X connect 42 0 35 0; -#X connect 42 1 43 0; -#X connect 42 2 44 0; -#X connect 43 0 37 1; -#X connect 44 0 37 1; -#X connect 45 0 69 0; -#X connect 46 0 47 0; -#X connect 47 0 4 1; -#X connect 53 0 14 1; -#X connect 54 0 24 1; -#X connect 55 0 37 1; -#X connect 60 0 56 0; -#X connect 61 0 60 1; -#X connect 62 0 60 2; -#X connect 63 0 57 0; -#X connect 64 0 63 1; -#X connect 65 0 63 2; -#X connect 66 0 58 0; -#X connect 67 0 66 1; -#X connect 68 0 66 2; -#X connect 69 0 59 0; -#X connect 70 0 69 1; -#X connect 71 0 69 2; -#X connect 72 0 103 0; -#X connect 73 0 104 0; -#X connect 74 0 105 0; -#X connect 75 0 106 0; -#X connect 76 0 4 0; -#X connect 77 0 14 0; -#X connect 78 0 24 0; -#X connect 79 0 37 0; -#X connect 80 0 4 1; -#X connect 81 0 116 0; -#X connect 82 0 80 0; -#X connect 83 0 14 1; -#X connect 84 0 83 0; -#X connect 85 0 24 1; -#X connect 86 0 85 0; -#X connect 87 0 37 1; -#X connect 88 0 87 0; -#X connect 89 0 56 1; -#X connect 90 0 56 2; -#X connect 92 0 57 1; -#X connect 93 0 57 2; -#X connect 95 0 58 1; -#X connect 96 0 58 2; -#X connect 98 0 59 1; -#X connect 99 0 59 2; -#X connect 102 0 117 0; -#X connect 103 0 76 0; -#X connect 104 0 77 0; -#X connect 105 0 78 0; -#X connect 106 0 79 0; -#X connect 112 0 113 0; -#X connect 113 0 48 0; -#X connect 114 0 115 0; -#X connect 115 0 112 0; -#X connect 116 0 46 0; -#X connect 117 0 101 0; -#X connect 118 0 6 0; -#X connect 119 0 16 0; -#X connect 120 0 26 0; -#X connect 121 0 39 0; +#X obj 160 243 _glsl shader/panoramique; +#X obj 19 312 loadbang; +#X obj 19 335 s init_shader; +#X obj 353 243 _glsl shader/panoramique; +#X obj 552 244 _glsl shader/panoramique; +#X obj 747 245 _glsl shader/panoramique; +#N canvas 735 461 450 300 getdimen 0; +#X obj 49 37 inlet; +#X obj 49 60 pix_info -m; +#X obj 49 83 outlet; +#X obj 140 60 route dimen; +#X obj 140 106 outlet; +#X msg 140 83 sizeX \$1 \, sizeY \$2; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 3 0; +#X connect 3 0 5 0; +#X connect 5 0 4 0; +#X restore 160 357 pd getdimen; +#N canvas 735 461 450 300 getdimen 0; +#X obj 49 37 inlet; +#X obj 49 60 pix_info -m; +#X obj 49 83 outlet; +#X obj 140 60 route dimen; +#X obj 140 106 outlet; +#X msg 140 83 sizeX \$1 \, sizeY \$2; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 3 0; +#X connect 3 0 5 0; +#X connect 5 0 4 0; +#X restore 552 359 pd getdimen; +#N canvas 735 461 450 300 getdimen 0; +#X obj 49 37 inlet; +#X obj 49 60 pix_info -m; +#X obj 49 83 outlet; +#X obj 140 60 route dimen; +#X obj 140 106 outlet; +#X msg 140 83 sizeX \$1 \, sizeY \$2; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 3 0; +#X connect 3 0 5 0; +#X connect 5 0 4 0; +#X restore 747 360 pd getdimen; +#N canvas 735 461 450 300 getdimen 0; +#X obj 49 37 inlet; +#X obj 49 60 pix_info -m; +#X obj 49 83 outlet; +#X obj 140 60 route dimen; +#X obj 140 106 outlet; +#X msg 140 83 sizeX \$1 \, sizeY \$2; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 3 0; +#X connect 3 0 5 0; +#X connect 5 0 4 0; +#X restore 353 358 pd getdimen; +#X obj 160 308 pix_image \; thread 0 \; open ../data/cam1.jpg; +#X obj 353 309 pix_image \; thread 0 \; open ../data/cam2.jpg; +#X obj 552 310 pix_image \; thread 0 \; open ../data/cam3.jpg; +#X obj 747 311 pix_image \; thread 0 \; open ../data/cam4.jpg; +#X obj 160 425 pix_texture \; rectangle 1; +#X obj 353 426 pix_texture \; rectangle 1; +#X obj 552 427 pix_texture \; rectangle 1; +#X obj 747 428 pix_texture \; rectangle 1; +#X obj 17 258 gemwin \; dimen 1024 256; +#X connect 0 0 94 0; +#X connect 1 0 94 0; +#X connect 2 0 76 0; +#X connect 3 0 79 0; +#X connect 4 0 80 0; +#X connect 5 0 20 0; +#X connect 6 0 23 0; +#X connect 7 0 26 0; +#X connect 8 0 81 0; +#X connect 9 0 29 0; +#X connect 10 0 11 0; +#X connect 11 0 76 1; +#X connect 13 0 79 1; +#X connect 14 0 80 1; +#X connect 15 0 81 1; +#X connect 20 0 16 0; +#X connect 21 0 20 1; +#X connect 22 0 20 2; +#X connect 23 0 17 0; +#X connect 24 0 23 1; +#X connect 25 0 23 2; +#X connect 26 0 18 0; +#X connect 27 0 26 1; +#X connect 28 0 26 2; +#X connect 29 0 19 0; +#X connect 30 0 29 1; +#X connect 31 0 29 2; +#X connect 32 0 61 0; +#X connect 33 0 62 0; +#X connect 34 0 63 0; +#X connect 35 0 64 0; +#X connect 36 0 76 0; +#X connect 37 0 79 0; +#X connect 38 0 80 0; +#X connect 39 0 81 0; +#X connect 40 0 76 1; +#X connect 41 0 74 0; +#X connect 42 0 40 0; +#X connect 43 0 79 1; +#X connect 44 0 43 0; +#X connect 45 0 80 1; +#X connect 46 0 45 0; +#X connect 47 0 81 1; +#X connect 48 0 47 0; +#X connect 49 0 16 1; +#X connect 50 0 16 2; +#X connect 52 0 17 1; +#X connect 53 0 17 2; +#X connect 55 0 18 1; +#X connect 56 0 18 2; +#X connect 58 0 19 1; +#X connect 59 0 19 2; +#X connect 61 0 36 0; +#X connect 62 0 37 0; +#X connect 63 0 38 0; +#X connect 64 0 39 0; +#X connect 70 0 71 0; +#X connect 71 0 12 0; +#X connect 72 0 73 0; +#X connect 73 0 70 0; +#X connect 74 0 10 0; +#X connect 76 0 86 0; +#X connect 77 0 78 0; +#X connect 79 0 87 0; +#X connect 80 0 88 0; +#X connect 81 0 89 0; +#X connect 82 0 90 0; +#X connect 82 1 76 1; +#X connect 83 0 92 0; +#X connect 83 1 80 1; +#X connect 84 0 93 0; +#X connect 84 1 81 1; +#X connect 85 0 91 0; +#X connect 85 1 79 1; +#X connect 86 0 82 0; +#X connect 87 0 85 0; +#X connect 88 0 83 0; +#X connect 89 0 84 0; +#X connect 90 0 5 0; +#X connect 91 0 6 0; +#X connect 92 0 7 0; +#X connect 93 0 9 0; diff --git a/examples/10.glsl/14.blur.pd b/examples/10.glsl/14.blur.pd index e2c7905ef..30473a310 100644 --- a/examples/10.glsl/14.blur.pd +++ b/examples/10.glsl/14.blur.pd @@ -4,49 +4,45 @@ #X obj 16 130 gemframebuffer; #X obj 129 13 loadbang; #X obj 16 185 translateXYZ 0 0 -4; -#X obj 14 283 cnv 15 125 200 empty empty empty 20 12 0 14 -228856 -66577 -0; -#X floatatom 82 334 5 0 0 0 - - -; +#X obj 14 283 cnv 15 125 200 empty empty empty 20 12 0 14 #dcdcdc #404040 0; +#X floatatom 82 334 5 0 0 0 - - - 0; #X obj 16 362 rotateXYZ 30 30 0; #X obj 16 385 colorRGB 1 0 1; #X obj 16 408 teapot 1.5; #N canvas 385 358 230 231 shunt 0; -#X obj 171 17 inlet; -#X obj 72 67 * -1; -#X obj 72 91 + 1; +#X obj 154 17 inlet; #X obj 27 17 inlet; #X obj 27 200 outlet; #X obj 126 197 outlet; #X obj 27 117 spigot 1; #X obj 126 115 spigot 0; -#X connect 0 0 1 0; -#X connect 0 0 7 1; -#X connect 1 0 2 0; -#X connect 2 0 6 1; -#X connect 3 0 6 0; -#X connect 3 0 7 0; -#X connect 6 0 4 0; -#X connect 7 0 5 0; +#X obj 72 87 == 0; +#X obj 171 87 == 1; +#X obj 144 40 t f f; +#X connect 0 0 8 0; +#X connect 1 0 4 0; +#X connect 1 0 5 0; +#X connect 4 0 2 0; +#X connect 5 0 3 0; +#X connect 6 0 4 1; +#X connect 7 0 5 1; +#X connect 8 0 6 0; +#X connect 8 1 7 0; #X restore 16 223 pd shunt; -#X obj 81 224 tgl 15 0 empty empty empty 17 7 0 10 -257985 -1 -1 0 -1; -#X obj 162 283 cnv 15 125 200 empty empty empty 20 12 0 14 -228856 --66577 0; +#X obj 81 224 tgl 15 0 empty empty empty 17 7 0 10 #f8fc00 #000000 #000000 0 1; +#X obj 162 283 cnv 15 125 200 empty empty empty 20 12 0 14 #dcdcdc #404040 0; #X obj 169 385 colorRGB 1 1 0; #X text 76 286 Scene A; #X text 223 287 Scene B; #X text 105 223 Scene A / Scene B; #X obj 169 360 rotateXYZ 0 0 45; #X obj 169 463 square 2.8; -#X floatatom 197 409 5 0 0 0 - - -; +#X floatatom 197 409 5 0 0 0 - - - 0; #X obj 169 429 translateXYZ; #X obj 129 54 s to_fb; #X obj 30 103 r to_fb; #X msg 129 34 dimen 500 500 \, rectangle 0; -#X obj 327 379 pix_texture; -#X obj 327 399 square 4; -#X msg 344 358 quality 1 \, rectangle 0; -#X obj 344 337 loadbang; +#X obj 327 429 square 4; #X obj 327 309 gemhead 99; #N canvas 70 136 503 739 14_pass_blur 0; #X obj 87 102 inlet; @@ -82,13 +78,13 @@ #X connect 15 0 14 0; #X restore 114 149 pd 14_pass_blur; #X obj 557 245 pack f f; -#X obj 557 264 s motion_blur; +#X obj 557 265 s motion_blur; #X obj 575 205 cos; #X obj 557 151 / 500; #X obj 557 171 t f f; #X obj 610 226 *; #X obj 628 205 sin; -#X floatatom 596 129 5 0 6.28 0 - - -; +#X floatatom 596 129 5 0 6.28 0 - - - 0; #X obj 596 150 t b f; #N canvas 0 22 454 304 gemwin 0; #X obj 132 136 gemwin; @@ -102,8 +98,7 @@ #N canvas 87 154 850 451 Gem.init 0; #X obj 59 46 loadbang; #X obj 119 130 outlet; -#X msg 118 81 reset \, dimen 500 500 \, lighting 1 \, title blur \, -frame 20 \,; +#X msg 118 81 reset \, dimen 500 500 \, lighting 1 \, title blur \, frame 20 \,; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 289 80 pd Gem.init; @@ -122,24 +117,21 @@ frame 20 \,; #X connect 10 0 9 0; #X restore 17 32 pd gemwin; #X msg 17 8 create; -#X obj 383 89 cnv 15 150 25 empty empty empty 20 12 0 14 -257985 -66577 -0; -#X obj 392 95 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144 --1 -1 0 1; +#X obj 383 89 cnv 15 150 25 empty empty empty 20 12 0 14 #f8fc00 #404040 0; +#X obj 392 95 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X obj 389 140 s blur; #X obj 389 115 / 500; #X text 389 69 blur; -#X obj 551 91 cnv 15 150 25 empty empty empty 20 12 0 14 -257985 -66577 -0; -#X obj 560 97 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144 --1 -1 0 1; +#X obj 551 91 cnv 15 150 25 empty empty empty 20 12 0 14 #f8fc00 #404040 0; +#X obj 560 97 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1; #X text 556 67 motion blur; #X obj 557 226 * 1; #X text 640 129 angle (radian); #X obj 663 7 declare -lib Gem; +#X obj 327 379 pix_texture \; quality 1 \; rectangle 0; #X connect 0 0 1 0; #X connect 1 0 3 0; -#X connect 1 1 28 0; +#X connect 1 1 25 0; #X connect 2 0 22 0; #X connect 3 0 9 0; #X connect 5 0 6 2; @@ -155,25 +147,23 @@ frame 20 \,; #X connect 19 0 17 0; #X connect 21 0 1 0; #X connect 22 0 20 0; -#X connect 23 0 24 0; -#X connect 25 0 23 0; -#X connect 26 0 25 0; -#X connect 27 0 23 0; -#X connect 28 0 23 1; +#X connect 24 0 48 0; +#X connect 25 0 48 1; +#X connect 26 0 27 0; +#X connect 28 0 45 1; #X connect 29 0 30 0; -#X connect 31 0 48 1; -#X connect 32 0 33 0; -#X connect 33 0 48 0; -#X connect 33 1 34 0; -#X connect 34 0 29 1; -#X connect 35 0 34 1; -#X connect 36 0 37 0; -#X connect 37 0 32 0; -#X connect 37 1 35 0; -#X connect 37 1 31 0; -#X connect 38 0 39 0; -#X connect 39 0 38 0; -#X connect 41 0 43 0; -#X connect 43 0 42 0; -#X connect 46 0 32 0; -#X connect 48 0 29 0; +#X connect 30 0 45 0; +#X connect 30 1 31 0; +#X connect 31 0 26 1; +#X connect 32 0 31 1; +#X connect 33 0 34 0; +#X connect 34 0 29 0; +#X connect 34 1 32 0; +#X connect 34 1 28 0; +#X connect 35 0 36 0; +#X connect 36 0 35 0; +#X connect 38 0 40 0; +#X connect 40 0 39 0; +#X connect 43 0 29 0; +#X connect 45 0 26 0; +#X connect 48 0 23 0; diff --git a/examples/10.glsl/15.bicubic_image_interpolation.pd b/examples/10.glsl/15.bicubic_image_interpolation.pd index bd19553a5..2454aa8c7 100644 --- a/examples/10.glsl/15.bicubic_image_interpolation.pd +++ b/examples/10.glsl/15.bicubic_image_interpolation.pd @@ -15,7 +15,7 @@ #X floatatom 303 271 5 0 0 0 - - - 0; #X msg 35 151 create \, 1; #X msg 42 173 0 \, destroy; -#X obj 436 191 gemhead; +#X obj 366 189 gemhead; #X msg 358 408 quality \$1; #X obj 358 389 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 33 246 vradio 15 1 1 3 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 1; @@ -25,8 +25,8 @@ #X obj 33 304 s sel_interpolation; #X obj 232 169 == 0; #X obj 232 149 r sel_interpolation; -#X obj 436 152 r sel_interpolation; -#X obj 436 172 != 0; +#X obj 366 149 r sel_interpolation; +#X obj 366 169 != 0; #X obj 358 369 != 2; #X obj 358 349 r sel_interpolation; #X text 46 16 This example use shader in order to compute a bicubic image interpolation. Bicubic interpolation offer a smoother surface than obtain with bilinear interpolation. But since it need 16 sample to compute the interpolation \, it is quite slow.; diff --git a/examples/10.glsl/16.vertexbuffer_attributes.pd b/examples/10.glsl/16.vertexbuffer_attributes.pd index 64e9d58a8..a3ae30809 100644 --- a/examples/10.glsl/16.vertexbuffer_attributes.pd +++ b/examples/10.glsl/16.vertexbuffer_attributes.pd @@ -1,4 +1,4 @@ -#N canvas 804 152 860 713 10; +#N canvas 546 139 729 807 10; #X declare -lib Gem; #N canvas 1 89 450 300 fps 0; #X obj 46 -61 gemhead; @@ -17,8 +17,8 @@ #X connect 4 0 3 0; #X connect 6 0 7 0; #X connect 7 0 5 0; -#X restore 806 149 pd fps; -#X floatatom 806 172 5 0 0 1 fps - - 0; +#X restore 616 149 pd fps; +#X floatatom 616 172 5 0 0 1 fps - - 0; #N canvas 5 76 450 300 gemwin 0; #X obj 132 246 gemwin; #X obj 67 89 outlet; @@ -54,40 +54,23 @@ #X connect 13 0 14 0; #X connect 13 1 12 0; #X connect 14 0 15 0; -#X restore 577 115 pd gemwin; -#X msg 577 96 destroy; -#X text 573 75 Create window:; -#X msg 184 350 link \$1 \$2; -#X obj 154 264 glsl_vertex; -#X obj 154 307 glsl_fragment; -#X obj 168 150 loadbang; -#X obj 154 399 glsl_program; -#X obj 154 673 gemvertexbuffer; +#X restore 387 115 pd gemwin; +#X msg 387 95 create; +#X text 383 75 Create window:; #X obj 154 116 gemhead; #X obj 36 403 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #X msg 36 433 position_enable \$1; -#X msg 105 366 print; -#X msg 101 278 print; -#X msg 103 233 print; -#X obj 246 548 cnv 15 90 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 255 559 program \$1; +#X obj 277 548 cnv 15 90 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 286 559 program \$1; #X obj 30 544 cnv 15 120 70 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 39 583 print_attributes; #X msg 38 556 reset_attributes; #X obj 27 487 cnv 15 140 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X obj 36 465 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #X msg 36 498 attribute_enable \$1; -#X msg 223 475 position \$1_position \, attribute LightPosition \$1_LightPosition \, attribute BrickColor \$1_BrickColor \, attribute MortarColor \$1_MortarColor \, attribute BrickSize \$1_BrickSize \, attribute BrickPct \$1_BrickPct; -#X obj 224 612 loadbang; -#X msg 224 629 resize 16 \, draw quad; -#X text 378 629 4 quads; -#X obj 168 179 t b b; -#X obj 223 421 t b f; #X text 406 232 syntax:; -#X text 339 559 <----- essential for lookup functions; +#X text 370 559 <----- essential for lookup functions; #X text 406 248 attribute ; -#X obj 358 431 print linking; -#X obj 184 372 t a a; #N canvas 359 182 450 300 tables 0; #N canvas 81 49 460 613 load_tables 0; #X obj 39 17 loadbang; @@ -126,8 +109,8 @@ #X obj 129 128 table \$0_MortarColor 48; #X obj 129 149 table \$0_BrickSize 32; #X obj 128 169 table \$0_BrickPct 32; -#X restore 754 73 pd tables; -#X obj 223 443 list prepend \$0; +#X restore 564 73 pd tables; +#X obj 183 443 list prepend \$0; #X obj 396 298 cnv 15 90 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X obj 396 348 cnv 15 90 40 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 408 310 attribute LightPosition \$1_LightPosition; @@ -142,64 +125,34 @@ #X text 66 321 in order to set 'uniform' type variables once per vertex or geo \, they must be changed to attribute/varying type in the vert and frag files; #X restore 407 359 pd more; #X obj 164 646 t a; -#X obj 301 663 print vb; -#X msg 246 176 bang; -#N canvas 1 51 450 300 modulelist 0; -#X obj 81 44 inlet; -#X obj 248 55 inlet; -#X obj 81 172 outlet; -#X obj 81 66 t b f; -#X obj 81 128 pack 0 0 0; -#X obj 81 150 route 0; -#X obj 81 98 del 0; -#X connect 0 0 3 0; -#X connect 1 0 4 2; -#X connect 3 0 6 0; -#X connect 3 1 4 1; -#X connect 4 0 5 0; -#X connect 5 0 2 0; -#X connect 6 0 4 0; -#X restore 184 330 pd modulelist; -#X msg 272 416 bang; -#X obj 753 7 declare -lib Gem; -#X msg 168 207 open shader/brick.vert; -#X msg 195 234 open shader/brick.frag; +#X obj 194 647 print vb; +#X msg 183 420 bang; +#X obj 563 7 declare -lib Gem; +#X obj 154 172 _glsl shader/brick; +#X msg 165 152 bang; +#X floatatom 278 204 5 0 0 0 - - - 0; +#X obj 154 673 gemvertexbuffer \; resize 16 \; draw quad; +#X obj 259 366 t b f; +#X msg 183 475 position \$1_position \, attribute LightPosition \$1_LightPosition \, attribute BrickColor \$1_BrickColor \, attribute MortarColor \$1_MortarColor \, attribute BrickSize \$1_BrickSize \, attribute BrickPct \$1_BrickPct; #X connect 0 0 1 0; #X connect 2 0 3 0; #X connect 3 0 2 0; -#X connect 5 0 35 0; +#X connect 5 0 29 0; #X connect 6 0 7 0; -#X connect 6 1 45 1; -#X connect 7 0 9 0; -#X connect 7 1 45 0; -#X connect 8 0 29 0; -#X connect 9 0 10 0; -#X connect 9 1 30 0; -#X connect 11 0 6 0; -#X connect 12 0 13 0; -#X connect 13 0 42 0; -#X connect 14 0 9 0; -#X connect 15 0 7 0; -#X connect 16 0 6 0; -#X connect 18 0 42 0; -#X connect 20 0 42 0; -#X connect 21 0 42 0; -#X connect 23 0 24 0; -#X connect 24 0 42 0; -#X connect 25 0 42 0; -#X connect 26 0 27 0; -#X connect 27 0 42 0; -#X connect 29 0 48 0; -#X connect 29 1 49 0; -#X connect 30 0 37 0; -#X connect 30 1 18 0; -#X connect 35 0 9 0; -#X connect 35 1 34 0; -#X connect 37 0 25 0; -#X connect 42 0 10 0; -#X connect 42 0 43 0; -#X connect 44 0 29 0; -#X connect 45 0 5 0; -#X connect 46 0 37 0; -#X connect 48 0 6 0; -#X connect 49 0 7 0; +#X connect 7 0 25 0; +#X connect 9 0 25 0; +#X connect 11 0 25 0; +#X connect 12 0 25 0; +#X connect 14 0 15 0; +#X connect 15 0 25 0; +#X connect 20 0 34 0; +#X connect 25 0 26 0; +#X connect 25 0 32 0; +#X connect 27 0 20 0; +#X connect 29 0 32 0; +#X connect 29 1 31 0; +#X connect 29 1 33 0; +#X connect 30 0 29 0; +#X connect 33 0 27 0; +#X connect 33 1 9 0; +#X connect 34 0 25 0; diff --git a/examples/10.glsl/17.light.pd b/examples/10.glsl/17.light.pd index 10e0b084c..991432496 100644 --- a/examples/10.glsl/17.light.pd +++ b/examples/10.glsl/17.light.pd @@ -1,4 +1,4 @@ -#N canvas 1927 311 749 579 10; +#N canvas 191 0 745 445 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -32,13 +32,8 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X msg 261 285 link \$1 \$2; -#X obj 195 55 loadbang; #X obj 181 24 gemhead; -#X obj 288 330 print linking; -#X obj 261 307 t a a; #X obj 44 9 declare -lib Gem; -#X obj 261 265 pack f f; #N canvas 899 105 557 405 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -79,16 +74,10 @@ #X connect 17 0 4 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 195 114 t a a; -#X msg 226 140 open \$1.vert; -#X msg 229 169 open \$1.frag; -#X obj 181 199 glsl_vertex; -#X obj 181 242 glsl_fragment; -#X obj 181 507 rotateXYZ -40 10 0; -#X msg 195 82 symbol shader/light; -#X obj 181 534 torus 2 30 0.8; +#X obj 181 347 rotateXYZ -40 10 0; +#X obj 181 374 torus 2 30 0.8; #X text 350 21 Since shader remplace the standard pipeline \, light are not automatically computed. Lighting effect have to be manually computed in the shader.; -#X floatatom 216 484 5 0 0 0 - - - 0; +#X floatatom 216 324 5 0 0 0 - - - 0; #N canvas 1921 61 450 300 pak 0; #X obj 74 46 inlet; #X obj 76 110 pack f f f; @@ -105,33 +94,19 @@ #X connect 4 0 5 0; #X connect 5 0 1 0; #X connect 5 1 1 2; -#X restore 398 326 pd pak f f f; -#X msg 398 351 LightPosition \$1 \$2 \$3 1; -#X floatatom 398 292 5 0 0 0 - - - 0; -#X floatatom 443 292 5 0 0 0 - - - 0; -#X floatatom 485 293 5 0 0 0 - - - 0; -#X obj 181 364 glsl_program \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.1 0.1 0.5 \; MaterialKd 0.8 0.1 0.1 \; MaterialKs 0.1 0.3 0.1 \; MaterialShininess 30; +#X restore 398 186 pd pak f f f; +#X msg 398 211 LightPosition \$1 \$2 \$3 1; +#X floatatom 398 152 5 0 0 0 - - - 0; +#X floatatom 443 152 5 0 0 0 - - - 0; +#X floatatom 485 153 5 0 0 0 - - - 0; +#X obj 181 151 _glsl shader/light \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.1 0.1 0.5 \; MaterialKd 0.8 0.1 0.1 \; MaterialKs 0.1 0.3 0.1 \; MaterialShininess 30; #X connect 0 0 1 0; -#X connect 2 0 6 0; -#X connect 3 0 16 0; -#X connect 4 0 13 0; -#X connect 6 0 25 0; -#X connect 6 1 5 0; -#X connect 8 0 2 0; -#X connect 10 0 12 0; -#X connect 10 1 11 0; -#X connect 11 0 13 0; -#X connect 12 0 14 0; -#X connect 13 0 14 0; -#X connect 13 1 8 1; -#X connect 14 0 25 0; -#X connect 14 1 8 0; -#X connect 15 0 17 0; -#X connect 16 0 10 0; -#X connect 19 0 15 1; -#X connect 20 0 21 0; -#X connect 21 0 25 0; -#X connect 22 0 20 0; -#X connect 23 0 20 1; -#X connect 24 0 20 2; -#X connect 25 0 15 0; +#X connect 2 0 14 0; +#X connect 5 0 6 0; +#X connect 8 0 5 1; +#X connect 9 0 10 0; +#X connect 10 0 14 1; +#X connect 11 0 9 0; +#X connect 12 0 9 1; +#X connect 13 0 9 2; +#X connect 14 0 5 0; diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index a856883ea..4d145c626 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -179,78 +179,6 @@ #X obj 594 243 translateXYZ 0 0 -4; #X obj 40 30 inlet; #X obj 63 88 s pd; -#N canvas 346 93 673 762 shader 0; -#X obj 78 339 glsl_vertex; -#X msg 32 338 print; -#X obj 78 626 glsl_program; -#X obj 163 555 pack 0 0; -#X msg 30 476 print; -#X obj 163 511 change; -#X obj 150 358 change; -#X msg 163 579 link \$1 \$2; -#X msg 32 620 print; -#X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - - 0; -#X floatatom 150 381 2 0 0 0 ID - - 0; -#X obj 181 600 print linking; -#X obj 15 21 inlet; -#X obj 78 662 outlet; -#X msg 106 309 open \$1.vert; -#X msg 90 453 open \$1.frag; -#X obj 577 95 inlet; -#X obj 15 44 route bang; -#X obj 255 11 gemhead 1; -#X msg 255 33 1; -#X obj 255 57 change; -#X obj 255 81 t b; -#X obj 157 647 change; -#X obj 157 668 t b; -#X obj 158 690 outlet; -#X obj 140 224 t a a; -#X obj 90 426 symbol; -#X obj 90 401 t b; -#X msg 287 598 0; -#X obj 15 65 t b b b, f 29; -#X obj 140 199 symbol shader/additive; -#X connect 0 0 9 0; -#X connect 0 1 6 0; -#X connect 1 0 0 0; -#X connect 2 0 14 0; -#X connect 2 1 23 0; -#X connect 3 0 7 0; -#X connect 4 0 9 0; -#X connect 5 0 10 0; -#X connect 6 0 11 0; -#X connect 6 0 28 0; -#X connect 7 0 2 0; -#X connect 7 0 12 0; -#X connect 8 0 2 0; -#X connect 9 0 2 0; -#X connect 9 1 5 0; -#X connect 10 0 3 0; -#X connect 11 0 3 1; -#X connect 13 0 18 0; -#X connect 15 0 0 0; -#X connect 16 0 9 0; -#X connect 17 0 2 0; -#X connect 18 0 30 0; -#X connect 18 1 0 0; -#X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 21 0 22 0; -#X connect 22 0 31 0; -#X connect 23 0 24 0; -#X connect 24 0 25 0; -#X connect 26 0 15 0; -#X connect 26 1 27 1; -#X connect 27 0 16 0; -#X connect 28 0 27 0; -#X connect 29 0 23 0; -#X connect 30 0 10 0; -#X connect 30 1 31 0; -#X connect 30 2 29 0; -#X connect 31 0 26 0; -#X restore 274 223 pd shader; #X obj 284 198 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X obj 274 63 gemframebuffer \; dimen 4096 1 \; rectangle 1 \; type FLOAT \; format RGBA32F; #X obj 301 458 pix_snap 0 0 4096 1 \; type FLOAT; @@ -268,33 +196,34 @@ #X text 737 297 change input to be converted to sound here, f 24; #X obj 567 66 gemframebuffer \; dimen 4096 2 \; rectangle 1 \; texunit 0; #X obj 705 451 gemframebuffer \; dimen 4096 1 \; rectangle 1; -#X connect 1 0 56 0; -#X connect 1 1 55 0; +#X obj 274 223 _glsl shader/additive; +#X connect 1 0 55 0; +#X connect 1 1 54 0; #X connect 2 0 1 0; -#X connect 3 0 53 0; +#X connect 3 0 52 0; #X connect 5 0 35 0; -#X connect 5 0 58 0; +#X connect 5 0 57 0; #X connect 7 0 8 0; #X connect 8 0 5 0; -#X connect 9 0 49 0; +#X connect 9 0 66 0; #X connect 10 0 12 0; #X connect 11 1 7 0; #X connect 12 0 35 0; -#X connect 12 0 52 0; -#X connect 12 1 52 0; -#X connect 13 0 49 1; +#X connect 12 0 51 0; +#X connect 12 1 51 0; +#X connect 13 0 66 1; #X connect 14 0 16 0; #X connect 16 0 14 1; #X connect 16 0 15 0; #X connect 16 0 13 0; #X connect 17 0 14 0; -#X connect 20 0 65 0; +#X connect 20 0 64 0; #X connect 21 0 10 0; #X connect 22 0 21 1; #X connect 23 0 14 0; #X connect 25 0 24 0; -#X connect 27 0 59 1; -#X connect 28 0 54 0; +#X connect 27 0 58 1; +#X connect 28 0 53 0; #X connect 29 0 26 0; #X connect 30 0 25 0; #X connect 31 0 34 0; @@ -309,26 +238,26 @@ #X connect 42 0 46 0; #X connect 44 0 38 1; #X connect 46 0 38 0; -#X connect 47 0 57 0; +#X connect 47 0 56 0; #X connect 47 0 2 0; -#X connect 49 0 21 0; -#X connect 49 1 17 0; -#X connect 50 0 49 0; -#X connect 51 0 9 0; -#X connect 51 1 18 0; -#X connect 52 0 11 0; -#X connect 53 0 54 0; -#X connect 55 0 54 0; -#X connect 56 0 54 0; -#X connect 57 0 48 0; -#X connect 58 0 4 0; -#X connect 59 0 29 0; -#X connect 60 0 66 0; -#X connect 61 0 51 0; -#X connect 65 0 31 0; -#X connect 65 1 19 0; -#X connect 66 0 59 0; -#X connect 66 1 30 1; +#X connect 49 0 66 0; +#X connect 50 0 9 0; +#X connect 50 1 18 0; +#X connect 51 0 11 0; +#X connect 52 0 53 0; +#X connect 54 0 53 0; +#X connect 55 0 53 0; +#X connect 56 0 48 0; +#X connect 57 0 4 0; +#X connect 58 0 29 0; +#X connect 59 0 65 0; +#X connect 60 0 50 0; +#X connect 64 0 31 0; +#X connect 64 1 19 0; +#X connect 65 0 58 0; +#X connect 65 1 30 1; +#X connect 66 0 21 0; +#X connect 66 1 17 0; #X restore 26 45 pd audio_GPU; #X obj 26 14 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X text 51 15 <- start; diff --git a/examples/10.glsl/_glsl.pd b/examples/10.glsl/_glsl.pd index ca41544e7..5376fb08f 100644 --- a/examples/10.glsl/_glsl.pd +++ b/examples/10.glsl/_glsl.pd @@ -1,73 +1,71 @@ -#N canvas 52 79 668 661 10; -#X obj 78 339 glsl_vertex; -#X msg 32 338 print; -#X obj 78 626 glsl_program; -#X obj 163 555 pack 0 0; -#X msg 30 476 print; -#X obj 163 511 change; -#X obj 150 358 change; -#X msg 163 579 link \$1 \$2; -#X msg 32 620 print; -#X obj 77 490 glsl_fragment; -#X floatatom 163 535 2 0 0 0 ID - -; -#X floatatom 150 381 2 0 0 0 ID - -; -#X obj 181 600 print linking; -#X obj 15 21 inlet; -#X obj 78 662 outlet; -#X msg 106 309 open \$1.vert; -#X msg 90 453 open \$1.frag; +#N canvas 1980 98 668 783 10; +#X obj 118 339 glsl_vertex; +#X msg 72 338 print; +#X obj 118 626 glsl_program; +#X obj 193 545 pack 0 0; +#X msg 70 476 print; +#X msg 193 569 link \$1 \$2; +#X msg 72 620 print; +#X obj 118 490 glsl_fragment; +#X floatatom 193 525 2 0 0 0 ID - - 0; +#X floatatom 237 371 2 0 0 0 ID - - 0; +#X obj 211 590 print linking; +#X obj 118 21 inlet; +#X obj 118 662 outlet; +#X msg 167 309 open \$1.vert; +#X msg 194 453 open \$1.frag; #X obj 577 95 inlet; -#X obj 15 44 route bang; -#X obj 255 11 gemhead 1; -#X msg 255 33 1; -#X obj 255 57 change; -#X obj 255 81 t b; -#X obj 157 647 change; -#X obj 157 668 t b; -#X obj 158 690 outlet; -#X obj 140 224 t a a; -#X obj 90 426 symbol; -#X obj 90 401 t b; -#X msg 287 598 0; -#X obj 15 65 t b b b, f 29; -#X obj 140 199 symbol \$1; -#X text 270 193 This abstraction can be useful to load shader. Shader -location is relative to this abstraction path.; -#X connect 0 0 9 0; -#X connect 0 1 6 0; +#X obj 118 192 t a; +#X floatatom 197 662 2 0 0 0 ID - - 0; +#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; +#X obj 197 690 outlet programID; +#X obj 383 104 gemargs; +#X obj 383 68 loadbang; +#X obj 422 128 route bang; +#X obj 167 284 t a a; +#X obj 167 258 list prepend \$1; +#X obj 167 189 t b a; +#X obj 383 361 t a a; +#X obj 118 44 route bang symbol print; +#X msg 33 124 print; +#X obj 33 103 t b; +#X obj 33 145 t a a a; +#X connect 0 0 7 0; +#X connect 0 1 9 0; #X connect 1 0 0 0; -#X connect 2 0 14 0; -#X connect 2 1 23 0; -#X connect 3 0 7 0; -#X connect 4 0 9 0; +#X connect 2 0 12 0; +#X connect 2 1 17 0; +#X connect 3 0 5 0; +#X connect 4 0 7 0; +#X connect 5 0 2 0; #X connect 5 0 10 0; -#X connect 6 0 11 0; -#X connect 6 0 28 0; +#X connect 6 0 2 0; #X connect 7 0 2 0; -#X connect 7 0 12 0; -#X connect 8 0 2 0; -#X connect 9 0 2 0; -#X connect 9 1 5 0; -#X connect 10 0 3 0; -#X connect 11 0 3 1; -#X connect 13 0 18 0; -#X connect 15 0 0 0; -#X connect 16 0 9 0; -#X connect 17 0 2 0; -#X connect 18 0 30 0; -#X connect 18 1 0 0; -#X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 21 0 22 0; -#X connect 22 0 31 0; -#X connect 23 0 24 0; -#X connect 24 0 25 0; -#X connect 26 0 15 0; -#X connect 26 1 27 1; -#X connect 27 0 16 0; -#X connect 28 0 27 0; -#X connect 29 0 23 0; -#X connect 30 0 10 0; -#X connect 30 1 31 0; -#X connect 30 2 29 0; -#X connect 31 0 26 0; +#X connect 7 1 8 0; +#X connect 8 0 3 0; +#X connect 9 0 3 1; +#X connect 11 0 27 0; +#X connect 13 0 0 0; +#X connect 14 0 7 0; +#X connect 15 0 26 0; +#X connect 16 0 0 0; +#X connect 17 0 19 0; +#X connect 20 0 26 0; +#X connect 20 1 22 0; +#X connect 21 0 20 0; +#X connect 22 1 25 0; +#X connect 23 0 13 0; +#X connect 23 1 14 0; +#X connect 24 0 23 0; +#X connect 25 0 24 0; +#X connect 25 1 24 1; +#X connect 26 0 2 0; +#X connect 27 0 24 0; +#X connect 27 1 25 0; +#X connect 27 2 29 0; +#X connect 27 3 16 0; +#X connect 28 0 30 0; +#X connect 29 0 28 0; +#X connect 30 0 2 0; +#X connect 30 1 7 0; +#X connect 30 2 0 0; diff --git a/examples/10.glsl/_glsl_f.pd b/examples/10.glsl/_glsl_f.pd new file mode 100644 index 000000000..72a7a25a1 --- /dev/null +++ b/examples/10.glsl/_glsl_f.pd @@ -0,0 +1,45 @@ +#N canvas 1980 98 668 629 10; +#X obj 78 496 glsl_program; +#X msg 32 360 print; +#X msg 32 496 print; +#X obj 78 360 glsl_fragment; +#X floatatom 153 395 2 0 0 0 ID - - 0; +#X obj 153 470 print linking; +#X obj 78 21 inlet; +#X obj 78 532 outlet; +#X msg 202 293 open \$1.frag; +#X obj 577 95 inlet; +#X obj 127 209 symbol \$1; +#X obj 197 161 loadbang; +#X obj 78 44 route bang symbol; +#X obj 78 192 t a; +#X floatatom 157 532 2 0 0 0 ID - - 0; +#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; +#X obj 162 185 t b b; +#X obj 127 247 select symbol; +#X msg 189 209 symbol; +#X obj 157 560 outlet programID; +#X msg 153 439 link \$1; +#X connect 0 0 7 0; +#X connect 0 1 14 0; +#X connect 1 0 3 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 3 1 4 0; +#X connect 4 0 20 0; +#X connect 6 0 12 0; +#X connect 8 0 3 0; +#X connect 9 0 0 0; +#X connect 10 0 17 0; +#X connect 11 0 16 0; +#X connect 12 0 10 0; +#X connect 12 1 10 0; +#X connect 12 2 13 0; +#X connect 13 0 3 0; +#X connect 14 0 19 0; +#X connect 16 0 10 0; +#X connect 16 1 18 0; +#X connect 17 1 8 0; +#X connect 18 0 17 1; +#X connect 20 0 0 0; +#X connect 20 0 5 0; diff --git a/examples/10.glsl/_glsl_vgf.pd b/examples/10.glsl/_glsl_vgf.pd new file mode 100644 index 000000000..516f32c9e --- /dev/null +++ b/examples/10.glsl/_glsl_vgf.pd @@ -0,0 +1,78 @@ +#N canvas 1980 98 668 783 10; +#X obj 78 339 glsl_vertex; +#X msg 30 339 print; +#X obj 78 626 glsl_program; +#X msg 30 490 print; +#X msg 32 626 print; +#X obj 78 490 glsl_fragment; +#X floatatom 153 525 2 0 0 0 ID - - 0; +#X floatatom 210 341 2 0 0 0 ID - - 0; +#X obj 171 590 print linking; +#X obj 78 21 inlet; +#X obj 78 662 outlet; +#X msg 164 320 open \$1.vert; +#X msg 164 470 open \$1.frag; +#X obj 577 95 inlet; +#X obj 157 697 change; +#X obj 157 718 t b; +#X obj 157 740 outlet; +#X obj 127 209 symbol \$1; +#X obj 197 161 loadbang; +#X msg 287 598 set 0; +#X obj 260 87 t b b; +#X obj 78 44 route bang symbol; +#X obj 78 192 t a; +#X floatatom 157 662 2 0 0 0 ID - - 0; +#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; +#X obj 162 185 t b b; +#X obj 127 247 select symbol; +#X msg 189 209 symbol; +#X msg 30 420 print; +#X obj 78 420 glsl_geometry; +#X obj 153 545 pack 0 0 0; +#X obj 164 294 t s s s; +#X floatatom 181 431 2 0 0 0 ID - - 0; +#X msg 153 569 link \$1 \$2 \$3; +#X msg 164 400 open \$1.geom; +#X connect 0 0 29 0; +#X connect 0 1 7 0; +#X connect 1 0 0 0; +#X connect 2 0 10 0; +#X connect 2 1 23 0; +#X connect 3 0 5 0; +#X connect 4 0 2 0; +#X connect 5 0 2 0; +#X connect 5 1 6 0; +#X connect 6 0 30 0; +#X connect 7 0 30 2; +#X connect 9 0 21 0; +#X connect 11 0 0 0; +#X connect 12 0 5 0; +#X connect 13 0 2 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 17 0 26 0; +#X connect 18 0 25 0; +#X connect 19 0 14 0; +#X connect 20 0 17 0; +#X connect 20 1 19 0; +#X connect 21 0 20 0; +#X connect 21 1 17 0; +#X connect 21 2 22 0; +#X connect 22 0 0 0; +#X connect 23 0 14 0; +#X connect 25 0 17 0; +#X connect 25 1 27 0; +#X connect 26 1 31 0; +#X connect 27 0 26 1; +#X connect 28 0 29 0; +#X connect 29 0 5 0; +#X connect 29 1 32 0; +#X connect 30 0 33 0; +#X connect 31 0 11 0; +#X connect 31 1 34 0; +#X connect 31 2 12 0; +#X connect 32 0 30 1; +#X connect 33 0 2 0; +#X connect 33 0 8 0; +#X connect 34 0 29 0; diff --git a/examples/10.glsl/single_blur.pd b/examples/10.glsl/single_blur.pd index 26345ba31..fc4988983 100644 --- a/examples/10.glsl/single_blur.pd +++ b/examples/10.glsl/single_blur.pd @@ -2,10 +2,7 @@ #X obj 99 59 inlet; #X obj 26 145 gemframebuffer; #X obj 26 215 translateXYZ 0 0 -4; -#X obj 26 285 pix_texture; -#X obj 26 305 square 4; -#X msg 43 264 quality 1 \, rectangle 0; -#X obj 43 243 loadbang; +#X obj 26 345 square 4; #X obj 128 431 outlet; #X obj 47 166 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 248 85 t f f; @@ -24,31 +21,30 @@ #X obj 441 41 unpack f f; #X obj 508 65 * \$2; #X obj 26 195 _glsl shader/blur; -#X connect 0 0 3 1; -#X connect 1 0 24 0; -#X connect 1 1 7 0; -#X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 5 0 3 0; -#X connect 6 0 5 0; -#X connect 8 0 24 0; -#X connect 9 0 13 0; -#X connect 9 1 14 0; -#X connect 10 0 17 0; -#X connect 11 0 15 0; -#X connect 12 0 1 0; -#X connect 13 0 11 0; -#X connect 14 0 11 1; -#X connect 15 0 24 1; -#X connect 16 0 1 0; -#X connect 17 0 9 0; -#X connect 17 1 18 0; -#X connect 18 0 13 0; -#X connect 18 1 14 0; -#X connect 19 0 22 0; -#X connect 20 0 15 0; -#X connect 21 0 20 0; -#X connect 22 0 21 0; -#X connect 22 1 23 0; -#X connect 23 0 20 1; -#X connect 24 0 2 0; +#X obj 26 285 pix_texture \; quality 1 \; rectangle 0; +#X connect 0 0 22 1; +#X connect 1 0 21 0; +#X connect 1 1 4 0; +#X connect 2 0 22 0; +#X connect 5 0 21 0; +#X connect 6 0 10 0; +#X connect 6 1 11 0; +#X connect 7 0 14 0; +#X connect 8 0 12 0; +#X connect 9 0 1 0; +#X connect 10 0 8 0; +#X connect 11 0 8 1; +#X connect 12 0 21 1; +#X connect 13 0 1 0; +#X connect 14 0 6 0; +#X connect 14 1 15 0; +#X connect 15 0 10 0; +#X connect 15 1 11 0; +#X connect 16 0 19 0; +#X connect 17 0 12 0; +#X connect 18 0 17 0; +#X connect 19 0 18 0; +#X connect 19 1 20 0; +#X connect 20 0 17 1; +#X connect 21 0 2 0; +#X connect 22 0 3 0; From b5c42ec14986aa9b38d82e0f3853e9fb83c255c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 11:08:00 +0200 Subject: [PATCH 286/387] [gem*framebuffer] reset active texture in postrender Closes: https://github.com/umlaeute/Gem/issues/479 Closes: https://github.com/umlaeute/Gem/issues/478 --- src/Controls/gemcubeframebuffer.cpp | 1 + src/Controls/gemframebuffer.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Controls/gemcubeframebuffer.cpp b/src/Controls/gemcubeframebuffer.cpp index d51cb0ec9..27d48fd0a 100644 --- a/src/Controls/gemcubeframebuffer.cpp +++ b/src/Controls/gemcubeframebuffer.cpp @@ -237,6 +237,7 @@ void gemcubeframebuffer :: postrender(GemState *state) SETFLOAT(ap+4, static_cast(0.)); outlet_list(m_outTexInfo, 0, 5, ap); } + glActiveTexture(GL_TEXTURE0_ARB); } namespace diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index f341e79e7..d2dfe8257 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -298,6 +298,8 @@ void gemframebuffer :: postrender(GemState *state) SETFLOAT(ap+3, m_texTarget); SETFLOAT(ap+4, static_cast(0.)); outlet_list(m_outTexInfo, 0, 5, ap); + + glActiveTexture(GL_TEXTURE0_ARB); } namespace From 8e525946a33c44a8d075bfe1e9cc828c4893a06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 13:38:33 +0200 Subject: [PATCH 287/387] glReportError() helper for reporting openGL errors in a CPPExtern --- src/Utils/GLUtil.cpp | 18 ++++++++++++++++++ src/Utils/GLUtil.h | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Utils/GLUtil.cpp b/src/Utils/GLUtil.cpp index 8f2135a46..5119784e3 100644 --- a/src/Utils/GLUtil.cpp +++ b/src/Utils/GLUtil.cpp @@ -20,6 +20,7 @@ #include #include "Gem/RTE.h" #include "Gem/ContextData.h" +#include "Base/CPPExtern.h" #include @@ -103,6 +104,23 @@ GLenum gem::utils::gl::glReportError (bool verbose) } } +GLenum gem::utils::gl::glReportError (struct CPPExtern*parent, const char*prefix) +{ + GLenum errNum, finalErrNum=0; + if (!parent) + return glReportError(true); + + while ((errNum = glGetError()) != GL_NO_ERROR) { + finalErrNum = errNum; + const char*errStr = glErrorString(errNum); + if(errStr) + parent->error("%s%s [%d]", prefix?prefix:"", errStr, errNum); + else + parent->error("%sopenGL error 0x%X", prefix?prefix:"", errNum); + } + + return finalErrNum; +} #warning TODO: use gem::ContextData diff --git a/src/Utils/GLUtil.h b/src/Utils/GLUtil.h index c29edaefb..fa681bf83 100644 --- a/src/Utils/GLUtil.h +++ b/src/Utils/GLUtil.h @@ -29,7 +29,7 @@ struct _symbol; #include "Gem/GemGL.h" #include "Gem/Exception.h" - +struct CPPExtern; namespace gem { namespace utils @@ -45,6 +45,7 @@ namespace gl */ GEM_EXTERN const char* glErrorString(void); GEM_EXTERN extern GLenum glReportError (bool verbose=true); + GEM_EXTERN extern GLenum glReportError (struct CPPExtern*, const char*prefix=0); GEM_EXTERN extern int getGLdefine(const char *name); GEM_EXTERN extern int getGLdefine(const struct _symbol *name); From 85b0a22c34d70278ee3871185670ce3e1a338ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 14:24:16 +0200 Subject: [PATCH 288/387] use gem::utils::gl::glReportError(CPPExtern*) --- src/Base/GemBase.cpp | 8 +------- src/Base/GemWindow.cpp | 23 ++--------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/Base/GemBase.cpp b/src/Base/GemBase.cpp index 91209e098..bd4ada137 100644 --- a/src/Base/GemBase.cpp +++ b/src/Base/GemBase.cpp @@ -85,13 +85,7 @@ struct GemBase::PIMPL { void debugGLerror(const char*prefix=0) { if(debugGL) { GLenum errNum; - while ((errNum = gem::utils::gl::glReportError(false))) { - const char*errStr = gem::utils::gl::glErrorString(errNum); - if(errStr) - parent->error("%s%s [%d]", prefix?prefix:"", errStr, errNum); - else - parent->error("%sopenGL error 0x%X", prefix?prefix:"", errNum); - } + gem::utils::gl::glReportError(parent, prefix); } } }; diff --git a/src/Base/GemWindow.cpp b/src/Base/GemWindow.cpp index 3c7838b95..3e88373b1 100644 --- a/src/Base/GemWindow.cpp +++ b/src/Base/GemWindow.cpp @@ -26,25 +26,6 @@ namespace { -void reportGLerrors(GemWindow*obj) -{ - GLenum errNum; - while ((errNum = gem::utils::gl::glReportError(false))) { - const char*errStr = gem::utils::gl::glErrorString(errNum); - if(obj) { - if(errStr) - obj->error("%s [%d]", errStr, errNum); - else - obj->error("openGL error 0x%X", errNum); - } else { - if(errStr) - pd_error(0, "%s [%d]", errStr, errNum); - else - pd_error(0, "openGL error 0x%X", errNum); - - } - } -} bool sendContextDestroyedMsg(t_pd*x) { if(!x) { @@ -56,7 +37,7 @@ bool sendContextDestroyedMsg(t_pd*x) pd_typedmess(x, s, 1, a); /* clear all openGL errors */ - reportGLerrors(NULL); + gem::utils::gl::glReportError((CPPExtern*)NULL); return true; } }; @@ -221,7 +202,7 @@ class GemWindow::PIMPL } /* check for openGL errors */ - reportGLerrors(parent); + gem::utils::gl::glReportError(parent); if(dispatch) parent->dispatch(); From c5001b3172a226b641a17094328da376ae6b1284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 14:14:55 +0200 Subject: [PATCH 289/387] cleaned up [gemcubeframebuffer] help --- help/gemcubeframebuffer-help.pd | 242 ++++++++++++++++---------------- 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/help/gemcubeframebuffer-help.pd b/help/gemcubeframebuffer-help.pd index 094f2e782..4a0f4fc2d 100644 --- a/help/gemcubeframebuffer-help.pd +++ b/help/gemcubeframebuffer-help.pd @@ -6,7 +6,7 @@ #X obj 174 257 cnv 15 180 25 empty empty post 2 12 0 14 #00f8fc #000000 0; #X obj 20 571 cnv 15 600 30 empty empty empty 20 12 0 14 #fc8000 #404040 0; #X obj 27 72 cnv 15 100 90 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X obj 174 225 cnv 15 180 30 empty empty empty 20 12 0 14 #00fc04 #404040 0; +#X obj 174 180 cnv 15 180 70 empty empty empty 20 12 0 14 #00fc04 #404040 0; #X obj 184 24 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 184 68 alpha; #N canvas 974 317 450 481 draw_6_faces 0; @@ -98,25 +98,20 @@ #X connect 15 0 16 0; #X connect 16 0 10 0; #X restore 211 263 pd rotate_scene; -#X obj 211 231 gemcubeframebuffer; -#X obj 225 177 loadbang; #X obj 184 107 t a a; #N canvas 620 313 360 553 shader 0; #X obj 72 166 glsl_vertex; #X obj 72 269 glsl_fragment; #X obj 72 449 glsl_program; -#X obj 138 387 pack 0 0; -#X obj 156 357 t b f; -#X obj 156 300 change; -#X obj 138 191 change; -#X msg 138 409 link \$1 \$2; -#X floatatom 156 324 2 0 0 0 ID - - 0; -#X floatatom 138 214 2 0 0 0 ID - - 0; +#X obj 147 387 pack 0 0; +#X msg 147 409 link \$1 \$2; +#X floatatom 147 324 2 0 0 0 ID - - 0; +#X floatatom 135 194 2 0 0 0 ID - - 0; #X obj 120 60 tgl 15 0 \$0-shadOn-snd \$0-shadOn-rcv on/off 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 21 59 inlet gemlist; #X obj 21 489 outlet gemlist; #X msg 87 139 open \$1.vert; -#X msg 152 238 open \$1.frag; +#X msg 179 269 open \$1.frag; #X obj 120 14 loadbang; #X msg 120 36 1; #X obj 152 69 inlet loadShader; @@ -144,33 +139,38 @@ #X connect 9 1 7 0; #X restore 21 108 pd demux; #X obj 152 91 symbol; -#X obj 152 113 t s s; +#X obj 147 429 t a a; +#X obj 174 501 print -n; +#X obj 174 455 list prepend; +#X obj 174 478 list trim; +#X obj 152 113 t s s s; #X connect 0 0 1 0; #X connect 0 1 6 0; #X connect 1 0 2 0; #X connect 1 1 5 0; -#X connect 2 0 12 0; -#X connect 3 0 7 0; -#X connect 4 0 3 0; -#X connect 4 1 3 1; -#X connect 5 0 8 0; -#X connect 6 0 9 0; -#X connect 7 0 2 0; -#X connect 8 0 4 0; -#X connect 9 0 3 0; -#X connect 10 0 19 1; -#X connect 11 0 19 0; -#X connect 13 0 0 0; -#X connect 14 0 1 0; -#X connect 15 0 16 0; -#X connect 16 0 10 0; -#X connect 17 0 20 0; +#X connect 2 0 9 0; +#X connect 3 0 4 0; +#X connect 4 0 18 0; +#X connect 5 0 3 0; +#X connect 6 0 3 1; +#X connect 7 0 16 1; +#X connect 8 0 16 0; +#X connect 10 0 0 0; +#X connect 11 0 1 0; +#X connect 12 0 13 0; +#X connect 13 0 7 0; +#X connect 14 0 17 0; +#X connect 15 0 2 0; +#X connect 16 0 9 0; +#X connect 16 1 0 0; +#X connect 17 0 22 0; #X connect 18 0 2 0; -#X connect 19 0 12 0; -#X connect 19 1 0 0; +#X connect 18 1 20 0; #X connect 20 0 21 0; -#X connect 21 0 13 0; -#X connect 21 1 14 0; +#X connect 21 0 19 0; +#X connect 22 0 10 0; +#X connect 22 1 11 0; +#X connect 22 2 20 1; #X restore 184 369 pd shader; #X obj 184 343 pix_texture; #X obj 184 310 separator; @@ -304,9 +304,8 @@ #X restore 409 294 pd draw_scene; #X obj 409 265 r \$0-sceneHead; #X text 30 165 Show:; -#X obj 553 178 hsl 128 15 0 1 0 0 empty empty background_opacity -2 -8 0 10 #fcfcfc #000000 #000000 0 1; -#X msg 550 199 color 0 0.1 0.2 \$1; -#X msg 225 199 dimen 512 512 \, format RGBA \, color 0 0.1 0.2 1; +#X obj 553 148 hsl 128 15 0 1 0 0 empty empty background_opacity -2 -8 0 10 #fcfcfc #000000 #000000 0 1; +#X msg 550 169 color 0 0.1 0.2 \$1; #X text 14 630 Antoine Rousseau nov 2015; #X text 316 64 See:; #X text 467 64 for more messages.; @@ -316,22 +315,19 @@ #X obj 72 166 glsl_vertex; #X obj 72 269 glsl_fragment; #X obj 72 449 glsl_program; -#X obj 138 387 pack 0 0; -#X obj 156 357 t b f; -#X obj 156 300 change; -#X obj 138 191 change; -#X msg 138 409 link \$1 \$2; -#X floatatom 156 324 2 0 0 0 ID - - 0; -#X floatatom 138 214 2 0 0 0 ID - - 0; +#X obj 147 387 pack 0 0; +#X msg 147 409 link \$1 \$2; +#X floatatom 147 324 2 0 0 0 ID - - 0; +#X floatatom 135 194 2 0 0 0 ID - - 0; #X obj 120 60 tgl 15 0 \$0-shadOn-snd \$0-shadOn-rcv on/off 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 21 59 inlet gemlist; #X obj 21 489 outlet gemlist; #X msg 87 139 open \$1.vert; -#X msg 152 238 open \$1.frag; +#X msg 179 238 open \$1.frag; #X obj 120 14 loadbang; #X msg 120 36 1; #X obj 152 69 inlet loadShader; -#X obj 229 408 inlet variables; +#X obj 238 408 inlet variables; #N canvas 85 80 450 300 demux 0; #X obj 52 33 inlet; #X obj 308 37 inlet select; @@ -355,33 +351,38 @@ #X connect 9 1 7 0; #X restore 21 108 pd demux; #X obj 152 91 symbol; -#X obj 152 113 t s s; +#X obj 174 501 print -n; +#X obj 174 455 list prepend; +#X obj 174 478 list trim; +#X obj 147 430 t a a; +#X obj 152 113 t s s s; #X connect 0 0 1 0; #X connect 0 1 6 0; #X connect 1 0 2 0; #X connect 1 1 5 0; -#X connect 2 0 12 0; -#X connect 3 0 7 0; -#X connect 4 0 3 0; -#X connect 4 1 3 1; -#X connect 5 0 8 0; -#X connect 6 0 9 0; -#X connect 7 0 2 0; -#X connect 8 0 4 0; -#X connect 9 0 3 0; -#X connect 10 0 19 1; -#X connect 11 0 19 0; -#X connect 13 0 0 0; -#X connect 14 0 1 0; -#X connect 15 0 16 0; -#X connect 16 0 10 0; -#X connect 17 0 20 0; -#X connect 18 0 2 0; -#X connect 19 0 12 0; -#X connect 19 1 0 0; -#X connect 20 0 21 0; -#X connect 21 0 13 0; -#X connect 21 1 14 0; +#X connect 2 0 9 0; +#X connect 3 0 4 0; +#X connect 4 0 21 0; +#X connect 5 0 3 0; +#X connect 6 0 3 1; +#X connect 7 0 16 1; +#X connect 8 0 16 0; +#X connect 10 0 0 0; +#X connect 11 0 1 0; +#X connect 12 0 13 0; +#X connect 13 0 7 0; +#X connect 14 0 17 0; +#X connect 15 0 2 0; +#X connect 16 0 9 0; +#X connect 16 1 0 0; +#X connect 17 0 22 0; +#X connect 19 0 20 0; +#X connect 20 0 18 0; +#X connect 21 0 2 0; +#X connect 21 1 19 0; +#X connect 22 0 10 0; +#X connect 22 1 11 0; +#X connect 22 2 19 1; #X restore 493 429 pd shader; #X obj 575 364 loadbang; #X obj 493 385 spigot; @@ -405,59 +406,58 @@ #X obj 34 90 _gemwin \; 0 \; 0 \; view 0 0 3; #X obj 635 74 world_light; #X obj 635 51 gemhead 80; -#X connect 7 0 72 0; -#X connect 8 0 13 0; -#X connect 9 0 11 0; +#X obj 211 186 gemcubeframebuffer \; dimen 512 512 \; format RGBA \; color 0 0.1 0.2 1; +#X connect 7 0 69 0; +#X connect 8 0 11 0; +#X connect 9 0 75 0; #X connect 9 1 10 1; -#X connect 10 0 38 0; -#X connect 11 0 10 0; -#X connect 11 1 15 1; -#X connect 12 0 49 0; -#X connect 13 0 16 0; -#X connect 13 1 17 0; -#X connect 14 0 22 0; -#X connect 14 0 37 0; -#X connect 15 0 14 0; -#X connect 15 0 57 0; -#X connect 16 0 15 0; -#X connect 16 0 35 0; -#X connect 17 0 9 0; -#X connect 18 0 54 0; -#X connect 21 0 23 0; -#X connect 22 0 19 0; -#X connect 24 0 22 1; -#X connect 25 0 39 0; -#X connect 26 0 31 0; -#X connect 30 0 24 0; -#X connect 32 0 36 0; -#X connect 33 0 34 0; +#X connect 10 0 36 0; +#X connect 11 0 14 0; +#X connect 11 1 15 0; +#X connect 12 0 20 0; +#X connect 12 0 35 0; +#X connect 13 0 12 0; +#X connect 13 0 54 0; +#X connect 14 0 13 0; +#X connect 14 0 33 0; +#X connect 15 0 9 0; +#X connect 16 0 51 0; +#X connect 19 0 21 0; +#X connect 20 0 17 0; +#X connect 22 0 20 1; +#X connect 23 0 37 0; +#X connect 24 0 29 0; +#X connect 28 0 22 0; +#X connect 30 0 34 0; +#X connect 31 0 32 0; +#X connect 32 0 33 1; +#X connect 33 0 23 0; #X connect 34 0 35 1; -#X connect 35 0 25 0; -#X connect 36 0 37 1; -#X connect 37 0 21 0; -#X connect 40 0 75 0; -#X connect 41 0 40 0; -#X connect 45 0 44 0; -#X connect 47 0 48 0; -#X connect 48 0 11 0; -#X connect 49 0 11 0; -#X connect 54 0 14 1; -#X connect 55 0 65 0; -#X connect 56 0 59 0; -#X connect 57 0 55 0; -#X connect 58 0 60 0; -#X connect 59 0 55 1; -#X connect 60 0 57 1; -#X connect 61 0 67 0; -#X connect 62 0 61 0; -#X connect 62 1 63 0; -#X connect 62 1 64 0; -#X connect 63 0 61 1; -#X connect 64 0 61 2; -#X connect 65 0 62 0; -#X connect 68 0 65 3; -#X connect 69 0 65 3; -#X connect 70 0 21 3; -#X connect 71 0 21 3; -#X connect 72 0 8 0; -#X connect 77 0 76 0; +#X connect 35 0 19 0; +#X connect 38 0 72 0; +#X connect 39 0 38 0; +#X connect 43 0 42 0; +#X connect 45 0 46 0; +#X connect 46 0 75 0; +#X connect 51 0 12 1; +#X connect 52 0 62 0; +#X connect 53 0 56 0; +#X connect 54 0 52 0; +#X connect 55 0 57 0; +#X connect 56 0 52 1; +#X connect 57 0 54 1; +#X connect 58 0 64 0; +#X connect 59 0 58 0; +#X connect 59 1 60 0; +#X connect 59 1 61 0; +#X connect 60 0 58 1; +#X connect 61 0 58 2; +#X connect 62 0 59 0; +#X connect 65 0 62 3; +#X connect 66 0 62 3; +#X connect 67 0 19 3; +#X connect 68 0 19 3; +#X connect 69 0 8 0; +#X connect 74 0 73 0; +#X connect 75 0 10 0; +#X connect 75 1 13 1; From ce1fce8c2001c0030951edf28130953fdbe2d7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 14:23:09 +0200 Subject: [PATCH 290/387] gemcubeframebuffer: force 'alpha' uniform to 1.0 seems like on re-loading a shader, default values (as specified in the shader) don't work anymore... Closes: https://github.com/umlaeute/Gem/issues/480 --- help/gemcubeframebuffer-help.pd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/help/gemcubeframebuffer-help.pd b/help/gemcubeframebuffer-help.pd index 4a0f4fc2d..f81a11355 100644 --- a/help/gemcubeframebuffer-help.pd +++ b/help/gemcubeframebuffer-help.pd @@ -102,7 +102,7 @@ #N canvas 620 313 360 553 shader 0; #X obj 72 166 glsl_vertex; #X obj 72 269 glsl_fragment; -#X obj 72 449 glsl_program; +#X obj 72 449 glsl_program \; alpha 1; #X obj 147 387 pack 0 0; #X msg 147 409 link \$1 \$2; #X floatatom 147 324 2 0 0 0 ID - - 0; From 68f259aa4e770ac3e8e96423c8ef862e3bf47601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 14:44:36 +0200 Subject: [PATCH 291/387] push/pop all texture units Closes: https://github.com/umlaeute/Gem/issues/478 --- src/Gem/GLStack.cpp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/Gem/GLStack.cpp b/src/Gem/GLStack.cpp index 40145f9e3..a652fa8cf 100644 --- a/src/Gem/GLStack.cpp +++ b/src/Gem/GLStack.cpp @@ -38,6 +38,7 @@ class GLStack::Data { public: Data(void) + : numTexUnits(0) { int i=0; for(i=0; i<4; i++) { @@ -49,6 +50,7 @@ class GLStack::Data int stackDepth[4]; int maxDepth[4]; int orgDepth[4]; + int numTexUnits; }; }; @@ -116,8 +118,18 @@ bool GLStack::push(enum GemStackId id) } if(data->stackDepth[id]maxDepth[id]) { glMatrixMode(mode); - glPushMatrix(); + if(id == TEXTURE && data->numTexUnits) { + int curUnit; + glGetIntegerv(GL_ACTIVE_TEXTURE, &curUnit); + for (int i=0; inumTexUnits; i++) { + glActiveTexture(GL_TEXTURE0_ARB + i); + glPushMatrix(); + } + glActiveTexture(curUnit); + } else + glPushMatrix(); data->stackDepth[id]++; + if(gem::utils::gl::glReportError(NULL, "push "))post("stack=%d", id); return true; } @@ -148,7 +160,17 @@ bool GLStack::pop(enum GemStackId id) data->stackDepth[id]--; if(data->stackDepth[id]maxDepth[id]) { glMatrixMode(mode); - glPopMatrix(); + if(id == TEXTURE && data->numTexUnits) { + int curUnit; + glGetIntegerv(GL_ACTIVE_TEXTURE, &curUnit); + for (int i=0; inumTexUnits; i++) { + glActiveTexture(GL_TEXTURE0_ARB + i); + glPopMatrix(); + } + glActiveTexture(curUnit); + } else + glPopMatrix(); + if(gem::utils::gl::glReportError(NULL, "pop "))post("stack=%d", id); return true; } return false; @@ -187,6 +209,12 @@ int GLStack::reset(enum GemStackId id) s_id2maxdepth[id]=0; s_id2depth[id]=0; } + + data->numTexUnits = 0; + if(TEXTURE == id && GLEW_ARB_multitexture) { + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->numTexUnits); + } + glReportError(); // clear any errors so far } From c7e0d33225421b0fdffac9e4ff4906dae9e48ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 15:02:56 +0200 Subject: [PATCH 292/387] pix_snap2tex: don't snap if there's no texture object Closes: https://github.com/umlaeute/Gem/issues/477 --- src/Pixes/pix_snap2tex.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Pixes/pix_snap2tex.cpp b/src/Pixes/pix_snap2tex.cpp index 943371713..fce45772e 100644 --- a/src/Pixes/pix_snap2tex.cpp +++ b/src/Pixes/pix_snap2tex.cpp @@ -157,6 +157,8 @@ void pix_snap2tex :: snapMess(void) if(!GLEW_VERSION_1_1 && !GLEW_EXT_texture_object) { return; } + if (!m_textureObj) + return; int width = m_width; int height = m_height; From d863997b963f852020439d35c4437ffc45a86d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 17:01:35 +0200 Subject: [PATCH 293/387] GLSL helper --- abstractions/Makefile.am | 2 + abstractions/_glsl.compile.pd | 78 ++++++++++++++++++++++++++++++++ abstractions/glsl.pd | 85 +++++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 abstractions/_glsl.compile.pd create mode 100644 abstractions/glsl.pd diff --git a/abstractions/Makefile.am b/abstractions/Makefile.am index d7e32023c..2cca55828 100644 --- a/abstractions/Makefile.am +++ b/abstractions/Makefile.am @@ -20,6 +20,8 @@ dist_gemabs_DATA = \ gemrepeat.pd \ gemtablet.pd \ gemwin.pd \ + glsl.pd \ + _glsl.compile.pd \ hsv2rgb-help.pd \ hsv2rgb.pd \ part_info.pd \ diff --git a/abstractions/_glsl.compile.pd b/abstractions/_glsl.compile.pd new file mode 100644 index 000000000..707d27061 --- /dev/null +++ b/abstractions/_glsl.compile.pd @@ -0,0 +1,78 @@ +#N canvas 2613 393 512 437 12; +#X obj 131 383 glsl_\$1; +#X obj 251 39 inlet shaderfile; +#X obj 283 94 list append \$2; +#X obj 131 408 outlet gemstate; +#X obj 69 68 inlet gemstate; +#X obj 69 311 t a a; +#X obj 131 342 spigot 0; +#X obj 69 341 spigot 1; +#X msg 283 119 symbol \$1.\$2; +#X obj 283 179 t a b; +#X msg 283 204 open \$1; +#X obj 255 408 outlet shaderID; +#X msg 347 203 1; +#X msg 377 203 0; +#X obj 347 258 t f f, f 6; +#X obj 347 283 == 0; +#X obj 386 283 == 1; +#X obj 251 67 t a a; +#X obj 371 408 outlet shaderfile; +#X obj 367 228 t f f; +#N canvas 3269 334 450 484 find 0; +#X obj 62 26 inlet filename; +#X obj 62 51 t b s s; +#X obj 62 106 file patchpath 2; +#X msg 62 76 2; +#X obj 62 156 file join; +#X obj 62 131 pack s s; +#X msg 179 29 symbol shader/blur.frag; +#X obj 62 181 file which; +#X obj 62 346 outlet abs_filename; +#X obj 129 207 t b; +#X obj 129 232 symbol; +#X obj 129 257 file which; +#X obj 208 346 outlet notfound; +#X obj 208 321 t b; +#X connect 0 0 1 0; +#X connect 1 0 3 0; +#X connect 1 1 5 1; +#X connect 1 2 10 1; +#X connect 2 0 5 0; +#X connect 3 0 2 0; +#X connect 4 0 7 0; +#X connect 5 0 4 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 7 1 9 0; +#X connect 9 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 8 0; +#X connect 11 1 13 0; +#X connect 13 0 12 0; +#X restore 283 150 pd find file; +#X connect 0 0 3 0; +#X connect 0 1 11 0; +#X connect 1 0 17 0; +#X connect 2 0 8 0; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 5 1 6 0; +#X connect 6 0 0 0; +#X connect 7 0 3 0; +#X connect 8 0 20 0; +#X connect 9 0 10 0; +#X connect 9 1 12 0; +#X connect 10 0 0 0; +#X connect 12 0 14 0; +#X connect 13 0 19 0; +#X connect 14 0 15 0; +#X connect 14 1 16 0; +#X connect 15 0 7 1; +#X connect 16 0 6 1; +#X connect 17 0 18 0; +#X connect 17 1 2 0; +#X connect 19 0 14 0; +#X connect 19 1 11 0; +#X connect 20 0 9 0; +#X connect 20 1 13 0; diff --git a/abstractions/glsl.pd b/abstractions/glsl.pd new file mode 100644 index 000000000..c5fb062d3 --- /dev/null +++ b/abstractions/glsl.pd @@ -0,0 +1,85 @@ +#N canvas 1980 98 668 783 10; +#X msg 72 338 print; +#X obj 118 626 glsl_program; +#X msg 72 620 print; +#X obj 118 21 inlet; +#X obj 118 662 outlet; +#X obj 577 95 inlet; +#X obj 118 192 t a; +#X floatatom 197 662 2 0 0 0 ID - - 0; +#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; +#X obj 197 690 outlet programID; +#X obj 383 104 gemargs; +#X obj 383 68 loadbang; +#X obj 422 128 route bang; +#X obj 167 258 list prepend \$1; +#X obj 227 189 t b a; +#X obj 383 361 t a a; +#X msg 33 124 print; +#X obj 33 103 t b; +#X obj 118 339 _glsl.compile vertex vert, f 30; +#X msg 72 368 print; +#X msg 72 398 print; +#X obj 118 369 _glsl.compile geometry geom, f 30; +#X obj 118 399 _glsl.compile fragment frag, f 30; +#X obj 223 578 list prepend link; +#X obj 223 601 list trim; +#X listbox 286 601 20 0 0 0 - - - 0; +#X obj 118 44 route print bang symbol open; +#X msg 72 469 print; +#X obj 118 469 _glsl.compile tesscontrol tesc; +#X obj 118 492 _glsl.compile tesseval tese, f 30; +#X obj 223 556 pack 0 0 0 0 0; +#X msg 72 492 print; +#X obj 33 145 t a a a a a a; +#X connect 0 0 18 0; +#X connect 1 0 4 0; +#X connect 1 1 7 0; +#X connect 2 0 1 0; +#X connect 3 0 26 0; +#X connect 5 0 15 0; +#X connect 6 0 18 0; +#X connect 7 0 9 0; +#X connect 10 0 15 0; +#X connect 10 1 12 0; +#X connect 11 0 10 0; +#X connect 12 1 14 0; +#X connect 13 0 18 1; +#X connect 14 0 13 0; +#X connect 14 1 13 1; +#X connect 15 0 1 0; +#X connect 16 0 32 0; +#X connect 17 0 16 0; +#X connect 18 0 21 0; +#X connect 18 1 30 2; +#X connect 18 2 21 1; +#X connect 19 0 21 0; +#X connect 20 0 22 0; +#X connect 21 0 22 0; +#X connect 21 1 30 1; +#X connect 21 2 22 1; +#X connect 22 0 28 0; +#X connect 22 1 30 0; +#X connect 22 2 28 1; +#X connect 23 0 24 0; +#X connect 23 0 25 0; +#X connect 24 0 1 0; +#X connect 26 0 17 0; +#X connect 26 1 13 0; +#X connect 26 2 14 0; +#X connect 26 3 14 0; +#X connect 26 4 6 0; +#X connect 27 0 28 0; +#X connect 28 0 29 0; +#X connect 28 1 30 4; +#X connect 28 2 29 1; +#X connect 29 0 1 0; +#X connect 29 1 30 3; +#X connect 30 0 23 0; +#X connect 31 0 29 0; +#X connect 32 0 1 0; +#X connect 32 1 29 0; +#X connect 32 2 28 0; +#X connect 32 3 22 0; +#X connect 32 4 21 0; +#X connect 32 5 18 0; From b85499e3ea87529c2dd16a4e4c72d549a112351e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 17:01:47 +0200 Subject: [PATCH 294/387] Document [glsl] --- help/Makefile.am | 3 ++ help/glsl-help.pd | 76 +++++++++++++++++++++++++++++++++++++++++++++ help/glsl_test.frag | 38 +++++++++++++++++++++++ help/glsl_test.vert | 12 +++++++ 4 files changed, 129 insertions(+) create mode 100644 help/glsl-help.pd create mode 100644 help/glsl_test.frag create mode 100644 help/glsl_test.vert diff --git a/help/Makefile.am b/help/Makefile.am index 8b711f28f..776507b2d 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -60,6 +60,9 @@ dist_gemhelp_DATA += \ gemsdl2window-help.pd \ gemw32window-help.pd \ GLdefine-help.pd \ + glsl-help.pd \ + glsl_test.frag \ + glsl_test.vert \ glsl_fragment-help.pd \ glsl_geometry-help.pd \ glsl_program-help.pd \ diff --git a/help/glsl-help.pd b/help/glsl-help.pd new file mode 100644 index 000000000..ed0b3e7f0 --- /dev/null +++ b/help/glsl-help.pd @@ -0,0 +1,76 @@ +#N canvas 504 148 683 643 10; +#X declare -lib Gem; +#X text 452 8 GEM object; +#X obj 8 337 cnv 15 430 220 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 11 338 Inlets:; +#X text 10 504 Outlets:; +#X obj 8 302 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 17 302 Arguments:; +#X obj 7 56 cnv 15 430 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 449 77 cnv 15 230 250 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X text 453 60 Example:; +#X obj 450 108 cnv 15 220 160 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X text 63 313 ; +#X text 15 517 Outlet 1: gemlist, f 68; +#X text 21 352 Inlet 1: gemlist, f 67; +#X obj 11 576 cnv 15 420 50 empty empty empty 20 12 0 14 #d8fcfc #404040 0; +#X text 71 31 Class: shader object; +#X text 451 345 see also:; +#X obj 453 362 glsl_fragment; +#X obj 453 382 glsl_vertex; +#X text 13 56 Description: link GLSL-modules into a shader program, f 67; +#X text 15 580 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support the GLSL-standard (which is part of openGL-2.0) in order to make use of this object., f 68; +#X text 14 275 An ID of the generated program is sent to the 2nd outlet., f 69; +#X text 15 532 Outlet 2: : ID of the linked glsl_program, f 68; +#X floatatom 628 248 5 0 0 0 ID - - 0; +#X obj 451 86 gemhead; +#X msg 460 120 print; +#X text 21 367 Inlet 1: "print": print info about the GLSL-support in your openGL implementation and about the linked program, f 67; +#X obj 453 402 glsl_geometry; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 45 DESCRIPTION link GLSL-modules into a shader program, f 67; +#X text 10 65 KEYWORDS Gem openGL shader; +#X text 20 135 OUTLET_0 gemlist; +#X text 20 155 OUTLET_1 float; +#X text 10 175 AUTHOR IOhannes m zmölnig; +#X text 10 195 LICENSE GPL v2; +#X text 20 85 INLET_0 gemlist open symbol bang; +#X text 20 115 INLET_1 ; +#X restore 518 8 pd META; +#X obj 515 273 _gemwin; +#X text 50 12 Synopsis: [glsl]; +#X text 14 75 [glsl[ wraps the various GLSL compilers ([glsl_vertex] \, [glsl_fragment] \, [glsl_geometry]...) and the GLSL linker ([glsl_program]) into a single easy-to-use object., f 69; +#X text 14 118 It takes the basename of the shader file(s) \, and tries to guess some common extension for the various shader stages., f 69; +#X text 29 147 vertex shader: *.vert; +#X text 29 162 fragment shader: *.frag; +#X text 29 177 geometry shader: *.geom; +#X text 14 217 The files are searched for in the directory of the current patch (where [glsl] is invoked) \, and if they are not found there \, the Pd search path is used., f 69; +#X text 21 395 Inlet 1: "open ": basename of the shader files, f 67; +#X text 21 410 Inlet 1: "symbol": alias for "open", f 67; +#X text 21 439 Inlet 2: " ...": set the uniform variable of name uniformName to the (list of) uniformParms. this is only valid after successfully linking a program. the inlet is actually forwarded to [glsl_program], f 67; +#X obj 453 432 glsl_program; +#X obj 470 141 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 470 164 openpanel; +#X obj 470 184 file splitext; +#X msg 470 204 open \$1; +#X obj 451 291 teapot; +#X msg 558 208 shininess \$1; +#X floatatom 575 181 5 0 0 0 - - - 0; +#X text 21 425 Inlet 1: "bang": reload, f 67; +#X msg 505 120 bang; +#X text 189 177 (compute shader: *.comp); +#X text 189 162 (tesselation evaluation shader: *.tese); +#X text 189 147 (tesselation control shader: *.tesc); +#X obj 451 228 glsl glsl_test \; shininess 50; +#X connect 23 0 52 0; +#X connect 24 0 52 0; +#X connect 40 0 41 0; +#X connect 41 0 42 0; +#X connect 42 0 43 0; +#X connect 43 0 52 0; +#X connect 45 0 52 1; +#X connect 46 0 45 0; +#X connect 48 0 52 0; +#X connect 52 0 44 0; +#X connect 52 1 22 0; diff --git a/help/glsl_test.frag b/help/glsl_test.frag new file mode 100644 index 000000000..27a31ef66 --- /dev/null +++ b/help/glsl_test.frag @@ -0,0 +1,38 @@ +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// from vertex shader +varying vec3 Normal; +varying vec3 Position; + +// light description +const vec4 LightPosition = vec4(5.,3.,1.,1.); // Light position in eye coords. +const vec3 LightLa = vec3(1.,1.,1.); // Ambient light intensity +const vec3 LightL = vec3(1.,1.,1.); // Diffuse and specular light intensity + +// material definition +const vec3 MaterialKa = vec3(.1, .1, .5); // Ambient reflectivity +const vec3 MaterialKd = vec3(.8, .1, .1); // Diffuse reflectivity +const vec3 MaterialKs = vec3(.1, .3, .1); // Specular reflectivity +uniform float shininess; // Specular shininess factor + +// The lighting model +vec3 blinnPhong( vec3 position, vec3 n) { + vec3 ambient = LightLa * MaterialKa; + vec3 s = normalize( LightPosition.xyz - position ); + float sDotN = max( dot(s,n), 0.0 ); + vec3 diffuse = MaterialKd * sDotN; + vec3 spec = vec3(0.0); + if( sDotN > 0.0 ) { + vec3 v = normalize(-position.xyz); + vec3 h = normalize( v + s ); + spec = MaterialKs * pow( max( dot(h,n), 0.0 ), shininess ); + } + return ambient + LightL * (diffuse + spec); +} + +void main (void) +{ + gl_FragColor = vec4(blinnPhong(Position, normalize(Normal)), 1.0); + //gl_FragColor = vec4(blinnPhong(Position, Normal), 1.0); +} diff --git a/help/glsl_test.vert b/help/glsl_test.vert new file mode 100644 index 000000000..80ad2e8ce --- /dev/null +++ b/help/glsl_test.vert @@ -0,0 +1,12 @@ +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +varying vec3 Normal; +varying vec3 Position; + +void main() +{ + Normal = normalize(gl_NormalMatrix * gl_Normal.xyz); + Position = ( gl_ModelViewMatrix * vec4(gl_Vertex.xyz,1.0) ).xyz; + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} From 2434744ec42e4bfc48e3ce2ce48654e7a30257b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 17:03:12 +0200 Subject: [PATCH 295/387] GLSL examples: use [glsl] --- examples/10.glsl/01.simple_texture.pd | 75 ++++++++---------- examples/10.glsl/02.primitive_distortion.pd | 18 ++--- examples/10.glsl/03.texture_distortion.pd | 4 +- examples/10.glsl/04.game_of_life.pd | 2 +- examples/10.glsl/05.multitexture.pd | 2 +- examples/10.glsl/05.multitexture_basic.pd | 20 +++-- examples/10.glsl/05.multitexture_bis.pd | 47 +++++------ examples/10.glsl/06.rectangle_multitexture.pd | 28 +++---- examples/10.glsl/07.framebuffer_and_shader.pd | 4 +- examples/10.glsl/08.multi_pass_rendering.pd | 6 +- .../10.glsl/09.vertex_texture_fetching.pd | 2 +- examples/10.glsl/11.geometry.pd | 2 +- examples/10.glsl/12.tri2fan.pd | 2 +- examples/10.glsl/13.panoramique.pd | 8 +- .../10.glsl/15.bicubic_image_interpolation.pd | 2 +- .../10.glsl/16.vertexbuffer_attributes.pd | 2 +- examples/10.glsl/17.light.pd | 2 +- .../10.glsl/18.additive_audio_synthesis.pd | 2 +- examples/10.glsl/_glsl.pd | 71 ----------------- examples/10.glsl/_glsl_f.pd | 45 ----------- examples/10.glsl/_glsl_vgf.pd | 78 ------------------- examples/10.glsl/single_blur.pd | 2 +- 22 files changed, 107 insertions(+), 317 deletions(-) delete mode 100644 examples/10.glsl/_glsl.pd delete mode 100644 examples/10.glsl/_glsl_f.pd delete mode 100644 examples/10.glsl/_glsl_vgf.pd diff --git a/examples/10.glsl/01.simple_texture.pd b/examples/10.glsl/01.simple_texture.pd index 32a2d5cb2..ccea1917c 100644 --- a/examples/10.glsl/01.simple_texture.pd +++ b/examples/10.glsl/01.simple_texture.pd @@ -1,8 +1,6 @@ #N canvas 486 82 722 633 10; #X declare -lib Gem; #X obj 76 22 gemhead; -#X obj 76 367 glsl_program; -#X obj 169 329 print linking; #X obj 76 411 rotateXYZ; #X floatatom 96 389 5 0 0 0 - - - 0; #X floatatom 140 389 5 0 0 0 - - - 0; @@ -10,7 +8,6 @@ #X obj 76 580 pix_texture; #X msg 548 116 color 1 0 0; #X obj 106 69 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; -#X obj 76 197 glsl_fragment; #X text 245 459 <- load texture; #X obj 106 535 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 76 489 pix_image ../data/img1.jpg; @@ -78,45 +75,39 @@ #X obj 294 134 s rectangle; #X obj 114 134 s rectangle; #X obj 106 512 r rectangle; -#X msg 32 167 print; -#X msg 39 340 print; -#X floatatom 192 372 0 0 0 0 - - - 0; -#X msg 151 308 link \$1; +#X msg 34 277 print; +#X floatatom 97 300 0 0 0 0 - - - 0; #X obj 604 13 declare -lib Gem; -#X msg 106 154 open shader/texture.frag; -#X msg 283 154 open shader/texture_rect.frag; #X obj 106 46 loadbang; -#X connect 0 0 10 0; -#X connect 1 0 3 0; -#X connect 1 1 36 0; -#X connect 3 0 13 0; -#X connect 4 0 3 1; -#X connect 5 0 3 2; -#X connect 6 0 3 3; -#X connect 7 0 27 0; -#X connect 8 0 29 0; -#X connect 9 0 39 0; -#X connect 9 0 15 0; -#X connect 10 0 1 0; -#X connect 10 1 37 0; -#X connect 12 0 30 0; -#X connect 13 0 7 0; -#X connect 14 0 13 0; -#X connect 15 0 32 0; -#X connect 16 0 40 0; -#X connect 16 0 19 0; -#X connect 19 0 31 0; -#X connect 20 0 1 0; -#X connect 21 0 1 0; -#X connect 22 0 20 0; -#X connect 23 0 21 0; -#X connect 28 0 29 0; -#X connect 30 0 7 0; -#X connect 33 0 12 0; -#X connect 34 0 10 0; +#X obj 76 277 glsl; +#X msg 106 154 open shader/texture; +#X msg 283 154 open shader/texture_rect; +#X connect 0 0 35 0; +#X connect 1 0 10 0; +#X connect 2 0 1 1; +#X connect 3 0 1 2; +#X connect 4 0 1 3; +#X connect 5 0 24 0; +#X connect 6 0 26 0; +#X connect 7 0 36 0; +#X connect 7 0 12 0; +#X connect 9 0 27 0; +#X connect 10 0 5 0; +#X connect 11 0 10 0; +#X connect 12 0 29 0; +#X connect 13 0 37 0; +#X connect 13 0 16 0; +#X connect 16 0 28 0; +#X connect 17 0 35 1; +#X connect 18 0 35 1; +#X connect 19 0 17 0; +#X connect 20 0 18 0; +#X connect 25 0 26 0; +#X connect 27 0 5 0; +#X connect 30 0 9 0; +#X connect 31 0 35 0; +#X connect 34 0 7 0; #X connect 35 0 1 0; -#X connect 37 0 1 0; -#X connect 37 0 2 0; -#X connect 39 0 10 0; -#X connect 40 0 10 0; -#X connect 41 0 9 0; +#X connect 35 1 32 0; +#X connect 36 0 35 0; +#X connect 37 0 35 0; diff --git a/examples/10.glsl/02.primitive_distortion.pd b/examples/10.glsl/02.primitive_distortion.pd index e7ee5420a..3eda95136 100644 --- a/examples/10.glsl/02.primitive_distortion.pd +++ b/examples/10.glsl/02.primitive_distortion.pd @@ -1,4 +1,4 @@ -#N canvas 228 61 587 514 10; +#N canvas 545 64 587 514 10; #X declare -lib Gem; #X obj 74 19 gemhead; #X obj 74 44 alpha; @@ -59,20 +59,20 @@ #X restore 359 78 pd gemwin; #X text 423 451 ch 2007; #X obj 389 43 declare -lib Gem; -#X obj 74 201 _glsl shader/P_distord; #X msg 84 178 print; #X obj 74 311 pix_texture \; rectangle 0; #X obj 203 110 loadbang; +#X obj 74 201 glsl shader/P_distord; #X connect 0 0 1 0; -#X connect 1 0 15 0; +#X connect 1 0 18 0; #X connect 2 0 3 0; -#X connect 3 0 15 1; +#X connect 3 0 18 1; #X connect 6 0 9 0; #X connect 7 0 4 0; #X connect 8 0 2 0; -#X connect 9 0 17 0; +#X connect 9 0 16 0; #X connect 11 0 12 0; -#X connect 15 0 9 0; -#X connect 16 0 15 0; -#X connect 17 0 7 0; -#X connect 18 0 8 0; +#X connect 15 0 18 0; +#X connect 16 0 7 0; +#X connect 17 0 8 0; +#X connect 18 0 9 0; diff --git a/examples/10.glsl/03.texture_distortion.pd b/examples/10.glsl/03.texture_distortion.pd index 60804cdec..09948b303 100644 --- a/examples/10.glsl/03.texture_distortion.pd +++ b/examples/10.glsl/03.texture_distortion.pd @@ -1,4 +1,4 @@ -#N canvas 10 61 552 547 10; +#N canvas 495 82 552 547 10; #X declare -lib Gem; #X obj 74 189 gemhead; #X obj 74 214 alpha; @@ -59,7 +59,7 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 354 58 pd gemwin; #X obj 384 23 declare -lib Gem; -#X obj 74 257 _glsl shader/T_distord; +#X obj 74 257 glsl shader/T_distord; #X obj 203 119 loadbang; #X obj 74 391 pix_texture \; rectangle 0; #X text 431 480 ch 2007; diff --git a/examples/10.glsl/04.game_of_life.pd b/examples/10.glsl/04.game_of_life.pd index f629c26f3..dc6f62fcf 100644 --- a/examples/10.glsl/04.game_of_life.pd +++ b/examples/10.glsl/04.game_of_life.pd @@ -68,7 +68,7 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 52 117 pd gemwin; #X obj 484 13 declare -lib Gem; -#X obj 316 106 _glsl shader/game; +#X obj 316 106 glsl shader/game; #X obj 316 298 pix_snap2tex 500 500; #X connect 0 0 6 0; #X connect 2 0 22 0; diff --git a/examples/10.glsl/05.multitexture.pd b/examples/10.glsl/05.multitexture.pd index 683eeaf4d..61b25cfa4 100644 --- a/examples/10.glsl/05.multitexture.pd +++ b/examples/10.glsl/05.multitexture.pd @@ -85,7 +85,7 @@ #X msg 698 403 texunit \$1; #X obj 698 380 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 76 414 pix_texture \; rectangle 0 \; texunit 2; -#X obj 76 179 _glsl shader/multitexture \; MyTex 0 \; MyTex1 1; +#X obj 76 179 glsl shader/multitexture \; MyTex 0 \; MyTex1 1; #X msg 143 82 0; #X msg 143 105 1; #X msg 143 128 2; diff --git a/examples/10.glsl/05.multitexture_basic.pd b/examples/10.glsl/05.multitexture_basic.pd index b30f8bd44..9e8ec67e3 100644 --- a/examples/10.glsl/05.multitexture_basic.pd +++ b/examples/10.glsl/05.multitexture_basic.pd @@ -64,28 +64,26 @@ #X msg 95 455 open ../data/img1.jpg; #X obj 76 484 pix_image ../data/img1.jpg; #X obj 365 21 declare -lib Gem; -#X msg 223 81 MyTex 0 \, MyTex 1; -#X obj 76 104 _glsl shader/multitexture; -#X obj 223 59 loadbang; #X obj 76 513 pix_texture \; rectangle 0 \; texunit 1; #X obj 76 344 pix_texture \; rectangle 0 \; texunit 0; -#X connect 0 0 21 0; +#X obj 76 104 glsl shader/multitexture \; MyTex 0 \; MyTex1 1; +#X msg 33 115 print; +#X connect 0 0 22 0; #X connect 1 0 11 0; #X connect 2 0 5 0; #X connect 3 0 2 0; #X connect 5 0 7 0; #X connect 6 0 7 0; #X connect 7 0 8 0; -#X connect 8 0 24 0; +#X connect 8 0 21 0; #X connect 10 0 11 0; #X connect 13 0 15 0; #X connect 14 0 13 0; #X connect 15 0 17 0; #X connect 16 0 17 0; #X connect 17 0 18 0; -#X connect 18 0 23 0; -#X connect 20 0 21 1; -#X connect 21 0 8 0; -#X connect 22 0 20 0; -#X connect 23 0 12 0; -#X connect 24 0 18 0; +#X connect 18 0 20 0; +#X connect 20 0 12 0; +#X connect 21 0 18 0; +#X connect 22 0 8 0; +#X connect 23 0 22 0; diff --git a/examples/10.glsl/05.multitexture_bis.pd b/examples/10.glsl/05.multitexture_bis.pd index 89212a493..e362856cc 100644 --- a/examples/10.glsl/05.multitexture_bis.pd +++ b/examples/10.glsl/05.multitexture_bis.pd @@ -1,6 +1,6 @@ #N canvas 619 198 1100 637 10; #X declare -lib Gem; -#X obj 76 5 gemhead; +#X obj 75 275 gemhead; #X msg 365 23 color 1 0 0; #X obj 749 262 openpanel; #X obj 749 239 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; @@ -15,7 +15,7 @@ #X obj 685 286 loadbang; #X obj 907 285 loadbang; #X obj 890 220 gemhead 22; -#X text 197 320 2) change shader texunit; +#X text 115 300 2) change shader texunit; #X msg 685 311 open ../data/img2.jpg; #X obj 666 340 pix_image ../data/img2.jpg; #X obj 890 337 pix_image ../data/img3.jpg; @@ -78,21 +78,19 @@ #X msg 462 313 open ../data/img1.jpg; #X obj 443 342 pix_image ../data/img1.jpg; #X obj 983 7 declare -lib Gem; -#X obj 187 267 loadbang; -#X obj 75 429 _glsl shader/multitexture; -#X obj 187 290 t b b, f 12; #X obj 443 427 pix_texture \; rectangle 0; #X obj 666 425 pix_texture \; rectangle 0; #X obj 890 428 pix_texture \; rectangle 0; #X msg 113 389 MyTex \$1; -#X msg 113 328 0; +#X msg 123 328 0; #X msg 123 348 1; #X msg 123 368 2; -#X msg 222 340 0; +#X msg 232 340 0; #X msg 232 360 1; #X msg 232 380 2; #X msg 222 401 MyTex1 \$1; -#X connect 0 0 35 0; +#X obj 75 429 glsl shader/multitexture \; MyTex 0 \; MyTex1 1; +#X connect 0 0 45 0; #X connect 1 0 22 0; #X connect 2 0 10 0; #X connect 3 0 2 0; @@ -107,8 +105,8 @@ #X connect 13 0 19 0; #X connect 14 0 18 0; #X connect 16 0 17 0; -#X connect 17 0 38 0; -#X connect 18 0 39 0; +#X connect 17 0 35 0; +#X connect 18 0 36 0; #X connect 19 0 18 0; #X connect 21 0 22 0; #X connect 24 0 23 0; @@ -119,19 +117,16 @@ #X connect 29 0 31 0; #X connect 30 0 31 0; #X connect 31 0 32 0; -#X connect 32 0 37 0; -#X connect 34 0 36 0; -#X connect 35 0 24 0; -#X connect 36 0 41 0; -#X connect 36 1 45 0; -#X connect 37 1 24 1; -#X connect 38 1 24 2; -#X connect 39 1 24 3; -#X connect 40 0 35 1; -#X connect 41 0 40 0; -#X connect 42 0 40 0; -#X connect 43 0 40 0; -#X connect 44 0 47 0; -#X connect 45 0 47 0; -#X connect 46 0 47 0; -#X connect 47 0 35 1; +#X connect 32 0 34 0; +#X connect 34 1 24 1; +#X connect 35 1 24 2; +#X connect 36 1 24 3; +#X connect 37 0 45 1; +#X connect 38 0 37 0; +#X connect 39 0 37 0; +#X connect 40 0 37 0; +#X connect 41 0 44 0; +#X connect 42 0 44 0; +#X connect 43 0 44 0; +#X connect 44 0 45 1; +#X connect 45 0 24 0; diff --git a/examples/10.glsl/06.rectangle_multitexture.pd b/examples/10.glsl/06.rectangle_multitexture.pd index e3166e6ce..054f53a62 100644 --- a/examples/10.glsl/06.rectangle_multitexture.pd +++ b/examples/10.glsl/06.rectangle_multitexture.pd @@ -28,13 +28,13 @@ #X connect 6 0 0 0; #X connect 7 0 0 0; #X restore 388 118 pd gemwin; -#X msg 388 99 destroy; +#X msg 388 99 create; #X text 384 78 Create window:; -#X obj 113 147 cnv 15 120 120 empty empty empty 20 12 0 14 #00fc04 #404040 0; -#X obj 37 111 gemhead 51; -#X msg 125 160 add; -#X msg 125 220 multiply; -#X msg 125 240 mix; +#X obj 107 147 cnv 15 120 120 empty empty empty 20 12 0 14 #00fc04 #404040 0; +#X obj 37 381 gemhead 51; +#X msg 119 160 add; +#X msg 119 220 multiply; +#X msg 119 240 mix; #N canvas 0 0 450 300 route 0; #X obj 113 53 inlet; #X msg 113 95 0; @@ -55,15 +55,15 @@ #X connect 7 2 3 0; #X connect 7 3 4 0; #X connect 7 4 6 0; -#X restore 88 275 pd route; -#X msg 88 296 style \$1; -#X obj 125 126 loadbang; +#X restore 82 275 pd route; +#X msg 82 296 style \$1; +#X obj 119 126 loadbang; #X obj 37 508 pix_set; -#X obj 169 246 hsl 50 10 0 1 0 1 empty empty MIX_FACTOR -2 -4 0 7 #fcfcfc #000000 #000000 2400 1; -#X msg 125 200 diff; +#X obj 163 246 hsl 50 10 0 1 0 1 empty empty MIX_FACTOR -2 -4 0 7 #fcfcfc #000000 #000000 3400 1; +#X msg 119 200 diff; #X text 487 99 <- 1 : create GEM window; #X text 276 209 add : add two texture together (it is easy to get a white out); -#X msg 125 180 subtract; +#X msg 119 180 subtract; #X text 29 24 This shader program give you the possibility to mix two sources of different size. You can add \, subtract \, diff \, multiply and mix the two sources.; #X text 276 235 subtract : subtract two texture together (it is easy to get a black out); #X text 276 261 diff : subtract two texture together (get absolute value); @@ -75,14 +75,14 @@ #X obj 163 589 pix_image ../data/img3.jpg; #X obj 343 589 pix_image ../data/img2.jpg; #X text 176 628 images have different sizes; -#X msg 166 296 mix_factor \$1; +#X msg 160 296 mix_factor \$1; #X obj 37 586 square 4; #X obj 533 6 declare -lib Gem; #X obj 37 535 pix_texture \; rectangle 1 \; texunit 0; #X obj 163 693 pix_texture \; rectangle 1 \; texunit 1; #X obj 343 693 pix_texture \; rectangle 1 \; texunit 2; #X msg 60 417 bang; -#X obj 37 452 _glsl shader/GLSL_mix \; Ttex1 1 \; Ttex2 2; +#X obj 37 452 glsl shader/GLSL_mix \; Ttex1 1 \; Ttex2 2; #X connect 0 0 34 0; #X connect 1 0 2 0; #X connect 2 0 34 0; diff --git a/examples/10.glsl/07.framebuffer_and_shader.pd b/examples/10.glsl/07.framebuffer_and_shader.pd index 728e7d545..02c1bf0fe 100644 --- a/examples/10.glsl/07.framebuffer_and_shader.pd +++ b/examples/10.glsl/07.framebuffer_and_shader.pd @@ -153,7 +153,7 @@ #X obj 867 189 loadbang; #X obj 9 315 gemframebuffer \; type FLOAT \; dimen 512 512 \; rectangle 1; #X obj 218 344 gemframebuffer \; type FLOAT \; dimen 512 512 \; rectangle 1; -#X obj 774 326 _glsl_f shader/vague; +#X obj 774 326 glsl shader/vague; #X floatatom 90 109 5 0 0 0 - \$0-K1 - 0; #X floatatom 192 109 5 0 0 0 - \$0-D1 - 0; #X floatatom 141 109 5 0 0 0 - \$0-K3 - 0; @@ -168,7 +168,7 @@ #X connect 2 0 0 0; #X restore 990 483 pd init; #X obj 990 456 loadbang; -#X obj 9 269 _glsl_f shader/wave; +#X obj 9 269 glsl shader/wave; #X msg 182 216 quality \$1; #X obj 182 192 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 9 494 pix_texture \; rectangle 1 \; quality 1; diff --git a/examples/10.glsl/08.multi_pass_rendering.pd b/examples/10.glsl/08.multi_pass_rendering.pd index 441844d3f..2c1412d9e 100644 --- a/examples/10.glsl/08.multi_pass_rendering.pd +++ b/examples/10.glsl/08.multi_pass_rendering.pd @@ -78,17 +78,17 @@ #X obj 353 177 gemframebuffer \; type FLOAT \; dimen 1024 1024 \; rectangle 0 \; texunit 2; #X obj 650 142 gemframebuffer \; type FLOAT \; dimen 1024 1024 \; rectangle 0; #X obj 671 326 pix_texture \; rectangle 0; -#X obj 42 154 _glsl shader/T_distord; +#X obj 42 154 glsl shader/T_distord; #X obj 171 56 loadbang; #X msg 171 79 1; #X floatatom 171 102 5 0 0 0 - - - 0; #X msg 171 124 K1 \$1; #X obj 482 56 loadbang; #X floatatom 482 102 5 0 0 0 - - - 0; -#X obj 353 154 _glsl shader/P_distord; +#X obj 353 154 glsl shader/P_distord; #X msg 482 124 K \$1; #X msg 482 79 0.1; -#X obj 650 87 _glsl shader/multitexture \; MyTex 1 \; MyTex1 2; +#X obj 650 87 glsl shader/multitexture \; MyTex 1 \; MyTex1 2; #X connect 1 0 7 0; #X connect 5 0 26 0; #X connect 7 0 28 0; diff --git a/examples/10.glsl/09.vertex_texture_fetching.pd b/examples/10.glsl/09.vertex_texture_fetching.pd index 915350f2b..9228e563a 100644 --- a/examples/10.glsl/09.vertex_texture_fetching.pd +++ b/examples/10.glsl/09.vertex_texture_fetching.pd @@ -63,7 +63,7 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 26 94 pd gemwin; #X obj 563 7 declare -lib Gem; -#X obj 504 292 _glsl shader/fetching; +#X obj 504 292 glsl shader/fetching; #X obj 28 310 gemframebuffer \; rectangle 0 \; type BYTE \; format RGB32 \; dimen 1024 1024; #X obj 28 545 pix_texture \; rectangle 0 \; quality 0; #X obj 504 450 pix_texture \; quality 0; diff --git a/examples/10.glsl/11.geometry.pd b/examples/10.glsl/11.geometry.pd index 6a7f07442..195e6573b 100644 --- a/examples/10.glsl/11.geometry.pd +++ b/examples/10.glsl/11.geometry.pd @@ -59,7 +59,7 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 336 264 pd gemwin; #X obj 444 13 declare -lib Gem; -#X obj 44 236 _glsl_vgf shader/geo; +#X obj 44 236 glsl shader/geo; #X text 51 47 Here is an example where 40 circles are drawn with 1 single primitive.; #X text 49 87 Be aware that the geometry shader is computed after the vertex shader. coordinates are in 2d.; #X connect 0 0 1 0; diff --git a/examples/10.glsl/12.tri2fan.pd b/examples/10.glsl/12.tri2fan.pd index 7814e590b..17512b9dc 100644 --- a/examples/10.glsl/12.tri2fan.pd +++ b/examples/10.glsl/12.tri2fan.pd @@ -62,7 +62,7 @@ #X obj 450 378 t f f; #X msg 452 425 force \$1 \$2 0.3; #X obj 574 13 declare -lib Gem; -#X obj 61 245 _glsl_vgf shader/tri2fan; +#X obj 61 245 glsl shader/tri2fan; #X obj 61 151 alpha \; auto 1; #X obj 61 494 newWave 25 25 \; D1 0.01 \; D2 0.1; #X obj 322 169 gemwin \; perspec -0.1 0.1 -0.1 0.1 1 110 \; lighting 1; diff --git a/examples/10.glsl/13.panoramique.pd b/examples/10.glsl/13.panoramique.pd index 52bb24e4d..6536b8cdb 100644 --- a/examples/10.glsl/13.panoramique.pd +++ b/examples/10.glsl/13.panoramique.pd @@ -76,12 +76,12 @@ #X msg 18 403 1.62; #X msg 199 137 1.38; #X obj 964 623 declare -lib Gem; -#X obj 160 243 _glsl shader/panoramique; +#X obj 160 243 glsl shader/panoramique; #X obj 19 312 loadbang; #X obj 19 335 s init_shader; -#X obj 353 243 _glsl shader/panoramique; -#X obj 552 244 _glsl shader/panoramique; -#X obj 747 245 _glsl shader/panoramique; +#X obj 353 243 glsl shader/panoramique; +#X obj 552 244 glsl shader/panoramique; +#X obj 747 245 glsl shader/panoramique; #N canvas 735 461 450 300 getdimen 0; #X obj 49 37 inlet; #X obj 49 60 pix_info -m; diff --git a/examples/10.glsl/15.bicubic_image_interpolation.pd b/examples/10.glsl/15.bicubic_image_interpolation.pd index 2454aa8c7..4a86b8fae 100644 --- a/examples/10.glsl/15.bicubic_image_interpolation.pd +++ b/examples/10.glsl/15.bicubic_image_interpolation.pd @@ -31,7 +31,7 @@ #X obj 358 349 r sel_interpolation; #X text 46 16 This example use shader in order to compute a bicubic image interpolation. Bicubic interpolation offer a smoother surface than obtain with bilinear interpolation. But since it need 16 sample to compute the interpolation \, it is quite slow.; #X obj 563 7 declare -lib Gem; -#X obj 232 243 _glsl shader/bicubic_interpolation; +#X obj 232 243 glsl shader/bicubic_interpolation; #X connect 0 0 31 0; #X connect 1 0 2 0; #X connect 2 0 3 0; diff --git a/examples/10.glsl/16.vertexbuffer_attributes.pd b/examples/10.glsl/16.vertexbuffer_attributes.pd index a3ae30809..37e21302d 100644 --- a/examples/10.glsl/16.vertexbuffer_attributes.pd +++ b/examples/10.glsl/16.vertexbuffer_attributes.pd @@ -128,7 +128,7 @@ #X obj 194 647 print vb; #X msg 183 420 bang; #X obj 563 7 declare -lib Gem; -#X obj 154 172 _glsl shader/brick; +#X obj 154 172 glsl shader/brick; #X msg 165 152 bang; #X floatatom 278 204 5 0 0 0 - - - 0; #X obj 154 673 gemvertexbuffer \; resize 16 \; draw quad; diff --git a/examples/10.glsl/17.light.pd b/examples/10.glsl/17.light.pd index 991432496..f729959bf 100644 --- a/examples/10.glsl/17.light.pd +++ b/examples/10.glsl/17.light.pd @@ -99,7 +99,7 @@ #X floatatom 398 152 5 0 0 0 - - - 0; #X floatatom 443 152 5 0 0 0 - - - 0; #X floatatom 485 153 5 0 0 0 - - - 0; -#X obj 181 151 _glsl shader/light \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.1 0.1 0.5 \; MaterialKd 0.8 0.1 0.1 \; MaterialKs 0.1 0.3 0.1 \; MaterialShininess 30; +#X obj 181 151 glsl shader/light \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.1 0.1 0.5 \; MaterialKd 0.8 0.1 0.1 \; MaterialKs 0.1 0.3 0.1 \; MaterialShininess 30; #X connect 0 0 1 0; #X connect 2 0 14 0; #X connect 5 0 6 0; diff --git a/examples/10.glsl/18.additive_audio_synthesis.pd b/examples/10.glsl/18.additive_audio_synthesis.pd index 4d145c626..1d70a0741 100644 --- a/examples/10.glsl/18.additive_audio_synthesis.pd +++ b/examples/10.glsl/18.additive_audio_synthesis.pd @@ -196,7 +196,7 @@ #X text 737 297 change input to be converted to sound here, f 24; #X obj 567 66 gemframebuffer \; dimen 4096 2 \; rectangle 1 \; texunit 0; #X obj 705 451 gemframebuffer \; dimen 4096 1 \; rectangle 1; -#X obj 274 223 _glsl shader/additive; +#X obj 274 223 glsl shader/additive; #X connect 1 0 55 0; #X connect 1 1 54 0; #X connect 2 0 1 0; diff --git a/examples/10.glsl/_glsl.pd b/examples/10.glsl/_glsl.pd deleted file mode 100644 index 5376fb08f..000000000 --- a/examples/10.glsl/_glsl.pd +++ /dev/null @@ -1,71 +0,0 @@ -#N canvas 1980 98 668 783 10; -#X obj 118 339 glsl_vertex; -#X msg 72 338 print; -#X obj 118 626 glsl_program; -#X obj 193 545 pack 0 0; -#X msg 70 476 print; -#X msg 193 569 link \$1 \$2; -#X msg 72 620 print; -#X obj 118 490 glsl_fragment; -#X floatatom 193 525 2 0 0 0 ID - - 0; -#X floatatom 237 371 2 0 0 0 ID - - 0; -#X obj 211 590 print linking; -#X obj 118 21 inlet; -#X obj 118 662 outlet; -#X msg 167 309 open \$1.vert; -#X msg 194 453 open \$1.frag; -#X obj 577 95 inlet; -#X obj 118 192 t a; -#X floatatom 197 662 2 0 0 0 ID - - 0; -#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; -#X obj 197 690 outlet programID; -#X obj 383 104 gemargs; -#X obj 383 68 loadbang; -#X obj 422 128 route bang; -#X obj 167 284 t a a; -#X obj 167 258 list prepend \$1; -#X obj 167 189 t b a; -#X obj 383 361 t a a; -#X obj 118 44 route bang symbol print; -#X msg 33 124 print; -#X obj 33 103 t b; -#X obj 33 145 t a a a; -#X connect 0 0 7 0; -#X connect 0 1 9 0; -#X connect 1 0 0 0; -#X connect 2 0 12 0; -#X connect 2 1 17 0; -#X connect 3 0 5 0; -#X connect 4 0 7 0; -#X connect 5 0 2 0; -#X connect 5 0 10 0; -#X connect 6 0 2 0; -#X connect 7 0 2 0; -#X connect 7 1 8 0; -#X connect 8 0 3 0; -#X connect 9 0 3 1; -#X connect 11 0 27 0; -#X connect 13 0 0 0; -#X connect 14 0 7 0; -#X connect 15 0 26 0; -#X connect 16 0 0 0; -#X connect 17 0 19 0; -#X connect 20 0 26 0; -#X connect 20 1 22 0; -#X connect 21 0 20 0; -#X connect 22 1 25 0; -#X connect 23 0 13 0; -#X connect 23 1 14 0; -#X connect 24 0 23 0; -#X connect 25 0 24 0; -#X connect 25 1 24 1; -#X connect 26 0 2 0; -#X connect 27 0 24 0; -#X connect 27 1 25 0; -#X connect 27 2 29 0; -#X connect 27 3 16 0; -#X connect 28 0 30 0; -#X connect 29 0 28 0; -#X connect 30 0 2 0; -#X connect 30 1 7 0; -#X connect 30 2 0 0; diff --git a/examples/10.glsl/_glsl_f.pd b/examples/10.glsl/_glsl_f.pd deleted file mode 100644 index 72a7a25a1..000000000 --- a/examples/10.glsl/_glsl_f.pd +++ /dev/null @@ -1,45 +0,0 @@ -#N canvas 1980 98 668 629 10; -#X obj 78 496 glsl_program; -#X msg 32 360 print; -#X msg 32 496 print; -#X obj 78 360 glsl_fragment; -#X floatatom 153 395 2 0 0 0 ID - - 0; -#X obj 153 470 print linking; -#X obj 78 21 inlet; -#X obj 78 532 outlet; -#X msg 202 293 open \$1.frag; -#X obj 577 95 inlet; -#X obj 127 209 symbol \$1; -#X obj 197 161 loadbang; -#X obj 78 44 route bang symbol; -#X obj 78 192 t a; -#X floatatom 157 532 2 0 0 0 ID - - 0; -#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; -#X obj 162 185 t b b; -#X obj 127 247 select symbol; -#X msg 189 209 symbol; -#X obj 157 560 outlet programID; -#X msg 153 439 link \$1; -#X connect 0 0 7 0; -#X connect 0 1 14 0; -#X connect 1 0 3 0; -#X connect 2 0 0 0; -#X connect 3 0 0 0; -#X connect 3 1 4 0; -#X connect 4 0 20 0; -#X connect 6 0 12 0; -#X connect 8 0 3 0; -#X connect 9 0 0 0; -#X connect 10 0 17 0; -#X connect 11 0 16 0; -#X connect 12 0 10 0; -#X connect 12 1 10 0; -#X connect 12 2 13 0; -#X connect 13 0 3 0; -#X connect 14 0 19 0; -#X connect 16 0 10 0; -#X connect 16 1 18 0; -#X connect 17 1 8 0; -#X connect 18 0 17 1; -#X connect 20 0 0 0; -#X connect 20 0 5 0; diff --git a/examples/10.glsl/_glsl_vgf.pd b/examples/10.glsl/_glsl_vgf.pd deleted file mode 100644 index 516f32c9e..000000000 --- a/examples/10.glsl/_glsl_vgf.pd +++ /dev/null @@ -1,78 +0,0 @@ -#N canvas 1980 98 668 783 10; -#X obj 78 339 glsl_vertex; -#X msg 30 339 print; -#X obj 78 626 glsl_program; -#X msg 30 490 print; -#X msg 32 626 print; -#X obj 78 490 glsl_fragment; -#X floatatom 153 525 2 0 0 0 ID - - 0; -#X floatatom 210 341 2 0 0 0 ID - - 0; -#X obj 171 590 print linking; -#X obj 78 21 inlet; -#X obj 78 662 outlet; -#X msg 164 320 open \$1.vert; -#X msg 164 470 open \$1.frag; -#X obj 577 95 inlet; -#X obj 157 697 change; -#X obj 157 718 t b; -#X obj 157 740 outlet; -#X obj 127 209 symbol \$1; -#X obj 197 161 loadbang; -#X msg 287 598 set 0; -#X obj 260 87 t b b; -#X obj 78 44 route bang symbol; -#X obj 78 192 t a; -#X floatatom 157 662 2 0 0 0 ID - - 0; -#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; -#X obj 162 185 t b b; -#X obj 127 247 select symbol; -#X msg 189 209 symbol; -#X msg 30 420 print; -#X obj 78 420 glsl_geometry; -#X obj 153 545 pack 0 0 0; -#X obj 164 294 t s s s; -#X floatatom 181 431 2 0 0 0 ID - - 0; -#X msg 153 569 link \$1 \$2 \$3; -#X msg 164 400 open \$1.geom; -#X connect 0 0 29 0; -#X connect 0 1 7 0; -#X connect 1 0 0 0; -#X connect 2 0 10 0; -#X connect 2 1 23 0; -#X connect 3 0 5 0; -#X connect 4 0 2 0; -#X connect 5 0 2 0; -#X connect 5 1 6 0; -#X connect 6 0 30 0; -#X connect 7 0 30 2; -#X connect 9 0 21 0; -#X connect 11 0 0 0; -#X connect 12 0 5 0; -#X connect 13 0 2 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 17 0 26 0; -#X connect 18 0 25 0; -#X connect 19 0 14 0; -#X connect 20 0 17 0; -#X connect 20 1 19 0; -#X connect 21 0 20 0; -#X connect 21 1 17 0; -#X connect 21 2 22 0; -#X connect 22 0 0 0; -#X connect 23 0 14 0; -#X connect 25 0 17 0; -#X connect 25 1 27 0; -#X connect 26 1 31 0; -#X connect 27 0 26 1; -#X connect 28 0 29 0; -#X connect 29 0 5 0; -#X connect 29 1 32 0; -#X connect 30 0 33 0; -#X connect 31 0 11 0; -#X connect 31 1 34 0; -#X connect 31 2 12 0; -#X connect 32 0 30 1; -#X connect 33 0 2 0; -#X connect 33 0 8 0; -#X connect 34 0 29 0; diff --git a/examples/10.glsl/single_blur.pd b/examples/10.glsl/single_blur.pd index fc4988983..7872c82aa 100644 --- a/examples/10.glsl/single_blur.pd +++ b/examples/10.glsl/single_blur.pd @@ -20,7 +20,7 @@ #X obj 441 65 * \$2; #X obj 441 41 unpack f f; #X obj 508 65 * \$2; -#X obj 26 195 _glsl shader/blur; +#X obj 26 195 glsl shader/blur; #X obj 26 285 pix_texture \; quality 1 \; rectangle 0; #X connect 0 0 22 1; #X connect 1 0 21 0; From 511752462b5ea79360b3fe5342e37d3f9377f5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 31 Mar 2025 19:11:25 +0200 Subject: [PATCH 296/387] Drop [_glsl] helper from examples/10.glsl/ --- examples/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index 5fe171155..5eeb90614 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -136,7 +136,6 @@ nobase_dist_gemexamples_DATA = \ 10.glsl/16.vertexbuffer_attributes.pd \ 10.glsl/17.light.pd \ 10.glsl/18.additive_audio_synthesis.pd \ - 10.glsl/_glsl.pd \ 10.glsl/single_blur.pd \ 10.glsl/shader/additive.frag \ 10.glsl/shader/additive.vert \ From 2959d0290e990e968d3c71759a70648a3853a445 Mon Sep 17 00:00:00 2001 From: chnry Date: Mon, 14 Apr 2025 13:30:01 +0200 Subject: [PATCH 297/387] do not pass the print message to next shader --- abstractions/_glsl.compile.pd | 46 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/abstractions/_glsl.compile.pd b/abstractions/_glsl.compile.pd index 707d27061..4fc87dad1 100644 --- a/abstractions/_glsl.compile.pd +++ b/abstractions/_glsl.compile.pd @@ -1,24 +1,24 @@ -#N canvas 2613 393 512 437 12; -#X obj 131 383 glsl_\$1; -#X obj 251 39 inlet shaderfile; -#X obj 283 94 list append \$2; -#X obj 131 408 outlet gemstate; +#N canvas 396 234 609 622 12; +#X obj 131 423 glsl_\$1; +#X obj 368 72 inlet shaderfile; +#X obj 400 127 list append \$2; +#X obj 131 448 outlet gemstate; #X obj 69 68 inlet gemstate; -#X obj 69 311 t a a; -#X obj 131 342 spigot 0; -#X obj 69 341 spigot 1; -#X msg 283 119 symbol \$1.\$2; -#X obj 283 179 t a b; -#X msg 283 204 open \$1; -#X obj 255 408 outlet shaderID; -#X msg 347 203 1; -#X msg 377 203 0; -#X obj 347 258 t f f, f 6; -#X obj 347 283 == 0; -#X obj 386 283 == 1; -#X obj 251 67 t a a; -#X obj 371 408 outlet shaderfile; -#X obj 367 228 t f f; +#X obj 69 331 t a a; +#X obj 131 362 spigot 0; +#X obj 69 361 spigot 1; +#X msg 400 152 symbol \$1.\$2; +#X obj 400 212 t a b; +#X msg 400 237 open \$1; +#X obj 255 448 outlet shaderID; +#X msg 464 236 1; +#X msg 494 236 0; +#X obj 464 291 t f f, f 6; +#X obj 464 316 == 0; +#X obj 503 316 == 1; +#X obj 368 100 t a a; +#X obj 371 448 outlet shaderfile; +#X obj 484 261 t f f; #N canvas 3269 334 450 484 find 0; #X obj 62 26 inlet filename; #X obj 62 51 t b s s; @@ -50,7 +50,8 @@ #X connect 11 0 8 0; #X connect 11 1 13 0; #X connect 13 0 12 0; -#X restore 283 150 pd find file; +#X restore 400 183 pd find file; +#X obj 69 388 route print; #X connect 0 0 3 0; #X connect 0 1 11 0; #X connect 1 0 17 0; @@ -59,7 +60,7 @@ #X connect 5 0 7 0; #X connect 5 1 6 0; #X connect 6 0 0 0; -#X connect 7 0 3 0; +#X connect 7 0 21 0; #X connect 8 0 20 0; #X connect 9 0 10 0; #X connect 9 1 12 0; @@ -76,3 +77,4 @@ #X connect 19 1 11 0; #X connect 20 0 9 0; #X connect 20 1 13 0; +#X connect 21 1 0 0; From c920744ceb33263623c18a5d72332a6bf9fcfd3d Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 11:38:29 +0200 Subject: [PATCH 298/387] increase range of GPU that can load geometry shaders --- src/Manips/glsl_geometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manips/glsl_geometry.cpp b/src/Manips/glsl_geometry.cpp index 7af3b5c3c..26b157a1f 100644 --- a/src/Manips/glsl_geometry.cpp +++ b/src/Manips/glsl_geometry.cpp @@ -48,7 +48,7 @@ glsl_geometry :: ~glsl_geometry() ///////////////////////////////////////////////////////// bool glsl_geometry :: isRunnable() { - if(GLEW_EXT_geometry_shader4) { // GLEW_VERSION_2_1 ?? + if(GLEW_VERSION_2_0 || GLEW_EXT_geometry_shader4) { // GLEW_VERSION_2_1 ?? m_shaderTarget = GL_GEOMETRY_SHADER_EXT; m_shaderType = GL2; return true; From 48b297c45496d17f361038a543ce80600d322159 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 11:39:02 +0200 Subject: [PATCH 299/387] do not forward print message if the shader is not loaded --- abstractions/_glsl.compile.pd | 53 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/abstractions/_glsl.compile.pd b/abstractions/_glsl.compile.pd index 4fc87dad1..b4a2d0287 100644 --- a/abstractions/_glsl.compile.pd +++ b/abstractions/_glsl.compile.pd @@ -1,24 +1,24 @@ -#N canvas 396 234 609 622 12; -#X obj 131 423 glsl_\$1; -#X obj 368 72 inlet shaderfile; -#X obj 400 127 list append \$2; -#X obj 131 448 outlet gemstate; +#N canvas 406 409 616 457 12; +#X obj 131 383 glsl_\$1; +#X obj 251 39 inlet shaderfile; +#X obj 283 94 list append \$2; +#X obj 131 408 outlet gemstate; #X obj 69 68 inlet gemstate; -#X obj 69 331 t a a; -#X obj 131 362 spigot 0; -#X obj 69 361 spigot 1; -#X msg 400 152 symbol \$1.\$2; -#X obj 400 212 t a b; -#X msg 400 237 open \$1; -#X obj 255 448 outlet shaderID; -#X msg 464 236 1; -#X msg 494 236 0; -#X obj 464 291 t f f, f 6; -#X obj 464 316 == 0; -#X obj 503 316 == 1; -#X obj 368 100 t a a; -#X obj 371 448 outlet shaderfile; -#X obj 484 261 t f f; +#X obj 69 311 t a a; +#X obj 131 342 spigot 0; +#X obj 69 341 spigot 1; +#X msg 283 119 symbol \$1.\$2; +#X obj 283 179 t a b; +#X msg 283 204 open \$1; +#X obj 255 408 outlet shaderID; +#X msg 347 203 1; +#X msg 377 203 0; +#X obj 347 258 t f f, f 6; +#X obj 347 283 == 0; +#X obj 386 283 == 1; +#X obj 251 67 t a a; +#X obj 371 408 outlet shaderfile; +#X obj 367 228 t f f; #N canvas 3269 334 450 484 find 0; #X obj 62 26 inlet filename; #X obj 62 51 t b s s; @@ -50,17 +50,18 @@ #X connect 11 0 8 0; #X connect 11 1 13 0; #X connect 13 0 12 0; -#X restore 400 183 pd find file; -#X obj 69 388 route print; +#X restore 283 150 pd find file; +#X obj 69 106 route print; +#X msg 69 132 print; #X connect 0 0 3 0; #X connect 0 1 11 0; #X connect 1 0 17 0; #X connect 2 0 8 0; -#X connect 4 0 5 0; +#X connect 4 0 21 0; #X connect 5 0 7 0; #X connect 5 1 6 0; #X connect 6 0 0 0; -#X connect 7 0 21 0; +#X connect 7 0 3 0; #X connect 8 0 20 0; #X connect 9 0 10 0; #X connect 9 1 12 0; @@ -77,4 +78,6 @@ #X connect 19 1 11 0; #X connect 20 0 9 0; #X connect 20 1 13 0; -#X connect 21 1 0 0; +#X connect 21 0 22 0; +#X connect 21 1 5 0; +#X connect 22 0 6 0; From 399bd0a713e960b4399b1069908768437c6c1b15 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 11:40:18 +0200 Subject: [PATCH 300/387] geometry shader example. This one is not impressive, but it works! --- examples/15.GLSL4/05.geometry.pd | 157 +++++++++++++++++++++++++ examples/15.GLSL4/shader/geometry.frag | 41 +++++++ examples/15.GLSL4/shader/geometry.geom | 31 +++++ examples/15.GLSL4/shader/geometry.vert | 25 ++++ 4 files changed, 254 insertions(+) create mode 100644 examples/15.GLSL4/05.geometry.pd create mode 100644 examples/15.GLSL4/shader/geometry.frag create mode 100644 examples/15.GLSL4/shader/geometry.geom create mode 100644 examples/15.GLSL4/shader/geometry.vert diff --git a/examples/15.GLSL4/05.geometry.pd b/examples/15.GLSL4/05.geometry.pd new file mode 100644 index 000000000..6cc4596d9 --- /dev/null +++ b/examples/15.GLSL4/05.geometry.pd @@ -0,0 +1,157 @@ +#N canvas 231 365 1140 558 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X obj 333 64 gemhead; +#X msg 477 377 program \$1; +#X msg 488 400 print_attributes; +#X obj 477 448 print vb; +#X obj 44 9 declare -lib Gem; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 450 424 t a a; +#X obj 37 174 loadbang; +#X obj 37 228 s \$0_position; +#X obj 37 295 s \$0_color; +#X obj 37 255 loadbang; +#X obj 450 318 f \$0; +#X obj 470 247 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X floatatom 450 272 5 0 0 0 - - - 0; +#X obj 450 295 t b f; +#X obj 37 319 loadbang; +#X obj 37 359 s \$0_normal; +#X obj 36 381 loadbang; +#X obj 36 422 s \$0_texcoord; +#X obj 345 201 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X msg 450 342 attribute position \$1_position \, attribute normal \$1_normal \, attribute texCoord \$1_texcoord; +#X obj 691 131 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X msg 718 147 modelMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1; +#X msg 718 228 normalMatrix 1 0 0 0 1 0 0 0 1; +#X msg 718 255 lightPos 2 2 2; +#X msg 718 282 lightColor 1 1 1; +#X msg 718 309 ambientColor 0.2 0.2 0.2; +#X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37; +#X msg 37 275 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 1 1 1 0; +#X msg 37 339 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1; +#X msg 36 401 0 0 0 0 1 1 0 0 1 1 0 1 1; +#X obj 167 53 table \$0_position 18; +#X obj 167 74 table \$0_color 18; +#X obj 167 95 table \$0_normal 18; +#X obj 167 116 table \$0_texcoord 12; +#X obj 333 226 glsl shader/geometry; +#X obj 333 486 gemvertexbuffer \; resize 6 \; draw tri; +#X msg 718 174 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; +#X msg 718 201 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; +#X obj 333 116 translateXYZ; +#X floatatom 356 90 5 0 0 0 - - - 0; +#X obj 413 187 r shader_matrix; +#X text 399 89 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117; +#X text 165 32 tables used by the vertex buffer; +#X connect 0 0 1 0; +#X connect 2 0 41 0; +#X connect 3 0 8 0; +#X connect 4 0 8 0; +#X connect 8 0 38 0; +#X connect 8 1 5 0; +#X connect 9 0 29 0; +#X connect 12 0 30 0; +#X connect 13 0 22 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 13 0; +#X connect 16 1 3 0; +#X connect 17 0 31 0; +#X connect 19 0 32 0; +#X connect 21 0 37 0; +#X connect 22 0 8 0; +#X connect 23 0 24 0; +#X connect 23 0 28 0; +#X connect 23 0 27 0; +#X connect 23 0 26 0; +#X connect 23 0 40 0; +#X connect 23 0 39 0; +#X connect 23 0 25 0; +#X connect 24 0 37 1; +#X connect 25 0 37 1; +#X connect 26 0 37 1; +#X connect 27 0 37 1; +#X connect 28 0 37 1; +#X connect 29 0 10 0; +#X connect 30 0 11 0; +#X connect 31 0 18 0; +#X connect 32 0 20 0; +#X connect 37 0 38 0; +#X connect 37 1 15 0; +#X connect 37 1 23 0; +#X connect 39 0 37 1; +#X connect 40 0 37 1; +#X connect 41 0 37 0; +#X connect 42 0 41 1; +#X connect 43 0 37 1; diff --git a/examples/15.GLSL4/shader/geometry.frag b/examples/15.GLSL4/shader/geometry.frag new file mode 100644 index 000000000..cbdccc744 --- /dev/null +++ b/examples/15.GLSL4/shader/geometry.frag @@ -0,0 +1,41 @@ +#version 150 + +// from geometry shader +in vec3 geomPosition; +in vec3 geomNormal; +in vec2 geomTexCoord; +in vec3 barycentric; + +// to rendering +out vec4 fragColor; + +// uniform to compute the pixel color +uniform vec3 lightPos; +uniform vec3 lightColor; +uniform vec3 ambientColor; +uniform sampler2D diffuseTexture; + +void main() { + // Normalize the normal vector + vec3 normal = normalize(geomNormal); + + // Calculate the light direction and distance + vec3 lightDir = normalize(lightPos - geomPosition); + + // Diffuse shading + float diff = max(dot(normal, lightDir), 0.0); + vec3 diffuse = diff * lightColor; + + // Texture sampling + vec4 texColor = texture(diffuseTexture, geomTexCoord); + + // Wire effect using barycentric coordinates + float minBary = min(min(barycentric.x, barycentric.y), barycentric.z); + float edgeFactor = smoothstep(0.0, 0.2, minBary); + + // Final color calculation + vec3 result = (ambientColor + diffuse) * texColor.rgb; + result = mix(vec3(0.0, 0.7, 1.0), result, edgeFactor); // Blue wireframe + + fragColor = vec4(result, texColor.a); +} diff --git a/examples/15.GLSL4/shader/geometry.geom b/examples/15.GLSL4/shader/geometry.geom new file mode 100644 index 000000000..ed7555cea --- /dev/null +++ b/examples/15.GLSL4/shader/geometry.geom @@ -0,0 +1,31 @@ +#version 150 + +layout(triangles) in; +layout(triangle_strip, max_vertices = 3) out; + +// from vertex shader +in vec3 vertPosition[]; +in vec3 vertNormal[]; +in vec2 vertTexCoord[]; + +// to fragment shader +out vec3 geomPosition; +out vec3 geomNormal; +out vec2 geomTexCoord; +out vec3 barycentric; + +void main() { + for(int i = 0; i < 3; i++) { + geomPosition = vertPosition[i]; + geomNormal = vertNormal[i]; + geomTexCoord = vertTexCoord[i]; + + // Passing barycentric coordinates for fragment shading + barycentric = vec3(0.0); + barycentric[i] = 1.0; + + gl_Position = gl_in[i].gl_Position; + EmitVertex(); + } + EndPrimitive(); +} diff --git a/examples/15.GLSL4/shader/geometry.vert b/examples/15.GLSL4/shader/geometry.vert new file mode 100644 index 000000000..8113951e6 --- /dev/null +++ b/examples/15.GLSL4/shader/geometry.vert @@ -0,0 +1,25 @@ +// Vertex Shader (version 150) +#version 150 + +// from VBO +in vec3 position; +in vec3 normal; +in vec2 texCoord; + +// to geometry shader +out vec3 vertPosition; +out vec3 vertNormal; +out vec2 vertTexCoord; + +uniform mat4 modelMatrix; +uniform mat4 viewMatrix; +uniform mat4 projMatrix; +uniform mat3 normalMatrix; + +void main() { + vertPosition = vec3(modelMatrix * vec4(position, 1.0)); + vertNormal = normalMatrix * normal; + vertTexCoord = texCoord; + + gl_Position = projMatrix * viewMatrix * modelMatrix * vec4(position, 1.0); +} From f73ae57a7c754566c2ba4b5c713268a736e00bd8 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 11:41:10 +0200 Subject: [PATCH 301/387] example to explore the various matrix used --- examples/15.GLSL4/06.matrix.pd | 322 +++++++++++++++++++++++++++++++++ 1 file changed, 322 insertions(+) create mode 100644 examples/15.GLSL4/06.matrix.pd diff --git a/examples/15.GLSL4/06.matrix.pd b/examples/15.GLSL4/06.matrix.pd new file mode 100644 index 000000000..1f9af6d87 --- /dev/null +++ b/examples/15.GLSL4/06.matrix.pd @@ -0,0 +1,322 @@ +#N canvas 161 221 1450 697 12; +#X obj 21 209 GEMglLoadIdentity; +#X obj 21 174 gemhead; +#X obj 21 255 translateXYZ; +#X obj 21 302 scaleXYZ; +#X obj 21 348 rotateXYZ; +#X obj 21 371 gemlist_matrix; +#X floatatom 48 232 5 0 0 0 - - - 0; +#X floatatom 87 232 5 0 0 0 - - - 0; +#X floatatom 126 232 5 0 0 0 - - - 0; +#X floatatom 38 278 5 0 0 0 - - - 0; +#X floatatom 77 279 5 0 0 0 - - - 0; +#X floatatom 116 279 5 0 0 0 - - - 0; +#X floatatom 41 325 5 0 0 0 - - - 0; +#X floatatom 80 326 5 0 0 0 - - - 0; +#X floatatom 119 327 5 0 0 0 - - - 0; +#X obj 128 399 print; +#X obj 22 427 list split 4; +#X obj 22 452 list split 4; +#X obj 21 476 list split 4; +#X obj 21 501 list split 4; +#X listbox 119 429 20 0 0 0 - - - 0; +#X listbox 118 455 20 0 0 0 - - - 0; +#X listbox 118 480 20 0 0 0 - - - 0; +#X listbox 118 504 20 0 0 0 - - - 0; +#X obj 288 175 gemhead; +#X obj 288 208 gemlist_matrix; +#X obj 394 242 print; +#X obj 288 430 list split 4; +#X obj 288 455 list split 4; +#X obj 287 479 list split 4; +#X obj 287 504 list split 4; +#X listbox 385 432 20 0 0 0 - - - 0; +#X listbox 384 458 20 0 0 0 - - - 0; +#X listbox 384 483 20 0 0 0 - - - 0; +#X listbox 384 507 20 0 0 0 - - - 0; +#X obj 543 178 gemhead; +#X obj 543 259 translateXYZ; +#X obj 543 306 scaleXYZ; +#X obj 543 352 rotateXYZ; +#X obj 543 375 gemlist_matrix; +#X floatatom 570 236 5 0 0 0 - - - 0; +#X floatatom 609 236 5 0 0 0 - - - 0; +#X floatatom 648 236 5 0 0 0 - - - 0; +#X floatatom 560 282 5 0 0 0 - - - 0; +#X floatatom 599 283 5 0 0 0 - - - 0; +#X floatatom 638 283 5 0 0 0 - - - 0; +#X floatatom 563 329 5 0 0 0 - - - 0; +#X floatatom 602 330 5 0 0 0 - - - 0; +#X floatatom 641 331 5 0 0 0 - - - 0; +#X obj 650 403 print; +#X obj 544 431 list split 4; +#X obj 544 456 list split 4; +#X obj 543 480 list split 4; +#X obj 543 505 list split 4; +#X listbox 641 433 20 0 0 0 - - - 0; +#X listbox 640 459 20 0 0 0 - - - 0; +#X listbox 640 484 20 0 0 0 - - - 0; +#X listbox 640 508 20 0 0 0 - - - 0; +#N canvas 115 312 498 411 build_ortho 0; +#X obj 28 19 inlet; +#X text 89 22 left \, right \, bottom \, top \, nearZ \, farZ; +#X msg 28 97 \$2 \$1; +#X obj 60 153 -; +#X text 95 154 width; +#X obj 28 154 +; +#X msg 60 178 2 \$1; +#X obj 60 202 /; +#X obj 28 129 t a a; +#X obj 28 202 /; +#X obj 28 65 t a a a; +#X obj 179 155 -; +#X obj 147 156 +; +#X msg 179 180 2 \$1; +#X obj 179 204 /; +#X obj 147 131 t a a; +#X obj 147 204 /; +#X obj 298 156 -; +#X obj 266 157 +; +#X obj 298 205 /; +#X obj 266 132 t a a; +#X obj 266 205 /; +#X msg 147 99 \$4 \$3; +#X text 207 156 height; +#X msg 266 100 \$6 \$5; +#X text 333 157 depth; +#X obj 28 268 pack f f f f f f, f 43; +#X obj 28 335 outlet; +#X obj 28 236 * -1; +#X obj 147 237 * -1; +#X obj 266 237 * -1; +#X msg 28 301 \$2 0 0 0 0 \$4 0 0 0 0 \$6 0 \$1 \$3 \$5 1; +#X msg 298 181 -2 \$1; +#X connect 0 0 10 0; +#X connect 2 0 8 0; +#X connect 3 0 6 0; +#X connect 3 0 9 1; +#X connect 5 0 9 0; +#X connect 6 0 7 0; +#X connect 7 0 26 1; +#X connect 8 0 5 0; +#X connect 8 1 3 0; +#X connect 9 0 28 0; +#X connect 10 0 2 0; +#X connect 10 1 22 0; +#X connect 10 2 24 0; +#X connect 11 0 13 0; +#X connect 11 0 16 1; +#X connect 12 0 16 0; +#X connect 13 0 14 0; +#X connect 14 0 26 3; +#X connect 15 0 12 0; +#X connect 15 1 11 0; +#X connect 16 0 29 0; +#X connect 17 0 32 0; +#X connect 17 0 21 1; +#X connect 18 0 21 0; +#X connect 19 0 26 5; +#X connect 20 0 18 0; +#X connect 20 1 17 0; +#X connect 21 0 30 0; +#X connect 22 0 15 0; +#X connect 24 0 20 0; +#X connect 26 0 31 0; +#X connect 28 0 26 0; +#X connect 29 0 26 2; +#X connect 30 0 26 4; +#X connect 31 0 27 0; +#X connect 32 0 19 0; +#X restore 843 243 pd build_ortho; +#X text 859 212 left \, right \, bottom \, top \, nearZ \, farZ; +#X obj 843 286 list split 4; +#X obj 843 311 list split 4; +#X obj 842 335 list split 4; +#X obj 842 360 list split 4; +#X listbox 940 288 20 0 0 0 - - - 0; +#X listbox 939 314 20 0 0 0 - - - 0; +#X listbox 939 339 20 0 0 0 - - - 0; +#X listbox 939 363 20 0 0 0 - - - 0; +#X text 19 140 Model Matrix :; +#X text 287 137 View Matrix :; +#X text 541 138 Model * View Matrix; +#X text 839 145 Projection Matrix; +#X msg 843 193 -4 4 -4 4 0 20; +#X text 853 429 fovY (field of view) \, aspect ratio \, nearZ \, farZ; +#X text 840 408 perspective projection :; +#X text 838 162 orthographique projection :; +#X msg 1237 458 3.14159 4; +#X obj 1237 486 /; +#X obj 1236 345 r __gem; +#X obj 1236 370 route dimen; +#X obj 1236 395 /; +#X text 1268 394 real gemwin X/Y ratio; +#X floatatom 1237 513 5 0 0 0 - - - 0; +#X msg 843 457 0.7 1 1 20; +#X obj 843 515 list split 4; +#X obj 843 540 list split 4; +#X obj 842 564 list split 4; +#X obj 842 589 list split 4; +#X listbox 940 517 20 0 0 0 - - - 0; +#X listbox 939 543 20 0 0 0 - - - 0; +#X listbox 939 568 20 0 0 0 - - - 0; +#X listbox 939 592 20 0 0 0 - - - 0; +#X floatatom 1236 424 5 0 0 0 - - - 0; +#X text 1238 313 tips :; +#X obj 27 551 list prepend modelMatrix; +#X obj 287 551 list prepend viewMatrix; +#X obj 814 622 list prepend projMatrix; +#X obj 27 574 list trim; +#X obj 287 574 list trim; +#X obj 814 646 list trim; +#X obj 27 598 s shader_matrix; +#X obj 287 596 s shader_matrix; +#X obj 814 670 s shader_matrix; +#X text 27 35 The model matrix combine the geometry transformation. It can be computed with specific library \, or with standard openGL object., f 30; +#X text 1286 485 45° fov (this is a very wild angle), f 21; +#X text 535 34 Since the shader need only the multiplication of the model matrix and the view matrix \, you can get this combination directly :, f 35; +#N canvas 234 350 511 439 build_perspective 0; +#X obj 37 24 inlet; +#X obj 37 108 * 0.5; +#X obj 37 132 tan; +#X msg 37 83 \$1; +#X msg 37 156 1 \$1; +#X obj 37 181 /; +#X msg 158 81 \$3 \$4; +#X obj 158 106 -; +#X msg 158 130 1 \$1; +#X obj 158 154 /; +#X obj 69 234 pack f f; +#X msg 122 210 \$2; +#X msg 218 155 \$3 \$4; +#X obj 218 185 +; +#X obj 200 214 *; +#X msg 279 156 \$3 \$4; +#X obj 261 217 *; +#X obj 279 186 *; +#X obj 37 209 t f f; +#X obj 261 243 * 2; +#X msg 37 314 \$2 0 0 0 0 \$1 0 0 0 0 \$3 -1 0 0 \$4 0; +#X obj 37 52 t a a a a a, f 35; +#X obj 37 284 pack f f f f, f 32; +#X obj 37 342 outlet; +#X obj 69 259 /; +#X connect 0 0 21 0; +#X connect 1 0 2 0; +#X connect 2 0 4 0; +#X connect 3 0 1 0; +#X connect 4 0 5 0; +#X connect 5 0 18 0; +#X connect 6 0 7 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 14 0; +#X connect 9 0 16 0; +#X connect 10 0 24 0; +#X connect 11 0 10 1; +#X connect 12 0 13 0; +#X connect 13 0 14 1; +#X connect 14 0 22 2; +#X connect 15 0 17 0; +#X connect 16 0 19 0; +#X connect 17 0 16 1; +#X connect 18 0 22 0; +#X connect 18 1 10 0; +#X connect 19 0 22 3; +#X connect 20 0 23 0; +#X connect 21 0 3 0; +#X connect 21 1 11 0; +#X connect 21 2 6 0; +#X connect 21 3 12 0; +#X connect 21 4 15 0; +#X connect 22 0 20 0; +#X connect 24 0 22 1; +#X restore 843 484 pd build_perspective; +#X text 274 38 The view matrix represent the camera position and orientation. It can be set via message to the gemwin object, f 31; +#X text 834 28 The projection matrix The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; +#X text 27 8 This patch create transformation matrix to be use with previous patch., f 71; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 5 1 16 0; +#X connect 5 1 94 0; +#X connect 6 0 2 1; +#X connect 7 0 2 2; +#X connect 8 0 2 3; +#X connect 9 0 3 1; +#X connect 10 0 3 2; +#X connect 11 0 3 3; +#X connect 12 0 4 1; +#X connect 13 0 4 2; +#X connect 14 0 4 3; +#X connect 16 0 20 0; +#X connect 16 1 17 0; +#X connect 17 0 21 0; +#X connect 17 1 18 0; +#X connect 18 0 22 0; +#X connect 18 1 19 0; +#X connect 19 0 23 0; +#X connect 24 0 25 0; +#X connect 25 1 27 0; +#X connect 25 1 95 0; +#X connect 27 0 31 0; +#X connect 27 1 28 0; +#X connect 28 0 32 0; +#X connect 28 1 29 0; +#X connect 29 0 33 0; +#X connect 29 1 30 0; +#X connect 30 0 34 0; +#X connect 35 0 36 0; +#X connect 36 0 37 0; +#X connect 37 0 38 0; +#X connect 38 0 39 0; +#X connect 39 1 50 0; +#X connect 40 0 36 1; +#X connect 41 0 36 2; +#X connect 42 0 36 3; +#X connect 43 0 37 1; +#X connect 44 0 37 2; +#X connect 45 0 37 3; +#X connect 46 0 38 1; +#X connect 47 0 38 2; +#X connect 48 0 38 3; +#X connect 50 0 54 0; +#X connect 50 1 51 0; +#X connect 51 0 55 0; +#X connect 51 1 52 0; +#X connect 52 0 56 0; +#X connect 52 1 53 0; +#X connect 53 0 57 0; +#X connect 58 0 60 0; +#X connect 58 0 96 0; +#X connect 60 0 64 0; +#X connect 60 1 61 0; +#X connect 61 0 65 0; +#X connect 61 1 62 0; +#X connect 62 0 66 0; +#X connect 62 1 63 0; +#X connect 63 0 67 0; +#X connect 72 0 58 0; +#X connect 76 0 77 0; +#X connect 77 0 82 0; +#X connect 78 0 79 0; +#X connect 79 0 80 0; +#X connect 80 0 92 0; +#X connect 83 0 106 0; +#X connect 84 0 88 0; +#X connect 84 1 85 0; +#X connect 85 0 89 0; +#X connect 85 1 86 0; +#X connect 86 0 90 0; +#X connect 86 1 87 0; +#X connect 87 0 91 0; +#X connect 94 0 97 0; +#X connect 95 0 98 0; +#X connect 96 0 99 0; +#X connect 97 0 100 0; +#X connect 98 0 101 0; +#X connect 99 0 102 0; +#X connect 106 0 84 0; +#X connect 106 0 96 0; From fe4f1edbf16a09acf3b599a79c7b54a3c689e572 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 13:51:24 +0200 Subject: [PATCH 302/387] use triangle_strip for the input and reduce the array size --- examples/15.GLSL4/05.geometry.pd | 71 ++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/examples/15.GLSL4/05.geometry.pd b/examples/15.GLSL4/05.geometry.pd index 6cc4596d9..b94805a47 100644 --- a/examples/15.GLSL4/05.geometry.pd +++ b/examples/15.GLSL4/05.geometry.pd @@ -1,4 +1,4 @@ -#N canvas 231 365 1140 558 10; +#N canvas 151 363 1140 558 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -97,16 +97,11 @@ #X msg 718 255 lightPos 2 2 2; #X msg 718 282 lightColor 1 1 1; #X msg 718 309 ambientColor 0.2 0.2 0.2; -#X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37; -#X msg 37 275 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 1 1 1 0; -#X msg 37 339 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1; -#X msg 36 401 0 0 0 0 1 1 0 0 1 1 0 1 1; #X obj 167 53 table \$0_position 18; #X obj 167 74 table \$0_color 18; #X obj 167 95 table \$0_normal 18; #X obj 167 116 table \$0_texcoord 12; #X obj 333 226 glsl shader/geometry; -#X obj 333 486 gemvertexbuffer \; resize 6 \; draw tri; #X msg 718 174 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; #X msg 718 201 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; #X obj 333 116 translateXYZ; @@ -114,44 +109,56 @@ #X obj 413 187 r shader_matrix; #X text 399 89 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117; #X text 165 32 tables used by the vertex buffer; +#X msg 37 275 0 1 0 0 0 1 0 0 0 1 1 1 0; +#X msg 37 339 0 0 0 1 0 0 1 0 0 1 0 0 1; +#X msg 36 401 0 0 0 0 1 1 0 1 1; +#X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37; +#X obj 333 486 gemvertexbuffer \; resize 4 \; draw tristrip; +#N canvas 2 102 450 300 drawing 0; +#X text 33 32 VBO draw type : same as all openGL primitive; +#X text 40 83 geometr shader in type :; +#X text 209 136 points (pour GL_POINTS) lines (pour GL_LINES \, GL_LINE_STRIP \, GL_LINE_LOOP) triangles (pour GL_TRIANGLES \, GL_TRIANGLE_STRIP \, GL_TRIANGLE_FAN) lines_adjacency (pour GL_LINES_ADJACENCY) triangles_adjacency (pour GL_TRIANGLES_ADJACENCY); +#X text 43 292 geometry shader out type :; +#X text 155 359 points - Émet des points individuels line_strip - Émet une séquence de lignes connectées triangle_strip - Émet une séquence de triangles connectés; +#X restore 37 499 pd drawing type; #X connect 0 0 1 0; -#X connect 2 0 41 0; +#X connect 2 0 36 0; #X connect 3 0 8 0; #X connect 4 0 8 0; -#X connect 8 0 38 0; +#X connect 8 0 45 0; #X connect 8 1 5 0; -#X connect 9 0 29 0; -#X connect 12 0 30 0; +#X connect 9 0 44 0; +#X connect 12 0 41 0; #X connect 13 0 22 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 13 0; #X connect 16 1 3 0; -#X connect 17 0 31 0; -#X connect 19 0 32 0; -#X connect 21 0 37 0; +#X connect 17 0 42 0; +#X connect 19 0 43 0; +#X connect 21 0 33 0; #X connect 22 0 8 0; #X connect 23 0 24 0; #X connect 23 0 28 0; #X connect 23 0 27 0; #X connect 23 0 26 0; -#X connect 23 0 40 0; -#X connect 23 0 39 0; +#X connect 23 0 35 0; +#X connect 23 0 34 0; #X connect 23 0 25 0; -#X connect 24 0 37 1; -#X connect 25 0 37 1; -#X connect 26 0 37 1; -#X connect 27 0 37 1; -#X connect 28 0 37 1; -#X connect 29 0 10 0; -#X connect 30 0 11 0; -#X connect 31 0 18 0; -#X connect 32 0 20 0; -#X connect 37 0 38 0; -#X connect 37 1 15 0; -#X connect 37 1 23 0; -#X connect 39 0 37 1; -#X connect 40 0 37 1; -#X connect 41 0 37 0; -#X connect 42 0 41 1; -#X connect 43 0 37 1; +#X connect 24 0 33 1; +#X connect 25 0 33 1; +#X connect 26 0 33 1; +#X connect 27 0 33 1; +#X connect 28 0 33 1; +#X connect 33 0 45 0; +#X connect 33 1 15 0; +#X connect 33 1 23 0; +#X connect 34 0 33 1; +#X connect 35 0 33 1; +#X connect 36 0 33 0; +#X connect 37 0 36 1; +#X connect 38 0 33 1; +#X connect 41 0 11 0; +#X connect 42 0 18 0; +#X connect 43 0 20 0; +#X connect 44 0 10 0; From 063bfda38c9507e7cf87ea627d5febe4e7459b37 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 13:52:24 +0200 Subject: [PATCH 303/387] rename the shader to fit other examples template --- examples/15.GLSL4/05.geometry.pd | 77 +++++++++---------- .../{geometry.frag => 05.geometry.frag} | 0 .../{geometry.geom => 05.geometry.geom} | 1 + .../{geometry.vert => 05.geometry.vert} | 0 4 files changed, 36 insertions(+), 42 deletions(-) rename examples/15.GLSL4/shader/{geometry.frag => 05.geometry.frag} (100%) rename examples/15.GLSL4/shader/{geometry.geom => 05.geometry.geom} (89%) rename examples/15.GLSL4/shader/{geometry.vert => 05.geometry.vert} (100%) diff --git a/examples/15.GLSL4/05.geometry.pd b/examples/15.GLSL4/05.geometry.pd index b94805a47..2360730d4 100644 --- a/examples/15.GLSL4/05.geometry.pd +++ b/examples/15.GLSL4/05.geometry.pd @@ -33,9 +33,9 @@ #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; #X obj 333 64 gemhead; -#X msg 477 377 program \$1; -#X msg 488 400 print_attributes; -#X obj 477 448 print vb; +#X msg 495 377 program \$1; +#X msg 506 400 print_attributes; +#X obj 495 448 print vb; #X obj 44 9 declare -lib Gem; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; @@ -76,21 +76,21 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 450 424 t a a; +#X obj 468 424 t a a; #X obj 37 174 loadbang; #X obj 37 228 s \$0_position; #X obj 37 295 s \$0_color; #X obj 37 255 loadbang; -#X obj 450 318 f \$0; -#X obj 470 247 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X floatatom 450 272 5 0 0 0 - - - 0; -#X obj 450 295 t b f; +#X obj 468 318 f \$0; +#X obj 488 247 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X floatatom 468 272 5 0 0 0 - - - 0; +#X obj 468 295 t b f; #X obj 37 319 loadbang; #X obj 37 359 s \$0_normal; #X obj 36 381 loadbang; #X obj 36 422 s \$0_texcoord; #X obj 345 201 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X msg 450 342 attribute position \$1_position \, attribute normal \$1_normal \, attribute texCoord \$1_texcoord; +#X msg 468 342 attribute position \$1_position \, attribute normal \$1_normal \, attribute texCoord \$1_texcoord; #X obj 691 131 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X msg 718 147 modelMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1; #X msg 718 228 normalMatrix 1 0 0 0 1 0 0 0 1; @@ -101,7 +101,6 @@ #X obj 167 74 table \$0_color 18; #X obj 167 95 table \$0_normal 18; #X obj 167 116 table \$0_texcoord 12; -#X obj 333 226 glsl shader/geometry; #X msg 718 174 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; #X msg 718 201 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; #X obj 333 116 translateXYZ; @@ -114,51 +113,45 @@ #X msg 36 401 0 0 0 0 1 1 0 1 1; #X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37; #X obj 333 486 gemvertexbuffer \; resize 4 \; draw tristrip; -#N canvas 2 102 450 300 drawing 0; -#X text 33 32 VBO draw type : same as all openGL primitive; -#X text 40 83 geometr shader in type :; -#X text 209 136 points (pour GL_POINTS) lines (pour GL_LINES \, GL_LINE_STRIP \, GL_LINE_LOOP) triangles (pour GL_TRIANGLES \, GL_TRIANGLE_STRIP \, GL_TRIANGLE_FAN) lines_adjacency (pour GL_LINES_ADJACENCY) triangles_adjacency (pour GL_TRIANGLES_ADJACENCY); -#X text 43 292 geometry shader out type :; -#X text 155 359 points - Émet des points individuels line_strip - Émet une séquence de lignes connectées triangle_strip - Émet une séquence de triangles connectés; -#X restore 37 499 pd drawing type; +#X obj 333 226 glsl shader/05.geometry; #X connect 0 0 1 0; -#X connect 2 0 36 0; +#X connect 2 0 35 0; #X connect 3 0 8 0; #X connect 4 0 8 0; -#X connect 8 0 45 0; +#X connect 8 0 44 0; #X connect 8 1 5 0; -#X connect 9 0 44 0; -#X connect 12 0 41 0; +#X connect 9 0 43 0; +#X connect 12 0 40 0; #X connect 13 0 22 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 13 0; #X connect 16 1 3 0; -#X connect 17 0 42 0; -#X connect 19 0 43 0; -#X connect 21 0 33 0; +#X connect 17 0 41 0; +#X connect 19 0 42 0; +#X connect 21 0 45 0; #X connect 22 0 8 0; #X connect 23 0 24 0; #X connect 23 0 28 0; #X connect 23 0 27 0; #X connect 23 0 26 0; -#X connect 23 0 35 0; #X connect 23 0 34 0; +#X connect 23 0 33 0; #X connect 23 0 25 0; -#X connect 24 0 33 1; -#X connect 25 0 33 1; -#X connect 26 0 33 1; -#X connect 27 0 33 1; -#X connect 28 0 33 1; -#X connect 33 0 45 0; -#X connect 33 1 15 0; -#X connect 33 1 23 0; -#X connect 34 0 33 1; -#X connect 35 0 33 1; -#X connect 36 0 33 0; -#X connect 37 0 36 1; -#X connect 38 0 33 1; -#X connect 41 0 11 0; -#X connect 42 0 18 0; -#X connect 43 0 20 0; -#X connect 44 0 10 0; +#X connect 24 0 45 1; +#X connect 25 0 45 1; +#X connect 26 0 45 1; +#X connect 27 0 45 1; +#X connect 28 0 45 1; +#X connect 33 0 45 1; +#X connect 34 0 45 1; +#X connect 35 0 45 0; +#X connect 36 0 35 1; +#X connect 37 0 45 1; +#X connect 40 0 11 0; +#X connect 41 0 18 0; +#X connect 42 0 20 0; +#X connect 43 0 10 0; +#X connect 45 0 44 0; +#X connect 45 1 15 0; +#X connect 45 1 23 0; diff --git a/examples/15.GLSL4/shader/geometry.frag b/examples/15.GLSL4/shader/05.geometry.frag similarity index 100% rename from examples/15.GLSL4/shader/geometry.frag rename to examples/15.GLSL4/shader/05.geometry.frag diff --git a/examples/15.GLSL4/shader/geometry.geom b/examples/15.GLSL4/shader/05.geometry.geom similarity index 89% rename from examples/15.GLSL4/shader/geometry.geom rename to examples/15.GLSL4/shader/05.geometry.geom index ed7555cea..b48a24a59 100644 --- a/examples/15.GLSL4/shader/geometry.geom +++ b/examples/15.GLSL4/shader/05.geometry.geom @@ -1,6 +1,7 @@ #version 150 layout(triangles) in; + // the triangle_strip is split in multiples triangles before this shader layout(triangle_strip, max_vertices = 3) out; // from vertex shader diff --git a/examples/15.GLSL4/shader/geometry.vert b/examples/15.GLSL4/shader/05.geometry.vert similarity index 100% rename from examples/15.GLSL4/shader/geometry.vert rename to examples/15.GLSL4/shader/05.geometry.vert From 51b3a269cc3b5d301b8a088132534239add396f6 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 14:00:20 +0200 Subject: [PATCH 304/387] add information about openGL drawing type --- examples/15.GLSL4/05.geometry.pd | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/examples/15.GLSL4/05.geometry.pd b/examples/15.GLSL4/05.geometry.pd index 2360730d4..8a2051606 100644 --- a/examples/15.GLSL4/05.geometry.pd +++ b/examples/15.GLSL4/05.geometry.pd @@ -1,4 +1,4 @@ -#N canvas 151 363 1140 558 10; +#N canvas 229 344 1140 558 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -114,6 +114,21 @@ #X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37; #X obj 333 486 gemvertexbuffer \; resize 4 \; draw tristrip; #X obj 333 226 glsl shader/05.geometry; +#N canvas 125 216 972 620 drawing_type 0; +#X text 40 50 VBO draw type : same as all openGL primitive; +#X text 46 433 geometry shader out type :; +#X text 70 345 points (pour GL_POINTS) \; lines (for GL_LINES \, GL_LINE_STRIP \, GL_LINE_LOOP) \; triangles (for GL_TRIANGLES \, GL_TRIANGLE_STRIP \, GL_TRIANGLE_FAN \; lines_adjacency (for GL_LINES_ADJACENCY) \; triangles_adjacency (for GL_TRIANGLES_ADJACENCY), f 66; +#X text 50 329 geometry shader in type :; +#X text 69 451 points line_strip triangle_strip, f 17; +#X text 78 71 point for GL_POINTS \; points for GL_POINTS \; line for GL_LINE_LOOP \; lineloop for GL_LINE_LOOP \; lines for GL_LINES \; linestrip for GL_LINE_STRIP \; linesadj for GL_LINES_ADJACENCY \; linestripadj for GL_LINE_STRIP_ADJACENCY \; tri for GL_TRIANGLES \; triangle for GL_TRIANGLES \; tristrip for GL_TRIANGLE_STRIP \; trifan for GL_TRIANGLE_FAN \; triadj for GL_TRIANGLES_ADJACENCY \; tristripadj for GL_TRIANGLE_STRIP_ADJACENCY \; quad for GL_QUADS \; quads for GL_QUADS \; quadstrip for GL_QUAD_STRIP \; strip for GL_TRIANGLE_STRIP \; fill for GL_POLYGON \;; +#X text 41 17 version >= 150; +#X text 529 13 version >=410; +#X text 501 370 GL_PATCHES for teselarisation; +#X text 754 9 version >=420; +#X obj 714 5 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; +#X obj 474 7 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; +#X text 744 461 add invocations; +#X restore 37 499 pd drawing_type; #X connect 0 0 1 0; #X connect 2 0 35 0; #X connect 3 0 8 0; From 9b77c7d7008776ad31a423f6a2d78f743b112ac2 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 15:27:46 +0200 Subject: [PATCH 305/387] the size of the buffer depend of the dimention of the data stored --- src/Geos/gemvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Geos/gemvertexbuffer.cpp b/src/Geos/gemvertexbuffer.cpp index 9368dc32c..3a77a7713 100644 --- a/src/Geos/gemvertexbuffer.cpp +++ b/src/Geos/gemvertexbuffer.cpp @@ -475,7 +475,7 @@ void gemvertexbuffer :: copyArray(const std::string&tab_name, t_word *vec; const bool interleaved = (0==dimen); - if(offset>vb.size) { + if(offset>vb.size*vb.dimen) { error("offset %d is bigger than vertexbuffer size (%d) for %s", offset, vb.size, tab_name.c_str()); return; } From a61703c3426f483098b21d365b2fbda354ee60a1 Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 17:04:28 +0200 Subject: [PATCH 306/387] new example that test various primitives made with VBO --- examples/15.GLSL4/07.primitives.pd | 108 +++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 examples/15.GLSL4/07.primitives.pd diff --git a/examples/15.GLSL4/07.primitives.pd b/examples/15.GLSL4/07.primitives.pd new file mode 100644 index 000000000..dbcddf0c3 --- /dev/null +++ b/examples/15.GLSL4/07.primitives.pd @@ -0,0 +1,108 @@ +#N canvas 621 225 1140 655 12; +#X obj 469 431 VBOsphere; +#X obj 555 428 VBOcube; +#X obj 268 429 VBOcircle; +#X obj 354 429 BBOmesh_square; +#X obj 130 362 == 0; +#X obj 184 389 spigot; +#X obj 279 390 spigot; +#X obj 365 391 spigot; +#X obj 465 394 spigot; +#X obj 550 394 spigot; +#X obj 639 395 spigot; +#X obj 223 363 == 1; +#X obj 318 364 == 2; +#X obj 404 365 == 3; +#X obj 504 368 == 4; +#X obj 589 368 == 5; +#X obj 678 369 == 6; +#X obj 769 144 vradio 20 1 0 8 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0; +#X text 792 143 line; +#X text 792 166 square; +#X obj 77 252 rotateXYZ; +#X floatatom 98 222 5 0 0 0 - - - 0; +#X floatatom 145 222 5 0 0 0 - - - 0; +#X floatatom 190 222 5 0 0 0 - - - 0; +#X obj 77 41 gemhead; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 402 30 pd gemwin; +#X obj 77 388 spigot 1; +#X obj 77 431 VBOline \; res 2 \; width 3 \; pos 0 -1 0 0 \; pos 1 1 0 0 \; color 1 1 1 1; +#X obj 636 428 VBOplane; +#X obj 184 429 VBOsquare; +#X obj 77 85 pix_video; +#X obj 77 159 scaleXYZ; +#X floatatom 161 155 5 0 0 0 - - - 0; +#X obj 150 88 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X obj 77 112 pix_texture \; 0; +#X connect 4 0 26 1; +#X connect 5 0 29 0; +#X connect 11 0 5 1; +#X connect 12 0 6 1; +#X connect 13 0 7 1; +#X connect 14 0 8 1; +#X connect 15 0 9 1; +#X connect 16 0 10 1; +#X connect 17 0 16 0; +#X connect 17 0 15 0; +#X connect 17 0 14 0; +#X connect 17 0 13 0; +#X connect 17 0 12 0; +#X connect 17 0 11 0; +#X connect 17 0 4 0; +#X connect 20 0 10 0; +#X connect 20 0 9 0; +#X connect 20 0 8 0; +#X connect 20 0 7 0; +#X connect 20 0 6 0; +#X connect 20 0 5 0; +#X connect 20 0 26 0; +#X connect 21 0 20 1; +#X connect 22 0 20 2; +#X connect 23 0 20 3; +#X connect 24 0 30 0; +#X connect 26 0 27 0; +#X connect 30 0 34 0; +#X connect 31 0 20 0; +#X connect 32 0 31 1; +#X connect 32 0 31 2; +#X connect 32 0 31 3; +#X connect 33 0 34 0; +#X connect 34 0 31 0; From a0e897e6c7799a0969d2fb335960bd6f350ebbdd Mon Sep 17 00:00:00 2001 From: chnry Date: Wed, 16 Apr 2025 17:05:38 +0200 Subject: [PATCH 307/387] new primitives using VBO to use with shaders --- examples/15.GLSL4/VBOline-help.pd | 72 +++++++++++++++++ examples/15.GLSL4/VBOline.pd | 130 ++++++++++++++++++++++++++++++ examples/15.GLSL4/VBOsquare.pd | 92 +++++++++++++++++++++ 3 files changed, 294 insertions(+) create mode 100644 examples/15.GLSL4/VBOline-help.pd create mode 100644 examples/15.GLSL4/VBOline.pd create mode 100644 examples/15.GLSL4/VBOsquare.pd diff --git a/examples/15.GLSL4/VBOline-help.pd b/examples/15.GLSL4/VBOline-help.pd new file mode 100644 index 000000000..2daa8548a --- /dev/null +++ b/examples/15.GLSL4/VBOline-help.pd @@ -0,0 +1,72 @@ +#N canvas 514 238 782 673 12; +#X declare -lib Gem; +#X text 476 8 GEM object; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 65 KEYWORDS Gem openGL shape; +#X text 20 85 INLET_0 gemlist draw; +#X text 20 125 OUTLET_0 gemlist; +#X text 10 165 LICENSE GPL v2; +#X text 10 45 DESCRIPTION Renders a line using a VBO; +#X text 20 105 INLET_1 arguments; +#X text 10 145 AUTHOR Cyrille Henry; +#X restore 576 10 pd META; +#X text 471 43 Example:; +#X obj 469 73 cnv 15 280 580 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 481 165 cnv 15 260 390 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 475 108 gemhead; +#X msg 523 280 res \$1; +#X msg 554 356 color \$1 \$2 \$3 \$4; +#X msg 590 436 pos 0 \$1 \$2 \$3; +#X listbox 554 331 19 0 0 0 - - - 0; +#X msg 523 227 2; +#X floatatom 523 254 5 0 0 0 - - - 0; +#X listbox 590 410 14 0 0 0 - - - 0; +#X msg 590 384 0 0 0; +#X listbox 621 489 14 0 0 0 - - - 0; +#X msg 621 463 1 0 0; +#X msg 621 515 pos 1 \$1 \$2 \$3; +#X obj 475 138 alpha; +#X msg 502 197 width \$1; +#X floatatom 502 172 5 0 0 0 - - - 0; +#X msg 554 305 1 1 1 1; +#X obj 7 74 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 225 cnv 15 450 310 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 9 230 Inlets:; +#X obj 8 185 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 17 184 Arguments:; +#X text 27 256 Inlet 1: message: draw [line|fill|point]; +#X text 27 242 Inlet 1: gemlist; +#X text 9 429 Outlets:; +#X text 23 447 Outlet 1: gemlist; +#X text 17 11 Synopsis: [VBOline]; +#X text 37 38 Class: geometric object using Vertex Buffer Object; +#X text 7 78 Description: Renders a line; +#X text 24 101 This primitive create a line \, using only a framebuffer. It replace standard geo object when it's not possible to use them (like in shader version >150); +#X text 61 197 number of points in the line; +#X text 27 272 Inlet 2: message: res : number of point in the line; +#X text 27 288 Inlet 2: message: color float (R) float (G) float (B) float (A) : set the color of the line; +#X text 27 318 Inlet 2: message: pos float (Id) float (X) float (Y) float (Z): set the XYZ position of point: Id; +#X text 27 348 Inlet 2: message: table symbol (name) float (offset) floats (value) : send multiples data to the internal table.; +#X text 28 382 The internal table are : posX \, posY \, posZ \, colorR \, colorG \, colorB \, colorA; +#X obj 639 100 _gemwin; +#X obj 475 606 VBOline 3 \; width 2; +#X obj 475 574 GEMglPointSize 5; +#X text 16 491 internal tables (position and color) are reseted when the resolution is changed; +#X connect 5 0 17 0; +#X connect 6 0 41 1; +#X connect 7 0 41 1; +#X connect 8 0 41 1; +#X connect 9 0 7 0; +#X connect 10 0 11 0; +#X connect 11 0 6 0; +#X connect 12 0 8 0; +#X connect 13 0 12 0; +#X connect 14 0 16 0; +#X connect 15 0 14 0; +#X connect 16 0 41 1; +#X connect 17 0 42 0; +#X connect 18 0 41 0; +#X connect 19 0 18 0; +#X connect 20 0 9 0; +#X connect 42 0 41 0; diff --git a/examples/15.GLSL4/VBOline.pd b/examples/15.GLSL4/VBOline.pd new file mode 100644 index 000000000..17f22e516 --- /dev/null +++ b/examples/15.GLSL4/VBOline.pd @@ -0,0 +1,130 @@ +#N canvas 907 224 1301 696 12; +#X obj 34 27 inlet; +#X obj 231 85 gemargs; +#X obj 314 30 inlet; +#X msg 346 188 resize \$1; +#X text 481 155 forward to the corresponding table, f 21; +#X obj 470 318 send; +#X obj 544 204 list split 1; +#X obj 470 231 list trim; +#X obj 58 83 table table-\$0-posX; +#X obj 58 105 table table-\$0-posY; +#X obj 58 127 table table-\$0-posZ; +#X obj 58 152 table table-\$0-colorR; +#X obj 58 174 table table-\$0-colorG; +#X obj 58 196 table table-\$0-colorB; +#X obj 58 218 table table-\$0-colorA; +#X obj 430 206 list split 1; +#X obj 653 221 unpack f f f f; +#X msg 653 387 const \$1; +#X obj 653 410 s table-\$0-colorR; +#X obj 231 21 loadbang; +#X msg 748 248 const \$1; +#X msg 716 294 const \$1; +#X msg 684 341 const \$1; +#X obj 684 364 s table-\$0-colorG; +#X obj 716 317 s table-\$0-colorB; +#X obj 748 271 s table-\$0-colorA; +#X obj 653 128 route color; +#X obj 920 126 route pos; +#X msg 552 505 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; +#X obj 552 446 delay 0; +#X obj 854 445 delay 0; +#X text 920 452 delay is here to limit the update rate of thevertex buffer once per input message, f 45; +#X text 664 153 RGB or RGBA value; +#X text 937 156 point number \, X Y Z position; +#X msg 335 86 res 2 \, color 1 1 1 1 \, pos 0 0 0 0 \, pos 1 1 0 0; +#X msg 854 504 position table-\$1-posX table-\$1-posY table-\$1-posZ, f 39; +#X obj 552 475 \$0; +#X obj 854 474 \$0; +#X obj 587 475 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 886 472 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 231 48 t b b; +#X obj 198 382 s table-\$0-posX; +#X obj 198 404 s table-\$0-posY; +#X obj 198 426 s table-\$0-posZ; +#X obj 198 450 s table-\$0-colorR; +#X obj 198 472 s table-\$0-colorG; +#X obj 198 494 s table-\$0-colorB; +#X obj 198 516 s table-\$0-colorA; +#X obj 920 272 unpack f f f f; +#X obj 920 222 t a a; +#X msg 1166 269 \$1; +#X obj 951 310 tabwrite table-\$0-posX; +#X obj 1015 359 tabwrite table-\$0-posZ; +#X obj 983 334 tabwrite table-\$0-posY; +#X obj 314 122 route res table, f 27; +#X obj 407 155 t b a a; +#X obj 407 400 b; +#X obj 314 159 t b f; +#X obj 58 243 table table-\$0-textureU; +#X obj 34 611 gemvertexbuffer \; draw tristrip \;; +#X obj 58 265 table table-\$0-textureV; +#X obj 58 290 table table-\$0-normalX; +#X obj 58 312 table table-\$0-normalY; +#X obj 58 334 table table-\$0-normalZ; +#X obj 34 661 outlet; +#X obj 544 250 list prepend \$0; +#X msg 544 273 symbol table-\$1-\$2; +#X connect 0 0 59 0; +#X connect 1 0 54 0; +#X connect 1 1 57 0; +#X connect 2 0 54 0; +#X connect 3 0 41 0; +#X connect 3 0 47 0; +#X connect 3 0 46 0; +#X connect 3 0 45 0; +#X connect 3 0 44 0; +#X connect 3 0 43 0; +#X connect 3 0 42 0; +#X connect 3 0 59 0; +#X connect 6 0 65 0; +#X connect 7 0 5 0; +#X connect 15 1 7 0; +#X connect 16 0 17 0; +#X connect 16 1 22 0; +#X connect 16 2 21 0; +#X connect 16 3 20 0; +#X connect 17 0 18 0; +#X connect 19 0 40 0; +#X connect 20 0 25 0; +#X connect 21 0 24 0; +#X connect 22 0 23 0; +#X connect 26 0 16 0; +#X connect 26 0 29 0; +#X connect 26 1 27 0; +#X connect 27 0 30 0; +#X connect 27 0 49 0; +#X connect 27 1 59 0; +#X connect 28 0 59 0; +#X connect 29 0 36 0; +#X connect 30 0 37 0; +#X connect 34 0 54 0; +#X connect 35 0 59 0; +#X connect 36 0 28 0; +#X connect 37 0 35 0; +#X connect 38 0 36 0; +#X connect 39 0 37 0; +#X connect 40 0 1 0; +#X connect 40 1 34 0; +#X connect 48 1 51 0; +#X connect 48 2 53 0; +#X connect 48 3 52 0; +#X connect 49 0 48 0; +#X connect 49 1 50 0; +#X connect 50 0 52 1; +#X connect 50 0 53 1; +#X connect 50 0 51 1; +#X connect 54 0 57 0; +#X connect 54 1 55 0; +#X connect 54 2 26 0; +#X connect 55 0 56 0; +#X connect 55 1 15 0; +#X connect 55 2 6 0; +#X connect 56 0 29 0; +#X connect 56 0 30 0; +#X connect 57 0 56 0; +#X connect 57 1 3 0; +#X connect 59 0 64 0; +#X connect 65 0 66 0; +#X connect 66 0 5 1; diff --git a/examples/15.GLSL4/VBOsquare.pd b/examples/15.GLSL4/VBOsquare.pd new file mode 100644 index 000000000..cff09fe41 --- /dev/null +++ b/examples/15.GLSL4/VBOsquare.pd @@ -0,0 +1,92 @@ +#N canvas 679 46 934 869 12; +#X obj 34 27 inlet; +#X obj 276 113 gemargs; +#X obj 344 30 inlet; +#X text 418 185 forward to the corresponding table, f 21; +#X obj 407 320 send; +#X obj 481 234 list split 1; +#X obj 407 261 list trim; +#X obj 367 236 list split 1; +#X obj 683 251 unpack f f f f; +#X msg 683 417 const \$1; +#X obj 683 440 s table-\$0-colorR; +#X obj 261 21 loadbang; +#X msg 778 278 const \$1; +#X msg 746 324 const \$1; +#X msg 714 371 const \$1; +#X obj 714 394 s table-\$0-colorG; +#X obj 746 347 s table-\$0-colorB; +#X obj 778 301 s table-\$0-colorA; +#X obj 683 188 route color; +#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; +#X obj 344 476 delay 0; +#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; +#X text 694 213 RGB or RGBA value; +#X obj 344 505 \$0; +#X obj 261 614 \$0; +#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 261 48 t b b; +#X obj 344 185 t b a a; +#X obj 344 430 b; +#X msg 365 116 color 1 1 1 1; +#X obj 344 152 route table, f 27; +#X obj 34 721 gemvertexbuffer \; draw tristrip \; resize 4 \;; +#X obj 58 83 table table-\$0-posX 4; +#X obj 58 105 table table-\$0-posY 4; +#X obj 58 127 table table-\$0-posZ 4; +#X obj 58 152 table table-\$0-colorR 4; +#X obj 58 174 table table-\$0-colorG 4; +#X obj 58 196 table table-\$0-colorB 4; +#X obj 58 218 table table-\$0-colorA 4; +#X obj 58 243 table table-\$0-textureU 4; +#X obj 58 265 table table-\$0-textureV 4; +#X obj 58 290 table table-\$0-normalX 4; +#X obj 58 312 table table-\$0-normalY 4; +#X obj 58 334 table table-\$0-normalZ 4; +#X obj 34 775 outlet; +#X obj 481 258 list prepend \$0; +#X msg 481 281 symbol table-\$1-\$2; +#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; +#X msg 491 99 posX 0 -1 1 -1 1 \, posY 0 -1 -1 1 1 \, textureU 0 0 1 0 1 \, textureV 0 1 1 0 0 \, normalZ 0 1 1 1 1; +#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; +#X text 254 780 TODO : add a size message for the square (is that really needed? a scaleXYZ object can be use); +#X connect 0 0 32 0; +#X connect 1 0 31 0; +#X connect 2 0 31 0; +#X connect 5 0 46 0; +#X connect 6 0 4 0; +#X connect 7 1 6 0; +#X connect 8 0 9 0; +#X connect 8 1 14 0; +#X connect 8 2 13 0; +#X connect 8 3 12 0; +#X connect 9 0 10 0; +#X connect 11 0 27 0; +#X connect 12 0 17 0; +#X connect 13 0 16 0; +#X connect 14 0 15 0; +#X connect 18 0 8 0; +#X connect 18 0 20 0; +#X connect 19 0 32 0; +#X connect 20 0 23 0; +#X connect 23 0 19 0; +#X connect 24 0 48 0; +#X connect 25 0 23 0; +#X connect 26 0 24 0; +#X connect 27 0 1 0; +#X connect 27 0 24 0; +#X connect 27 1 30 0; +#X connect 27 1 49 0; +#X connect 28 0 29 0; +#X connect 28 1 7 0; +#X connect 28 2 5 0; +#X connect 29 0 20 0; +#X connect 30 0 31 0; +#X connect 31 0 28 0; +#X connect 31 1 18 0; +#X connect 32 0 45 0; +#X connect 46 0 47 0; +#X connect 47 0 4 1; +#X connect 48 0 32 0; +#X connect 49 0 28 0; From eca530c7c7bd6b34a3b05687516d2afb8ed42a3d Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 09:10:45 +0200 Subject: [PATCH 308/387] better way to exclude multiple print when shader is not loaded --- abstractions/_glsl.compile.pd | 29 +++++++++---------- .../{15.GLSL4 => 15.OPENGL3.2}/01.basic.pd | 0 .../02.transformation.pd | 0 .../{15.GLSL4 => 15.OPENGL3.2}/03.texture.pd | 0 .../{15.GLSL4 => 15.OPENGL3.2}/04.model.pd | 0 .../{15.GLSL4 => 15.OPENGL3.2}/05.geometry.pd | 0 .../{15.GLSL4 => 15.OPENGL3.2}/06.matrix.pd | 0 .../07.primitives.pd | 0 .../VBOline-help.pd | 0 .../{15.GLSL4 => 15.OPENGL3.2}/VBOline.pd | 0 .../{15.GLSL4 => 15.OPENGL3.2}/VBOsquare.pd | 0 .../shader/01.basic.frag | 0 .../shader/01.basic.vert | 0 .../shader/02.transformation.frag | 0 .../shader/02.transformation.vert | 0 .../shader/03.texture.frag | 0 .../shader/03.texture.vert | 0 .../shader/04.model.frag | 0 .../shader/04.model.vert | 0 .../shader/05.geometry.frag | 0 .../shader/05.geometry.geom | 0 .../shader/05.geometry.vert | 0 22 files changed, 13 insertions(+), 16 deletions(-) rename examples/{15.GLSL4 => 15.OPENGL3.2}/01.basic.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/02.transformation.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/03.texture.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/04.model.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/05.geometry.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/06.matrix.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/07.primitives.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/VBOline-help.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/VBOline.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/VBOsquare.pd (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/01.basic.frag (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/01.basic.vert (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/02.transformation.frag (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/02.transformation.vert (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/03.texture.frag (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/03.texture.vert (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/04.model.frag (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/04.model.vert (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/05.geometry.frag (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/05.geometry.geom (100%) rename examples/{15.GLSL4 => 15.OPENGL3.2}/shader/05.geometry.vert (100%) diff --git a/abstractions/_glsl.compile.pd b/abstractions/_glsl.compile.pd index b4a2d0287..7d55b9f73 100644 --- a/abstractions/_glsl.compile.pd +++ b/abstractions/_glsl.compile.pd @@ -1,23 +1,23 @@ -#N canvas 406 409 616 457 12; -#X obj 131 383 glsl_\$1; +#N canvas 396 322 608 534 12; +#X obj 171 443 glsl_\$1; #X obj 251 39 inlet shaderfile; #X obj 283 94 list append \$2; -#X obj 131 408 outlet gemstate; -#X obj 69 68 inlet gemstate; -#X obj 69 311 t a a; -#X obj 131 342 spigot 0; -#X obj 69 341 spigot 1; +#X obj 171 468 outlet gemstate; +#X obj 69 38 inlet gemstate; +#X obj 69 321 t a a; +#X obj 171 382 spigot 0; +#X obj 69 381 spigot 1; #X msg 283 119 symbol \$1.\$2; #X obj 283 179 t a b; #X msg 283 204 open \$1; -#X obj 255 408 outlet shaderID; +#X obj 295 469 outlet shaderID; #X msg 347 203 1; #X msg 377 203 0; #X obj 347 258 t f f, f 6; #X obj 347 283 == 0; #X obj 386 283 == 1; #X obj 251 67 t a a; -#X obj 371 408 outlet shaderfile; +#X obj 411 469 outlet shaderfile; #X obj 367 228 t f f; #N canvas 3269 334 450 484 find 0; #X obj 62 26 inlet filename; @@ -51,17 +51,16 @@ #X connect 11 1 13 0; #X connect 13 0 12 0; #X restore 283 150 pd find file; -#X obj 69 106 route print; -#X msg 69 132 print; +#X obj 69 407 route print; #X connect 0 0 3 0; #X connect 0 1 11 0; #X connect 1 0 17 0; #X connect 2 0 8 0; -#X connect 4 0 21 0; +#X connect 4 0 5 0; #X connect 5 0 7 0; #X connect 5 1 6 0; #X connect 6 0 0 0; -#X connect 7 0 3 0; +#X connect 7 0 21 0; #X connect 8 0 20 0; #X connect 9 0 10 0; #X connect 9 1 12 0; @@ -78,6 +77,4 @@ #X connect 19 1 11 0; #X connect 20 0 9 0; #X connect 20 1 13 0; -#X connect 21 0 22 0; -#X connect 21 1 5 0; -#X connect 22 0 6 0; +#X connect 21 1 0 0; diff --git a/examples/15.GLSL4/01.basic.pd b/examples/15.OPENGL3.2/01.basic.pd similarity index 100% rename from examples/15.GLSL4/01.basic.pd rename to examples/15.OPENGL3.2/01.basic.pd diff --git a/examples/15.GLSL4/02.transformation.pd b/examples/15.OPENGL3.2/02.transformation.pd similarity index 100% rename from examples/15.GLSL4/02.transformation.pd rename to examples/15.OPENGL3.2/02.transformation.pd diff --git a/examples/15.GLSL4/03.texture.pd b/examples/15.OPENGL3.2/03.texture.pd similarity index 100% rename from examples/15.GLSL4/03.texture.pd rename to examples/15.OPENGL3.2/03.texture.pd diff --git a/examples/15.GLSL4/04.model.pd b/examples/15.OPENGL3.2/04.model.pd similarity index 100% rename from examples/15.GLSL4/04.model.pd rename to examples/15.OPENGL3.2/04.model.pd diff --git a/examples/15.GLSL4/05.geometry.pd b/examples/15.OPENGL3.2/05.geometry.pd similarity index 100% rename from examples/15.GLSL4/05.geometry.pd rename to examples/15.OPENGL3.2/05.geometry.pd diff --git a/examples/15.GLSL4/06.matrix.pd b/examples/15.OPENGL3.2/06.matrix.pd similarity index 100% rename from examples/15.GLSL4/06.matrix.pd rename to examples/15.OPENGL3.2/06.matrix.pd diff --git a/examples/15.GLSL4/07.primitives.pd b/examples/15.OPENGL3.2/07.primitives.pd similarity index 100% rename from examples/15.GLSL4/07.primitives.pd rename to examples/15.OPENGL3.2/07.primitives.pd diff --git a/examples/15.GLSL4/VBOline-help.pd b/examples/15.OPENGL3.2/VBOline-help.pd similarity index 100% rename from examples/15.GLSL4/VBOline-help.pd rename to examples/15.OPENGL3.2/VBOline-help.pd diff --git a/examples/15.GLSL4/VBOline.pd b/examples/15.OPENGL3.2/VBOline.pd similarity index 100% rename from examples/15.GLSL4/VBOline.pd rename to examples/15.OPENGL3.2/VBOline.pd diff --git a/examples/15.GLSL4/VBOsquare.pd b/examples/15.OPENGL3.2/VBOsquare.pd similarity index 100% rename from examples/15.GLSL4/VBOsquare.pd rename to examples/15.OPENGL3.2/VBOsquare.pd diff --git a/examples/15.GLSL4/shader/01.basic.frag b/examples/15.OPENGL3.2/shader/01.basic.frag similarity index 100% rename from examples/15.GLSL4/shader/01.basic.frag rename to examples/15.OPENGL3.2/shader/01.basic.frag diff --git a/examples/15.GLSL4/shader/01.basic.vert b/examples/15.OPENGL3.2/shader/01.basic.vert similarity index 100% rename from examples/15.GLSL4/shader/01.basic.vert rename to examples/15.OPENGL3.2/shader/01.basic.vert diff --git a/examples/15.GLSL4/shader/02.transformation.frag b/examples/15.OPENGL3.2/shader/02.transformation.frag similarity index 100% rename from examples/15.GLSL4/shader/02.transformation.frag rename to examples/15.OPENGL3.2/shader/02.transformation.frag diff --git a/examples/15.GLSL4/shader/02.transformation.vert b/examples/15.OPENGL3.2/shader/02.transformation.vert similarity index 100% rename from examples/15.GLSL4/shader/02.transformation.vert rename to examples/15.OPENGL3.2/shader/02.transformation.vert diff --git a/examples/15.GLSL4/shader/03.texture.frag b/examples/15.OPENGL3.2/shader/03.texture.frag similarity index 100% rename from examples/15.GLSL4/shader/03.texture.frag rename to examples/15.OPENGL3.2/shader/03.texture.frag diff --git a/examples/15.GLSL4/shader/03.texture.vert b/examples/15.OPENGL3.2/shader/03.texture.vert similarity index 100% rename from examples/15.GLSL4/shader/03.texture.vert rename to examples/15.OPENGL3.2/shader/03.texture.vert diff --git a/examples/15.GLSL4/shader/04.model.frag b/examples/15.OPENGL3.2/shader/04.model.frag similarity index 100% rename from examples/15.GLSL4/shader/04.model.frag rename to examples/15.OPENGL3.2/shader/04.model.frag diff --git a/examples/15.GLSL4/shader/04.model.vert b/examples/15.OPENGL3.2/shader/04.model.vert similarity index 100% rename from examples/15.GLSL4/shader/04.model.vert rename to examples/15.OPENGL3.2/shader/04.model.vert diff --git a/examples/15.GLSL4/shader/05.geometry.frag b/examples/15.OPENGL3.2/shader/05.geometry.frag similarity index 100% rename from examples/15.GLSL4/shader/05.geometry.frag rename to examples/15.OPENGL3.2/shader/05.geometry.frag diff --git a/examples/15.GLSL4/shader/05.geometry.geom b/examples/15.OPENGL3.2/shader/05.geometry.geom similarity index 100% rename from examples/15.GLSL4/shader/05.geometry.geom rename to examples/15.OPENGL3.2/shader/05.geometry.geom diff --git a/examples/15.GLSL4/shader/05.geometry.vert b/examples/15.OPENGL3.2/shader/05.geometry.vert similarity index 100% rename from examples/15.GLSL4/shader/05.geometry.vert rename to examples/15.OPENGL3.2/shader/05.geometry.vert From 6fbaae529bd35349b554197982df5cdcfcedb691 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 09:12:19 +0200 Subject: [PATCH 309/387] comments and clean --- abstractions/glsl.pd | 100 +++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/abstractions/glsl.pd b/abstractions/glsl.pd index c5fb062d3..d08587a04 100644 --- a/abstractions/glsl.pd +++ b/abstractions/glsl.pd @@ -1,4 +1,4 @@ -#N canvas 1980 98 668 783 10; +#N canvas 632 136 668 783 10; #X msg 72 338 print; #X obj 118 626 glsl_program; #X msg 72 620 print; @@ -6,15 +6,13 @@ #X obj 118 662 outlet; #X obj 577 95 inlet; #X obj 118 192 t a; -#X floatatom 197 662 2 0 0 0 ID - - 0; -#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction path.; +#X floatatom 197 662 3 0 0 0 ID - - 0; #X obj 197 690 outlet programID; #X obj 383 104 gemargs; #X obj 383 68 loadbang; #X obj 422 128 route bang; #X obj 167 258 list prepend \$1; #X obj 227 189 t b a; -#X obj 383 361 t a a; #X msg 33 124 print; #X obj 33 103 t b; #X obj 118 339 _glsl.compile vertex vert, f 30; @@ -32,54 +30,56 @@ #X obj 223 556 pack 0 0 0 0 0; #X msg 72 492 print; #X obj 33 145 t a a a a a a; -#X connect 0 0 18 0; +#X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction parent patch path.; +#X obj 383 361 t a; +#X connect 0 0 16 0; #X connect 1 0 4 0; #X connect 1 1 7 0; #X connect 2 0 1 0; -#X connect 3 0 26 0; -#X connect 5 0 15 0; -#X connect 6 0 18 0; -#X connect 7 0 9 0; -#X connect 10 0 15 0; -#X connect 10 1 12 0; -#X connect 11 0 10 0; -#X connect 12 1 14 0; -#X connect 13 0 18 1; -#X connect 14 0 13 0; -#X connect 14 1 13 1; -#X connect 15 0 1 0; -#X connect 16 0 32 0; -#X connect 17 0 16 0; -#X connect 18 0 21 0; -#X connect 18 1 30 2; -#X connect 18 2 21 1; -#X connect 19 0 21 0; -#X connect 20 0 22 0; +#X connect 3 0 24 0; +#X connect 5 0 32 0; +#X connect 6 0 16 0; +#X connect 7 0 8 0; +#X connect 9 0 32 0; +#X connect 9 1 11 0; +#X connect 10 0 9 0; +#X connect 11 1 13 0; +#X connect 12 0 16 1; +#X connect 13 0 12 0; +#X connect 13 1 12 1; +#X connect 14 0 30 0; +#X connect 15 0 14 0; +#X connect 16 0 19 0; +#X connect 16 1 28 2; +#X connect 16 2 19 1; +#X connect 17 0 19 0; +#X connect 18 0 20 0; +#X connect 19 0 20 0; +#X connect 19 1 28 1; +#X connect 19 2 20 1; +#X connect 20 0 26 0; +#X connect 20 1 28 0; +#X connect 20 2 26 1; #X connect 21 0 22 0; -#X connect 21 1 30 1; -#X connect 21 2 22 1; -#X connect 22 0 28 0; -#X connect 22 1 30 0; -#X connect 22 2 28 1; -#X connect 23 0 24 0; -#X connect 23 0 25 0; -#X connect 24 0 1 0; -#X connect 26 0 17 0; -#X connect 26 1 13 0; -#X connect 26 2 14 0; -#X connect 26 3 14 0; -#X connect 26 4 6 0; -#X connect 27 0 28 0; -#X connect 28 0 29 0; -#X connect 28 1 30 4; -#X connect 28 2 29 1; -#X connect 29 0 1 0; -#X connect 29 1 30 3; -#X connect 30 0 23 0; -#X connect 31 0 29 0; +#X connect 21 0 23 0; +#X connect 22 0 1 0; +#X connect 24 0 15 0; +#X connect 24 1 12 0; +#X connect 24 2 13 0; +#X connect 24 3 13 0; +#X connect 24 4 6 0; +#X connect 25 0 26 0; +#X connect 26 0 27 0; +#X connect 26 1 28 4; +#X connect 26 2 27 1; +#X connect 27 0 1 0; +#X connect 27 1 28 3; +#X connect 28 0 21 0; +#X connect 29 0 27 0; +#X connect 30 0 1 0; +#X connect 30 1 27 0; +#X connect 30 2 26 0; +#X connect 30 3 20 0; +#X connect 30 4 19 0; +#X connect 30 5 16 0; #X connect 32 0 1 0; -#X connect 32 1 29 0; -#X connect 32 2 28 0; -#X connect 32 3 22 0; -#X connect 32 4 21 0; -#X connect 32 5 18 0; From 234a3e839bf91e0fe1fa82d574df535220429430 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 09:34:03 +0200 Subject: [PATCH 310/387] comments --- examples/15.OPENGL3.2/01.basic.pd | 12 ++++++++---- examples/15.OPENGL3.2/02.transformation.pd | 3 ++- examples/15.OPENGL3.2/03.texture.pd | 1 + examples/15.OPENGL3.2/04.model.pd | 1 + examples/15.OPENGL3.2/05.geometry.pd | 3 ++- examples/15.OPENGL3.2/06.matrix.pd | 12 ++++++------ 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/examples/15.OPENGL3.2/01.basic.pd b/examples/15.OPENGL3.2/01.basic.pd index 9e909d9a9..e5297307f 100644 --- a/examples/15.OPENGL3.2/01.basic.pd +++ b/examples/15.OPENGL3.2/01.basic.pd @@ -1,4 +1,4 @@ -#N canvas 493 260 713 709 10; +#N canvas 145 232 1078 659 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -45,7 +45,7 @@ #X text 447 454 <----- essential for lookup functions; #X obj 374 320 print linking; #X obj 347 297 t a a; -#X obj 330 610 print vb; +#X obj 330 560 print vb; #X msg 385 341 bang; #X obj 44 9 declare -lib Gem; #X obj 347 255 pack f f; @@ -93,7 +93,7 @@ #X obj 281 104 t a a; #X msg 312 130 open shader/\$1.vert; #X msg 315 159 open shader/\$1.frag; -#X obj 303 586 t a a; +#X obj 303 536 t a a; #X obj 40 175 table \$0_position 9; #X obj 40 196 table \$0_color 9; #X obj 41 235 loadbang; @@ -103,7 +103,11 @@ #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; #X msg 281 72 symbol 01.basic; -#X obj 267 638 gemvertexbuffer \; resize 9 \; draw tri; +#X obj 267 588 gemvertexbuffer \; resize 9 \; draw tri; +#X text 490 119 OpenGL 3.2 deprecated the fixed-function pipeline \, which was less flexible and harder to optimize \, in favor of the programmable pipeline using shaders \, allowing for more customizable and efficient rendering techniques., f 88; +#X text 491 14 OpenGL 3.2 introduced deprecation of immediate mode rendering \, encouraging the use of Vertex Buffer Objects (VBOs) and Vertex Array Objects (VAOs) for more efficient and modern graphics programming. This shift was made to improve performance and flexibility \, aligning OpenGL with contemporary GPU capabilities and programming practices., f 88; +#X text 491 80 VBOs are crucial because they represent the modern and efficient way to manage vertex data in OpenGL \, replacing the older and less performant immediate mode., f 88; +#X text 490 173 With the deprecation of the fixed-function pipeline in OpenGL 3.2 \, users must now manually handle many aspects that were previously automated \, such as matrix transformations and lighting calculations \, by writing their own shaders and managing buffers \, which offers greater control but requires more effort and understanding of the rendering process., f 88; #X connect 0 0 1 0; #X connect 2 0 14 0; #X connect 3 0 4 0; diff --git a/examples/15.OPENGL3.2/02.transformation.pd b/examples/15.OPENGL3.2/02.transformation.pd index 33cf0abbc..d0b00ec70 100644 --- a/examples/15.OPENGL3.2/02.transformation.pd +++ b/examples/15.OPENGL3.2/02.transformation.pd @@ -142,12 +142,13 @@ #X obj 707 266 list prepend transformation_matrix; #X obj 707 288 list trim; #X obj 626 73 translateXYZ 0 0 4; -#X text 565 618 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; +#X text 552 530 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; #X obj 267 638 gemvertexbuffer \; resize 9 \; draw tri; #X obj 267 42 translateXYZ; #X floatatom 330 16 5 0 0 0 - - - 0; #X text 369 15 this transformation is ignored..., f 19; #X msg 218 303 print; +#X text 555 581 Z translation have no effect since the perspective is not yet implemented; #X connect 0 0 1 0; #X connect 2 0 14 0; #X connect 3 0 4 0; diff --git a/examples/15.OPENGL3.2/03.texture.pd b/examples/15.OPENGL3.2/03.texture.pd index 6437a19c2..b07cf8cf4 100644 --- a/examples/15.OPENGL3.2/03.texture.pd +++ b/examples/15.OPENGL3.2/03.texture.pd @@ -110,6 +110,7 @@ #X msg 542 323 bang; #X obj 427 678 gemvertexbuffer \; draw quad; #X obj 427 424 glsl_program \; Texture2 1; +#X text 46 430 Using textures did not change; #X connect 0 0 1 0; #X connect 2 0 13 0; #X connect 3 0 4 0; diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.OPENGL3.2/04.model.pd index 3e858b2a0..7484d34ff 100644 --- a/examples/15.OPENGL3.2/04.model.pd +++ b/examples/15.OPENGL3.2/04.model.pd @@ -159,6 +159,7 @@ #X obj 267 349 glsl_program \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.5 0.5 0.5 \; MaterialKd 0.1 0.1 0.1 \; MaterialKs 0.3 0.3 0.3 \; MaterialShininess 30; #X msg 402 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; #X obj 267 718 gemvertexbuffer \; draw tri; +#X text 23 253 modelfiler load a 3d object into tables. So the pipeline is unchange regarding previous examples, f 36; #X connect 0 0 1 0; #X connect 2 0 12 0; #X connect 3 0 4 0; diff --git a/examples/15.OPENGL3.2/05.geometry.pd b/examples/15.OPENGL3.2/05.geometry.pd index 8a2051606..adf5d1ca8 100644 --- a/examples/15.OPENGL3.2/05.geometry.pd +++ b/examples/15.OPENGL3.2/05.geometry.pd @@ -1,4 +1,4 @@ -#N canvas 229 344 1140 558 10; +#N canvas 361 294 1140 558 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -129,6 +129,7 @@ #X obj 474 7 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; #X text 744 461 add invocations; #X restore 37 499 pd drawing_type; +#X text 449 12 This example introduce the Model Projection View matrix and a simple geometry shader; #X connect 0 0 1 0; #X connect 2 0 35 0; #X connect 3 0 8 0; diff --git a/examples/15.OPENGL3.2/06.matrix.pd b/examples/15.OPENGL3.2/06.matrix.pd index 1f9af6d87..886b90ba1 100644 --- a/examples/15.OPENGL3.2/06.matrix.pd +++ b/examples/15.OPENGL3.2/06.matrix.pd @@ -1,4 +1,4 @@ -#N canvas 161 221 1450 697 12; +#N canvas 294 257 1450 697 12; #X obj 21 209 GEMglLoadIdentity; #X obj 21 174 gemhead; #X obj 21 255 translateXYZ; @@ -174,7 +174,6 @@ #X obj 814 670 s shader_matrix; #X text 27 35 The model matrix combine the geometry transformation. It can be computed with specific library \, or with standard openGL object., f 30; #X text 1286 485 45° fov (this is a very wild angle), f 21; -#X text 535 34 Since the shader need only the multiplication of the model matrix and the view matrix \, you can get this combination directly :, f 35; #N canvas 234 350 511 439 build_perspective 0; #X obj 37 24 inlet; #X obj 37 108 * 0.5; @@ -234,7 +233,8 @@ #X restore 843 484 pd build_perspective; #X text 274 38 The view matrix represent the camera position and orientation. It can be set via message to the gemwin object, f 31; #X text 834 28 The projection matrix The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; -#X text 27 8 This patch create transformation matrix to be use with previous patch., f 71; +#X text 27 8 This patch create transformation matrix to be use with previous patch (keep the previous patch open)., f 103; +#X text 535 34 Since the shader need only the multiplication of the model matrix and the view matrix \, you can get this combination directly : (not used in this example), f 35; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 3 0; @@ -304,7 +304,7 @@ #X connect 78 0 79 0; #X connect 79 0 80 0; #X connect 80 0 92 0; -#X connect 83 0 106 0; +#X connect 83 0 105 0; #X connect 84 0 88 0; #X connect 84 1 85 0; #X connect 85 0 89 0; @@ -318,5 +318,5 @@ #X connect 97 0 100 0; #X connect 98 0 101 0; #X connect 99 0 102 0; -#X connect 106 0 84 0; -#X connect 106 0 96 0; +#X connect 105 0 84 0; +#X connect 105 0 96 0; From eda818ecad55c603e95aeb612161737eca908dfe Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 09:49:22 +0200 Subject: [PATCH 311/387] use the glsl abstraction --- examples/15.OPENGL3.2/01.basic.pd | 84 ++++------ examples/15.OPENGL3.2/02.transformation.pd | 169 +++++++++------------ examples/15.OPENGL3.2/03.texture.pd | 83 ++++------ examples/15.OPENGL3.2/04.model.pd | 92 +++++------ 4 files changed, 164 insertions(+), 264 deletions(-) diff --git a/examples/15.OPENGL3.2/01.basic.pd b/examples/15.OPENGL3.2/01.basic.pd index e5297307f..560d3ee11 100644 --- a/examples/15.OPENGL3.2/01.basic.pd +++ b/examples/15.OPENGL3.2/01.basic.pd @@ -1,4 +1,4 @@ -#N canvas 145 232 1078 659 10; +#N canvas 566 216 1078 659 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -32,25 +32,14 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X msg 347 275 link \$1 \$2; -#X obj 267 189 glsl_vertex; -#X obj 267 232 glsl_fragment; -#X obj 281 45 loadbang; -#X obj 267 324 glsl_program; #X obj 267 14 gemhead; -#X msg 363 454 program \$1; -#X obj 373 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 381 490 print_attributes; -#X obj 336 346 t b f; -#X text 447 454 <----- essential for lookup functions; -#X obj 374 320 print linking; -#X obj 347 297 t a a; +#X msg 435 434 program \$1; +#X obj 433 483 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 441 489 print_attributes; +#X text 519 434 <----- essential for lookup functions; #X obj 330 560 print vb; -#X msg 385 341 bang; #X obj 44 9 declare -lib Gem; -#X obj 347 255 pack f f; -#X obj 336 368 f \$0; -#X msg 336 400 attribute position \$1_position \, attribute color \$1_color; +#X msg 384 380 attribute position \$1_position \, attribute color \$1_color; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -90,9 +79,6 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 281 104 t a a; -#X msg 312 130 open shader/\$1.vert; -#X msg 315 159 open shader/\$1.frag; #X obj 303 536 t a a; #X obj 40 175 table \$0_position 9; #X obj 40 196 table \$0_color 9; @@ -102,40 +88,28 @@ #X msg 40 341 0 1 0 0 0 1 0 0 0 1; #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; -#X msg 281 72 symbol 01.basic; #X obj 267 588 gemvertexbuffer \; resize 9 \; draw tri; -#X text 490 119 OpenGL 3.2 deprecated the fixed-function pipeline \, which was less flexible and harder to optimize \, in favor of the programmable pipeline using shaders \, allowing for more customizable and efficient rendering techniques., f 88; -#X text 491 14 OpenGL 3.2 introduced deprecation of immediate mode rendering \, encouraging the use of Vertex Buffer Objects (VBOs) and Vertex Array Objects (VAOs) for more efficient and modern graphics programming. This shift was made to improve performance and flexibility \, aligning OpenGL with contemporary GPU capabilities and programming practices., f 88; -#X text 491 80 VBOs are crucial because they represent the modern and efficient way to manage vertex data in OpenGL \, replacing the older and less performant immediate mode., f 88; -#X text 490 173 With the deprecation of the fixed-function pipeline in OpenGL 3.2 \, users must now manually handle many aspects that were previously automated \, such as matrix transformations and lighting calculations \, by writing their own shaders and managing buffers \, which offers greater control but requires more effort and understanding of the rendering process., f 88; +#X text 444 124 OpenGL 3.2 deprecated the fixed-function pipeline \, which was less flexible and harder to optimize \, in favor of the programmable pipeline using shaders \, allowing for more customizable and efficient rendering techniques., f 88; +#X text 445 19 OpenGL 3.2 introduced deprecation of immediate mode rendering \, encouraging the use of Vertex Buffer Objects (VBOs) and Vertex Array Objects (VAOs) for more efficient and modern graphics programming. This shift was made to improve performance and flexibility \, aligning OpenGL with contemporary GPU capabilities and programming practices., f 88; +#X text 445 85 VBOs are crucial because they represent the modern and efficient way to manage vertex data in OpenGL \, replacing the older and less performant immediate mode., f 88; +#X text 444 178 With the deprecation of the fixed-function pipeline in OpenGL 3.2 \, users must now manually handle many aspects that were previously automated \, such as matrix transformations and lighting calculations \, by writing their own shaders and managing buffers \, which offers greater control but requires more effort and understanding of the rendering process., f 88; +#X obj 384 331 t b; +#X obj 267 276 glsl shader/01.basic; +#X obj 384 353 \$0; +#X text 445 259 This example demonstrates how to use Vertex Buffer Objects (VBOs) in conjunction with shaders in OpenGL. It illustrates the process of creating and binding a VBO to store vertex data \, and then using a vertex shader and fragment shader to render that data., f 88; #X connect 0 0 1 0; -#X connect 2 0 14 0; -#X connect 3 0 4 0; -#X connect 3 1 18 1; -#X connect 4 0 6 0; -#X connect 4 1 18 0; -#X connect 5 0 34 0; -#X connect 6 0 35 0; -#X connect 6 1 11 0; -#X connect 7 0 3 0; -#X connect 8 0 25 0; -#X connect 10 0 25 0; -#X connect 11 0 19 0; -#X connect 11 1 8 0; -#X connect 14 0 6 0; -#X connect 14 1 13 0; -#X connect 16 0 19 0; -#X connect 18 0 2 0; -#X connect 19 0 20 0; -#X connect 20 0 25 0; -#X connect 22 0 24 0; -#X connect 22 1 23 0; -#X connect 23 0 3 0; -#X connect 24 0 4 0; -#X connect 25 0 35 0; -#X connect 25 1 15 0; -#X connect 28 0 32 0; -#X connect 31 0 30 0; -#X connect 32 0 29 0; -#X connect 33 0 31 0; -#X connect 34 0 22 0; +#X connect 2 0 26 0; +#X connect 3 0 11 0; +#X connect 5 0 11 0; +#X connect 9 0 11 0; +#X connect 11 0 20 0; +#X connect 11 1 7 0; +#X connect 14 0 18 0; +#X connect 17 0 16 0; +#X connect 18 0 15 0; +#X connect 19 0 17 0; +#X connect 25 0 27 0; +#X connect 26 0 20 0; +#X connect 26 1 3 0; +#X connect 26 1 25 0; +#X connect 27 0 9 0; diff --git a/examples/15.OPENGL3.2/02.transformation.pd b/examples/15.OPENGL3.2/02.transformation.pd index d0b00ec70..e4d4a4cfc 100644 --- a/examples/15.OPENGL3.2/02.transformation.pd +++ b/examples/15.OPENGL3.2/02.transformation.pd @@ -1,4 +1,4 @@ -#N canvas 554 90 989 704 10; +#N canvas 919 206 989 704 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -32,25 +32,15 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X msg 347 275 link \$1 \$2; -#X obj 267 199 glsl_vertex; -#X obj 267 232 glsl_fragment; -#X obj 318 106 loadbang; -#X obj 267 324 glsl_program; #X obj 267 14 gemhead; -#X msg 363 454 program \$1; -#X obj 373 484 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 381 490 print_attributes; -#X obj 336 346 t b f; -#X text 447 454 <----- essential for lookup functions; -#X obj 374 320 print linking; -#X obj 347 297 t a a; +#X msg 462 493 program \$1; +#X obj 472 523 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 480 529 print_attributes; +#X text 546 493 <----- essential for lookup functions; #X obj 330 610 print vb; -#X msg 385 341 bang; #X obj 44 9 declare -lib Gem; -#X obj 347 255 pack f f; -#X obj 336 368 f \$0; -#X msg 336 400 attribute position \$1_position \, attribute color \$1_color; +#X obj 438 437 f \$0; +#X msg 438 469 attribute position \$1_position \, attribute color \$1_color; #N canvas 171 609 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -90,9 +80,6 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 318 149 t a a; -#X msg 345 176 open shader/\$1.vert; -#X msg 345 199 open shader/\$1.frag; #X obj 303 586 t a a; #X obj 40 175 table \$0_position 9; #X obj 40 196 table \$0_color 9; @@ -102,17 +89,16 @@ #X msg 40 341 0 1 0 0 0 1 0 0 0 1; #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; -#X msg 318 127 symbol 02.transformation; -#X obj 626 18 gemhead; -#X floatatom 661 50 5 0 0 0 - - - 0; -#X floatatom 696 50 5 0 0 0 - - - 0; -#X floatatom 731 50 5 0 0 0 - - - 0; -#X floatatom 642 193 5 0 0 0 - - - 0; -#X floatatom 676 193 5 0 0 0 - - - 0; -#X floatatom 710 193 5 0 0 0 - - - 0; -#X floatatom 640 99 5 0 0 0 - - - 0; -#X floatatom 674 99 5 0 0 0 - - - 0; -#X floatatom 708 99 5 0 0 0 - - - 0; +#X obj 513 23 gemhead; +#X floatatom 548 55 5 0 0 0 - - - 0; +#X floatatom 583 55 5 0 0 0 - - - 0; +#X floatatom 618 55 5 0 0 0 - - - 0; +#X floatatom 529 198 5 0 0 0 - - - 0; +#X floatatom 563 198 5 0 0 0 - - - 0; +#X floatatom 597 198 5 0 0 0 - - - 0; +#X floatatom 527 104 5 0 0 0 - - - 0; +#X floatatom 561 104 5 0 0 0 - - - 0; +#X floatatom 595 104 5 0 0 0 - - - 0; #N canvas 437 191 753 491 shear 0; #X obj 25 17 inlet; #X obj 25 270 outlet; @@ -132,74 +118,59 @@ #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 1 0; -#X restore 626 166 pd shear; -#X obj 626 214 rotateXYZ; -#X obj 626 118 scaleXYZ; -#X floatatom 640 145 5 0 0 0 - - - 0; -#X floatatom 674 145 5 0 0 0 - - - 0; -#X floatatom 708 145 5 0 0 0 - - - 0; -#X obj 626 239 gemlist_matrix; -#X obj 707 266 list prepend transformation_matrix; -#X obj 707 288 list trim; -#X obj 626 73 translateXYZ 0 0 4; -#X text 552 530 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; +#X restore 513 171 pd shear; +#X obj 513 219 rotateXYZ; +#X obj 513 123 scaleXYZ; +#X floatatom 527 150 5 0 0 0 - - - 0; +#X floatatom 561 150 5 0 0 0 - - - 0; +#X floatatom 595 150 5 0 0 0 - - - 0; +#X obj 513 244 gemlist_matrix; +#X obj 594 271 list prepend transformation_matrix; +#X obj 594 293 list trim; +#X obj 513 78 translateXYZ 0 0 4; +#X text 563 350 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; #X obj 267 638 gemvertexbuffer \; resize 9 \; draw tri; -#X obj 267 42 translateXYZ; -#X floatatom 330 16 5 0 0 0 - - - 0; -#X text 369 15 this transformation is ignored..., f 19; -#X msg 218 303 print; -#X text 555 581 Z translation have no effect since the perspective is not yet implemented; +#X obj 267 162 translateXYZ; +#X floatatom 290 117 5 0 0 0 - - - 0; +#X text 329 116 this transformation is ignored..., f 19; +#X text 566 402 Z translation have no effect since the perspective is not yet implemented; +#X obj 438 408 t b f; +#X obj 267 377 glsl shader/02.transformation; #X connect 0 0 1 0; -#X connect 2 0 14 0; -#X connect 3 0 4 0; -#X connect 3 1 18 1; -#X connect 4 0 6 0; -#X connect 4 1 18 0; -#X connect 5 0 34 0; -#X connect 6 0 56 0; -#X connect 6 1 11 0; -#X connect 7 0 57 0; -#X connect 8 0 25 0; -#X connect 10 0 25 0; -#X connect 11 0 19 0; -#X connect 11 1 8 0; -#X connect 14 0 6 0; -#X connect 14 1 13 0; -#X connect 16 0 19 0; -#X connect 18 0 2 0; -#X connect 19 0 20 0; -#X connect 20 0 25 0; -#X connect 22 0 24 0; -#X connect 22 1 23 0; -#X connect 23 0 3 0; -#X connect 24 0 4 0; -#X connect 25 0 56 0; -#X connect 25 1 15 0; -#X connect 28 0 32 0; -#X connect 31 0 30 0; -#X connect 32 0 29 0; +#X connect 2 0 43 0; +#X connect 3 0 12 0; +#X connect 5 0 12 0; +#X connect 9 0 10 0; +#X connect 10 0 12 0; +#X connect 12 0 42 0; +#X connect 12 1 7 0; +#X connect 15 0 19 0; +#X connect 18 0 17 0; +#X connect 19 0 16 0; +#X connect 20 0 18 0; +#X connect 21 0 40 0; +#X connect 22 0 40 1; +#X connect 23 0 40 2; +#X connect 24 0 40 3; +#X connect 25 0 32 1; +#X connect 26 0 32 2; +#X connect 27 0 32 3; +#X connect 28 0 33 1; +#X connect 29 0 33 2; +#X connect 30 0 33 3; +#X connect 31 0 32 0; +#X connect 32 0 37 0; #X connect 33 0 31 0; -#X connect 34 0 22 0; -#X connect 35 0 54 0; -#X connect 36 0 54 1; -#X connect 37 0 54 2; -#X connect 38 0 54 3; -#X connect 39 0 46 1; -#X connect 40 0 46 2; -#X connect 41 0 46 3; -#X connect 42 0 47 1; -#X connect 43 0 47 2; -#X connect 44 0 47 3; -#X connect 45 0 46 0; -#X connect 46 0 51 0; -#X connect 47 0 45 0; -#X connect 48 0 45 1; -#X connect 49 0 45 2; -#X connect 50 0 45 3; -#X connect 51 1 52 0; -#X connect 52 0 53 0; -#X connect 53 0 6 0; -#X connect 54 0 47 0; -#X connect 57 0 3 0; -#X connect 58 0 57 1; -#X connect 60 0 6 0; +#X connect 34 0 31 1; +#X connect 35 0 31 2; +#X connect 36 0 31 3; +#X connect 37 1 38 0; +#X connect 38 0 39 0; +#X connect 39 0 48 1; +#X connect 40 0 33 0; +#X connect 43 0 48 0; +#X connect 44 0 43 1; +#X connect 47 0 9 0; +#X connect 47 1 3 0; +#X connect 48 0 42 0; +#X connect 48 1 47 0; diff --git a/examples/15.OPENGL3.2/03.texture.pd b/examples/15.OPENGL3.2/03.texture.pd index b07cf8cf4..96fe20a6a 100644 --- a/examples/15.OPENGL3.2/03.texture.pd +++ b/examples/15.OPENGL3.2/03.texture.pd @@ -32,21 +32,14 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X msg 507 375 link \$1 \$2; -#X obj 427 309 glsl_vertex; -#X obj 427 332 glsl_fragment; -#X obj 441 182 loadbang; #X obj 427 14 gemhead; #X msg 529 554 program \$1; #X obj 523 584 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 531 590 print_attributes; #X obj 502 466 t b f; #X text 607 554 <----- essential for lookup functions; -#X obj 534 420 print linking; -#X obj 507 397 t a a; #X obj 490 650 print vb; #X obj 44 9 declare -lib Gem; -#X obj 507 355 pack f f; #X obj 502 488 f \$0; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; @@ -87,14 +80,10 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 441 224 t a a; -#X msg 468 250 open shader/\$1.vert; -#X msg 471 279 open shader/\$1.frag; #X obj 463 626 t a a; #X obj 41 235 loadbang; #X obj 41 283 s \$0_position; #X obj 40 317 loadbang; -#X msg 441 203 symbol 03.texture; #X obj 427 42 pix_image ../data/img1.jpg; #X obj 427 67 pix_texture; #X msg 41 260 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 0.8 0 0.8 -0.8 0; @@ -103,48 +92,38 @@ #X obj 40 364 s \$0_texcoord; #X msg 502 510 attribute position \$1_position \, attribute texcoord \$1_texcoord, f 63; #X obj 427 103 pix_image ../data/img2.jpg; -#X floatatom 682 333 5 0 1 0 - - - 0; -#X msg 682 356 mix_factor \$1; +#X floatatom 556 228 5 0 1 0 - - - 0; +#X msg 556 251 mix_factor \$1; #X msg 40 341 0 0 1 0 0 1 0 1 1; #X obj 427 128 pix_texture \; texunit 1; -#X msg 542 323 bang; #X obj 427 678 gemvertexbuffer \; draw quad; -#X obj 427 424 glsl_program \; Texture2 1; -#X text 46 430 Using textures did not change; +#X text 597 227 <--------------------; +#X obj 427 285 glsl shader/03.texture; +#X msg 445 258 print; +#X msg 613 319 Texture2 1; +#X text 46 430 Using textures did not really change; #X connect 0 0 1 0; -#X connect 2 0 13 0; -#X connect 3 0 4 0; -#X connect 3 1 16 1; -#X connect 4 0 41 0; -#X connect 4 1 16 0; -#X connect 5 0 26 0; -#X connect 6 0 27 0; -#X connect 7 0 22 0; -#X connect 9 0 22 0; -#X connect 10 0 17 0; -#X connect 10 1 7 0; -#X connect 13 0 41 0; -#X connect 13 1 12 0; -#X connect 16 0 2 0; -#X connect 17 0 33 0; -#X connect 19 0 21 0; -#X connect 19 1 20 0; -#X connect 20 0 3 0; -#X connect 21 0 4 0; -#X connect 22 0 40 0; -#X connect 22 1 14 0; -#X connect 23 0 29 0; -#X connect 25 0 37 0; -#X connect 26 0 19 0; -#X connect 27 0 28 0; -#X connect 28 0 34 0; -#X connect 29 0 24 0; -#X connect 33 0 22 0; -#X connect 34 0 38 0; -#X connect 35 0 36 0; -#X connect 36 0 41 0; -#X connect 37 0 32 0; -#X connect 38 0 3 0; -#X connect 39 0 16 0; -#X connect 41 0 40 0; -#X connect 41 1 10 0; +#X connect 2 0 16 0; +#X connect 3 0 12 0; +#X connect 5 0 12 0; +#X connect 6 0 10 0; +#X connect 6 1 3 0; +#X connect 10 0 22 0; +#X connect 12 0 28 0; +#X connect 12 1 8 0; +#X connect 13 0 18 0; +#X connect 15 0 26 0; +#X connect 16 0 17 0; +#X connect 17 0 23 0; +#X connect 18 0 14 0; +#X connect 22 0 12 0; +#X connect 23 0 27 0; +#X connect 24 0 25 0; +#X connect 25 0 30 1; +#X connect 26 0 21 0; +#X connect 27 0 30 0; +#X connect 30 0 28 0; +#X connect 30 1 6 0; +#X connect 30 1 32 0; +#X connect 31 0 30 0; +#X connect 32 0 30 1; diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.OPENGL3.2/04.model.pd index 7484d34ff..b9362cca5 100644 --- a/examples/15.OPENGL3.2/04.model.pd +++ b/examples/15.OPENGL3.2/04.model.pd @@ -1,4 +1,4 @@ -#N canvas 725 113 967 800 10; +#N canvas 445 103 967 800 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -32,20 +32,13 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X msg 347 275 link \$1 \$2; -#X obj 267 199 glsl_vertex; -#X obj 267 232 glsl_fragment; -#X obj 318 106 loadbang; #X obj 267 14 gemhead; -#X msg 428 590 program \$1; -#X obj 373 624 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 381 630 print_attributes; -#X obj 402 467 t b f; -#X obj 374 320 print linking; -#X obj 347 297 t a a; +#X msg 410 590 program \$1; +#X obj 423 624 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 431 630 print_attributes; +#X obj 384 467 t b f; #X obj 330 690 print vb; #X obj 44 9 declare -lib Gem; -#X obj 347 255 pack f f; #N canvas 171 609 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -85,9 +78,6 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 318 149 t a a; -#X msg 345 176 open shader/\$1.vert; -#X msg 345 199 open shader/\$1.frag; #X obj 303 666 t a a; #X obj 582 18 gemhead; #X floatatom 617 50 5 0 0 0 - - - 0; @@ -104,7 +94,6 @@ #X obj 267 42 translateXYZ; #X floatatom 330 16 5 0 0 0 - - - 0; #X text 369 15 this transformation is ignored..., f 19; -#X msg 285 303 print; #N canvas 1001 526 302 371 table 0; #X obj 29 30 table table_posX; #X obj 29 53 table table_posY; @@ -154,50 +143,37 @@ #X connect 14 0 12 0; #X connect 15 0 13 0; #X restore 40 205 pd modelfiler; -#X msg 318 127 symbol 04.model; #X obj 582 118 scaleXYZ 0.003 0.003 0.003; -#X obj 267 349 glsl_program \; LightPosition 5 3 1 1 \; LightL 1 1 1 \; LightLa 1 1 1 \; MaterialKa 0.5 0.5 0.5 \; MaterialKd 0.1 0.1 0.1 \; MaterialKs 0.3 0.3 0.3 \; MaterialShininess 30; -#X msg 402 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; +#X msg 384 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; #X obj 267 718 gemvertexbuffer \; draw tri; #X text 23 253 modelfiler load a 3d object into tables. So the pipeline is unchange regarding previous examples, f 36; +#X msg 449 347 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.5 0.5 0.5 \, MaterialKd 0.1 0.1 0.1 \, MaterialKs 0.3 0.3 0.3 \, MaterialShininess 30; +#X obj 267 310 glsl shader/04.model; #X connect 0 0 1 0; -#X connect 2 0 12 0; -#X connect 3 0 4 0; -#X connect 3 1 15 1; -#X connect 4 0 41 0; -#X connect 4 1 15 0; -#X connect 5 0 39 0; -#X connect 6 0 33 0; -#X connect 7 0 20 0; -#X connect 9 0 20 0; -#X connect 10 0 42 0; +#X connect 2 0 23 0; +#X connect 3 0 10 0; +#X connect 5 0 10 0; +#X connect 6 0 29 0; +#X connect 6 1 3 0; +#X connect 10 0 30 0; #X connect 10 1 7 0; -#X connect 12 0 41 0; -#X connect 12 1 11 0; -#X connect 15 0 2 0; -#X connect 17 0 19 0; -#X connect 17 1 18 0; -#X connect 18 0 3 0; -#X connect 19 0 4 0; -#X connect 20 0 43 0; -#X connect 20 1 13 0; -#X connect 21 0 32 0; -#X connect 22 0 32 1; -#X connect 23 0 32 2; -#X connect 24 0 32 3; -#X connect 25 0 28 1; -#X connect 26 0 28 2; -#X connect 27 0 28 3; -#X connect 28 0 29 0; -#X connect 29 1 30 0; -#X connect 30 0 31 0; -#X connect 31 0 41 0; -#X connect 32 0 40 0; -#X connect 33 0 3 0; -#X connect 34 0 33 1; -#X connect 36 0 41 0; -#X connect 39 0 17 0; -#X connect 40 0 28 0; -#X connect 41 0 43 0; -#X connect 41 1 10 0; -#X connect 42 0 20 0; +#X connect 11 0 22 0; +#X connect 12 0 22 1; +#X connect 13 0 22 2; +#X connect 14 0 22 3; +#X connect 15 0 18 1; +#X connect 16 0 18 2; +#X connect 17 0 18 3; +#X connect 18 0 19 0; +#X connect 19 1 20 0; +#X connect 20 0 21 0; +#X connect 21 0 33 1; +#X connect 22 0 28 0; +#X connect 23 0 33 0; +#X connect 24 0 23 1; +#X connect 28 0 18 0; +#X connect 29 0 10 0; +#X connect 32 0 33 1; +#X connect 33 0 30 0; +#X connect 33 1 6 0; +#X connect 33 1 32 0; From 5bae4adde5250b73372737853c9a3cbe1ac089bd Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 09:57:26 +0200 Subject: [PATCH 312/387] simplify the example --- examples/15.OPENGL3.2/04.model.pd | 81 +++++++++++----------- examples/15.OPENGL3.2/shader/04.model.frag | 30 +------- 2 files changed, 41 insertions(+), 70 deletions(-) diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.OPENGL3.2/04.model.pd index b9362cca5..25be5d66d 100644 --- a/examples/15.OPENGL3.2/04.model.pd +++ b/examples/15.OPENGL3.2/04.model.pd @@ -1,4 +1,4 @@ -#N canvas 445 103 967 800 10; +#N canvas 590 97 967 800 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -30,15 +30,15 @@ #X connect 6 0 8 0; #X connect 7 0 5 0; #X connect 8 0 7 0; -#X restore 44 104 pd fps; -#X floatatom 44 127 5 0 0 1 fps - - 0; -#X obj 267 14 gemhead; -#X msg 410 590 program \$1; -#X obj 423 624 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 431 630 print_attributes; -#X obj 384 467 t b f; -#X obj 330 690 print vb; -#X obj 44 9 declare -lib Gem; +#X restore 44 158 pd fps; +#X floatatom 44 181 5 0 0 1 fps - - 0; +#X obj 267 104 gemhead; +#X msg 410 570 program \$1; +#X obj 423 604 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 431 610 print_attributes; +#X obj 384 447 t b f; +#X obj 330 670 print vb; +#X obj 44 63 declare -lib Gem; #N canvas 171 609 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -77,23 +77,23 @@ #X connect 15 0 16 0; #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; -#X restore 42 51 pd gemwin; -#X obj 303 666 t a a; -#X obj 582 18 gemhead; -#X floatatom 617 50 5 0 0 0 - - - 0; -#X floatatom 652 50 5 0 0 0 - - - 0; -#X floatatom 687 50 5 0 0 0 - - - 0; -#X floatatom 598 163 5 0 0 0 - - - 0; -#X floatatom 632 163 5 0 0 0 - - - 0; -#X floatatom 666 163 5 0 0 0 - - - 0; -#X obj 582 184 rotateXYZ; -#X obj 582 209 gemlist_matrix; -#X obj 663 236 list prepend transformation_matrix; -#X obj 663 258 list trim; -#X obj 582 73 translateXYZ 0 0 4; -#X obj 267 42 translateXYZ; -#X floatatom 330 16 5 0 0 0 - - - 0; -#X text 369 15 this transformation is ignored..., f 19; +#X restore 42 105 pd gemwin; +#X obj 303 646 t a a; +#X obj 582 108 gemhead; +#X floatatom 617 140 5 0 0 0 - - - 0; +#X floatatom 652 140 5 0 0 0 - - - 0; +#X floatatom 687 140 5 0 0 0 - - - 0; +#X floatatom 598 253 5 0 0 0 - - - 0; +#X floatatom 632 253 5 0 0 0 - - - 0; +#X floatatom 666 253 5 0 0 0 - - - 0; +#X obj 582 274 rotateXYZ; +#X obj 582 299 gemlist_matrix; +#X obj 663 326 list prepend transformation_matrix; +#X obj 663 348 list trim; +#X obj 582 163 translateXYZ 0 0 4; +#X obj 267 132 translateXYZ; +#X floatatom 330 106 5 0 0 0 - - - 0; +#X text 369 105 this transformation is ignored..., f 19; #N canvas 1001 526 302 371 table 0; #X obj 29 30 table table_posX; #X obj 29 53 table table_posY; @@ -104,7 +104,7 @@ #X obj 28 195 table table_colorR; #X obj 28 215 table table_colorG; #X obj 28 235 table table_colorB; -#X restore 42 175 pd table; +#X restore 42 229 pd table; #N canvas 1279 243 543 538 modelfiler 0; #X obj 81 277 modelfiler; #X msg 106 132 position table_pos; @@ -142,13 +142,13 @@ #X connect 10 0 11 0; #X connect 14 0 12 0; #X connect 15 0 13 0; -#X restore 40 205 pd modelfiler; -#X obj 582 118 scaleXYZ 0.003 0.003 0.003; -#X msg 384 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; -#X obj 267 718 gemvertexbuffer \; draw tri; -#X text 23 253 modelfiler load a 3d object into tables. So the pipeline is unchange regarding previous examples, f 36; -#X msg 449 347 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.5 0.5 0.5 \, MaterialKd 0.1 0.1 0.1 \, MaterialKs 0.3 0.3 0.3 \, MaterialShininess 30; -#X obj 267 310 glsl shader/04.model; +#X restore 40 259 pd modelfiler; +#X obj 582 208 scaleXYZ 0.003 0.003 0.003; +#X msg 384 472 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; +#X obj 267 698 gemvertexbuffer \; draw tri; +#X obj 267 400 glsl shader/04.model; +#X obj 287 369 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X text 259 19 modelfiler load a 3d object into tables. The pipeline is unchange regarding previous examples, f 93; #X connect 0 0 1 0; #X connect 2 0 23 0; #X connect 3 0 10 0; @@ -167,13 +167,12 @@ #X connect 18 0 19 0; #X connect 19 1 20 0; #X connect 20 0 21 0; -#X connect 21 0 33 1; +#X connect 21 0 31 1; #X connect 22 0 28 0; -#X connect 23 0 33 0; +#X connect 23 0 31 0; #X connect 24 0 23 1; #X connect 28 0 18 0; #X connect 29 0 10 0; -#X connect 32 0 33 1; -#X connect 33 0 30 0; -#X connect 33 1 6 0; -#X connect 33 1 32 0; +#X connect 31 0 30 0; +#X connect 31 1 6 0; +#X connect 32 0 31 0; diff --git a/examples/15.OPENGL3.2/shader/04.model.frag b/examples/15.OPENGL3.2/shader/04.model.frag index b696daa16..2d539f8b2 100644 --- a/examples/15.OPENGL3.2/shader/04.model.frag +++ b/examples/15.OPENGL3.2/shader/04.model.frag @@ -1,38 +1,10 @@ #version 460 // Cyrille Henry 2024 -// light description -uniform vec4 LightPosition; // Light position in eye coords. -uniform vec3 LightLa; // Ambient light intensity -uniform vec3 LightL; // Diffuse and specular light intensity - -// material definition -uniform vec3 MaterialKa; // Ambient reflectivity -uniform vec3 MaterialKd; // Diffuse reflectivity -uniform vec3 MaterialKs; // Specular reflectivity -uniform float MaterialShininess; // Specular shininess factor - in vec4 Color; -in vec3 Normal; -in vec4 Position; out vec4 FragColor; -// The only output of this shader : the color of the pixel - -vec3 blinnPhong( vec3 position, vec3 n) { - vec3 ambient = LightLa * MaterialKa; - vec3 s = normalize( LightPosition.xyz - position ); - float sDotN = max( dot(s,n), 0.0 ); - vec3 diffuse = MaterialKd * sDotN; - vec3 spec = vec3(0.0); - if( sDotN > 0.0 ) { - vec3 v = normalize(-position.xyz); - vec3 h = normalize( v + s ); - spec = MaterialKs * pow( max( dot(h,n), 0.0 ), MaterialShininess ); - } - return ambient + LightL * (diffuse + spec); -} void main() { - FragColor = Color * vec4(blinnPhong(Position.xyz, normalize(Normal)), 1.); + FragColor = Color; } From 81da31796cbb3a07968bc66e4e8c1696b93f7df7 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 10:03:32 +0200 Subject: [PATCH 313/387] Lighting example using Blinn Phong model --- examples/15.OPENGL3.2/08.lighting.pd | 179 +++++++++++++++++++++ examples/15.OPENGL3.2/shader/08.light.frag | 38 +++++ examples/15.OPENGL3.2/shader/08.light.vert | 29 ++++ 3 files changed, 246 insertions(+) create mode 100644 examples/15.OPENGL3.2/08.lighting.pd create mode 100644 examples/15.OPENGL3.2/shader/08.light.frag create mode 100644 examples/15.OPENGL3.2/shader/08.light.vert diff --git a/examples/15.OPENGL3.2/08.lighting.pd b/examples/15.OPENGL3.2/08.lighting.pd new file mode 100644 index 000000000..844dcde3e --- /dev/null +++ b/examples/15.OPENGL3.2/08.lighting.pd @@ -0,0 +1,179 @@ +#N canvas 445 103 967 800 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X obj 267 74 gemhead; +#X msg 410 590 program \$1; +#X obj 423 624 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 431 630 print_attributes; +#X obj 384 467 t b f; +#X obj 330 690 print vb; +#X obj 44 9 declare -lib Gem; +#N canvas 171 609 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 303 666 t a a; +#X obj 582 78 gemhead; +#X floatatom 617 110 5 0 0 0 - - - 0; +#X floatatom 652 110 5 0 0 0 - - - 0; +#X floatatom 687 110 5 0 0 0 - - - 0; +#X floatatom 598 223 5 0 0 0 - - - 0; +#X floatatom 632 223 5 0 0 0 - - - 0; +#X floatatom 666 223 5 0 0 0 - - - 0; +#X obj 582 244 rotateXYZ; +#X obj 582 269 gemlist_matrix; +#X obj 663 296 list prepend transformation_matrix; +#X obj 663 318 list trim; +#X obj 582 133 translateXYZ 0 0 4; +#X obj 267 102 translateXYZ; +#X floatatom 330 76 5 0 0 0 - - - 0; +#X text 369 75 this transformation is ignored..., f 19; +#N canvas 1001 526 302 371 table 0; +#X obj 29 30 table table_posX; +#X obj 29 53 table table_posY; +#X obj 29 76 table table_posZ; +#X obj 27 113 table table_normalX; +#X obj 27 136 table table_normalY; +#X obj 27 159 table table_normalZ; +#X obj 28 195 table table_colorR; +#X obj 28 215 table table_colorG; +#X obj 28 235 table table_colorB; +#X restore 42 175 pd table; +#N canvas 1279 243 543 538 modelfiler 0; +#X obj 81 277 modelfiler; +#X msg 106 132 position table_pos; +#X msg 118 158 color table_color; +#X msg 136 212 normal table_normal; +#X obj 81 25 loadbang; +#X obj 144 24 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X msg 81 95 open ../data/venus.obj; +#X obj 81 303 route vertices; +#X msg 81 332 resize \$1; +#X obj 81 55 t b b b; +#X msg 201 361 sinesum 8192 0.5 0.25 0.25 0 0.2; +#X obj 91 419 s table_colorR; +#X obj 91 449 s table_colorG; +#X obj 91 479 s table_colorB; +#X msg 219 383 sinesum 8192 0.5 -0.25 0.25 0 0.2; +#X msg 235 409 sinesum 8192 0.5 0.25 -0.25 0 0.2; +#X connect 0 0 7 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 4 0 9 0; +#X connect 5 0 9 0; +#X connect 6 0 0 0; +#X connect 7 0 8 0; +#X connect 8 0 11 0; +#X connect 8 0 12 0; +#X connect 8 0 13 0; +#X connect 9 0 6 0; +#X connect 9 1 1 0; +#X connect 9 1 3 0; +#X connect 9 2 10 0; +#X connect 9 2 14 0; +#X connect 9 2 15 0; +#X connect 10 0 11 0; +#X connect 14 0 12 0; +#X connect 15 0 13 0; +#X restore 40 205 pd modelfiler; +#X obj 582 178 scaleXYZ 0.003 0.003 0.003; +#X msg 384 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; +#X obj 267 718 gemvertexbuffer \; draw tri; +#X obj 267 370 glsl shader/08.light; +#X msg 449 407 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.5 0.5 0.5 \, MaterialKd 0.1 0.1 0.1 \, MaterialKs 0.3 0.3 0.3 \, MaterialShininess 30; +#X text 269 10 This example introduces the Blinn-Phong lighting model \, which enhances flexibility \, improves light quality \, and optimizes rendering performance compared to the older fixed-function pipeline., f 102; +#X connect 0 0 1 0; +#X connect 2 0 23 0; +#X connect 3 0 10 0; +#X connect 5 0 10 0; +#X connect 6 0 29 0; +#X connect 6 1 3 0; +#X connect 10 0 30 0; +#X connect 10 1 7 0; +#X connect 11 0 22 0; +#X connect 12 0 22 1; +#X connect 13 0 22 2; +#X connect 14 0 22 3; +#X connect 15 0 18 1; +#X connect 16 0 18 2; +#X connect 17 0 18 3; +#X connect 18 0 19 0; +#X connect 19 1 20 0; +#X connect 20 0 21 0; +#X connect 21 0 31 1; +#X connect 22 0 28 0; +#X connect 23 0 31 0; +#X connect 24 0 23 1; +#X connect 28 0 18 0; +#X connect 29 0 10 0; +#X connect 31 0 30 0; +#X connect 31 1 6 0; +#X connect 31 1 32 0; +#X connect 32 0 31 1; diff --git a/examples/15.OPENGL3.2/shader/08.light.frag b/examples/15.OPENGL3.2/shader/08.light.frag new file mode 100644 index 000000000..b696daa16 --- /dev/null +++ b/examples/15.OPENGL3.2/shader/08.light.frag @@ -0,0 +1,38 @@ +#version 460 +// Cyrille Henry 2024 + +// light description +uniform vec4 LightPosition; // Light position in eye coords. +uniform vec3 LightLa; // Ambient light intensity +uniform vec3 LightL; // Diffuse and specular light intensity + +// material definition +uniform vec3 MaterialKa; // Ambient reflectivity +uniform vec3 MaterialKd; // Diffuse reflectivity +uniform vec3 MaterialKs; // Specular reflectivity +uniform float MaterialShininess; // Specular shininess factor + +in vec4 Color; +in vec3 Normal; +in vec4 Position; + +out vec4 FragColor; +// The only output of this shader : the color of the pixel + +vec3 blinnPhong( vec3 position, vec3 n) { + vec3 ambient = LightLa * MaterialKa; + vec3 s = normalize( LightPosition.xyz - position ); + float sDotN = max( dot(s,n), 0.0 ); + vec3 diffuse = MaterialKd * sDotN; + vec3 spec = vec3(0.0); + if( sDotN > 0.0 ) { + vec3 v = normalize(-position.xyz); + vec3 h = normalize( v + s ); + spec = MaterialKs * pow( max( dot(h,n), 0.0 ), MaterialShininess ); + } + return ambient + LightL * (diffuse + spec); +} + +void main() { + FragColor = Color * vec4(blinnPhong(Position.xyz, normalize(Normal)), 1.); +} diff --git a/examples/15.OPENGL3.2/shader/08.light.vert b/examples/15.OPENGL3.2/shader/08.light.vert new file mode 100644 index 000000000..421b0735d --- /dev/null +++ b/examples/15.OPENGL3.2/shader/08.light.vert @@ -0,0 +1,29 @@ +#version 460 + +// Cyrille Henry 2024 + + +layout (location=0) in float positionX; +layout (location=1) in float positionY; +layout (location=2) in float positionZ; +layout (location=3) in float normal_X; +layout (location=4) in float normal_Y; +layout (location=5) in float normal_Z; +layout (location=6) in float colorR; +layout (location=7) in float colorG; +layout (location=8) in float colorB; + +uniform mat4 transformation_matrix; + +out vec4 Color; +out vec3 Normal; +out vec4 Position; + +void main() +{ + Color = vec4(colorR, colorG, colorB, 1.); + Normal = vec3(normal_X, normal_Y, normal_Z); + vec3 pos = vec3(positionX, positionY, positionZ); + Position = transformation_matrix * vec4(pos,1.0); + gl_Position = Position; +} From 5df9e57ddb2c2b774578de995798a3d59ee5a4a6 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 11:26:52 +0200 Subject: [PATCH 314/387] remove unused variables --- examples/15.OPENGL3.2/04.model.pd | 18 +++++++++--------- examples/15.OPENGL3.2/shader/04.model.vert | 10 +++------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.OPENGL3.2/04.model.pd index 25be5d66d..f778d582d 100644 --- a/examples/15.OPENGL3.2/04.model.pd +++ b/examples/15.OPENGL3.2/04.model.pd @@ -1,4 +1,4 @@ -#N canvas 590 97 967 800 10; +#N canvas 774 83 967 800 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -144,18 +144,18 @@ #X connect 15 0 13 0; #X restore 40 259 pd modelfiler; #X obj 582 208 scaleXYZ 0.003 0.003 0.003; -#X msg 384 472 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; #X obj 267 698 gemvertexbuffer \; draw tri; #X obj 267 400 glsl shader/04.model; #X obj 287 369 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X text 259 19 modelfiler load a 3d object into tables. The pipeline is unchange regarding previous examples, f 93; +#X msg 384 472 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; #X connect 0 0 1 0; #X connect 2 0 23 0; #X connect 3 0 10 0; #X connect 5 0 10 0; -#X connect 6 0 29 0; +#X connect 6 0 33 0; #X connect 6 1 3 0; -#X connect 10 0 30 0; +#X connect 10 0 29 0; #X connect 10 1 7 0; #X connect 11 0 22 0; #X connect 12 0 22 1; @@ -167,12 +167,12 @@ #X connect 18 0 19 0; #X connect 19 1 20 0; #X connect 20 0 21 0; -#X connect 21 0 31 1; +#X connect 21 0 30 1; #X connect 22 0 28 0; -#X connect 23 0 31 0; +#X connect 23 0 30 0; #X connect 24 0 23 1; #X connect 28 0 18 0; -#X connect 29 0 10 0; +#X connect 30 0 29 0; +#X connect 30 1 6 0; #X connect 31 0 30 0; -#X connect 31 1 6 0; -#X connect 32 0 31 0; +#X connect 33 0 10 0; diff --git a/examples/15.OPENGL3.2/shader/04.model.vert b/examples/15.OPENGL3.2/shader/04.model.vert index 421b0735d..d0f9c27ee 100644 --- a/examples/15.OPENGL3.2/shader/04.model.vert +++ b/examples/15.OPENGL3.2/shader/04.model.vert @@ -6,12 +6,9 @@ layout (location=0) in float positionX; layout (location=1) in float positionY; layout (location=2) in float positionZ; -layout (location=3) in float normal_X; -layout (location=4) in float normal_Y; -layout (location=5) in float normal_Z; -layout (location=6) in float colorR; -layout (location=7) in float colorG; -layout (location=8) in float colorB; +layout (location=3) in float colorR; +layout (location=4) in float colorG; +layout (location=5) in float colorB; uniform mat4 transformation_matrix; @@ -22,7 +19,6 @@ out vec4 Position; void main() { Color = vec4(colorR, colorG, colorB, 1.); - Normal = vec3(normal_X, normal_Y, normal_Z); vec3 pos = vec3(positionX, positionY, positionZ); Position = transformation_matrix * vec4(pos,1.0); gl_Position = Position; From a3cee53e04325237ee451de0d67176933bebf3da Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 11:29:04 +0200 Subject: [PATCH 315/387] rotate also the normal of the model, so light apear fixed --- examples/15.OPENGL3.2/shader/08.light.vert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/15.OPENGL3.2/shader/08.light.vert b/examples/15.OPENGL3.2/shader/08.light.vert index 421b0735d..25d480981 100644 --- a/examples/15.OPENGL3.2/shader/08.light.vert +++ b/examples/15.OPENGL3.2/shader/08.light.vert @@ -22,7 +22,7 @@ out vec4 Position; void main() { Color = vec4(colorR, colorG, colorB, 1.); - Normal = vec3(normal_X, normal_Y, normal_Z); + Normal = (transformation_matrix * vec4(normal_X, normal_Y, normal_Z, 1.)).xyz; vec3 pos = vec3(positionX, positionY, positionZ); Position = transformation_matrix * vec4(pos,1.0); gl_Position = Position; From 0ca9362f37ca11a0422d631140d086d12998f7e7 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 11:29:14 +0200 Subject: [PATCH 316/387] clean --- examples/15.OPENGL3.2/08.lighting.pd | 65 +++++++++++++++------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/examples/15.OPENGL3.2/08.lighting.pd b/examples/15.OPENGL3.2/08.lighting.pd index 844dcde3e..fd8f2d604 100644 --- a/examples/15.OPENGL3.2/08.lighting.pd +++ b/examples/15.OPENGL3.2/08.lighting.pd @@ -79,21 +79,18 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; #X obj 303 666 t a a; -#X obj 582 78 gemhead; -#X floatatom 617 110 5 0 0 0 - - - 0; -#X floatatom 652 110 5 0 0 0 - - - 0; -#X floatatom 687 110 5 0 0 0 - - - 0; -#X floatatom 598 223 5 0 0 0 - - - 0; -#X floatatom 632 223 5 0 0 0 - - - 0; -#X floatatom 666 223 5 0 0 0 - - - 0; -#X obj 582 244 rotateXYZ; -#X obj 582 269 gemlist_matrix; -#X obj 663 296 list prepend transformation_matrix; -#X obj 663 318 list trim; -#X obj 582 133 translateXYZ 0 0 4; -#X obj 267 102 translateXYZ; -#X floatatom 330 76 5 0 0 0 - - - 0; -#X text 369 75 this transformation is ignored..., f 19; +#X obj 401 77 gemhead; +#X floatatom 436 109 5 0 0 0 - - - 0; +#X floatatom 471 109 5 0 0 0 - - - 0; +#X floatatom 506 109 5 0 0 0 - - - 0; +#X floatatom 417 222 5 0 0 0 - - - 0; +#X floatatom 451 222 5 0 0 0 - - - 0; +#X floatatom 485 222 5 0 0 0 - - - 0; +#X obj 401 243 rotateXYZ; +#X obj 401 268 gemlist_matrix; +#X obj 482 295 list prepend transformation_matrix; +#X obj 482 317 list trim; +#X obj 401 132 translateXYZ 0 0 4; #N canvas 1001 526 302 371 table 0; #X obj 29 30 table table_posX; #X obj 29 53 table table_posY; @@ -143,19 +140,23 @@ #X connect 14 0 12 0; #X connect 15 0 13 0; #X restore 40 205 pd modelfiler; -#X obj 582 178 scaleXYZ 0.003 0.003 0.003; +#X obj 401 177 scaleXYZ 0.003 0.003 0.003; #X msg 384 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; #X obj 267 718 gemvertexbuffer \; draw tri; #X obj 267 370 glsl shader/08.light; -#X msg 449 407 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.5 0.5 0.5 \, MaterialKd 0.1 0.1 0.1 \, MaterialKs 0.3 0.3 0.3 \, MaterialShininess 30; -#X text 269 10 This example introduces the Blinn-Phong lighting model \, which enhances flexibility \, improves light quality \, and optimizes rendering performance compared to the older fixed-function pipeline., f 102; +#X text 269 10 This example introduces the Blinn-Phong lighting model \, which enhances flexibility \, improves light quality \, and optimizes rendering performance compared to the older fixed-function pipeline., f 86; +#X msg 726 249 5 3 1 1; +#X listbox 726 276 20 0 0 0 - - - 0; +#X msg 726 303 LightPosition \$1 \$2 \$3 \$4; +#X msg 448 407 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.3 0.3 0.3 \, MaterialKd 0.1 0.1 0.1 \, MaterialKs 0.3 0.3 0.3 \, MaterialShininess 0.1; +#X obj 288 333 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X connect 0 0 1 0; -#X connect 2 0 23 0; +#X connect 2 0 28 0; #X connect 3 0 10 0; #X connect 5 0 10 0; -#X connect 6 0 29 0; +#X connect 6 0 26 0; #X connect 6 1 3 0; -#X connect 10 0 30 0; +#X connect 10 0 27 0; #X connect 10 1 7 0; #X connect 11 0 22 0; #X connect 12 0 22 1; @@ -167,13 +168,15 @@ #X connect 18 0 19 0; #X connect 19 1 20 0; #X connect 20 0 21 0; -#X connect 21 0 31 1; -#X connect 22 0 28 0; -#X connect 23 0 31 0; -#X connect 24 0 23 1; -#X connect 28 0 18 0; -#X connect 29 0 10 0; -#X connect 31 0 30 0; -#X connect 31 1 6 0; -#X connect 31 1 32 0; -#X connect 32 0 31 1; +#X connect 21 0 28 1; +#X connect 22 0 25 0; +#X connect 25 0 18 0; +#X connect 26 0 10 0; +#X connect 28 0 27 0; +#X connect 28 1 6 0; +#X connect 28 1 33 0; +#X connect 30 0 31 0; +#X connect 31 0 32 0; +#X connect 32 0 28 1; +#X connect 33 0 28 1; +#X connect 34 0 28 0; From 1d4dd1faec56815c574730fe281dfe020c6fd550 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 11:29:27 +0200 Subject: [PATCH 317/387] clean --- examples/15.OPENGL3.2/shader/02.transformation.vert | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/15.OPENGL3.2/shader/02.transformation.vert b/examples/15.OPENGL3.2/shader/02.transformation.vert index 640e3ba80..465e52885 100644 --- a/examples/15.OPENGL3.2/shader/02.transformation.vert +++ b/examples/15.OPENGL3.2/shader/02.transformation.vert @@ -17,7 +17,6 @@ uniform mat4 transformation_matrix; // In this example, we use gemlist_matrix in the patch to get the transformation matrix. // The perspective matrix (set with the perspec message to gemwin) is not used. - out vec3 Color_to_frag; // the output of this shader is only a color. // This variable will be interpolated between all vertices From 1df47d2a862376e9a16ec8157a1585f0fcd97057 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 11:29:50 +0200 Subject: [PATCH 318/387] debug wrong connection --- abstractions/_glsl.compile.pd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abstractions/_glsl.compile.pd b/abstractions/_glsl.compile.pd index 7d55b9f73..50e73125f 100644 --- a/abstractions/_glsl.compile.pd +++ b/abstractions/_glsl.compile.pd @@ -77,4 +77,4 @@ #X connect 19 1 11 0; #X connect 20 0 9 0; #X connect 20 1 13 0; -#X connect 21 1 0 0; +#X connect 21 1 3 0; From c3152fb4043ec1a2dd6b2f9195f724aac9f981c7 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 12:20:14 +0200 Subject: [PATCH 319/387] 1st draft of a help file --- help/modelfiler-help.pd | 109 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 help/modelfiler-help.pd diff --git a/help/modelfiler-help.pd b/help/modelfiler-help.pd new file mode 100644 index 000000000..5d4a73ba3 --- /dev/null +++ b/help/modelfiler-help.pd @@ -0,0 +1,109 @@ +#N canvas 354 229 732 634 10; +#X declare -lib Gem; +#X text 54 30 Class: geometric object; +#X obj 463 87 cnv 15 240 530 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X text 467 67 Example:; +#X obj 7 67 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 8 226 cnv 15 450 230 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X text 9 231 Inlets:; +#X obj 8 182 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X text 17 181 Arguments:; +#X text 452 8 GEM object; +#X obj 474 96 cnv 15 220 430 empty empty empty 20 12 0 14 #64fc64 #404040 0; +#X text 33 14 Synopsis: [model]; +#X text 7 79 Description: Renders an Alias/Wavefront-Model.; +#X text 63 192 optional: name of a OBJ-file to be loaded; +#X obj 474 533 cnv 15 80 30 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 477 107 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X obj 477 125 openpanel; +#X msg 477 146 open \$1; +#X text 27 260 Inlet 1: message: open ; +#X msg 506 384 backend OBJ; +#X msg 515 404 backend ASSIMP3; +#X text 27 342 Inlet 1: message: backend :: choose which backend to use first to open the model; +#X msg 513 427 backend; +#X obj 477 225 t a; +#X text 550 451 query backends; +#X obj 494 454 t a; +#N canvas 484 243 450 300 META 0; +#X obj 10 25 declare -lib Gem; +#X text 10 135 AUTHOR IOhannes m zmölnig; +#X text 10 155 LICENSE GPL v2; +#X text 10 45 DESCRIPTION load an Alias/Wavefront-Model to various tables.; +#X text 10 65 KEYWORDS Gem openGL; +#X text 20 85 INLET_0 gemlist open position color normal texture backend ...; +#X text 20 115 OUTLET_0 vertices; +#X restore 558 8 pd META; +#X obj 8 464 cnv 15 450 30 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 41 467 _backendinfo \$0 model; +#N canvas 393 109 534 459 properties 0; +#X msg 39 175 enumProps; +#X text 107 177 print available properties (for reading and/or writing); +#X msg 61 214 get texheight texwidth; +#X msg 84 245 set usematerial 1; +#X text 209 246 set an (available) named properties; +#X text 208 215 get (available) named properties; +#X msg 84 310 setProps usematerial 1; +#X text 232 309 store a named property for applying LATER; +#X msg 84 340 applyProps; +#X text 162 340 apply stored properties; +#X msg 84 370 clearProps; +#X text 161 366 clear stored properties; +#X text 26 35 ==========================; +#X text 26 22 getting/setting properties; +#X text 26 68 depending on the used backend for loading a model \, different properties might be available., f 61; +#X text 30 104 properties can only be enumerated after a model has been loaded (and thus the loader-backend has been determined); +#X obj 39 405 s \$0-ctl; +#X connect 0 0 16 0; +#X connect 2 0 16 0; +#X connect 3 0 16 0; +#X connect 6 0 16 0; +#X connect 8 0 16 0; +#X connect 10 0 16 0; +#X restore 353 468 pd properties; +#X obj 477 539 modelfiler; +#X msg 569 427 loader; +#X msg 515 214 position table_pos; +#X msg 527 240 color table_color; +#X msg 539 269 normal table_normal; +#X obj 13 508 table table_posX; +#X obj 13 528 table table_posY; +#X obj 13 549 table table_posZ; +#X obj 116 508 table table_normalX; +#X obj 116 528 table table_normalY; +#X obj 116 549 table table_normalZ; +#X obj 238 508 table table_colorR; +#X obj 238 528 table table_colorG; +#X obj 238 548 table table_colorB; +#X msg 495 172 open ../examples/data/venus.obj; +#X obj 477 574 print; +#X obj 489 340 t a; +#X text 16 96 The model object load a 3D-models that are saved in Alias/Wavefront's OBJ-format into various tables.; +#X text 27 277 Inlet 1 : message: position tablename; +#X text 27 293 Inlet 1 : message: color tablename; +#X text 27 309 Inlet 1 : message: normal tablename; +#X obj 507 505 r \$0-ctl; +#X text 28 324 Inlet 1 : message: texture tablename; +#X text 13 384 Outlets:; +#X text 33 409 Outlet 1 : vertices float : number of vertices copied to table; +#X obj 238 568 table table_colorA; +#X obj 354 508 table table_texU; +#X obj 354 528 table table_texV; +#X msg 554 295 texture table_tex; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 22 0; +#X connect 18 0 24 0; +#X connect 19 0 24 0; +#X connect 21 0 24 0; +#X connect 22 0 29 0; +#X connect 24 0 29 0; +#X connect 29 0 44 0; +#X connect 30 0 24 0; +#X connect 31 0 45 0; +#X connect 32 0 45 0; +#X connect 33 0 45 0; +#X connect 43 0 22 0; +#X connect 45 0 29 0; +#X connect 50 0 29 0; +#X connect 57 0 45 0; From b97b512aaeab1143cbfb61ea8363105fc78cd7f0 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 13:22:44 +0200 Subject: [PATCH 320/387] add drawing type --- examples/15.OPENGL3.2/VBOline-help.pd | 8 +- examples/15.OPENGL3.2/VBOline.pd | 150 ++++++++++++++++---------- 2 files changed, 100 insertions(+), 58 deletions(-) diff --git a/examples/15.OPENGL3.2/VBOline-help.pd b/examples/15.OPENGL3.2/VBOline-help.pd index 2daa8548a..4590f8a0f 100644 --- a/examples/15.OPENGL3.2/VBOline-help.pd +++ b/examples/15.OPENGL3.2/VBOline-help.pd @@ -53,6 +53,9 @@ #X obj 475 606 VBOline 3 \; width 2; #X obj 475 574 GEMglPointSize 5; #X text 16 491 internal tables (position and color) are reseted when the resolution is changed; +#X msg 612 175 draw line; +#X msg 628 199 draw point; +#X obj 487 234 t a; #X connect 5 0 17 0; #X connect 6 0 41 1; #X connect 7 0 41 1; @@ -66,7 +69,10 @@ #X connect 15 0 14 0; #X connect 16 0 41 1; #X connect 17 0 42 0; -#X connect 18 0 41 0; +#X connect 18 0 46 0; #X connect 19 0 18 0; #X connect 20 0 9 0; #X connect 42 0 41 0; +#X connect 44 0 46 0; +#X connect 45 0 46 0; +#X connect 46 0 41 0; diff --git a/examples/15.OPENGL3.2/VBOline.pd b/examples/15.OPENGL3.2/VBOline.pd index 17f22e516..17d9c451a 100644 --- a/examples/15.OPENGL3.2/VBOline.pd +++ b/examples/15.OPENGL3.2/VBOline.pd @@ -1,8 +1,8 @@ -#N canvas 907 224 1301 696 12; +#N canvas 270 128 1539 677 12; #X obj 34 27 inlet; #X obj 231 85 gemargs; #X obj 314 30 inlet; -#X msg 346 188 resize \$1; +#X msg 346 218 resize \$1; #X text 481 155 forward to the corresponding table, f 21; #X obj 470 318 send; #X obj 544 204 list split 1; @@ -30,23 +30,15 @@ #X msg 552 505 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; #X obj 552 446 delay 0; #X obj 854 445 delay 0; -#X text 920 452 delay is here to limit the update rate of thevertex buffer once per input message, f 45; +#X text 920 452 delay is here to limit the update rate of thevertex buffer once per input message, f 42; #X text 664 153 RGB or RGBA value; #X text 937 156 point number \, X Y Z position; -#X msg 335 86 res 2 \, color 1 1 1 1 \, pos 0 0 0 0 \, pos 1 1 0 0; #X msg 854 504 position table-\$1-posX table-\$1-posY table-\$1-posZ, f 39; #X obj 552 475 \$0; #X obj 854 474 \$0; #X obj 587 475 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 886 472 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 231 48 t b b; -#X obj 198 382 s table-\$0-posX; -#X obj 198 404 s table-\$0-posY; -#X obj 198 426 s table-\$0-posZ; -#X obj 198 450 s table-\$0-colorR; -#X obj 198 472 s table-\$0-colorG; -#X obj 198 494 s table-\$0-colorB; -#X obj 198 516 s table-\$0-colorA; #X obj 920 272 unpack f f f f; #X obj 920 222 t a a; #X msg 1166 269 \$1; @@ -56,9 +48,8 @@ #X obj 314 122 route res table, f 27; #X obj 407 155 t b a a; #X obj 407 400 b; -#X obj 314 159 t b f; +#X obj 314 189 t b f; #X obj 58 243 table table-\$0-textureU; -#X obj 34 611 gemvertexbuffer \; draw tristrip \;; #X obj 58 265 table table-\$0-textureV; #X obj 58 290 table table-\$0-normalX; #X obj 58 312 table table-\$0-normalY; @@ -66,19 +57,51 @@ #X obj 34 661 outlet; #X obj 544 250 list prepend \$0; #X msg 544 273 symbol table-\$1-\$2; -#X connect 0 0 59 0; -#X connect 1 0 54 0; -#X connect 1 1 57 0; -#X connect 2 0 54 0; -#X connect 3 0 41 0; -#X connect 3 0 47 0; -#X connect 3 0 46 0; -#X connect 3 0 45 0; -#X connect 3 0 44 0; -#X connect 3 0 43 0; -#X connect 3 0 42 0; -#X connect 3 0 59 0; -#X connect 6 0 65 0; +#N canvas -8 18 452 340 send_tables 0; +#X obj 118 52 s table-\$0-posX; +#X obj 118 74 s table-\$0-posY; +#X obj 118 96 s table-\$0-posZ; +#X obj 118 120 s table-\$0-colorR; +#X obj 118 142 s table-\$0-colorG; +#X obj 118 164 s table-\$0-colorB; +#X obj 118 186 s table-\$0-colorA; +#X obj 118 209 s table-\$0-textureU; +#X obj 118 231 s table-\$0-textureV; +#X obj 118 256 s table-\$0-normalX; +#X obj 118 278 s table-\$0-normalY; +#X obj 118 300 s table-\$0-normalZ; +#X obj 98 16 inlet; +#X connect 12 0 0 0; +#X connect 12 0 11 0; +#X connect 12 0 10 0; +#X connect 12 0 9 0; +#X connect 12 0 8 0; +#X connect 12 0 7 0; +#X connect 12 0 6 0; +#X connect 12 0 5 0; +#X connect 12 0 4 0; +#X connect 12 0 3 0; +#X connect 12 0 2 0; +#X connect 12 0 1 0; +#X restore 275 364 pd send_tables; +#X obj 314 161 f; +#X msg 330 77 res 2 \, color 1 1 1 1 \, pos 0 0 0 0 \, pos 1 1 0 0; +#X obj 198 45 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X floatatom 363 191 5 0 0 0 - - - 0; +#X obj 34 611 gemvertexbuffer \; draw linestrip \;; +#X obj 1231 121 route draw; +#X obj 1231 207 route line lines point points; +#X msg 1231 241 draw linestrip; +#X msg 1330 279 draw point; +#X obj 1241 349 print error : not a valid drawing type; +#X obj 1231 520 t a; +#X connect 0 0 63 0; +#X connect 1 0 46 0; +#X connect 1 1 59 0; +#X connect 2 0 46 0; +#X connect 3 0 58 0; +#X connect 3 0 63 0; +#X connect 6 0 56 0; #X connect 7 0 5 0; #X connect 15 1 7 0; #X connect 16 0 17 0; @@ -86,7 +109,7 @@ #X connect 16 2 21 0; #X connect 16 3 20 0; #X connect 17 0 18 0; -#X connect 19 0 40 0; +#X connect 19 0 39 0; #X connect 20 0 25 0; #X connect 21 0 24 0; #X connect 22 0 23 0; @@ -94,37 +117,50 @@ #X connect 26 0 29 0; #X connect 26 1 27 0; #X connect 27 0 30 0; -#X connect 27 0 49 0; -#X connect 27 1 59 0; -#X connect 28 0 59 0; -#X connect 29 0 36 0; -#X connect 30 0 37 0; -#X connect 34 0 54 0; -#X connect 35 0 59 0; -#X connect 36 0 28 0; +#X connect 27 0 41 0; +#X connect 27 1 64 0; +#X connect 28 0 63 0; +#X connect 29 0 35 0; +#X connect 30 0 36 0; +#X connect 34 0 63 0; +#X connect 35 0 28 0; +#X connect 36 0 34 0; #X connect 37 0 35 0; #X connect 38 0 36 0; -#X connect 39 0 37 0; -#X connect 40 0 1 0; -#X connect 40 1 34 0; -#X connect 48 1 51 0; -#X connect 48 2 53 0; -#X connect 48 3 52 0; +#X connect 39 0 1 0; +#X connect 39 1 60 0; +#X connect 40 1 43 0; +#X connect 40 2 45 0; +#X connect 40 3 44 0; +#X connect 41 0 40 0; +#X connect 41 1 42 0; +#X connect 42 0 44 1; +#X connect 42 0 45 1; +#X connect 42 0 43 1; +#X connect 46 0 59 0; +#X connect 46 1 47 0; +#X connect 46 2 26 0; +#X connect 47 0 48 0; +#X connect 47 1 15 0; +#X connect 47 2 6 0; +#X connect 48 0 29 0; +#X connect 48 0 30 0; #X connect 49 0 48 0; -#X connect 49 1 50 0; -#X connect 50 0 52 1; -#X connect 50 0 53 1; -#X connect 50 0 51 1; -#X connect 54 0 57 0; -#X connect 54 1 55 0; -#X connect 54 2 26 0; -#X connect 55 0 56 0; -#X connect 55 1 15 0; -#X connect 55 2 6 0; -#X connect 56 0 29 0; -#X connect 56 0 30 0; -#X connect 57 0 56 0; -#X connect 57 1 3 0; -#X connect 59 0 64 0; +#X connect 49 1 3 0; +#X connect 56 0 57 0; +#X connect 57 0 5 1; +#X connect 59 0 49 0; +#X connect 59 0 62 0; +#X connect 60 0 46 0; +#X connect 61 0 1 0; +#X connect 63 0 55 0; +#X connect 64 0 65 0; +#X connect 64 1 63 0; #X connect 65 0 66 0; -#X connect 66 0 5 1; +#X connect 65 1 66 0; +#X connect 65 2 67 0; +#X connect 65 3 67 0; +#X connect 65 4 68 0; +#X connect 66 0 69 0; +#X connect 67 0 69 0; +#X connect 69 0 63 0; From b224a3f3ebaaf4f7de445107290d6cb680d0fe00 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 14:42:06 +0200 Subject: [PATCH 321/387] adding ; at every line, in order to be able to visualize the shader with a text object inside the example patch. --- examples/15.OPENGL3.2/shader/01.basic.frag | 22 +++++----- examples/15.OPENGL3.2/shader/01.basic.vert | 32 +++++++------- .../shader/02.transformation.frag | 22 +++++----- .../shader/02.transformation.vert | 44 +++++++++---------- examples/15.OPENGL3.2/shader/03.texture.frag | 20 ++++----- examples/15.OPENGL3.2/shader/03.texture.vert | 16 +++---- examples/15.OPENGL3.2/shader/04.model.frag | 8 ++-- examples/15.OPENGL3.2/shader/04.model.vert | 11 +++-- examples/15.OPENGL3.2/shader/05.geometry.frag | 40 ++++++++--------- examples/15.OPENGL3.2/shader/05.geometry.geom | 22 +++++----- examples/15.OPENGL3.2/shader/05.geometry.vert | 15 +++---- examples/15.OPENGL3.2/shader/08.light.frag | 18 ++++---- examples/15.OPENGL3.2/shader/08.light.vert | 11 +++-- 13 files changed, 140 insertions(+), 141 deletions(-) diff --git a/examples/15.OPENGL3.2/shader/01.basic.frag b/examples/15.OPENGL3.2/shader/01.basic.frag index ba695e533..8cff637f5 100644 --- a/examples/15.OPENGL3.2/shader/01.basic.frag +++ b/examples/15.OPENGL3.2/shader/01.basic.frag @@ -1,17 +1,17 @@ #version 460 - -// Cyrille Henry 2024 -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff - -// This is the fragment shader : it is executed for every pixel to display - +; +// Cyrille Henry 2024; +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; +; +// This is the fragment shader : it is executed for every pixel to display; +; in vec3 Color_to_frag; -// the variable commint from the VBO - +// the variable commint from the VBO; +; out vec4 FragColor; -// The only output of this shader : the color of the pixel - +// The only output of this shader : the color of the pixel; +; void main() { FragColor = vec4(Color_to_frag, 1.0); - // the "Color_to_frag" variable is already interpolated between the 2 shaders. + // the "Color_to_frag" variable is already interpolated between the 2 shaders.; } diff --git a/examples/15.OPENGL3.2/shader/01.basic.vert b/examples/15.OPENGL3.2/shader/01.basic.vert index fb18ee34b..d3b47aae0 100644 --- a/examples/15.OPENGL3.2/shader/01.basic.vert +++ b/examples/15.OPENGL3.2/shader/01.basic.vert @@ -1,25 +1,25 @@ #version 460 - -//simple test shader -// Cyrille Henry 2024 -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff - -// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. - +; +//simple test shader; +// Cyrille Henry 2024; +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; +; +// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex.; +; layout (location=0) in vec3 position; layout (location=1) in vec3 color; -// declare the mandatory input : we need 2 attributes named position and color from the VBO -// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) - +// declare the mandatory input : we need 2 attributes named position and color from the VBO; +// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message); +; out vec3 Color_to_frag; -// the output of this shader is only a color. -// This variable will be interpolated between all vertices - +// the output of this shader is only a color.; +// This variable will be interpolated between all vertices; +; void main() { Color_to_frag = color; - // initialise the variable to pass to the frag shader with data comming from the VBO + // initialise the variable to pass to the frag shader with data comming from the VBO; - gl_Position = vec4(position,1.0); // update vertex position from the VBO - // No perspective is apply in this example + gl_Position = vec4(position,1.0); // update vertex position from the VBO; + // No perspective is apply in this example; } diff --git a/examples/15.OPENGL3.2/shader/02.transformation.frag b/examples/15.OPENGL3.2/shader/02.transformation.frag index ba695e533..8cff637f5 100644 --- a/examples/15.OPENGL3.2/shader/02.transformation.frag +++ b/examples/15.OPENGL3.2/shader/02.transformation.frag @@ -1,17 +1,17 @@ #version 460 - -// Cyrille Henry 2024 -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff - -// This is the fragment shader : it is executed for every pixel to display - +; +// Cyrille Henry 2024; +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; +; +// This is the fragment shader : it is executed for every pixel to display; +; in vec3 Color_to_frag; -// the variable commint from the VBO - +// the variable commint from the VBO; +; out vec4 FragColor; -// The only output of this shader : the color of the pixel - +// The only output of this shader : the color of the pixel; +; void main() { FragColor = vec4(Color_to_frag, 1.0); - // the "Color_to_frag" variable is already interpolated between the 2 shaders. + // the "Color_to_frag" variable is already interpolated between the 2 shaders.; } diff --git a/examples/15.OPENGL3.2/shader/02.transformation.vert b/examples/15.OPENGL3.2/shader/02.transformation.vert index 465e52885..55aa2359b 100644 --- a/examples/15.OPENGL3.2/shader/02.transformation.vert +++ b/examples/15.OPENGL3.2/shader/02.transformation.vert @@ -1,31 +1,31 @@ #version 460 - -//simple test shader -// Cyrille Henry 2024 -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff - -// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. - +; +//simple test shader; +// Cyrille Henry 2024; +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; +; +// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex.; +; layout (location=0) in vec3 position; layout (location=1) in vec3 color; -// declare the mandatory input : we need 2 attributes named position and color from the VBO -// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) - +// declare the mandatory input : we need 2 attributes named position and color from the VBO; +// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message); +; uniform mat4 transformation_matrix; -// The transformation matrix we want to apply to the vertex. -// The shader did not receive the transformation matrix from the pipeline, so we need to creater one and pass it as an argument. -// In this example, we use gemlist_matrix in the patch to get the transformation matrix. -// The perspective matrix (set with the perspec message to gemwin) is not used. - +// The transformation matrix we want to apply to the vertex.; +// The shader did not receive the transformation matrix from the pipeline, so we need to creater one and pass it as an argument.; +// In this example, we use gemlist_matrix in the patch to get the transformation matrix.; +// The perspective matrix (set with the perspec message to gemwin) is not used.; +; out vec3 Color_to_frag; -// the output of this shader is only a color. -// This variable will be interpolated between all vertices - +// the output of this shader is only a color.; +// This variable will be interpolated between all vertices; +; void main() { Color_to_frag = color; - // initialise the variable to pass to the frag shader with data comming from the VBO - - gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO - // No perspective is apply in this example + // initialise the variable to pass to the frag shader with data comming from the VBO; +; + gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO; + // No perspective is apply in this example; } diff --git a/examples/15.OPENGL3.2/shader/03.texture.frag b/examples/15.OPENGL3.2/shader/03.texture.frag index affacbbb7..79662b998 100644 --- a/examples/15.OPENGL3.2/shader/03.texture.frag +++ b/examples/15.OPENGL3.2/shader/03.texture.frag @@ -1,19 +1,19 @@ #version 460 - -// Cyrille Henry 2024 -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff - +; +// Cyrille Henry 2024; +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; +; in vec2 TexCoord; - -uniform sampler2D Texture1; -uniform sampler2D Texture2; +; +uniform sampler2D Texture1; // Texture 1 with using the textunit 0 +uniform sampler2D Texture2; // Texture 2 need to be set to 1 to use the correct texture; uniform float mix_factor; - +; out vec4 FragColor; - +; void main() { vec4 color1 = texture(Texture1, TexCoord); vec4 color2 = texture(Texture2, TexCoord); - +; FragColor = mix(color1, color2, mix_factor); } diff --git a/examples/15.OPENGL3.2/shader/03.texture.vert b/examples/15.OPENGL3.2/shader/03.texture.vert index 37cf6b027..42cf7d8aa 100644 --- a/examples/15.OPENGL3.2/shader/03.texture.vert +++ b/examples/15.OPENGL3.2/shader/03.texture.vert @@ -1,16 +1,16 @@ #version 460 - -//simple test shader -// Cyrille Henry 2024 -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff - +; +//simple test shader; +// Cyrille Henry 2024; +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; +; in vec3 position; in vec2 texcoord; - +; out vec2 TexCoord; - +; void main() { - TexCoord = texcoord; // pass the data from VBO to the frag shader + TexCoord = texcoord; // pass the data from VBO to the frag shader; gl_Position = vec4(position,1.0); } diff --git a/examples/15.OPENGL3.2/shader/04.model.frag b/examples/15.OPENGL3.2/shader/04.model.frag index 2d539f8b2..c22e25be3 100644 --- a/examples/15.OPENGL3.2/shader/04.model.frag +++ b/examples/15.OPENGL3.2/shader/04.model.frag @@ -1,10 +1,10 @@ #version 460 -// Cyrille Henry 2024 - +// Cyrille Henry 2024; +; in vec4 Color; - +; out vec4 FragColor; - +; void main() { FragColor = Color; } diff --git a/examples/15.OPENGL3.2/shader/04.model.vert b/examples/15.OPENGL3.2/shader/04.model.vert index d0f9c27ee..3e4e2bfcd 100644 --- a/examples/15.OPENGL3.2/shader/04.model.vert +++ b/examples/15.OPENGL3.2/shader/04.model.vert @@ -1,21 +1,20 @@ #version 460 - +; // Cyrille Henry 2024 - - +; layout (location=0) in float positionX; layout (location=1) in float positionY; layout (location=2) in float positionZ; layout (location=3) in float colorR; layout (location=4) in float colorG; layout (location=5) in float colorB; - +; uniform mat4 transformation_matrix; - +; out vec4 Color; out vec3 Normal; out vec4 Position; - +; void main() { Color = vec4(colorR, colorG, colorB, 1.); diff --git a/examples/15.OPENGL3.2/shader/05.geometry.frag b/examples/15.OPENGL3.2/shader/05.geometry.frag index cbdccc744..d919ef71a 100644 --- a/examples/15.OPENGL3.2/shader/05.geometry.frag +++ b/examples/15.OPENGL3.2/shader/05.geometry.frag @@ -1,41 +1,41 @@ #version 150 - -// from geometry shader +; +// from geometry shader; in vec3 geomPosition; in vec3 geomNormal; in vec2 geomTexCoord; in vec3 barycentric; - -// to rendering +; +// to rendering; out vec4 fragColor; - -// uniform to compute the pixel color +; +// uniform to compute the pixel color; uniform vec3 lightPos; uniform vec3 lightColor; uniform vec3 ambientColor; uniform sampler2D diffuseTexture; - +; void main() { - // Normalize the normal vector + // Normalize the normal vector; vec3 normal = normalize(geomNormal); - - // Calculate the light direction and distance +; + // Calculate the light direction and distance; vec3 lightDir = normalize(lightPos - geomPosition); - - // Diffuse shading +; + // Diffuse shading; float diff = max(dot(normal, lightDir), 0.0); vec3 diffuse = diff * lightColor; - - // Texture sampling +; + // Texture sampling; vec4 texColor = texture(diffuseTexture, geomTexCoord); - - // Wire effect using barycentric coordinates +; + // Wire effect using barycentric coordinates; float minBary = min(min(barycentric.x, barycentric.y), barycentric.z); float edgeFactor = smoothstep(0.0, 0.2, minBary); - - // Final color calculation +; + // Final color calculation; vec3 result = (ambientColor + diffuse) * texColor.rgb; - result = mix(vec3(0.0, 0.7, 1.0), result, edgeFactor); // Blue wireframe - + result = mix(vec3(0.0, 0.7, 1.0), result, edgeFactor); // Blue wireframe; +; fragColor = vec4(result, texColor.a); } diff --git a/examples/15.OPENGL3.2/shader/05.geometry.geom b/examples/15.OPENGL3.2/shader/05.geometry.geom index b48a24a59..e39b28871 100644 --- a/examples/15.OPENGL3.2/shader/05.geometry.geom +++ b/examples/15.OPENGL3.2/shader/05.geometry.geom @@ -1,32 +1,34 @@ #version 150 - +; layout(triangles) in; - // the triangle_strip is split in multiples triangles before this shader +// the triangle_strip is split in multiples triangles before this shader; layout(triangle_strip, max_vertices = 3) out; - -// from vertex shader +; +// from vertex shader; in vec3 vertPosition[]; in vec3 vertNormal[]; in vec2 vertTexCoord[]; - -// to fragment shader +; +// to fragment shader; out vec3 geomPosition; out vec3 geomNormal; out vec2 geomTexCoord; out vec3 barycentric; - +; void main() { +; for(int i = 0; i < 3; i++) { geomPosition = vertPosition[i]; geomNormal = vertNormal[i]; geomTexCoord = vertTexCoord[i]; - - // Passing barycentric coordinates for fragment shading +; + // Passing barycentric coordinates for fragment shading; barycentric = vec3(0.0); barycentric[i] = 1.0; - +; gl_Position = gl_in[i].gl_Position; EmitVertex(); } +; EndPrimitive(); } diff --git a/examples/15.OPENGL3.2/shader/05.geometry.vert b/examples/15.OPENGL3.2/shader/05.geometry.vert index 8113951e6..14fe3d341 100644 --- a/examples/15.OPENGL3.2/shader/05.geometry.vert +++ b/examples/15.OPENGL3.2/shader/05.geometry.vert @@ -1,25 +1,24 @@ -// Vertex Shader (version 150) #version 150 - -// from VBO +; +// from VBO; in vec3 position; in vec3 normal; in vec2 texCoord; - -// to geometry shader +; +// to geometry shader; out vec3 vertPosition; out vec3 vertNormal; out vec2 vertTexCoord; - +; uniform mat4 modelMatrix; uniform mat4 viewMatrix; uniform mat4 projMatrix; uniform mat3 normalMatrix; - +; void main() { vertPosition = vec3(modelMatrix * vec4(position, 1.0)); vertNormal = normalMatrix * normal; vertTexCoord = texCoord; - +; gl_Position = projMatrix * viewMatrix * modelMatrix * vec4(position, 1.0); } diff --git a/examples/15.OPENGL3.2/shader/08.light.frag b/examples/15.OPENGL3.2/shader/08.light.frag index b696daa16..225c91bda 100644 --- a/examples/15.OPENGL3.2/shader/08.light.frag +++ b/examples/15.OPENGL3.2/shader/08.light.frag @@ -1,24 +1,24 @@ #version 460 -// Cyrille Henry 2024 - -// light description +// Cyrille Henry 2024; +; +// light description; uniform vec4 LightPosition; // Light position in eye coords. uniform vec3 LightLa; // Ambient light intensity uniform vec3 LightL; // Diffuse and specular light intensity - -// material definition +; +// material definition; uniform vec3 MaterialKa; // Ambient reflectivity uniform vec3 MaterialKd; // Diffuse reflectivity uniform vec3 MaterialKs; // Specular reflectivity uniform float MaterialShininess; // Specular shininess factor - +; in vec4 Color; in vec3 Normal; in vec4 Position; - +; out vec4 FragColor; // The only output of this shader : the color of the pixel - +; vec3 blinnPhong( vec3 position, vec3 n) { vec3 ambient = LightLa * MaterialKa; vec3 s = normalize( LightPosition.xyz - position ); @@ -32,7 +32,7 @@ vec3 blinnPhong( vec3 position, vec3 n) { } return ambient + LightL * (diffuse + spec); } - +; void main() { FragColor = Color * vec4(blinnPhong(Position.xyz, normalize(Normal)), 1.); } diff --git a/examples/15.OPENGL3.2/shader/08.light.vert b/examples/15.OPENGL3.2/shader/08.light.vert index 25d480981..a61dba0cd 100644 --- a/examples/15.OPENGL3.2/shader/08.light.vert +++ b/examples/15.OPENGL3.2/shader/08.light.vert @@ -1,8 +1,7 @@ #version 460 - +; // Cyrille Henry 2024 - - +; layout (location=0) in float positionX; layout (location=1) in float positionY; layout (location=2) in float positionZ; @@ -12,13 +11,13 @@ layout (location=5) in float normal_Z; layout (location=6) in float colorR; layout (location=7) in float colorG; layout (location=8) in float colorB; - +; uniform mat4 transformation_matrix; - +; out vec4 Color; out vec3 Normal; out vec4 Position; - +; void main() { Color = vec4(colorR, colorG, colorB, 1.); From d5a60882ab631aaea5fce83181746fba8bed672b Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 14:43:06 +0200 Subject: [PATCH 322/387] adding "text define" object to visualize the shader in the patch --- examples/15.OPENGL3.2/01.basic.pd | 10 +++ examples/15.OPENGL3.2/02.transformation.pd | 83 ++++++++++++---------- examples/15.OPENGL3.2/03.texture.pd | 57 +++++++++------ examples/15.OPENGL3.2/04.model.pd | 9 +++ examples/15.OPENGL3.2/05.geometry.pd | 17 ++++- examples/15.OPENGL3.2/07.primitives.pd | 44 ++++++------ examples/15.OPENGL3.2/08.lighting.pd | 9 +++ 7 files changed, 146 insertions(+), 83 deletions(-) diff --git a/examples/15.OPENGL3.2/01.basic.pd b/examples/15.OPENGL3.2/01.basic.pd index 560d3ee11..1910dde51 100644 --- a/examples/15.OPENGL3.2/01.basic.pd +++ b/examples/15.OPENGL3.2/01.basic.pd @@ -97,6 +97,12 @@ #X obj 267 276 glsl shader/01.basic; #X obj 384 353 \$0; #X text 445 259 This example demonstrates how to use Vertex Buffer Objects (VBOs) in conjunction with shaders in OpenGL. It illustrates the process of creating and binding a VBO to store vertex data \, and then using a vertex shader and fragment shader to render that data., f 88; +#X text 60 527 click to see the shaders; +#X obj 59 447 text define; +#X msg 59 423 read shader/01.basic.frag; +#X msg 59 479 read shader/01.basic.vert; +#X obj 59 502 text define; +#X obj 39 399 loadbang; #X connect 0 0 1 0; #X connect 2 0 26 0; #X connect 3 0 11 0; @@ -113,3 +119,7 @@ #X connect 26 1 3 0; #X connect 26 1 25 0; #X connect 27 0 9 0; +#X connect 31 0 30 0; +#X connect 32 0 33 0; +#X connect 34 0 31 0; +#X connect 34 0 32 0; diff --git a/examples/15.OPENGL3.2/02.transformation.pd b/examples/15.OPENGL3.2/02.transformation.pd index e4d4a4cfc..4dd14eb1a 100644 --- a/examples/15.OPENGL3.2/02.transformation.pd +++ b/examples/15.OPENGL3.2/02.transformation.pd @@ -32,15 +32,15 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X obj 267 14 gemhead; -#X msg 462 493 program \$1; -#X obj 472 523 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 480 529 print_attributes; -#X text 546 493 <----- essential for lookup functions; -#X obj 330 610 print vb; +#X obj 287 14 gemhead; +#X msg 482 493 program \$1; +#X obj 492 523 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 500 529 print_attributes; +#X text 566 493 <----- essential for lookup functions; +#X obj 350 610 print vb; #X obj 44 9 declare -lib Gem; -#X obj 438 437 f \$0; -#X msg 438 469 attribute position \$1_position \, attribute color \$1_color; +#X obj 458 437 f \$0; +#X msg 458 469 attribute position \$1_position \, attribute color \$1_color; #N canvas 171 609 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -80,7 +80,7 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 303 586 t a a; +#X obj 323 586 t a a; #X obj 40 175 table \$0_position 9; #X obj 40 196 table \$0_color 9; #X obj 41 235 loadbang; @@ -89,16 +89,16 @@ #X msg 40 341 0 1 0 0 0 1 0 0 0 1; #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; -#X obj 513 23 gemhead; -#X floatatom 548 55 5 0 0 0 - - - 0; -#X floatatom 583 55 5 0 0 0 - - - 0; -#X floatatom 618 55 5 0 0 0 - - - 0; -#X floatatom 529 198 5 0 0 0 - - - 0; -#X floatatom 563 198 5 0 0 0 - - - 0; -#X floatatom 597 198 5 0 0 0 - - - 0; -#X floatatom 527 104 5 0 0 0 - - - 0; -#X floatatom 561 104 5 0 0 0 - - - 0; -#X floatatom 595 104 5 0 0 0 - - - 0; +#X obj 533 23 gemhead; +#X floatatom 568 55 5 0 0 0 - - - 0; +#X floatatom 603 55 5 0 0 0 - - - 0; +#X floatatom 638 55 5 0 0 0 - - - 0; +#X floatatom 549 198 5 0 0 0 - - - 0; +#X floatatom 583 198 5 0 0 0 - - - 0; +#X floatatom 617 198 5 0 0 0 - - - 0; +#X floatatom 547 104 5 0 0 0 - - - 0; +#X floatatom 581 104 5 0 0 0 - - - 0; +#X floatatom 615 104 5 0 0 0 - - - 0; #N canvas 437 191 753 491 shear 0; #X obj 25 17 inlet; #X obj 25 270 outlet; @@ -118,24 +118,29 @@ #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 1 0; -#X restore 513 171 pd shear; -#X obj 513 219 rotateXYZ; -#X obj 513 123 scaleXYZ; -#X floatatom 527 150 5 0 0 0 - - - 0; -#X floatatom 561 150 5 0 0 0 - - - 0; -#X floatatom 595 150 5 0 0 0 - - - 0; -#X obj 513 244 gemlist_matrix; -#X obj 594 271 list prepend transformation_matrix; -#X obj 594 293 list trim; -#X obj 513 78 translateXYZ 0 0 4; -#X text 563 350 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; -#X obj 267 638 gemvertexbuffer \; resize 9 \; draw tri; -#X obj 267 162 translateXYZ; -#X floatatom 290 117 5 0 0 0 - - - 0; -#X text 329 116 this transformation is ignored..., f 19; -#X text 566 402 Z translation have no effect since the perspective is not yet implemented; -#X obj 438 408 t b f; -#X obj 267 377 glsl shader/02.transformation; +#X restore 533 171 pd shear; +#X obj 533 219 rotateXYZ; +#X obj 533 123 scaleXYZ; +#X floatatom 547 150 5 0 0 0 - - - 0; +#X floatatom 581 150 5 0 0 0 - - - 0; +#X floatatom 615 150 5 0 0 0 - - - 0; +#X obj 533 244 gemlist_matrix; +#X obj 614 271 list prepend transformation_matrix; +#X obj 614 293 list trim; +#X obj 533 78 translateXYZ 0 0 4; +#X text 583 350 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; +#X obj 287 638 gemvertexbuffer \; resize 9 \; draw tri; +#X obj 287 162 translateXYZ; +#X floatatom 310 117 5 0 0 0 - - - 0; +#X text 349 116 this transformation is ignored..., f 19; +#X text 586 402 Z translation have no effect since the perspective is not yet implemented; +#X obj 458 408 t b f; +#X obj 287 377 glsl shader/02.transformation; +#X obj 59 447 text define; +#X obj 59 502 text define; +#X obj 39 399 loadbang; +#X msg 59 423 read shader/02.transformation.frag; +#X msg 59 479 read shader/02.transformation.vert; #X connect 0 0 1 0; #X connect 2 0 43 0; #X connect 3 0 12 0; @@ -174,3 +179,7 @@ #X connect 47 1 3 0; #X connect 48 0 42 0; #X connect 48 1 47 0; +#X connect 51 0 52 0; +#X connect 51 0 53 0; +#X connect 52 0 49 0; +#X connect 53 0 50 0; diff --git a/examples/15.OPENGL3.2/03.texture.pd b/examples/15.OPENGL3.2/03.texture.pd index 96fe20a6a..0c91fc7e2 100644 --- a/examples/15.OPENGL3.2/03.texture.pd +++ b/examples/15.OPENGL3.2/03.texture.pd @@ -1,4 +1,4 @@ -#N canvas 608 89 939 801 10; +#N canvas 598 264 892 616 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -32,15 +32,15 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X obj 427 14 gemhead; -#X msg 529 554 program \$1; -#X obj 523 584 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; -#X msg 531 590 print_attributes; -#X obj 502 466 t b f; -#X text 607 554 <----- essential for lookup functions; -#X obj 490 650 print vb; +#X obj 368 70 gemhead; +#X msg 470 440 program \$1; +#X obj 464 470 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; +#X msg 472 476 print_attributes; +#X obj 443 352 t b f; +#X text 548 440 <----- essential for lookup functions; +#X obj 431 536 print vb; #X obj 44 9 declare -lib Gem; -#X obj 502 488 f \$0; +#X obj 443 374 f \$0; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -80,28 +80,34 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 463 626 t a a; +#X obj 404 512 t a a; #X obj 41 235 loadbang; #X obj 41 283 s \$0_position; #X obj 40 317 loadbang; -#X obj 427 42 pix_image ../data/img1.jpg; -#X obj 427 67 pix_texture; +#X obj 368 98 pix_image ../data/img1.jpg; +#X obj 368 123 pix_texture; #X msg 41 260 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 0.8 0 0.8 -0.8 0; #X obj 40 175 table \$0_position 12; #X obj 40 196 table \$0_texcoord 8; #X obj 40 364 s \$0_texcoord; -#X msg 502 510 attribute position \$1_position \, attribute texcoord \$1_texcoord, f 63; -#X obj 427 103 pix_image ../data/img2.jpg; -#X floatatom 556 228 5 0 1 0 - - - 0; -#X msg 556 251 mix_factor \$1; +#X msg 443 396 attribute position \$1_position \, attribute texcoord \$1_texcoord, f 63; +#X obj 368 159 pix_image ../data/img2.jpg; +#X floatatom 497 224 5 0 1 0 - - - 0; +#X msg 497 247 mix_factor \$1; #X msg 40 341 0 0 1 0 0 1 0 1 1; -#X obj 427 128 pix_texture \; texunit 1; -#X obj 427 678 gemvertexbuffer \; draw quad; -#X text 597 227 <--------------------; -#X obj 427 285 glsl shader/03.texture; -#X msg 445 258 print; -#X msg 613 319 Texture2 1; -#X text 46 430 Using textures did not really change; +#X obj 368 184 pix_texture \; texunit 1; +#X obj 368 564 gemvertexbuffer \; draw quad; +#X text 538 223 <--------------------; +#X obj 368 281 glsl shader/03.texture; +#X msg 386 254 print; +#X msg 554 315 Texture2 1; +#X text 263 12 Using textures did not really change; +#X obj 59 447 text define; +#X obj 59 502 text define; +#X obj 39 399 loadbang; +#X msg 59 423 read shader/03.texture.frag; +#X msg 59 479 read shader/03.texture.vert; +#X obj 378 229 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X connect 0 0 1 0; #X connect 2 0 16 0; #X connect 3 0 12 0; @@ -127,3 +133,8 @@ #X connect 30 1 32 0; #X connect 31 0 30 0; #X connect 32 0 30 1; +#X connect 36 0 37 0; +#X connect 36 0 38 0; +#X connect 37 0 34 0; +#X connect 38 0 35 0; +#X connect 39 0 30 0; diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.OPENGL3.2/04.model.pd index f778d582d..a960ecb8a 100644 --- a/examples/15.OPENGL3.2/04.model.pd +++ b/examples/15.OPENGL3.2/04.model.pd @@ -149,6 +149,11 @@ #X obj 287 369 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X text 259 19 modelfiler load a 3d object into tables. The pipeline is unchange regarding previous examples, f 93; #X msg 384 472 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; +#X obj 59 447 text define; +#X obj 59 502 text define; +#X obj 39 399 loadbang; +#X msg 59 423 read shader/04.model.frag; +#X msg 59 479 read shader/04.model.vert; #X connect 0 0 1 0; #X connect 2 0 23 0; #X connect 3 0 10 0; @@ -176,3 +181,7 @@ #X connect 30 1 6 0; #X connect 31 0 30 0; #X connect 33 0 10 0; +#X connect 36 0 37 0; +#X connect 36 0 38 0; +#X connect 37 0 34 0; +#X connect 38 0 35 0; diff --git a/examples/15.OPENGL3.2/05.geometry.pd b/examples/15.OPENGL3.2/05.geometry.pd index adf5d1ca8..33a5cdc06 100644 --- a/examples/15.OPENGL3.2/05.geometry.pd +++ b/examples/15.OPENGL3.2/05.geometry.pd @@ -1,4 +1,4 @@ -#N canvas 361 294 1140 558 10; +#N canvas 245 206 1145 664 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -128,8 +128,15 @@ #X obj 714 5 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; #X obj 474 7 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; #X text 744 461 add invocations; -#X restore 37 499 pd drawing_type; +#X restore 981 576 pd drawing_type; #X text 449 12 This example introduce the Model Projection View matrix and a simple geometry shader; +#X obj 60 510 text define; +#X obj 60 565 text define; +#X obj 40 462 loadbang; +#X msg 60 486 read shader/05.geometry.frag; +#X obj 60 615 text define; +#X msg 60 592 read shader/05.geometry.vert; +#X msg 60 542 read shader/05.geometry.geo; #X connect 0 0 1 0; #X connect 2 0 35 0; #X connect 3 0 8 0; @@ -171,3 +178,9 @@ #X connect 45 0 44 0; #X connect 45 1 15 0; #X connect 45 1 23 0; +#X connect 50 0 51 0; +#X connect 50 0 54 0; +#X connect 50 0 53 0; +#X connect 51 0 48 0; +#X connect 53 0 52 0; +#X connect 54 0 49 0; diff --git a/examples/15.OPENGL3.2/07.primitives.pd b/examples/15.OPENGL3.2/07.primitives.pd index dbcddf0c3..191bab3fc 100644 --- a/examples/15.OPENGL3.2/07.primitives.pd +++ b/examples/15.OPENGL3.2/07.primitives.pd @@ -1,9 +1,9 @@ -#N canvas 621 225 1140 655 12; +#N canvas 568 165 1140 655 12; #X obj 469 431 VBOsphere; #X obj 555 428 VBOcube; #X obj 268 429 VBOcircle; #X obj 354 429 BBOmesh_square; -#X obj 130 362 == 0; +#X obj 116 362 == 0; #X obj 184 389 spigot; #X obj 279 390 spigot; #X obj 365 391 spigot; @@ -16,7 +16,7 @@ #X obj 504 368 == 4; #X obj 589 368 == 5; #X obj 678 369 == 6; -#X obj 769 144 vradio 20 1 0 8 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0; +#X obj 769 144 vradio 20 1 1 8 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0; #X text 792 143 line; #X text 792 166 square; #X obj 77 252 rotateXYZ; @@ -62,18 +62,19 @@ #X connect 15 0 16 0; #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; -#X restore 402 30 pd gemwin; -#X obj 77 388 spigot 1; -#X obj 77 431 VBOline \; res 2 \; width 3 \; pos 0 -1 0 0 \; pos 1 1 0 0 \; color 1 1 1 1; +#X restore 398 91 pd gemwin; #X obj 636 428 VBOplane; #X obj 184 429 VBOsquare; -#X obj 77 85 pix_video; -#X obj 77 159 scaleXYZ; -#X floatatom 161 155 5 0 0 0 - - - 0; -#X obj 150 88 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; -#X obj 77 112 pix_texture \; 0; -#X connect 4 0 26 1; -#X connect 5 0 29 0; +#X floatatom 195 157 5 0 0 0 - - - 0; +#X obj 77 132 pix_texture \; 0; +#X obj 77 388 spigot; +#X obj 77 189 scaleXYZ 1 1 1; +#X obj 77 431 VBOline \; res 3 \; width 3 \; pos 0 -1 0 0 \; pos 1 0 0 0 \; pos 2 1 0 0 \; color 1 1 1 1; +#X obj 165 47 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X obj 77 85 pix_video \; 0; +#X text 221 12 this example demonstrate various abstraction that mimic simple primitives uving VBO, f 85; +#X connect 4 0 30 1; +#X connect 5 0 27 0; #X connect 11 0 5 1; #X connect 12 0 6 1; #X connect 13 0 7 1; @@ -93,16 +94,17 @@ #X connect 20 0 7 0; #X connect 20 0 6 0; #X connect 20 0 5 0; -#X connect 20 0 26 0; +#X connect 20 0 30 0; #X connect 21 0 20 1; #X connect 22 0 20 2; #X connect 23 0 20 3; -#X connect 24 0 30 0; -#X connect 26 0 27 0; -#X connect 30 0 34 0; +#X connect 24 0 34 0; +#X connect 28 0 31 1; +#X connect 28 0 31 2; +#X connect 28 0 31 3; +#X connect 29 0 31 0; +#X connect 30 0 32 0; #X connect 31 0 20 0; -#X connect 32 0 31 1; -#X connect 32 0 31 2; -#X connect 32 0 31 3; #X connect 33 0 34 0; -#X connect 34 0 31 0; +#X connect 33 0 29 0; +#X connect 34 0 29 0; diff --git a/examples/15.OPENGL3.2/08.lighting.pd b/examples/15.OPENGL3.2/08.lighting.pd index fd8f2d604..8fd7adf55 100644 --- a/examples/15.OPENGL3.2/08.lighting.pd +++ b/examples/15.OPENGL3.2/08.lighting.pd @@ -150,6 +150,11 @@ #X msg 726 303 LightPosition \$1 \$2 \$3 \$4; #X msg 448 407 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.3 0.3 0.3 \, MaterialKd 0.1 0.1 0.1 \, MaterialKs 0.3 0.3 0.3 \, MaterialShininess 0.1; #X obj 288 333 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 59 447 text define; +#X obj 59 502 text define; +#X obj 39 399 loadbang; +#X msg 59 423 read shader/08.light.vert; +#X msg 59 479 read shader/08.light.frag; #X connect 0 0 1 0; #X connect 2 0 28 0; #X connect 3 0 10 0; @@ -180,3 +185,7 @@ #X connect 32 0 28 1; #X connect 33 0 28 1; #X connect 34 0 28 0; +#X connect 37 0 38 0; +#X connect 37 0 39 0; +#X connect 38 0 35 0; +#X connect 39 0 36 0; From aacf6a0bd23226ee6aa77d4ae3b4c107896e839f Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 14:43:18 +0200 Subject: [PATCH 323/387] adding draw type --- examples/15.OPENGL3.2/VBOsquare.pd | 45 +++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/examples/15.OPENGL3.2/VBOsquare.pd b/examples/15.OPENGL3.2/VBOsquare.pd index cff09fe41..5b7db22f7 100644 --- a/examples/15.OPENGL3.2/VBOsquare.pd +++ b/examples/15.OPENGL3.2/VBOsquare.pd @@ -1,4 +1,4 @@ -#N canvas 679 46 934 869 12; +#N canvas 565 54 1206 873 12; #X obj 34 27 inlet; #X obj 276 113 gemargs; #X obj 344 30 inlet; @@ -31,7 +31,6 @@ #X obj 344 430 b; #X msg 365 116 color 1 1 1 1; #X obj 344 152 route table, f 27; -#X obj 34 721 gemvertexbuffer \; draw tristrip \; resize 4 \;; #X obj 58 83 table table-\$0-posX 4; #X obj 58 105 table table-\$0-posY 4; #X obj 58 127 table table-\$0-posZ 4; @@ -48,13 +47,20 @@ #X obj 481 258 list prepend \$0; #X msg 481 281 symbol table-\$1-\$2; #X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; -#X msg 491 99 posX 0 -1 1 -1 1 \, posY 0 -1 -1 1 1 \, textureU 0 0 1 0 1 \, textureV 0 1 1 0 0 \, normalZ 0 1 1 1 1; #X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; #X text 254 780 TODO : add a size message for the square (is that really needed? a scaleXYZ object can be use); -#X connect 0 0 32 0; +#X obj 866 189 route draw; +#X obj 868 677 t a; +#X obj 866 215 route point points line lines fill; +#X obj 34 721 gemvertexbuffer \; draw quad \; resize 4 \;; +#X msg 491 99 posX 0 -1 1 1 -1 \, posY 0 -1 -1 1 1 \, textureU 0 0 1 1 0 \, textureV 0 1 1 0 0 \, normalZ 0 1 1 1 1; +#X msg 1063 256 draw quad; +#X msg 960 257 draw lineloop; +#X msg 866 256 draw point; +#X connect 0 0 53 0; #X connect 1 0 31 0; #X connect 2 0 31 0; -#X connect 5 0 46 0; +#X connect 5 0 45 0; #X connect 6 0 4 0; #X connect 7 1 6 0; #X connect 8 0 9 0; @@ -68,16 +74,17 @@ #X connect 14 0 15 0; #X connect 18 0 8 0; #X connect 18 0 20 0; -#X connect 19 0 32 0; +#X connect 18 1 50 0; +#X connect 19 0 53 0; #X connect 20 0 23 0; #X connect 23 0 19 0; -#X connect 24 0 48 0; +#X connect 24 0 47 0; #X connect 25 0 23 0; #X connect 26 0 24 0; #X connect 27 0 1 0; #X connect 27 0 24 0; #X connect 27 1 30 0; -#X connect 27 1 49 0; +#X connect 27 1 54 0; #X connect 28 0 29 0; #X connect 28 1 7 0; #X connect 28 2 5 0; @@ -85,8 +92,20 @@ #X connect 30 0 31 0; #X connect 31 0 28 0; #X connect 31 1 18 0; -#X connect 32 0 45 0; -#X connect 46 0 47 0; -#X connect 47 0 4 1; -#X connect 48 0 32 0; -#X connect 49 0 28 0; +#X connect 45 0 46 0; +#X connect 46 0 4 1; +#X connect 47 0 53 0; +#X connect 50 0 52 0; +#X connect 50 1 51 0; +#X connect 51 0 53 0; +#X connect 52 0 57 0; +#X connect 52 1 57 0; +#X connect 52 2 56 0; +#X connect 52 3 56 0; +#X connect 52 4 55 0; +#X connect 52 5 55 0; +#X connect 53 0 44 0; +#X connect 54 0 28 0; +#X connect 55 0 51 0; +#X connect 56 0 51 0; +#X connect 57 0 51 0; From 95bf4eb46359b872373605676d16fefdf894ef7d Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 15:40:58 +0200 Subject: [PATCH 324/387] cosmetic --- examples/15.OPENGL3.2/VBOline.pd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/15.OPENGL3.2/VBOline.pd b/examples/15.OPENGL3.2/VBOline.pd index 17d9c451a..91099d145 100644 --- a/examples/15.OPENGL3.2/VBOline.pd +++ b/examples/15.OPENGL3.2/VBOline.pd @@ -83,7 +83,7 @@ #X connect 12 0 3 0; #X connect 12 0 2 0; #X connect 12 0 1 0; -#X restore 275 364 pd send_tables; +#X restore 275 365 pd send_tables; #X obj 314 161 f; #X msg 330 77 res 2 \, color 1 1 1 1 \, pos 0 0 0 0 \, pos 1 1 0 0; #X obj 198 45 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; @@ -99,8 +99,8 @@ #X connect 1 0 46 0; #X connect 1 1 59 0; #X connect 2 0 46 0; -#X connect 3 0 58 0; #X connect 3 0 63 0; +#X connect 3 0 58 0; #X connect 6 0 56 0; #X connect 7 0 5 0; #X connect 15 1 7 0; From 460b061ddd90f0671615967a21e3d97925bb313b Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 15:41:16 +0200 Subject: [PATCH 325/387] new circle pimitive using VBO --- examples/15.OPENGL3.2/VBOcircle.pd | 250 +++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 examples/15.OPENGL3.2/VBOcircle.pd diff --git a/examples/15.OPENGL3.2/VBOcircle.pd b/examples/15.OPENGL3.2/VBOcircle.pd new file mode 100644 index 000000000..e417cd849 --- /dev/null +++ b/examples/15.OPENGL3.2/VBOcircle.pd @@ -0,0 +1,250 @@ +#N canvas 707 27 1210 853 12; +#X obj 34 27 inlet; +#X obj 276 113 gemargs; +#X obj 344 30 inlet; +#X text 418 245 forward to the corresponding table, f 21; +#X obj 407 380 send; +#X obj 481 294 list split 1; +#X obj 407 321 list trim; +#X obj 367 296 list split 1; +#X obj 683 251 unpack f f f f; +#X msg 683 417 const \$1; +#X obj 683 440 s table-\$0-colorR; +#X obj 261 21 loadbang; +#X msg 778 278 const \$1; +#X msg 746 324 const \$1; +#X msg 714 371 const \$1; +#X obj 714 394 s table-\$0-colorG; +#X obj 746 347 s table-\$0-colorB; +#X obj 778 301 s table-\$0-colorA; +#X obj 683 188 route color; +#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; +#X obj 344 476 delay 0; +#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; +#X text 694 213 RGB or RGBA value; +#X obj 344 505 \$0; +#X obj 261 614 \$0; +#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 261 48 t b b; +#X obj 344 245 t b a a; +#X obj 344 430 b; +#X msg 365 116 color 1 1 1 1; +#X obj 58 83 table table-\$0-posX 4; +#X obj 58 105 table table-\$0-posY 4; +#X obj 58 127 table table-\$0-posZ 4; +#X obj 58 152 table table-\$0-colorR 4; +#X obj 58 174 table table-\$0-colorG 4; +#X obj 58 196 table table-\$0-colorB 4; +#X obj 58 218 table table-\$0-colorA 4; +#X obj 58 243 table table-\$0-textureU 4; +#X obj 58 265 table table-\$0-textureV 4; +#X obj 58 290 table table-\$0-normalX 4; +#X obj 58 312 table table-\$0-normalY 4; +#X obj 58 334 table table-\$0-normalZ 4; +#X obj 34 775 outlet; +#X obj 481 318 list prepend \$0; +#X msg 481 341 symbol table-\$1-\$2; +#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; +#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; +#X text 256 780 TODO : add a size message for the square (is that really needed? a scaleXYZ object can be use); +#X obj 866 419 route draw; +#X obj 866 677 t a; +#X obj 866 445 route point points line lines fill; +#X msg 866 486 draw point; +#X obj 344 152 route table res, f 27; +#X msg 491 116 res 20; +#N canvas 915 123 722 770 resolution 0; +#X obj 42 10 inlet; +#X obj 137 70 + 2; +#N canvas 457 346 481 444 resize_tables 0; +#X obj 128 109 s table-\$0-posX; +#X obj 128 131 s table-\$0-posY; +#X obj 128 153 s table-\$0-posZ; +#X obj 128 177 s table-\$0-colorR; +#X obj 128 199 s table-\$0-colorG; +#X obj 128 221 s table-\$0-colorB; +#X obj 128 243 s table-\$0-colorA; +#X obj 128 266 s table-\$0-textureU; +#X obj 128 288 s table-\$0-textureV; +#X obj 128 313 s table-\$0-normalX; +#X obj 128 335 s table-\$0-normalY; +#X obj 128 357 s table-\$0-normalZ; +#X msg 90 54 resize \$1; +#X obj 88 23 inlet; +#X connect 12 0 0 0; +#X connect 12 0 11 0; +#X connect 12 0 10 0; +#X connect 12 0 9 0; +#X connect 12 0 8 0; +#X connect 12 0 7 0; +#X connect 12 0 6 0; +#X connect 12 0 5 0; +#X connect 12 0 4 0; +#X connect 12 0 3 0; +#X connect 12 0 2 0; +#X connect 12 0 1 0; +#X connect 13 0 12 0; +#X restore 137 97 pd resize_tables; +#X obj 42 38 t b f f; +#N canvas -10 69 452 340 init_tables 0; +#X obj 118 96 s table-\$0-posZ; +#X obj 118 256 s table-\$0-normalX; +#X obj 118 278 s table-\$0-normalY; +#X obj 98 16 inlet; +#X connect 3 0 2 0; +#X connect 3 0 1 0; +#X connect 3 0 0 0; +#X restore 73 343 pd init_tables; +#X msg 73 316 const 0; +#N canvas -10 69 452 340 init_tables 0; +#X obj 118 120 s table-\$0-colorR; +#X obj 118 142 s table-\$0-colorG; +#X obj 118 164 s table-\$0-colorB; +#X obj 118 186 s table-\$0-colorA; +#X obj 118 300 s table-\$0-normalZ; +#X obj 98 16 inlet; +#X connect 5 0 4 0; +#X connect 5 0 3 0; +#X connect 5 0 2 0; +#X connect 5 0 1 0; +#X connect 5 0 0 0; +#X restore 59 399 pd init_tables; +#X msg 59 372 const 1; +#X obj 141 200 until; +#X obj 201 239 f; +#X obj 264 305 + 1; +#X msg 201 191 0; +#X obj 201 354 /; +#X obj 141 152 t f b f, f 17; +#X obj 344 261 atan; +#X text 383 288 2 pi; +#X msg 344 234 1; +#X obj 344 208 loadbang; +#X obj 201 381 *; +#X obj 253 606 cos; +#X obj 473 614 sin; +#X obj 265 641 tabwrite table-\$0-posX; +#X obj 489 641 tabwrite table-\$0-posY; +#X obj 201 268 t f f; +#X obj 253 672 + 1; +#X obj 253 695 / 2; +#X obj 450 544 f; +#X obj 473 670 + 1; +#X obj 473 693 / 2; +#X obj 42 459 t b b; +#X msg 42 510 0; +#X msg 74 484 0; +#X obj 344 287 * 8; +#X obj 253 723 tabwrite table-\$0-textureU; +#X obj 473 720 tabwrite table-\$0-textureV; +#X connect 0 0 3 0; +#X connect 1 0 2 0; +#X connect 3 0 5 0; +#X connect 3 0 7 0; +#X connect 3 0 29 0; +#X connect 3 1 13 0; +#X connect 3 2 1 0; +#X connect 5 0 4 0; +#X connect 7 0 6 0; +#X connect 8 0 9 0; +#X connect 9 0 23 0; +#X connect 10 0 9 1; +#X connect 10 0 26 0; +#X connect 11 0 9 0; +#X connect 12 0 18 0; +#X connect 13 0 8 0; +#X connect 13 1 11 0; +#X connect 13 2 12 1; +#X connect 14 0 32 0; +#X connect 16 0 14 0; +#X connect 17 0 16 0; +#X connect 18 0 19 0; +#X connect 18 0 20 0; +#X connect 19 0 21 0; +#X connect 19 0 24 0; +#X connect 20 0 22 0; +#X connect 20 0 27 0; +#X connect 23 0 12 0; +#X connect 23 1 10 0; +#X connect 24 0 25 0; +#X connect 25 0 33 0; +#X connect 26 0 21 1; +#X connect 26 0 22 1; +#X connect 26 0 33 1; +#X connect 26 0 34 1; +#X connect 27 0 28 0; +#X connect 28 0 34 0; +#X connect 29 0 30 0; +#X connect 29 1 31 0; +#X connect 30 0 21 0; +#X connect 30 0 24 0; +#X connect 30 0 22 0; +#X connect 30 0 27 0; +#X connect 31 0 26 0; +#X connect 32 0 18 1; +#X restore 437 186 pd resolution; +#X msg 1063 486 draw trifan; +#X msg 78 662 resize \$1; +#X obj 217 9 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 77 635 + 2; +#X msg 960 487 draw linestrip; +#X text 252 823 TODO : lis render is not good.; +#X obj 34 721 gemvertexbuffer \; draw trifan \;; +#X connect 0 0 62 0; +#X connect 1 0 53 0; +#X connect 2 0 53 0; +#X connect 5 0 44 0; +#X connect 6 0 4 0; +#X connect 7 1 6 0; +#X connect 8 0 9 0; +#X connect 8 1 14 0; +#X connect 8 2 13 0; +#X connect 8 3 12 0; +#X connect 9 0 10 0; +#X connect 11 0 27 0; +#X connect 12 0 17 0; +#X connect 13 0 16 0; +#X connect 14 0 15 0; +#X connect 18 0 8 0; +#X connect 18 0 20 0; +#X connect 18 1 49 0; +#X connect 19 0 62 0; +#X connect 20 0 23 0; +#X connect 23 0 19 0; +#X connect 24 0 46 0; +#X connect 25 0 23 0; +#X connect 26 0 24 0; +#X connect 27 0 1 0; +#X connect 27 0 24 0; +#X connect 27 1 30 0; +#X connect 27 1 54 0; +#X connect 28 0 29 0; +#X connect 28 1 7 0; +#X connect 28 2 5 0; +#X connect 29 0 20 0; +#X connect 30 0 53 0; +#X connect 44 0 45 0; +#X connect 45 0 4 1; +#X connect 46 0 62 0; +#X connect 49 0 51 0; +#X connect 49 1 50 0; +#X connect 50 0 62 0; +#X connect 51 0 52 0; +#X connect 51 1 52 0; +#X connect 51 2 60 0; +#X connect 51 3 60 0; +#X connect 51 4 56 0; +#X connect 51 5 56 0; +#X connect 52 0 50 0; +#X connect 53 0 28 0; +#X connect 53 1 55 0; +#X connect 53 1 59 0; +#X connect 53 2 18 0; +#X connect 54 0 53 0; +#X connect 56 0 50 0; +#X connect 57 0 62 0; +#X connect 58 0 27 0; +#X connect 59 0 57 0; +#X connect 60 0 50 0; +#X connect 62 0 43 0; From 9d1f304cce1d867f5bccf7135b5ceeff95458e79 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 17:27:27 +0200 Subject: [PATCH 326/387] better init --- .../{06.matrix.pd => 05.matrix.pd} | 0 .../{08.lighting.pd => 06.lighting.pd} | 0 .../{05.geometry.pd => 08.geometry.pd} | 0 examples/15.OPENGL3.2/VBOcircle.pd | 108 +++++++++--------- 4 files changed, 54 insertions(+), 54 deletions(-) rename examples/15.OPENGL3.2/{06.matrix.pd => 05.matrix.pd} (100%) rename examples/15.OPENGL3.2/{08.lighting.pd => 06.lighting.pd} (100%) rename examples/15.OPENGL3.2/{05.geometry.pd => 08.geometry.pd} (100%) diff --git a/examples/15.OPENGL3.2/06.matrix.pd b/examples/15.OPENGL3.2/05.matrix.pd similarity index 100% rename from examples/15.OPENGL3.2/06.matrix.pd rename to examples/15.OPENGL3.2/05.matrix.pd diff --git a/examples/15.OPENGL3.2/08.lighting.pd b/examples/15.OPENGL3.2/06.lighting.pd similarity index 100% rename from examples/15.OPENGL3.2/08.lighting.pd rename to examples/15.OPENGL3.2/06.lighting.pd diff --git a/examples/15.OPENGL3.2/05.geometry.pd b/examples/15.OPENGL3.2/08.geometry.pd similarity index 100% rename from examples/15.OPENGL3.2/05.geometry.pd rename to examples/15.OPENGL3.2/08.geometry.pd diff --git a/examples/15.OPENGL3.2/VBOcircle.pd b/examples/15.OPENGL3.2/VBOcircle.pd index e417cd849..8b3c913ab 100644 --- a/examples/15.OPENGL3.2/VBOcircle.pd +++ b/examples/15.OPENGL3.2/VBOcircle.pd @@ -47,16 +47,14 @@ #X msg 481 341 symbol table-\$1-\$2; #X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; #X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; -#X text 256 780 TODO : add a size message for the square (is that really needed? a scaleXYZ object can be use); #X obj 866 419 route draw; #X obj 866 677 t a; #X obj 866 445 route point points line lines fill; #X msg 866 486 draw point; #X obj 344 152 route table res, f 27; -#X msg 491 116 res 20; -#N canvas 915 123 722 770 resolution 0; +#N canvas 822 119 722 770 resolution 0; #X obj 42 10 inlet; -#X obj 137 70 + 2; +#X obj 137 90 + 2; #N canvas 457 346 481 444 resize_tables 0; #X obj 128 109 s table-\$0-posX; #X obj 128 131 s table-\$0-posY; @@ -85,8 +83,8 @@ #X connect 12 0 2 0; #X connect 12 0 1 0; #X connect 13 0 12 0; -#X restore 137 97 pd resize_tables; -#X obj 42 38 t b f f; +#X restore 137 117 pd resize_tables; +#X obj 42 58 t b f f; #N canvas -10 69 452 340 init_tables 0; #X obj 118 96 s table-\$0-posZ; #X obj 118 256 s table-\$0-normalX; @@ -130,19 +128,20 @@ #X obj 253 672 + 1; #X obj 253 695 / 2; #X obj 450 544 f; -#X obj 473 670 + 1; -#X obj 473 693 / 2; #X obj 42 459 t b b; #X msg 42 510 0; #X msg 74 484 0; #X obj 344 287 * 8; #X obj 253 723 tabwrite table-\$0-textureU; #X obj 473 720 tabwrite table-\$0-textureV; -#X connect 0 0 3 0; +#X obj 473 670 - 1; +#X obj 473 693 / -2; +#X obj 42 34 f 20; +#X connect 0 0 35 0; #X connect 1 0 2 0; #X connect 3 0 5 0; #X connect 3 0 7 0; -#X connect 3 0 29 0; +#X connect 3 0 27 0; #X connect 3 1 13 0; #X connect 3 2 1 0; #X connect 5 0 4 0; @@ -156,7 +155,7 @@ #X connect 13 0 8 0; #X connect 13 1 11 0; #X connect 13 2 12 1; -#X connect 14 0 32 0; +#X connect 14 0 30 0; #X connect 16 0 14 0; #X connect 17 0 16 0; #X connect 18 0 19 0; @@ -164,36 +163,39 @@ #X connect 19 0 21 0; #X connect 19 0 24 0; #X connect 20 0 22 0; -#X connect 20 0 27 0; +#X connect 20 0 33 0; #X connect 23 0 12 0; #X connect 23 1 10 0; #X connect 24 0 25 0; -#X connect 25 0 33 0; +#X connect 25 0 31 0; #X connect 26 0 21 1; #X connect 26 0 22 1; -#X connect 26 0 33 1; -#X connect 26 0 34 1; +#X connect 26 0 31 1; +#X connect 26 0 32 1; #X connect 27 0 28 0; -#X connect 28 0 34 0; -#X connect 29 0 30 0; -#X connect 29 1 31 0; -#X connect 30 0 21 0; -#X connect 30 0 24 0; -#X connect 30 0 22 0; -#X connect 30 0 27 0; -#X connect 31 0 26 0; -#X connect 32 0 18 1; +#X connect 27 1 29 0; +#X connect 28 0 21 0; +#X connect 28 0 22 0; +#X connect 28 0 24 0; +#X connect 28 0 33 0; +#X connect 29 0 26 0; +#X connect 30 0 18 1; +#X connect 33 0 34 0; +#X connect 34 0 32 0; +#X connect 35 0 3 0; #X restore 437 186 pd resolution; #X msg 1063 486 draw trifan; #X msg 78 662 resize \$1; #X obj 217 9 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; #X obj 77 635 + 2; #X msg 960 487 draw linestrip; -#X text 252 823 TODO : lis render is not good.; #X obj 34 721 gemvertexbuffer \; draw trifan \;; -#X connect 0 0 62 0; -#X connect 1 0 53 0; -#X connect 2 0 53 0; +#X text 256 780 TODO : add a size message (is that really needed? a scaleXYZ object can be use); +#X text 252 823 TODO : line render is not good.; +#X connect 0 0 59 0; +#X connect 1 0 52 0; +#X connect 1 1 53 0; +#X connect 2 0 52 0; #X connect 5 0 44 0; #X connect 6 0 4 0; #X connect 7 1 6 0; @@ -208,8 +210,8 @@ #X connect 14 0 15 0; #X connect 18 0 8 0; #X connect 18 0 20 0; -#X connect 18 1 49 0; -#X connect 19 0 62 0; +#X connect 18 1 48 0; +#X connect 19 0 59 0; #X connect 20 0 23 0; #X connect 23 0 19 0; #X connect 24 0 46 0; @@ -218,33 +220,31 @@ #X connect 27 0 1 0; #X connect 27 0 24 0; #X connect 27 1 30 0; -#X connect 27 1 54 0; #X connect 28 0 29 0; #X connect 28 1 7 0; #X connect 28 2 5 0; #X connect 29 0 20 0; -#X connect 30 0 53 0; +#X connect 30 0 52 0; #X connect 44 0 45 0; #X connect 45 0 4 1; -#X connect 46 0 62 0; -#X connect 49 0 51 0; -#X connect 49 1 50 0; -#X connect 50 0 62 0; -#X connect 51 0 52 0; -#X connect 51 1 52 0; -#X connect 51 2 60 0; -#X connect 51 3 60 0; -#X connect 51 4 56 0; -#X connect 51 5 56 0; -#X connect 52 0 50 0; -#X connect 53 0 28 0; -#X connect 53 1 55 0; -#X connect 53 1 59 0; -#X connect 53 2 18 0; -#X connect 54 0 53 0; -#X connect 56 0 50 0; -#X connect 57 0 62 0; -#X connect 58 0 27 0; -#X connect 59 0 57 0; -#X connect 60 0 50 0; -#X connect 62 0 43 0; +#X connect 46 0 59 0; +#X connect 48 0 50 0; +#X connect 48 1 49 0; +#X connect 49 0 59 0; +#X connect 50 0 51 0; +#X connect 50 1 51 0; +#X connect 50 2 58 0; +#X connect 50 3 58 0; +#X connect 50 4 54 0; +#X connect 50 5 54 0; +#X connect 51 0 49 0; +#X connect 52 0 28 0; +#X connect 52 1 53 0; +#X connect 52 1 57 0; +#X connect 52 2 18 0; +#X connect 54 0 49 0; +#X connect 55 0 59 0; +#X connect 56 0 27 0; +#X connect 57 0 55 0; +#X connect 58 0 49 0; +#X connect 59 0 43 0; From d5d7b749cfd1446850b4e577b0a88b1ce6f94da7 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 17:27:40 +0200 Subject: [PATCH 327/387] new primitives based on VBO --- examples/15.OPENGL3.2/VBOmesh_quad.pd | 406 ++++++++++++++++++++++ examples/15.OPENGL3.2/VBOmesh_tri.pd | 465 ++++++++++++++++++++++++++ 2 files changed, 871 insertions(+) create mode 100644 examples/15.OPENGL3.2/VBOmesh_quad.pd create mode 100644 examples/15.OPENGL3.2/VBOmesh_tri.pd diff --git a/examples/15.OPENGL3.2/VBOmesh_quad.pd b/examples/15.OPENGL3.2/VBOmesh_quad.pd new file mode 100644 index 000000000..56fa9884e --- /dev/null +++ b/examples/15.OPENGL3.2/VBOmesh_quad.pd @@ -0,0 +1,406 @@ +#N canvas 495 59 1210 853 12; +#X obj 34 27 inlet; +#X obj 276 113 gemargs; +#X obj 344 30 inlet; +#X text 418 245 forward to the corresponding table, f 21; +#X obj 407 380 send; +#X obj 481 294 list split 1; +#X obj 407 321 list trim; +#X obj 367 296 list split 1; +#X obj 683 251 unpack f f f f; +#X msg 683 417 const \$1; +#X obj 683 440 s table-\$0-colorR; +#X obj 261 21 loadbang; +#X msg 778 278 const \$1; +#X msg 746 324 const \$1; +#X msg 714 371 const \$1; +#X obj 714 394 s table-\$0-colorG; +#X obj 746 347 s table-\$0-colorB; +#X obj 778 301 s table-\$0-colorA; +#X obj 683 188 route color; +#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; +#X obj 344 476 delay 0; +#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; +#X text 694 213 RGB or RGBA value; +#X obj 344 505 \$0; +#X obj 261 614 \$0; +#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 261 48 t b b; +#X obj 344 245 t b a a; +#X obj 344 430 b; +#X msg 365 116 color 1 1 1 1; +#X obj 58 83 table table-\$0-posX 4; +#X obj 58 105 table table-\$0-posY 4; +#X obj 58 127 table table-\$0-posZ 4; +#X obj 58 152 table table-\$0-colorR 4; +#X obj 58 174 table table-\$0-colorG 4; +#X obj 58 196 table table-\$0-colorB 4; +#X obj 58 218 table table-\$0-colorA 4; +#X obj 58 243 table table-\$0-textureU 4; +#X obj 58 265 table table-\$0-textureV 4; +#X obj 58 290 table table-\$0-normalX 4; +#X obj 58 312 table table-\$0-normalY 4; +#X obj 58 334 table table-\$0-normalZ 4; +#X obj 34 775 outlet; +#X obj 481 318 list prepend \$0; +#X msg 481 341 symbol table-\$1-\$2; +#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; +#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; +#X obj 866 419 route draw; +#X obj 866 677 t a; +#X obj 866 445 route point points line lines fill; +#X msg 866 486 draw point; +#X obj 344 152 route table res, f 27; +#N canvas 298 0 1413 927 resolution 0; +#X obj 42 10 inlet; +#N canvas 996 329 481 444 resize_tables 0; +#X obj 128 189 s table-\$0-posX; +#X obj 128 211 s table-\$0-posY; +#X obj 128 233 s table-\$0-posZ; +#X obj 128 257 s table-\$0-colorR; +#X obj 128 279 s table-\$0-colorG; +#X obj 128 301 s table-\$0-colorB; +#X obj 128 323 s table-\$0-colorA; +#X obj 128 346 s table-\$0-textureU; +#X obj 128 368 s table-\$0-textureV; +#X obj 128 393 s table-\$0-normalX; +#X obj 128 415 s table-\$0-normalY; +#X obj 128 437 s table-\$0-normalZ; +#X msg 90 134 resize \$1; +#X obj 90 23 inlet; +#X obj 90 50 t f f; +#X obj 90 77 *; +#X obj 90 104 * 4; +#X connect 12 0 0 0; +#X connect 12 0 11 0; +#X connect 12 0 10 0; +#X connect 12 0 9 0; +#X connect 12 0 8 0; +#X connect 12 0 7 0; +#X connect 12 0 6 0; +#X connect 12 0 5 0; +#X connect 12 0 4 0; +#X connect 12 0 3 0; +#X connect 12 0 2 0; +#X connect 12 0 1 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 14 1 15 1; +#X connect 15 0 16 0; +#X connect 16 0 12 0; +#X restore 143 89 pd resize_tables; +#X obj 42 58 t b f f; +#N canvas -10 69 452 340 init_tables 0; +#X obj 118 96 s table-\$0-posZ; +#X obj 118 256 s table-\$0-normalX; +#X obj 118 278 s table-\$0-normalY; +#X obj 98 16 inlet; +#X connect 3 0 2 0; +#X connect 3 0 1 0; +#X connect 3 0 0 0; +#X restore 54 156 pd init_tables; +#X msg 54 129 const 0; +#N canvas -10 69 452 340 init_tables 0; +#X obj 118 120 s table-\$0-colorR; +#X obj 118 142 s table-\$0-colorG; +#X obj 118 164 s table-\$0-colorB; +#X obj 118 186 s table-\$0-colorA; +#X obj 118 300 s table-\$0-normalZ; +#X obj 98 16 inlet; +#X connect 5 0 4 0; +#X connect 5 0 3 0; +#X connect 5 0 2 0; +#X connect 5 0 1 0; +#X connect 5 0 0 0; +#X restore 42 212 pd init_tables; +#X msg 42 185 const 1; +#X obj 193 163 until; +#X obj 233 191 f; +#X obj 296 254 + 1; +#X msg 251 164 0; +#X obj 193 135 t f b f, f 17; +#X obj 305 829 tabwrite table-\$0-posX; +#X obj 512 828 tabwrite table-\$0-posY; +#X obj 233 217 t f f; +#X obj 664 763 f; +#X obj 233 342 until; +#X obj 273 370 f; +#X obj 322 422 + 1; +#X msg 291 343 0; +#X obj 233 314 t f b f, f 17; +#X obj 233 288 f; +#X obj 233 263 t b f; +#X obj 273 584 /; +#X obj 304 584 /; +#X obj 379 584 /; +#X obj 419 584 /; +#X obj 379 560 + 1; +#X obj 485 585 /; +#X obj 525 584 /; +#X obj 591 584 /; +#X obj 631 584 /; +#X obj 485 561 + 1; +#X obj 525 560 + 1; +#X obj 631 560 + 1; +#X obj 273 494 t a a a a a, f 61; +#X obj 305 803 - 1; +#X obj 273 678 pack f f f; +#X obj 273 716 unpack f f f; +#X obj 474 640 + 1; +#X obj 580 639 + 2; +#X obj 686 638 + 3; +#X obj 499 363 *; +#X obj 273 396 t f f f; +#X obj 481 390 +; +#X obj 481 416 * 4; +#X obj 273 450 pack f f f f, f 30; +#X obj 273 536 unpack f f f f; +#X obj 379 536 unpack f f f f; +#X obj 485 536 unpack f f f f; +#X obj 591 536 unpack f f f f; +#X obj 411 232 f; +#X obj 42 34 f 5; +#X obj 305 780 * 2; +#X obj 512 781 * -2; +#X obj 512 804 + 1; +#X obj 414 90 inlet; +#X obj 1177 762 f; +#X obj 786 863 tabwrite table-\$0-textureU; +#X obj 998 867 tabwrite table-\$0-textureV; +#X obj 786 583 /; +#X obj 817 583 /; +#X obj 892 583 /; +#X obj 932 583 /; +#X obj 892 559 + 1; +#X obj 998 584 /; +#X obj 1038 583 /; +#X obj 1104 583 /; +#X obj 1144 583 /; +#X obj 998 560 + 1; +#X obj 1038 559 + 1; +#X obj 1144 559 + 1; +#X obj 786 493 t a a a a a, f 61; +#X obj 786 677 pack f f f; +#X obj 786 715 unpack f f f; +#X obj 987 639 + 1; +#X obj 1093 638 + 2; +#X obj 1199 637 + 3; +#X obj 786 535 unpack f f f f; +#X obj 892 535 unpack f f f f; +#X obj 998 535 unpack f f f f; +#X obj 1104 535 unpack f f f f; +#X obj 786 388 unpack f f f f, f 24; +#X obj 786 460 pack f f f f, f 25; +#X obj 786 424 + 0.5; +#X obj 839 424 + 0.5; +#X obj 891 424 + 1; +#X connect 0 0 52 0; +#X connect 2 0 4 0; +#X connect 2 0 6 0; +#X connect 2 1 11 0; +#X connect 2 2 1 0; +#X connect 2 2 51 0; +#X connect 4 0 3 0; +#X connect 6 0 5 0; +#X connect 7 0 8 0; +#X connect 8 0 14 0; +#X connect 9 0 8 1; +#X connect 10 0 8 1; +#X connect 11 0 7 0; +#X connect 11 1 10 0; +#X connect 11 2 21 1; +#X connect 11 2 42 1; +#X connect 14 0 22 0; +#X connect 14 1 9 0; +#X connect 15 0 12 1; +#X connect 15 0 13 1; +#X connect 16 0 17 0; +#X connect 17 0 43 0; +#X connect 18 0 17 1; +#X connect 19 0 17 1; +#X connect 20 0 16 0; +#X connect 20 1 19 0; +#X connect 21 0 20 0; +#X connect 22 0 21 0; +#X connect 22 1 42 0; +#X connect 22 1 46 1; +#X connect 23 0 37 0; +#X connect 24 0 37 1; +#X connect 25 0 37 0; +#X connect 26 0 37 1; +#X connect 27 0 25 0; +#X connect 28 0 37 0; +#X connect 29 0 37 1; +#X connect 30 0 37 0; +#X connect 31 0 37 1; +#X connect 32 0 28 0; +#X connect 33 0 29 0; +#X connect 34 0 31 0; +#X connect 35 0 47 0; +#X connect 35 1 48 0; +#X connect 35 2 49 0; +#X connect 35 3 50 0; +#X connect 36 0 12 0; +#X connect 37 0 38 0; +#X connect 38 0 53 0; +#X connect 38 1 54 0; +#X connect 38 2 15 0; +#X connect 39 0 37 2; +#X connect 40 0 37 2; +#X connect 41 0 37 2; +#X connect 42 0 44 1; +#X connect 43 0 46 0; +#X connect 43 1 18 0; +#X connect 43 2 44 0; +#X connect 44 0 45 0; +#X connect 45 0 46 3; +#X connect 46 0 35 0; +#X connect 46 0 82 0; +#X connect 47 0 23 0; +#X connect 47 1 24 0; +#X connect 47 2 23 1; +#X connect 47 2 24 1; +#X connect 47 3 37 2; +#X connect 48 0 27 0; +#X connect 48 1 26 0; +#X connect 48 2 25 1; +#X connect 48 2 26 1; +#X connect 48 3 39 0; +#X connect 49 0 32 0; +#X connect 49 1 33 0; +#X connect 49 2 28 1; +#X connect 49 2 29 1; +#X connect 49 3 40 0; +#X connect 50 0 30 0; +#X connect 50 1 34 0; +#X connect 50 2 30 1; +#X connect 50 2 31 1; +#X connect 50 3 41 0; +#X connect 51 0 46 2; +#X connect 52 0 2 0; +#X connect 53 0 36 0; +#X connect 54 0 55 0; +#X connect 55 0 13 0; +#X connect 57 0 58 1; +#X connect 57 0 59 1; +#X connect 60 0 73 0; +#X connect 61 0 73 1; +#X connect 62 0 73 0; +#X connect 63 0 73 1; +#X connect 64 0 62 0; +#X connect 65 0 73 0; +#X connect 66 0 73 1; +#X connect 67 0 73 0; +#X connect 68 0 73 1; +#X connect 69 0 65 0; +#X connect 70 0 66 0; +#X connect 71 0 68 0; +#X connect 72 0 78 0; +#X connect 72 1 79 0; +#X connect 72 2 80 0; +#X connect 72 3 81 0; +#X connect 73 0 74 0; +#X connect 74 0 58 0; +#X connect 74 1 59 0; +#X connect 74 2 57 0; +#X connect 75 0 73 2; +#X connect 76 0 73 2; +#X connect 77 0 73 2; +#X connect 78 0 60 0; +#X connect 78 1 61 0; +#X connect 78 2 60 1; +#X connect 78 2 61 1; +#X connect 78 3 73 2; +#X connect 79 0 64 0; +#X connect 79 1 63 0; +#X connect 79 2 62 1; +#X connect 79 2 63 1; +#X connect 79 3 75 0; +#X connect 80 0 69 0; +#X connect 80 1 70 0; +#X connect 80 2 65 1; +#X connect 80 2 66 1; +#X connect 80 3 76 0; +#X connect 81 0 67 0; +#X connect 81 1 71 0; +#X connect 81 2 67 1; +#X connect 81 2 68 1; +#X connect 81 3 77 0; +#X connect 82 0 84 0; +#X connect 82 1 85 0; +#X connect 82 2 86 0; +#X connect 82 3 83 3; +#X connect 83 0 72 0; +#X connect 84 0 83 0; +#X connect 85 0 83 1; +#X connect 86 0 83 2; +#X restore 437 186 pd resolution; +#X msg 1063 486 draw trifan; +#X msg 74 662 resize \$1; +#X obj 217 9 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X msg 960 487 draw linestrip; +#X obj 74 605 *; +#X obj 74 576 t f f; +#X obj 74 633 * 4; +#X obj 34 721 gemvertexbuffer \; draw quad \;; +#X text 259 786 TODO : draw line did not work correctly; +#X connect 0 0 61 0; +#X connect 1 0 52 0; +#X connect 1 1 53 0; +#X connect 2 0 52 0; +#X connect 5 0 44 0; +#X connect 6 0 4 0; +#X connect 7 1 6 0; +#X connect 8 0 9 0; +#X connect 8 1 14 0; +#X connect 8 2 13 0; +#X connect 8 3 12 0; +#X connect 9 0 10 0; +#X connect 11 0 27 0; +#X connect 12 0 17 0; +#X connect 13 0 16 0; +#X connect 14 0 15 0; +#X connect 18 0 8 0; +#X connect 18 0 20 0; +#X connect 18 1 48 0; +#X connect 19 0 61 0; +#X connect 20 0 23 0; +#X connect 23 0 19 0; +#X connect 24 0 46 0; +#X connect 25 0 23 0; +#X connect 26 0 24 0; +#X connect 27 0 1 0; +#X connect 27 0 24 0; +#X connect 27 1 30 0; +#X connect 28 0 29 0; +#X connect 28 1 7 0; +#X connect 28 2 5 0; +#X connect 29 0 20 0; +#X connect 30 0 52 0; +#X connect 44 0 45 0; +#X connect 45 0 4 1; +#X connect 46 0 61 0; +#X connect 48 0 50 0; +#X connect 48 1 49 0; +#X connect 49 0 61 0; +#X connect 50 0 51 0; +#X connect 50 1 51 0; +#X connect 50 2 57 0; +#X connect 50 3 57 0; +#X connect 50 4 54 0; +#X connect 50 5 54 0; +#X connect 51 0 49 0; +#X connect 52 0 28 0; +#X connect 52 1 53 0; +#X connect 52 1 59 0; +#X connect 52 2 18 0; +#X connect 54 0 49 0; +#X connect 55 0 61 0; +#X connect 56 0 27 0; +#X connect 57 0 49 0; +#X connect 58 0 60 0; +#X connect 59 0 58 0; +#X connect 59 1 58 1; +#X connect 60 0 55 0; +#X connect 61 0 43 0; diff --git a/examples/15.OPENGL3.2/VBOmesh_tri.pd b/examples/15.OPENGL3.2/VBOmesh_tri.pd new file mode 100644 index 000000000..b184e3797 --- /dev/null +++ b/examples/15.OPENGL3.2/VBOmesh_tri.pd @@ -0,0 +1,465 @@ +#N canvas 495 59 1210 853 12; +#X obj 34 27 inlet; +#X obj 276 113 gemargs; +#X obj 344 30 inlet; +#X text 418 245 forward to the corresponding table, f 21; +#X obj 407 380 send; +#X obj 481 294 list split 1; +#X obj 407 321 list trim; +#X obj 367 296 list split 1; +#X obj 683 251 unpack f f f f; +#X msg 683 417 const \$1; +#X obj 683 440 s table-\$0-colorR; +#X obj 261 21 loadbang; +#X msg 778 278 const \$1; +#X msg 746 324 const \$1; +#X msg 714 371 const \$1; +#X obj 714 394 s table-\$0-colorG; +#X obj 746 347 s table-\$0-colorB; +#X obj 778 301 s table-\$0-colorA; +#X obj 683 188 route color; +#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; +#X obj 344 476 delay 0; +#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; +#X text 694 213 RGB or RGBA value; +#X obj 344 505 \$0; +#X obj 261 614 \$0; +#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X obj 261 48 t b b; +#X obj 344 245 t b a a; +#X obj 344 430 b; +#X msg 365 116 color 1 1 1 1; +#X obj 58 83 table table-\$0-posX 4; +#X obj 58 105 table table-\$0-posY 4; +#X obj 58 127 table table-\$0-posZ 4; +#X obj 58 152 table table-\$0-colorR 4; +#X obj 58 174 table table-\$0-colorG 4; +#X obj 58 196 table table-\$0-colorB 4; +#X obj 58 218 table table-\$0-colorA 4; +#X obj 58 243 table table-\$0-textureU 4; +#X obj 58 265 table table-\$0-textureV 4; +#X obj 58 290 table table-\$0-normalX 4; +#X obj 58 312 table table-\$0-normalY 4; +#X obj 58 334 table table-\$0-normalZ 4; +#X obj 34 775 outlet; +#X obj 481 318 list prepend \$0; +#X msg 481 341 symbol table-\$1-\$2; +#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; +#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; +#X obj 866 419 route draw; +#X obj 866 677 t a; +#X obj 866 445 route point points line lines fill; +#X msg 866 486 draw point; +#X obj 344 152 route table res, f 27; +#N canvas 50 72 1769 922 resolution 0; +#X obj 42 10 inlet; +#N canvas 996 329 481 444 resize_tables 0; +#X obj 128 189 s table-\$0-posX; +#X obj 128 211 s table-\$0-posY; +#X obj 128 233 s table-\$0-posZ; +#X obj 128 257 s table-\$0-colorR; +#X obj 128 279 s table-\$0-colorG; +#X obj 128 301 s table-\$0-colorB; +#X obj 128 323 s table-\$0-colorA; +#X obj 128 346 s table-\$0-textureU; +#X obj 128 368 s table-\$0-textureV; +#X obj 128 393 s table-\$0-normalX; +#X obj 128 415 s table-\$0-normalY; +#X obj 128 437 s table-\$0-normalZ; +#X msg 90 134 resize \$1; +#X obj 90 23 inlet; +#X obj 90 50 t f f; +#X obj 90 77 *; +#X obj 90 104 * 6; +#X connect 12 0 0 0; +#X connect 12 0 11 0; +#X connect 12 0 10 0; +#X connect 12 0 9 0; +#X connect 12 0 8 0; +#X connect 12 0 7 0; +#X connect 12 0 6 0; +#X connect 12 0 5 0; +#X connect 12 0 4 0; +#X connect 12 0 3 0; +#X connect 12 0 2 0; +#X connect 12 0 1 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 14 1 15 1; +#X connect 15 0 16 0; +#X connect 16 0 12 0; +#X restore 143 89 pd resize_tables; +#X obj 42 58 t b f f; +#N canvas -10 69 452 340 init_tables 0; +#X obj 118 96 s table-\$0-posZ; +#X obj 118 256 s table-\$0-normalX; +#X obj 118 278 s table-\$0-normalY; +#X obj 98 16 inlet; +#X connect 3 0 2 0; +#X connect 3 0 1 0; +#X connect 3 0 0 0; +#X restore 54 156 pd init_tables; +#X msg 54 129 const 0; +#N canvas -10 69 452 340 init_tables 0; +#X obj 118 120 s table-\$0-colorR; +#X obj 118 142 s table-\$0-colorG; +#X obj 118 164 s table-\$0-colorB; +#X obj 118 186 s table-\$0-colorA; +#X obj 118 300 s table-\$0-normalZ; +#X obj 98 16 inlet; +#X connect 5 0 4 0; +#X connect 5 0 3 0; +#X connect 5 0 2 0; +#X connect 5 0 1 0; +#X connect 5 0 0 0; +#X restore 42 212 pd init_tables; +#X msg 42 185 const 1; +#X obj 193 163 until; +#X obj 233 191 f; +#X obj 296 254 + 1; +#X msg 251 164 0; +#X obj 193 135 t f b f, f 17; +#X obj 274 802 tabwrite table-\$0-posX; +#X obj 481 801 tabwrite table-\$0-posY; +#X obj 233 217 t f f; +#X obj 632 736 f; +#X obj 233 342 until; +#X obj 273 370 f; +#X obj 322 422 + 1; +#X msg 291 343 0; +#X obj 233 314 t f b f, f 17; +#X obj 233 288 f; +#X obj 233 263 t b f; +#X obj 273 584 /; +#X obj 304 584 /; +#X obj 379 584 /; +#X obj 419 584 /; +#X obj 379 560 + 1; +#X obj 485 585 /; +#X obj 525 584 /; +#X obj 591 584 /; +#X obj 631 584 /; +#X obj 485 561 + 1; +#X obj 525 560 + 1; +#X obj 274 776 - 1; +#X obj 273 678 pack f f f; +#X obj 273 716 unpack f f f; +#X obj 474 640 + 1; +#X obj 580 639 + 2; +#X obj 686 638 + 3; +#X obj 499 363 *; +#X obj 273 396 t f f f; +#X obj 481 390 +; +#X obj 273 450 pack f f f f, f 30; +#X obj 273 536 unpack f f f f; +#X obj 379 536 unpack f f f f; +#X obj 485 536 unpack f f f f; +#X obj 591 536 unpack f f f f; +#X obj 411 232 f; +#X obj 42 34 f 5; +#X obj 274 753 * 2; +#X obj 481 754 * -2; +#X obj 481 777 + 1; +#X obj 1337 762 f; +#X obj 946 833 tabwrite table-\$0-textureU; +#X obj 1158 837 tabwrite table-\$0-textureV; +#X obj 946 583 /; +#X obj 977 583 /; +#X obj 1052 583 /; +#X obj 1092 583 /; +#X obj 1052 559 + 1; +#X obj 1158 584 /; +#X obj 1198 583 /; +#X obj 1264 583 /; +#X obj 1304 583 /; +#X obj 1158 560 + 1; +#X obj 1198 559 + 1; +#X obj 946 677 pack f f f; +#X obj 946 715 unpack f f f; +#X obj 1147 639 + 1; +#X obj 1253 638 + 2; +#X obj 1359 637 + 3; +#X obj 946 535 unpack f f f f; +#X obj 1052 535 unpack f f f f; +#X obj 1158 535 unpack f f f f; +#X obj 1264 535 unpack f f f f; +#X obj 946 388 unpack f f f f, f 24; +#X obj 946 460 pack f f f f, f 25; +#X obj 946 424 + 0.5; +#X obj 1001 424 + 0.5; +#X obj 1056 424 + 1; +#X obj 481 416 * 6; +#X obj 273 494 t a a a a a a, f 76; +#X obj 700 584 /; +#X obj 740 583 /; +#X obj 806 583 /; +#X obj 846 583 /; +#X obj 700 560 + 1; +#X obj 740 559 + 1; +#X obj 846 559 + 1; +#X obj 700 535 unpack f f f f; +#X obj 806 535 unpack f f f f; +#X obj 795 638 + 4; +#X obj 901 637 + 5; +#X obj 1374 584 /; +#X obj 1414 583 /; +#X obj 1480 583 /; +#X obj 1520 583 /; +#X obj 1374 560 + 1; +#X obj 1414 559 + 1; +#X obj 1520 559 + 1; +#X obj 1374 535 unpack f f f f; +#X obj 1480 535 unpack f f f f; +#X obj 946 493 t a a a a a a, f 77; +#X obj 1469 638 + 4; +#X obj 1575 637 + 5; +#X connect 0 0 49 0; +#X connect 2 0 4 0; +#X connect 2 0 6 0; +#X connect 2 1 11 0; +#X connect 2 2 1 0; +#X connect 2 2 48 0; +#X connect 4 0 3 0; +#X connect 6 0 5 0; +#X connect 7 0 8 0; +#X connect 8 0 14 0; +#X connect 9 0 8 1; +#X connect 10 0 8 1; +#X connect 11 0 7 0; +#X connect 11 1 10 0; +#X connect 11 2 21 1; +#X connect 11 2 40 1; +#X connect 14 0 22 0; +#X connect 14 1 9 0; +#X connect 15 0 12 1; +#X connect 15 0 13 1; +#X connect 16 0 17 0; +#X connect 17 0 41 0; +#X connect 18 0 17 1; +#X connect 19 0 17 1; +#X connect 20 0 16 0; +#X connect 20 1 19 0; +#X connect 21 0 20 0; +#X connect 22 0 21 0; +#X connect 22 1 40 0; +#X connect 22 1 43 1; +#X connect 23 0 35 0; +#X connect 24 0 35 1; +#X connect 25 0 35 0; +#X connect 26 0 35 1; +#X connect 27 0 25 0; +#X connect 28 0 35 0; +#X connect 29 0 35 1; +#X connect 30 0 35 0; +#X connect 31 0 35 1; +#X connect 32 0 28 0; +#X connect 33 0 29 0; +#X connect 34 0 12 0; +#X connect 35 0 36 0; +#X connect 36 0 50 0; +#X connect 36 1 51 0; +#X connect 36 2 15 0; +#X connect 37 0 35 2; +#X connect 38 0 35 2; +#X connect 39 0 35 2; +#X connect 40 0 42 1; +#X connect 41 0 43 0; +#X connect 41 1 18 0; +#X connect 41 2 42 0; +#X connect 42 0 81 0; +#X connect 43 0 76 0; +#X connect 43 0 82 0; +#X connect 44 0 23 0; +#X connect 44 1 24 0; +#X connect 44 2 23 1; +#X connect 44 2 24 1; +#X connect 44 3 35 2; +#X connect 45 0 27 0; +#X connect 45 1 26 0; +#X connect 45 2 25 1; +#X connect 45 2 26 1; +#X connect 45 3 37 0; +#X connect 46 0 32 0; +#X connect 46 1 33 0; +#X connect 46 2 28 1; +#X connect 46 2 29 1; +#X connect 46 3 38 0; +#X connect 47 0 30 0; +#X connect 47 1 31 0; +#X connect 47 2 30 1; +#X connect 47 2 31 1; +#X connect 47 3 39 0; +#X connect 48 0 43 2; +#X connect 49 0 2 0; +#X connect 50 0 34 0; +#X connect 51 0 52 0; +#X connect 52 0 13 0; +#X connect 53 0 54 1; +#X connect 53 0 55 1; +#X connect 56 0 67 0; +#X connect 57 0 67 1; +#X connect 58 0 67 0; +#X connect 59 0 67 1; +#X connect 60 0 58 0; +#X connect 61 0 67 0; +#X connect 62 0 67 1; +#X connect 63 0 67 0; +#X connect 64 0 67 1; +#X connect 65 0 61 0; +#X connect 66 0 62 0; +#X connect 67 0 68 0; +#X connect 68 0 54 0; +#X connect 68 1 55 0; +#X connect 68 2 53 0; +#X connect 69 0 67 2; +#X connect 70 0 67 2; +#X connect 71 0 67 2; +#X connect 72 0 56 0; +#X connect 72 1 57 0; +#X connect 72 2 56 1; +#X connect 72 2 57 1; +#X connect 72 3 67 2; +#X connect 73 0 60 0; +#X connect 73 1 59 0; +#X connect 73 2 58 1; +#X connect 73 2 59 1; +#X connect 73 3 69 0; +#X connect 74 0 65 0; +#X connect 74 1 66 0; +#X connect 74 2 61 1; +#X connect 74 2 62 1; +#X connect 74 3 70 0; +#X connect 75 0 63 0; +#X connect 75 1 64 0; +#X connect 75 2 63 1; +#X connect 75 2 64 1; +#X connect 75 3 71 0; +#X connect 76 0 78 0; +#X connect 76 1 79 0; +#X connect 76 2 80 0; +#X connect 76 3 77 3; +#X connect 77 0 103 0; +#X connect 78 0 77 0; +#X connect 79 0 77 1; +#X connect 80 0 77 2; +#X connect 81 0 43 3; +#X connect 82 0 44 0; +#X connect 82 1 45 0; +#X connect 82 2 46 0; +#X connect 82 3 47 0; +#X connect 82 4 90 0; +#X connect 82 5 91 0; +#X connect 83 0 35 0; +#X connect 84 0 35 1; +#X connect 85 0 35 0; +#X connect 86 0 35 1; +#X connect 87 0 83 0; +#X connect 88 0 84 0; +#X connect 89 0 86 0; +#X connect 90 0 87 0; +#X connect 90 1 88 0; +#X connect 90 2 83 1; +#X connect 90 2 84 1; +#X connect 90 3 92 0; +#X connect 91 0 85 0; +#X connect 91 1 89 0; +#X connect 91 2 85 1; +#X connect 91 2 86 1; +#X connect 91 3 93 0; +#X connect 92 0 35 2; +#X connect 93 0 35 2; +#X connect 94 0 67 0; +#X connect 95 0 67 1; +#X connect 96 0 67 0; +#X connect 97 0 67 1; +#X connect 98 0 94 0; +#X connect 99 0 95 0; +#X connect 100 0 97 0; +#X connect 101 0 98 0; +#X connect 101 1 99 0; +#X connect 101 2 94 1; +#X connect 101 2 95 1; +#X connect 101 3 104 0; +#X connect 102 0 96 0; +#X connect 102 1 100 0; +#X connect 102 2 96 1; +#X connect 102 2 97 1; +#X connect 102 3 105 0; +#X connect 103 0 72 0; +#X connect 103 1 73 0; +#X connect 103 2 74 0; +#X connect 103 3 75 0; +#X connect 103 4 101 0; +#X connect 103 5 102 0; +#X connect 104 0 67 2; +#X connect 105 0 67 2; +#X restore 437 186 pd resolution; +#X msg 1063 486 draw trifan; +#X msg 74 662 resize \$1; +#X obj 217 9 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; +#X msg 960 487 draw linestrip; +#X obj 74 605 *; +#X obj 74 576 t f f; +#X text 259 786 TODO : draw line did not work correctly; +#X obj 34 721 gemvertexbuffer \; draw tri \;; +#X obj 74 633 * 6; +#X connect 0 0 61 0; +#X connect 1 0 52 0; +#X connect 1 1 53 0; +#X connect 2 0 52 0; +#X connect 5 0 44 0; +#X connect 6 0 4 0; +#X connect 7 1 6 0; +#X connect 8 0 9 0; +#X connect 8 1 14 0; +#X connect 8 2 13 0; +#X connect 8 3 12 0; +#X connect 9 0 10 0; +#X connect 11 0 27 0; +#X connect 12 0 17 0; +#X connect 13 0 16 0; +#X connect 14 0 15 0; +#X connect 18 0 8 0; +#X connect 18 0 20 0; +#X connect 18 1 48 0; +#X connect 19 0 61 0; +#X connect 20 0 23 0; +#X connect 23 0 19 0; +#X connect 24 0 46 0; +#X connect 25 0 23 0; +#X connect 26 0 24 0; +#X connect 27 0 1 0; +#X connect 27 0 24 0; +#X connect 27 1 30 0; +#X connect 28 0 29 0; +#X connect 28 1 7 0; +#X connect 28 2 5 0; +#X connect 29 0 20 0; +#X connect 30 0 52 0; +#X connect 44 0 45 0; +#X connect 45 0 4 1; +#X connect 46 0 61 0; +#X connect 48 0 50 0; +#X connect 48 1 49 0; +#X connect 49 0 61 0; +#X connect 50 0 51 0; +#X connect 50 1 51 0; +#X connect 50 2 57 0; +#X connect 50 3 57 0; +#X connect 50 4 54 0; +#X connect 50 5 54 0; +#X connect 51 0 49 0; +#X connect 52 0 28 0; +#X connect 52 1 53 0; +#X connect 52 1 59 0; +#X connect 52 2 18 0; +#X connect 54 0 49 0; +#X connect 55 0 61 0; +#X connect 56 0 27 0; +#X connect 57 0 49 0; +#X connect 58 0 62 0; +#X connect 59 0 58 0; +#X connect 59 1 58 1; +#X connect 61 0 43 0; +#X connect 62 0 55 0; From 88f42116fc919048711dc7a852d62c753f710e80 Mon Sep 17 00:00:00 2001 From: chnry Date: Thu, 17 Apr 2025 17:37:33 +0200 Subject: [PATCH 328/387] reorder examples --- .../{05.matrix.pd => 03.matrix.pd} | 0 .../{03.texture.pd => 05.texture.pd} | 24 +++++------ examples/15.OPENGL3.2/06.lighting.pd | 26 ++++++------ examples/15.OPENGL3.2/08.geometry.pd | 40 +++++++++---------- .../{03.texture.frag => 05.texture.frag} | 0 .../{03.texture.vert => 05.texture.vert} | 0 .../shader/{08.light.frag => 06.light.frag} | 0 .../shader/{08.light.vert => 06.light.vert} | 0 .../{05.geometry.frag => 08.geometry.frag} | 0 .../{05.geometry.geom => 08.geometry.geom} | 0 .../{05.geometry.vert => 08.geometry.vert} | 0 11 files changed, 45 insertions(+), 45 deletions(-) rename examples/15.OPENGL3.2/{05.matrix.pd => 03.matrix.pd} (100%) rename examples/15.OPENGL3.2/{03.texture.pd => 05.texture.pd} (92%) rename examples/15.OPENGL3.2/shader/{03.texture.frag => 05.texture.frag} (100%) rename examples/15.OPENGL3.2/shader/{03.texture.vert => 05.texture.vert} (100%) rename examples/15.OPENGL3.2/shader/{08.light.frag => 06.light.frag} (100%) rename examples/15.OPENGL3.2/shader/{08.light.vert => 06.light.vert} (100%) rename examples/15.OPENGL3.2/shader/{05.geometry.frag => 08.geometry.frag} (100%) rename examples/15.OPENGL3.2/shader/{05.geometry.geom => 08.geometry.geom} (100%) rename examples/15.OPENGL3.2/shader/{05.geometry.vert => 08.geometry.vert} (100%) diff --git a/examples/15.OPENGL3.2/05.matrix.pd b/examples/15.OPENGL3.2/03.matrix.pd similarity index 100% rename from examples/15.OPENGL3.2/05.matrix.pd rename to examples/15.OPENGL3.2/03.matrix.pd diff --git a/examples/15.OPENGL3.2/03.texture.pd b/examples/15.OPENGL3.2/05.texture.pd similarity index 92% rename from examples/15.OPENGL3.2/03.texture.pd rename to examples/15.OPENGL3.2/05.texture.pd index 0c91fc7e2..a3dc8c0b0 100644 --- a/examples/15.OPENGL3.2/03.texture.pd +++ b/examples/15.OPENGL3.2/05.texture.pd @@ -98,7 +98,6 @@ #X obj 368 184 pix_texture \; texunit 1; #X obj 368 564 gemvertexbuffer \; draw quad; #X text 538 223 <--------------------; -#X obj 368 281 glsl shader/03.texture; #X msg 386 254 print; #X msg 554 315 Texture2 1; #X text 263 12 Using textures did not really change; @@ -108,6 +107,7 @@ #X msg 59 423 read shader/03.texture.frag; #X msg 59 479 read shader/03.texture.vert; #X obj 378 229 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 368 281 glsl shader/05.texture; #X connect 0 0 1 0; #X connect 2 0 16 0; #X connect 3 0 12 0; @@ -125,16 +125,16 @@ #X connect 22 0 12 0; #X connect 23 0 27 0; #X connect 24 0 25 0; -#X connect 25 0 30 1; +#X connect 25 0 39 1; #X connect 26 0 21 0; -#X connect 27 0 30 0; -#X connect 30 0 28 0; -#X connect 30 1 6 0; -#X connect 30 1 32 0; -#X connect 31 0 30 0; -#X connect 32 0 30 1; -#X connect 36 0 37 0; -#X connect 36 0 38 0; +#X connect 27 0 39 0; +#X connect 30 0 39 0; +#X connect 31 0 39 1; +#X connect 35 0 36 0; +#X connect 35 0 37 0; +#X connect 36 0 33 0; #X connect 37 0 34 0; -#X connect 38 0 35 0; -#X connect 39 0 30 0; +#X connect 38 0 39 0; +#X connect 39 0 28 0; +#X connect 39 1 6 0; +#X connect 39 1 31 0; diff --git a/examples/15.OPENGL3.2/06.lighting.pd b/examples/15.OPENGL3.2/06.lighting.pd index 8fd7adf55..97c0a52db 100644 --- a/examples/15.OPENGL3.2/06.lighting.pd +++ b/examples/15.OPENGL3.2/06.lighting.pd @@ -143,7 +143,6 @@ #X obj 401 177 scaleXYZ 0.003 0.003 0.003; #X msg 384 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; #X obj 267 718 gemvertexbuffer \; draw tri; -#X obj 267 370 glsl shader/08.light; #X text 269 10 This example introduces the Blinn-Phong lighting model \, which enhances flexibility \, improves light quality \, and optimizes rendering performance compared to the older fixed-function pipeline., f 86; #X msg 726 249 5 3 1 1; #X listbox 726 276 20 0 0 0 - - - 0; @@ -155,8 +154,9 @@ #X obj 39 399 loadbang; #X msg 59 423 read shader/08.light.vert; #X msg 59 479 read shader/08.light.frag; +#X obj 267 370 glsl shader/06.light; #X connect 0 0 1 0; -#X connect 2 0 28 0; +#X connect 2 0 39 0; #X connect 3 0 10 0; #X connect 5 0 10 0; #X connect 6 0 26 0; @@ -173,19 +173,19 @@ #X connect 18 0 19 0; #X connect 19 1 20 0; #X connect 20 0 21 0; -#X connect 21 0 28 1; +#X connect 21 0 39 1; #X connect 22 0 25 0; #X connect 25 0 18 0; #X connect 26 0 10 0; -#X connect 28 0 27 0; -#X connect 28 1 6 0; -#X connect 28 1 33 0; +#X connect 29 0 30 0; #X connect 30 0 31 0; -#X connect 31 0 32 0; -#X connect 32 0 28 1; -#X connect 33 0 28 1; -#X connect 34 0 28 0; -#X connect 37 0 38 0; -#X connect 37 0 39 0; +#X connect 31 0 39 1; +#X connect 32 0 39 1; +#X connect 33 0 39 0; +#X connect 36 0 37 0; +#X connect 36 0 38 0; +#X connect 37 0 34 0; #X connect 38 0 35 0; -#X connect 39 0 36 0; +#X connect 39 0 27 0; +#X connect 39 1 6 0; +#X connect 39 1 32 0; diff --git a/examples/15.OPENGL3.2/08.geometry.pd b/examples/15.OPENGL3.2/08.geometry.pd index 33a5cdc06..bd34c082f 100644 --- a/examples/15.OPENGL3.2/08.geometry.pd +++ b/examples/15.OPENGL3.2/08.geometry.pd @@ -113,7 +113,6 @@ #X msg 36 401 0 0 0 0 1 1 0 1 1; #X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37; #X obj 333 486 gemvertexbuffer \; resize 4 \; draw tristrip; -#X obj 333 226 glsl shader/05.geometry; #N canvas 125 216 972 620 drawing_type 0; #X text 40 50 VBO draw type : same as all openGL primitive; #X text 46 433 geometry shader out type :; @@ -137,6 +136,7 @@ #X obj 60 615 text define; #X msg 60 592 read shader/05.geometry.vert; #X msg 60 542 read shader/05.geometry.geo; +#X obj 333 226 glsl shader/08.geometry; #X connect 0 0 1 0; #X connect 2 0 35 0; #X connect 3 0 8 0; @@ -152,7 +152,7 @@ #X connect 16 1 3 0; #X connect 17 0 41 0; #X connect 19 0 42 0; -#X connect 21 0 45 0; +#X connect 21 0 54 0; #X connect 22 0 8 0; #X connect 23 0 24 0; #X connect 23 0 28 0; @@ -161,26 +161,26 @@ #X connect 23 0 34 0; #X connect 23 0 33 0; #X connect 23 0 25 0; -#X connect 24 0 45 1; -#X connect 25 0 45 1; -#X connect 26 0 45 1; -#X connect 27 0 45 1; -#X connect 28 0 45 1; -#X connect 33 0 45 1; -#X connect 34 0 45 1; -#X connect 35 0 45 0; +#X connect 24 0 54 1; +#X connect 25 0 54 1; +#X connect 26 0 54 1; +#X connect 27 0 54 1; +#X connect 28 0 54 1; +#X connect 33 0 54 1; +#X connect 34 0 54 1; +#X connect 35 0 54 0; #X connect 36 0 35 1; -#X connect 37 0 45 1; +#X connect 37 0 54 1; #X connect 40 0 11 0; #X connect 41 0 18 0; #X connect 42 0 20 0; #X connect 43 0 10 0; -#X connect 45 0 44 0; -#X connect 45 1 15 0; -#X connect 45 1 23 0; -#X connect 50 0 51 0; -#X connect 50 0 54 0; -#X connect 50 0 53 0; -#X connect 51 0 48 0; -#X connect 53 0 52 0; -#X connect 54 0 49 0; +#X connect 49 0 50 0; +#X connect 49 0 53 0; +#X connect 49 0 52 0; +#X connect 50 0 47 0; +#X connect 52 0 51 0; +#X connect 53 0 48 0; +#X connect 54 0 44 0; +#X connect 54 1 15 0; +#X connect 54 1 23 0; diff --git a/examples/15.OPENGL3.2/shader/03.texture.frag b/examples/15.OPENGL3.2/shader/05.texture.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/03.texture.frag rename to examples/15.OPENGL3.2/shader/05.texture.frag diff --git a/examples/15.OPENGL3.2/shader/03.texture.vert b/examples/15.OPENGL3.2/shader/05.texture.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/03.texture.vert rename to examples/15.OPENGL3.2/shader/05.texture.vert diff --git a/examples/15.OPENGL3.2/shader/08.light.frag b/examples/15.OPENGL3.2/shader/06.light.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/08.light.frag rename to examples/15.OPENGL3.2/shader/06.light.frag diff --git a/examples/15.OPENGL3.2/shader/08.light.vert b/examples/15.OPENGL3.2/shader/06.light.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/08.light.vert rename to examples/15.OPENGL3.2/shader/06.light.vert diff --git a/examples/15.OPENGL3.2/shader/05.geometry.frag b/examples/15.OPENGL3.2/shader/08.geometry.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/05.geometry.frag rename to examples/15.OPENGL3.2/shader/08.geometry.frag diff --git a/examples/15.OPENGL3.2/shader/05.geometry.geom b/examples/15.OPENGL3.2/shader/08.geometry.geom similarity index 100% rename from examples/15.OPENGL3.2/shader/05.geometry.geom rename to examples/15.OPENGL3.2/shader/08.geometry.geom diff --git a/examples/15.OPENGL3.2/shader/05.geometry.vert b/examples/15.OPENGL3.2/shader/08.geometry.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/05.geometry.vert rename to examples/15.OPENGL3.2/shader/08.geometry.vert From d7030bf08605cc680e0efecc9a518855a60f09e2 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 09:34:22 +0200 Subject: [PATCH 329/387] clean --- examples/15.OPENGL3.2/01.basic.pd | 37 ++++++++++++++++--------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/examples/15.OPENGL3.2/01.basic.pd b/examples/15.OPENGL3.2/01.basic.pd index 1910dde51..5735061ec 100644 --- a/examples/15.OPENGL3.2/01.basic.pd +++ b/examples/15.OPENGL3.2/01.basic.pd @@ -1,4 +1,4 @@ -#N canvas 566 216 1078 659 10; +#N canvas 925 233 1078 659 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -33,13 +33,13 @@ #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; #X obj 267 14 gemhead; -#X msg 435 434 program \$1; +#X msg 411 444 program \$1; #X obj 433 483 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 441 489 print_attributes; -#X text 519 434 <----- essential for lookup functions; +#X text 490 444 <----- essential for lookup functions; #X obj 330 560 print vb; #X obj 44 9 declare -lib Gem; -#X msg 384 380 attribute position \$1_position \, attribute color \$1_color; +#X msg 384 370 attribute position \$1_position \, attribute color \$1_color; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X obj 102 161 r \$0-gemstart; @@ -88,14 +88,12 @@ #X msg 40 341 0 1 0 0 0 1 0 0 0 1; #X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 40 317 loadbang; -#X obj 267 588 gemvertexbuffer \; resize 9 \; draw tri; #X text 444 124 OpenGL 3.2 deprecated the fixed-function pipeline \, which was less flexible and harder to optimize \, in favor of the programmable pipeline using shaders \, allowing for more customizable and efficient rendering techniques., f 88; #X text 445 19 OpenGL 3.2 introduced deprecation of immediate mode rendering \, encouraging the use of Vertex Buffer Objects (VBOs) and Vertex Array Objects (VAOs) for more efficient and modern graphics programming. This shift was made to improve performance and flexibility \, aligning OpenGL with contemporary GPU capabilities and programming practices., f 88; #X text 445 85 VBOs are crucial because they represent the modern and efficient way to manage vertex data in OpenGL \, replacing the older and less performant immediate mode., f 88; #X text 444 178 With the deprecation of the fixed-function pipeline in OpenGL 3.2 \, users must now manually handle many aspects that were previously automated \, such as matrix transformations and lighting calculations \, by writing their own shaders and managing buffers \, which offers greater control but requires more effort and understanding of the rendering process., f 88; -#X obj 384 331 t b; #X obj 267 276 glsl shader/01.basic; -#X obj 384 353 \$0; +#X obj 384 343 \$0; #X text 445 259 This example demonstrates how to use Vertex Buffer Objects (VBOs) in conjunction with shaders in OpenGL. It illustrates the process of creating and binding a VBO to store vertex data \, and then using a vertex shader and fragment shader to render that data., f 88; #X text 60 527 click to see the shaders; #X obj 59 447 text define; @@ -103,23 +101,26 @@ #X msg 59 479 read shader/01.basic.vert; #X obj 59 502 text define; #X obj 39 399 loadbang; +#X obj 267 588 gemvertexbuffer \; resize 3 \; draw tri; +#X text 421 393 We are using attribute here \, since it's the way the shader will have access to the VBO data; +#X obj 384 321 t b f; #X connect 0 0 1 0; -#X connect 2 0 26 0; +#X connect 2 0 24 0; #X connect 3 0 11 0; #X connect 5 0 11 0; #X connect 9 0 11 0; -#X connect 11 0 20 0; +#X connect 11 0 33 0; #X connect 11 1 7 0; #X connect 14 0 18 0; #X connect 17 0 16 0; #X connect 18 0 15 0; #X connect 19 0 17 0; -#X connect 25 0 27 0; -#X connect 26 0 20 0; -#X connect 26 1 3 0; -#X connect 26 1 25 0; -#X connect 27 0 9 0; -#X connect 31 0 30 0; -#X connect 32 0 33 0; -#X connect 34 0 31 0; -#X connect 34 0 32 0; +#X connect 24 0 33 0; +#X connect 24 1 35 0; +#X connect 25 0 9 0; +#X connect 29 0 28 0; +#X connect 30 0 31 0; +#X connect 32 0 29 0; +#X connect 32 0 30 0; +#X connect 35 0 25 0; +#X connect 35 1 3 0; From 86358d5d992326d79d513203c866e1dc22c67c11 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 09:36:51 +0200 Subject: [PATCH 330/387] remove ";" and use textfile in "cr" mode to read the shader --- examples/15.OPENGL3.2/01.basic.pd | 28 ++++++++++---------- examples/15.OPENGL3.2/shader/01.basic.frag | 22 ++++++++-------- examples/15.OPENGL3.2/shader/01.basic.vert | 30 +++++++++++----------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/examples/15.OPENGL3.2/01.basic.pd b/examples/15.OPENGL3.2/01.basic.pd index 5735061ec..93317ea70 100644 --- a/examples/15.OPENGL3.2/01.basic.pd +++ b/examples/15.OPENGL3.2/01.basic.pd @@ -1,4 +1,4 @@ -#N canvas 925 233 1078 659 10; +#N canvas 291 103 1078 659 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -96,31 +96,31 @@ #X obj 384 343 \$0; #X text 445 259 This example demonstrates how to use Vertex Buffer Objects (VBOs) in conjunction with shaders in OpenGL. It illustrates the process of creating and binding a VBO to store vertex data \, and then using a vertex shader and fragment shader to render that data., f 88; #X text 60 527 click to see the shaders; -#X obj 59 447 text define; -#X msg 59 423 read shader/01.basic.frag; -#X msg 59 479 read shader/01.basic.vert; -#X obj 59 502 text define; #X obj 39 399 loadbang; #X obj 267 588 gemvertexbuffer \; resize 3 \; draw tri; #X text 421 393 We are using attribute here \, since it's the way the shader will have access to the VBO data; #X obj 384 321 t b f; +#X obj 59 502 textfile; +#X obj 59 447 textfile; +#X msg 59 423 read shader/01.basic.frag cr; +#X msg 59 479 read shader/01.basic.vert cr; #X connect 0 0 1 0; #X connect 2 0 24 0; #X connect 3 0 11 0; #X connect 5 0 11 0; #X connect 9 0 11 0; -#X connect 11 0 33 0; +#X connect 11 0 29 0; #X connect 11 1 7 0; #X connect 14 0 18 0; #X connect 17 0 16 0; #X connect 18 0 15 0; #X connect 19 0 17 0; -#X connect 24 0 33 0; -#X connect 24 1 35 0; +#X connect 24 0 29 0; +#X connect 24 1 31 0; #X connect 25 0 9 0; -#X connect 29 0 28 0; -#X connect 30 0 31 0; -#X connect 32 0 29 0; -#X connect 32 0 30 0; -#X connect 35 0 25 0; -#X connect 35 1 3 0; +#X connect 28 0 34 0; +#X connect 28 0 35 0; +#X connect 31 0 25 0; +#X connect 31 1 3 0; +#X connect 34 0 33 0; +#X connect 35 0 32 0; diff --git a/examples/15.OPENGL3.2/shader/01.basic.frag b/examples/15.OPENGL3.2/shader/01.basic.frag index 8cff637f5..ba695e533 100644 --- a/examples/15.OPENGL3.2/shader/01.basic.frag +++ b/examples/15.OPENGL3.2/shader/01.basic.frag @@ -1,17 +1,17 @@ #version 460 -; -// Cyrille Henry 2024; -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; -; -// This is the fragment shader : it is executed for every pixel to display; -; + +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the fragment shader : it is executed for every pixel to display + in vec3 Color_to_frag; -// the variable commint from the VBO; -; +// the variable commint from the VBO + out vec4 FragColor; -// The only output of this shader : the color of the pixel; -; +// The only output of this shader : the color of the pixel + void main() { FragColor = vec4(Color_to_frag, 1.0); - // the "Color_to_frag" variable is already interpolated between the 2 shaders.; + // the "Color_to_frag" variable is already interpolated between the 2 shaders. } diff --git a/examples/15.OPENGL3.2/shader/01.basic.vert b/examples/15.OPENGL3.2/shader/01.basic.vert index d3b47aae0..88ec8aca4 100644 --- a/examples/15.OPENGL3.2/shader/01.basic.vert +++ b/examples/15.OPENGL3.2/shader/01.basic.vert @@ -1,25 +1,25 @@ #version 460 -; -//simple test shader; -// Cyrille Henry 2024; -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; -; -// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex.; -; + +//simple test shader +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. + layout (location=0) in vec3 position; layout (location=1) in vec3 color; -// declare the mandatory input : we need 2 attributes named position and color from the VBO; -// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message); -; +// declare the mandatory input : we need 2 attributes named position and color from the VBO +// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) + out vec3 Color_to_frag; -// the output of this shader is only a color.; -// This variable will be interpolated between all vertices; -; +// the output of this shader is only a color. +// This variable will be interpolated between all vertices + void main() { Color_to_frag = color; - // initialise the variable to pass to the frag shader with data comming from the VBO; + // initialise the variable to pass to the frag shader with data comming from the VBO gl_Position = vec4(position,1.0); // update vertex position from the VBO; - // No perspective is apply in this example; + // No perspective is apply in this example } From 35b08a4bac5c604fd0c2d6fb96b729492a870d0e Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 09:42:08 +0200 Subject: [PATCH 331/387] remove unused ; and use texfile cr mode to read a display shaders --- examples/15.OPENGL3.2/02.transformation.pd | 22 ++-- examples/15.OPENGL3.2/03.matrix.pd | 108 ++++++++++++++---- .../shader/02.transformation.frag | 22 ++-- .../shader/02.transformation.vert | 43 +++---- examples/15.OPENGL3.2/shader/04.model.frag | 8 +- examples/15.OPENGL3.2/shader/04.model.vert | 10 +- examples/15.OPENGL3.2/shader/05.texture.frag | 18 +-- examples/15.OPENGL3.2/shader/05.texture.vert | 16 +-- examples/15.OPENGL3.2/shader/06.light.frag | 17 +-- examples/15.OPENGL3.2/shader/06.light.vert | 13 ++- examples/15.OPENGL3.2/shader/08.geometry.frag | 40 +++---- examples/15.OPENGL3.2/shader/08.geometry.geom | 22 ++-- examples/15.OPENGL3.2/shader/08.geometry.vert | 14 +-- 13 files changed, 209 insertions(+), 144 deletions(-) diff --git a/examples/15.OPENGL3.2/02.transformation.pd b/examples/15.OPENGL3.2/02.transformation.pd index 4dd14eb1a..77d5a87e6 100644 --- a/examples/15.OPENGL3.2/02.transformation.pd +++ b/examples/15.OPENGL3.2/02.transformation.pd @@ -1,4 +1,4 @@ -#N canvas 919 206 989 704 10; +#N canvas 418 184 989 704 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -33,10 +33,10 @@ #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; #X obj 287 14 gemhead; -#X msg 482 493 program \$1; +#X msg 485 493 program \$1; #X obj 492 523 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0; #X msg 500 529 print_attributes; -#X text 566 493 <----- essential for lookup functions; +#X text 569 493 <----- essential for lookup functions; #X obj 350 610 print vb; #X obj 44 9 declare -lib Gem; #X obj 458 437 f \$0; @@ -136,11 +136,11 @@ #X text 586 402 Z translation have no effect since the perspective is not yet implemented; #X obj 458 408 t b f; #X obj 287 377 glsl shader/02.transformation; -#X obj 59 447 text define; -#X obj 59 502 text define; #X obj 39 399 loadbang; -#X msg 59 423 read shader/02.transformation.frag; -#X msg 59 479 read shader/02.transformation.vert; +#X obj 59 447 textfile; +#X msg 59 423 read shader/02.transformation.frag cr; +#X obj 59 502 textfile; +#X msg 59 479 read shader/02.transformation.vert cr; #X connect 0 0 1 0; #X connect 2 0 43 0; #X connect 3 0 12 0; @@ -179,7 +179,7 @@ #X connect 47 1 3 0; #X connect 48 0 42 0; #X connect 48 1 47 0; -#X connect 51 0 52 0; -#X connect 51 0 53 0; -#X connect 52 0 49 0; -#X connect 53 0 50 0; +#X connect 49 0 51 0; +#X connect 49 0 53 0; +#X connect 51 0 50 0; +#X connect 53 0 52 0; diff --git a/examples/15.OPENGL3.2/03.matrix.pd b/examples/15.OPENGL3.2/03.matrix.pd index 886b90ba1..7f6eb7da0 100644 --- a/examples/15.OPENGL3.2/03.matrix.pd +++ b/examples/15.OPENGL3.2/03.matrix.pd @@ -1,4 +1,4 @@ -#N canvas 294 257 1450 697 12; +#N canvas 458 215 1450 697 12; #X obj 21 209 GEMglLoadIdentity; #X obj 21 174 gemhead; #X obj 21 255 translateXYZ; @@ -145,14 +145,13 @@ #X text 853 429 fovY (field of view) \, aspect ratio \, nearZ \, farZ; #X text 840 408 perspective projection :; #X text 838 162 orthographique projection :; -#X msg 1237 458 3.14159 4; -#X obj 1237 486 /; -#X obj 1236 345 r __gem; -#X obj 1236 370 route dimen; -#X obj 1236 395 /; -#X text 1268 394 real gemwin X/Y ratio; -#X floatatom 1237 513 5 0 0 0 - - - 0; -#X msg 843 457 0.7 1 1 20; +#X msg 1233 385 3.14159 4; +#X obj 1233 413 /; +#X obj 1232 272 r __gem; +#X obj 1232 297 route dimen; +#X obj 1232 322 /; +#X text 1264 321 real gemwin X/Y ratio; +#X floatatom 1233 440 5 0 0 0 - - - 0; #X obj 843 515 list split 4; #X obj 843 540 list split 4; #X obj 842 564 list split 4; @@ -161,8 +160,8 @@ #X listbox 939 543 20 0 0 0 - - - 0; #X listbox 939 568 20 0 0 0 - - - 0; #X listbox 939 592 20 0 0 0 - - - 0; -#X floatatom 1236 424 5 0 0 0 - - - 0; -#X text 1238 313 tips :; +#X floatatom 1232 351 5 0 0 0 - - - 0; +#X text 1234 240 tips :; #X obj 27 551 list prepend modelMatrix; #X obj 287 551 list prepend viewMatrix; #X obj 814 622 list prepend projMatrix; @@ -173,7 +172,7 @@ #X obj 287 596 s shader_matrix; #X obj 814 670 s shader_matrix; #X text 27 35 The model matrix combine the geometry transformation. It can be computed with specific library \, or with standard openGL object., f 30; -#X text 1286 485 45° fov (this is a very wild angle), f 21; +#X text 1282 412 45° fov (this is a very wild angle), f 21; #N canvas 234 350 511 439 build_perspective 0; #X obj 37 24 inlet; #X obj 37 108 * 0.5; @@ -235,13 +234,78 @@ #X text 834 28 The projection matrix The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; #X text 27 8 This patch create transformation matrix to be use with previous patch (keep the previous patch open)., f 103; #X text 535 34 Since the shader need only the multiplication of the model matrix and the view matrix \, you can get this combination directly : (not used in this example), f 35; +#N canvas 130 82 1016 644 shader 0; +#X obj 53 27 gemhead; +#X obj 65 164 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 411 94 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X msg 438 110 modelMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1; +#X msg 438 137 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; +#X msg 438 164 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; +#X obj 53 79 translateXYZ; +#X floatatom 76 53 5 0 0 0 - - - 0; +#X obj 133 150 r shader_matrix; +#X text 119 52 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117; +#X msg 229 283 program \$1; +#X obj 229 432 print vb; +#X obj 197 408 t a a; +#X obj 669 306 table \$0_position 9; +#X obj 666 384 loadbang; +#X obj 666 432 s \$0_position; +#X msg 666 409 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; +#X obj 665 466 loadbang; +#X obj 197 312 \$0; +#X floatatom 243 227 5 0 0 0 - - - 0; +#X obj 669 328 table \$0_normal 9; +#X obj 665 513 s \$0_normal; +#X obj 53 501 gemvertexbuffer \; resize 3 \; draw tri; +#X msg 665 490 0 0 0 1 0 0 1 0 0 1 0 0 1; +#X obj 197 257 t b f; +#X obj 670 351 table \$0_color 9; +#X obj 664 540 loadbang; +#X obj 664 587 s \$0_color; +#X msg 664 564 0 1 0 0 0 1 0 0 0 1; +#X obj 53 189 glsl shader/03.matrix; +#X msg 221 380 print_attributes; +#X msg 197 336 attribute position \$1_position \, attribute normal \$1_normal \, attribute color \$1_color; +#X connect 0 0 6 0; +#X connect 1 0 29 0; +#X connect 2 0 3 0; +#X connect 2 0 5 0; +#X connect 2 0 4 0; +#X connect 3 0 29 1; +#X connect 4 0 29 1; +#X connect 5 0 29 1; +#X connect 6 0 29 0; +#X connect 7 0 6 1; +#X connect 8 0 29 1; +#X connect 10 0 22 0; +#X connect 12 0 22 0; +#X connect 12 1 11 0; +#X connect 14 0 16 0; +#X connect 16 0 15 0; +#X connect 17 0 23 0; +#X connect 18 0 31 0; +#X connect 23 0 21 0; +#X connect 24 0 18 0; +#X connect 24 1 10 0; +#X connect 26 0 28 0; +#X connect 28 0 27 0; +#X connect 29 0 22 0; +#X connect 29 1 2 0; +#X connect 29 1 19 0; +#X connect 29 1 24 0; +#X connect 30 0 12 0; +#X connect 31 0 12 0; +#X restore 1228 514 pd shader; +#X obj 1228 550 _gemwin; +#X msg 843 457 0.7 1 1 20; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 1 16 0; -#X connect 5 1 94 0; +#X connect 5 1 93 0; #X connect 6 0 2 1; #X connect 7 0 2 2; #X connect 8 0 2 3; @@ -260,7 +324,7 @@ #X connect 19 0 23 0; #X connect 24 0 25 0; #X connect 25 1 27 0; -#X connect 25 1 95 0; +#X connect 25 1 94 0; #X connect 27 0 31 0; #X connect 27 1 28 0; #X connect 28 0 32 0; @@ -290,7 +354,7 @@ #X connect 52 1 53 0; #X connect 53 0 57 0; #X connect 58 0 60 0; -#X connect 58 0 96 0; +#X connect 58 0 95 0; #X connect 60 0 64 0; #X connect 60 1 61 0; #X connect 61 0 65 0; @@ -303,20 +367,20 @@ #X connect 77 0 82 0; #X connect 78 0 79 0; #X connect 79 0 80 0; -#X connect 80 0 92 0; -#X connect 83 0 105 0; +#X connect 80 0 91 0; +#X connect 83 0 87 0; +#X connect 83 1 84 0; #X connect 84 0 88 0; #X connect 84 1 85 0; #X connect 85 0 89 0; #X connect 85 1 86 0; #X connect 86 0 90 0; -#X connect 86 1 87 0; -#X connect 87 0 91 0; +#X connect 93 0 96 0; #X connect 94 0 97 0; #X connect 95 0 98 0; #X connect 96 0 99 0; #X connect 97 0 100 0; #X connect 98 0 101 0; -#X connect 99 0 102 0; -#X connect 105 0 84 0; -#X connect 105 0 96 0; +#X connect 104 0 83 0; +#X connect 104 0 95 0; +#X connect 111 0 104 0; diff --git a/examples/15.OPENGL3.2/shader/02.transformation.frag b/examples/15.OPENGL3.2/shader/02.transformation.frag index 8cff637f5..ba695e533 100644 --- a/examples/15.OPENGL3.2/shader/02.transformation.frag +++ b/examples/15.OPENGL3.2/shader/02.transformation.frag @@ -1,17 +1,17 @@ #version 460 -; -// Cyrille Henry 2024; -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; -; -// This is the fragment shader : it is executed for every pixel to display; -; + +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the fragment shader : it is executed for every pixel to display + in vec3 Color_to_frag; -// the variable commint from the VBO; -; +// the variable commint from the VBO + out vec4 FragColor; -// The only output of this shader : the color of the pixel; -; +// The only output of this shader : the color of the pixel + void main() { FragColor = vec4(Color_to_frag, 1.0); - // the "Color_to_frag" variable is already interpolated between the 2 shaders.; + // the "Color_to_frag" variable is already interpolated between the 2 shaders. } diff --git a/examples/15.OPENGL3.2/shader/02.transformation.vert b/examples/15.OPENGL3.2/shader/02.transformation.vert index 55aa2359b..686f893c0 100644 --- a/examples/15.OPENGL3.2/shader/02.transformation.vert +++ b/examples/15.OPENGL3.2/shader/02.transformation.vert @@ -1,31 +1,32 @@ #version 460 ; -//simple test shader; -// Cyrille Henry 2024; -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; -; -// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex.; -; +//simple test shader +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + +// This is the vertex shader, the 1st on the pipeline. It is executed for every vertex. + layout (location=0) in vec3 position; layout (location=1) in vec3 color; -// declare the mandatory input : we need 2 attributes named position and color from the VBO; -// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message); -; +// declare the mandatory input : we need 2 attributes named position and color from the VBO +// location must match the program_index from gemvertexbuffer (thanks to the print_attribute message) + uniform mat4 transformation_matrix; -// The transformation matrix we want to apply to the vertex.; -// The shader did not receive the transformation matrix from the pipeline, so we need to creater one and pass it as an argument.; -// In this example, we use gemlist_matrix in the patch to get the transformation matrix.; -// The perspective matrix (set with the perspec message to gemwin) is not used.; -; +// The transformation matrix we want to apply to the vertex. +// The shader did not receive the transformation matrix from the pipeline, +// so we need to creater one and pass it as an argument. +// In this example, we use gemlist_matrix in the patch to get the transformation matrix. +// The perspective matrix (set with the perspec message to gemwin) is not used. + out vec3 Color_to_frag; -// the output of this shader is only a color.; -// This variable will be interpolated between all vertices; -; +// the output of this shader is only a color. +// This variable will be interpolated between all vertices + void main() { Color_to_frag = color; - // initialise the variable to pass to the frag shader with data comming from the VBO; -; - gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO; - // No perspective is apply in this example; + // initialise the variable to pass to the frag shader with data comming from the VBO + + gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO + // No perspective is apply in this example } diff --git a/examples/15.OPENGL3.2/shader/04.model.frag b/examples/15.OPENGL3.2/shader/04.model.frag index c22e25be3..2d539f8b2 100644 --- a/examples/15.OPENGL3.2/shader/04.model.frag +++ b/examples/15.OPENGL3.2/shader/04.model.frag @@ -1,10 +1,10 @@ #version 460 -// Cyrille Henry 2024; -; +// Cyrille Henry 2024 + in vec4 Color; -; + out vec4 FragColor; -; + void main() { FragColor = Color; } diff --git a/examples/15.OPENGL3.2/shader/04.model.vert b/examples/15.OPENGL3.2/shader/04.model.vert index 3e4e2bfcd..62cf2d3b0 100644 --- a/examples/15.OPENGL3.2/shader/04.model.vert +++ b/examples/15.OPENGL3.2/shader/04.model.vert @@ -1,20 +1,20 @@ #version 460 -; + // Cyrille Henry 2024 -; + layout (location=0) in float positionX; layout (location=1) in float positionY; layout (location=2) in float positionZ; layout (location=3) in float colorR; layout (location=4) in float colorG; layout (location=5) in float colorB; -; + uniform mat4 transformation_matrix; -; + out vec4 Color; out vec3 Normal; out vec4 Position; -; + void main() { Color = vec4(colorR, colorG, colorB, 1.); diff --git a/examples/15.OPENGL3.2/shader/05.texture.frag b/examples/15.OPENGL3.2/shader/05.texture.frag index 79662b998..28c070715 100644 --- a/examples/15.OPENGL3.2/shader/05.texture.frag +++ b/examples/15.OPENGL3.2/shader/05.texture.frag @@ -1,19 +1,19 @@ #version 460 -; -// Cyrille Henry 2024; -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; -; + +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + in vec2 TexCoord; -; + uniform sampler2D Texture1; // Texture 1 with using the textunit 0 -uniform sampler2D Texture2; // Texture 2 need to be set to 1 to use the correct texture; +uniform sampler2D Texture2; // Texture 2 need to be set to 1 to use the correct texture uniform float mix_factor; -; + out vec4 FragColor; -; + void main() { vec4 color1 = texture(Texture1, TexCoord); vec4 color2 = texture(Texture2, TexCoord); -; + FragColor = mix(color1, color2, mix_factor); } diff --git a/examples/15.OPENGL3.2/shader/05.texture.vert b/examples/15.OPENGL3.2/shader/05.texture.vert index 42cf7d8aa..37cf6b027 100644 --- a/examples/15.OPENGL3.2/shader/05.texture.vert +++ b/examples/15.OPENGL3.2/shader/05.texture.vert @@ -1,16 +1,16 @@ #version 460 -; -//simple test shader; -// Cyrille Henry 2024; -// based on "OpenGL 4 Shading Language Cookbook" by David Wolff; -; + +//simple test shader +// Cyrille Henry 2024 +// based on "OpenGL 4 Shading Language Cookbook" by David Wolff + in vec3 position; in vec2 texcoord; -; + out vec2 TexCoord; -; + void main() { - TexCoord = texcoord; // pass the data from VBO to the frag shader; + TexCoord = texcoord; // pass the data from VBO to the frag shader gl_Position = vec4(position,1.0); } diff --git a/examples/15.OPENGL3.2/shader/06.light.frag b/examples/15.OPENGL3.2/shader/06.light.frag index 225c91bda..70a0d0ad9 100644 --- a/examples/15.OPENGL3.2/shader/06.light.frag +++ b/examples/15.OPENGL3.2/shader/06.light.frag @@ -1,24 +1,24 @@ #version 460 -// Cyrille Henry 2024; -; -// light description; +// Cyrille Henry 2024 + +// light description uniform vec4 LightPosition; // Light position in eye coords. uniform vec3 LightLa; // Ambient light intensity uniform vec3 LightL; // Diffuse and specular light intensity -; + // material definition; uniform vec3 MaterialKa; // Ambient reflectivity uniform vec3 MaterialKd; // Diffuse reflectivity uniform vec3 MaterialKs; // Specular reflectivity uniform float MaterialShininess; // Specular shininess factor -; + in vec4 Color; in vec3 Normal; in vec4 Position; -; + out vec4 FragColor; // The only output of this shader : the color of the pixel -; + vec3 blinnPhong( vec3 position, vec3 n) { vec3 ambient = LightLa * MaterialKa; vec3 s = normalize( LightPosition.xyz - position ); @@ -32,7 +32,8 @@ vec3 blinnPhong( vec3 position, vec3 n) { } return ambient + LightL * (diffuse + spec); } -; + void main() { + mat3 normalMatrix = mat3(transpose(inverse(viewMatrix * modelMatrix))); FragColor = Color * vec4(blinnPhong(Position.xyz, normalize(Normal)), 1.); } diff --git a/examples/15.OPENGL3.2/shader/06.light.vert b/examples/15.OPENGL3.2/shader/06.light.vert index a61dba0cd..b94ba61bf 100644 --- a/examples/15.OPENGL3.2/shader/06.light.vert +++ b/examples/15.OPENGL3.2/shader/06.light.vert @@ -1,7 +1,7 @@ #version 460 -; + // Cyrille Henry 2024 -; + layout (location=0) in float positionX; layout (location=1) in float positionY; layout (location=2) in float positionZ; @@ -11,17 +11,18 @@ layout (location=5) in float normal_Z; layout (location=6) in float colorR; layout (location=7) in float colorG; layout (location=8) in float colorB; -; + uniform mat4 transformation_matrix; -; + out vec4 Color; out vec3 Normal; out vec4 Position; -; + void main() { Color = vec4(colorR, colorG, colorB, 1.); - Normal = (transformation_matrix * vec4(normal_X, normal_Y, normal_Z, 1.)).xyz; + mat3 normalMatrix = mat3(transpose(inverse(transformation_matrix))); + Normal = normalMatrix * vec3(normal_X, normal_Y, normal_Z); vec3 pos = vec3(positionX, positionY, positionZ); Position = transformation_matrix * vec4(pos,1.0); gl_Position = Position; diff --git a/examples/15.OPENGL3.2/shader/08.geometry.frag b/examples/15.OPENGL3.2/shader/08.geometry.frag index d919ef71a..824eb58ac 100644 --- a/examples/15.OPENGL3.2/shader/08.geometry.frag +++ b/examples/15.OPENGL3.2/shader/08.geometry.frag @@ -1,41 +1,41 @@ #version 150 -; -// from geometry shader; + +// from geometry shader in vec3 geomPosition; in vec3 geomNormal; in vec2 geomTexCoord; in vec3 barycentric; -; -// to rendering; + +// to rendering out vec4 fragColor; -; -// uniform to compute the pixel color; + +// uniform to compute the pixel color uniform vec3 lightPos; uniform vec3 lightColor; uniform vec3 ambientColor; uniform sampler2D diffuseTexture; -; + void main() { - // Normalize the normal vector; + // Normalize the normal vector vec3 normal = normalize(geomNormal); -; - // Calculate the light direction and distance; + + // Calculate the light direction and distance vec3 lightDir = normalize(lightPos - geomPosition); -; - // Diffuse shading; + + // Diffuse shading float diff = max(dot(normal, lightDir), 0.0); vec3 diffuse = diff * lightColor; -; - // Texture sampling; + + // Texture sampling vec4 texColor = texture(diffuseTexture, geomTexCoord); -; - // Wire effect using barycentric coordinates; + + // Wire effect using barycentric coordinates float minBary = min(min(barycentric.x, barycentric.y), barycentric.z); float edgeFactor = smoothstep(0.0, 0.2, minBary); -; - // Final color calculation; + + // Final color calculation vec3 result = (ambientColor + diffuse) * texColor.rgb; - result = mix(vec3(0.0, 0.7, 1.0), result, edgeFactor); // Blue wireframe; -; + result = mix(vec3(0.0, 0.7, 1.0), result, edgeFactor); // Blue wireframe + fragColor = vec4(result, texColor.a); } diff --git a/examples/15.OPENGL3.2/shader/08.geometry.geom b/examples/15.OPENGL3.2/shader/08.geometry.geom index e39b28871..384adfd1d 100644 --- a/examples/15.OPENGL3.2/shader/08.geometry.geom +++ b/examples/15.OPENGL3.2/shader/08.geometry.geom @@ -1,34 +1,32 @@ #version 150 -; + layout(triangles) in; -// the triangle_strip is split in multiples triangles before this shader; +// the triangle_strip is split in multiples triangles before this shader layout(triangle_strip, max_vertices = 3) out; -; -// from vertex shader; + +// from vertex shader in vec3 vertPosition[]; in vec3 vertNormal[]; in vec2 vertTexCoord[]; -; -// to fragment shader; + +// to fragment shader out vec3 geomPosition; out vec3 geomNormal; out vec2 geomTexCoord; out vec3 barycentric; -; + void main() { -; for(int i = 0; i < 3; i++) { geomPosition = vertPosition[i]; geomNormal = vertNormal[i]; geomTexCoord = vertTexCoord[i]; -; - // Passing barycentric coordinates for fragment shading; + + // Passing barycentric coordinates for fragment shading barycentric = vec3(0.0); barycentric[i] = 1.0; -; + gl_Position = gl_in[i].gl_Position; EmitVertex(); } -; EndPrimitive(); } diff --git a/examples/15.OPENGL3.2/shader/08.geometry.vert b/examples/15.OPENGL3.2/shader/08.geometry.vert index 14fe3d341..ae724e55b 100644 --- a/examples/15.OPENGL3.2/shader/08.geometry.vert +++ b/examples/15.OPENGL3.2/shader/08.geometry.vert @@ -1,24 +1,24 @@ #version 150 -; -// from VBO; + +// from VBO in vec3 position; in vec3 normal; in vec2 texCoord; -; -// to geometry shader; + +// to geometry shader out vec3 vertPosition; out vec3 vertNormal; out vec2 vertTexCoord; -; + uniform mat4 modelMatrix; uniform mat4 viewMatrix; uniform mat4 projMatrix; uniform mat3 normalMatrix; -; + void main() { vertPosition = vec3(modelMatrix * vec4(position, 1.0)); vertNormal = normalMatrix * normal; vertTexCoord = texCoord; -; + gl_Position = projMatrix * viewMatrix * modelMatrix * vec4(position, 1.0); } From a8de9f6b68178005d7fc7a0bee091769d89b74f7 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 09:54:05 +0200 Subject: [PATCH 332/387] clean and add a shader to display the various modification due to matrix transformation --- examples/15.OPENGL3.2/03.matrix.pd | 74 +++++++++++---------- examples/15.OPENGL3.2/shader/03.matrix.frag | 18 +++++ examples/15.OPENGL3.2/shader/03.matrix.vert | 21 ++++++ 3 files changed, 78 insertions(+), 35 deletions(-) create mode 100644 examples/15.OPENGL3.2/shader/03.matrix.frag create mode 100644 examples/15.OPENGL3.2/shader/03.matrix.vert diff --git a/examples/15.OPENGL3.2/03.matrix.pd b/examples/15.OPENGL3.2/03.matrix.pd index 7f6eb7da0..c73d92ce9 100644 --- a/examples/15.OPENGL3.2/03.matrix.pd +++ b/examples/15.OPENGL3.2/03.matrix.pd @@ -1,4 +1,4 @@ -#N canvas 458 215 1450 697 12; +#N canvas 420 72 1450 697 12; #X obj 21 209 GEMglLoadIdentity; #X obj 21 174 gemhead; #X obj 21 255 translateXYZ; @@ -127,30 +127,28 @@ #X connect 30 0 26 4; #X connect 31 0 27 0; #X connect 32 0 19 0; -#X restore 843 243 pd build_ortho; -#X text 859 212 left \, right \, bottom \, top \, nearZ \, farZ; -#X obj 843 286 list split 4; -#X obj 843 311 list split 4; -#X obj 842 335 list split 4; -#X obj 842 360 list split 4; -#X listbox 940 288 20 0 0 0 - - - 0; -#X listbox 939 314 20 0 0 0 - - - 0; -#X listbox 939 339 20 0 0 0 - - - 0; -#X listbox 939 363 20 0 0 0 - - - 0; +#X restore 843 220 pd build_ortho; +#X text 953 195 left \, right \, bottom \, top \, nearZ \, farZ; +#X obj 853 253 list split 4; +#X obj 853 278 list split 4; +#X obj 852 302 list split 4; +#X obj 852 327 list split 4; +#X listbox 950 255 20 0 0 0 - - - 0; +#X listbox 949 281 20 0 0 0 - - - 0; +#X listbox 949 306 20 0 0 0 - - - 0; +#X listbox 949 330 20 0 0 0 - - - 0; #X text 19 140 Model Matrix :; #X text 287 137 View Matrix :; #X text 541 138 Model * View Matrix; #X text 839 145 Projection Matrix; #X msg 843 193 -4 4 -4 4 0 20; -#X text 853 429 fovY (field of view) \, aspect ratio \, nearZ \, farZ; -#X text 840 408 perspective projection :; +#X text 853 399 fovY (field of view) \, aspect ratio \, nearZ \, farZ; +#X text 840 378 perspective projection :; #X text 838 162 orthographique projection :; -#X msg 1233 385 3.14159 4; #X obj 1233 413 /; #X obj 1232 272 r __gem; #X obj 1232 297 route dimen; #X obj 1232 322 /; -#X text 1264 321 real gemwin X/Y ratio; #X floatatom 1233 440 5 0 0 0 - - - 0; #X obj 843 515 list split 4; #X obj 843 540 list split 4; @@ -172,7 +170,6 @@ #X obj 287 596 s shader_matrix; #X obj 814 670 s shader_matrix; #X text 27 35 The model matrix combine the geometry transformation. It can be computed with specific library \, or with standard openGL object., f 30; -#X text 1282 412 45° fov (this is a very wild angle), f 21; #N canvas 234 350 511 439 build_perspective 0; #X obj 37 24 inlet; #X obj 37 108 * 0.5; @@ -231,8 +228,6 @@ #X connect 24 0 22 1; #X restore 843 484 pd build_perspective; #X text 274 38 The view matrix represent the camera position and orientation. It can be set via message to the gemwin object, f 31; -#X text 834 28 The projection matrix The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; -#X text 27 8 This patch create transformation matrix to be use with previous patch (keep the previous patch open)., f 103; #X text 535 34 Since the shader need only the multiplication of the model matrix and the view matrix \, you can get this combination directly : (not used in this example), f 35; #N canvas 130 82 1016 644 shader 0; #X obj 53 27 gemhead; @@ -298,14 +293,22 @@ #X connect 31 0 12 0; #X restore 1228 514 pd shader; #X obj 1228 550 _gemwin; -#X msg 843 457 0.7 1 1 20; +#X text 27 8 This patch create the various matrix used by the rendering pipeline, f 103; +#X text 834 28 The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; +#X msg 843 427 1.57 1 0 20; +#X msg 1233 385 3.14159 2; +#X text 1282 412 90° fov (this is a very wild angle), f 21; +#X text 948 429 Gem wild angle; +#X text 959 460 smaller angle vision; +#X text 1264 321 real gemwin aspect ratio; +#X msg 870 457 0.5 1 0 20; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 1 16 0; -#X connect 5 1 93 0; +#X connect 5 1 91 0; #X connect 6 0 2 1; #X connect 7 0 2 2; #X connect 8 0 2 3; @@ -324,7 +327,7 @@ #X connect 19 0 23 0; #X connect 24 0 25 0; #X connect 25 1 27 0; -#X connect 25 1 94 0; +#X connect 25 1 92 0; #X connect 27 0 31 0; #X connect 27 1 28 0; #X connect 28 0 32 0; @@ -354,7 +357,7 @@ #X connect 52 1 53 0; #X connect 53 0 57 0; #X connect 58 0 60 0; -#X connect 58 0 95 0; +#X connect 58 0 93 0; #X connect 60 0 64 0; #X connect 60 1 61 0; #X connect 61 0 65 0; @@ -363,24 +366,25 @@ #X connect 62 1 63 0; #X connect 63 0 67 0; #X connect 72 0 58 0; -#X connect 76 0 77 0; -#X connect 77 0 82 0; +#X connect 76 0 80 0; +#X connect 77 0 78 0; #X connect 78 0 79 0; -#X connect 79 0 80 0; -#X connect 80 0 91 0; +#X connect 79 0 89 0; +#X connect 81 0 85 0; +#X connect 81 1 82 0; +#X connect 82 0 86 0; +#X connect 82 1 83 0; #X connect 83 0 87 0; #X connect 83 1 84 0; #X connect 84 0 88 0; -#X connect 84 1 85 0; -#X connect 85 0 89 0; -#X connect 85 1 86 0; -#X connect 86 0 90 0; +#X connect 91 0 94 0; +#X connect 92 0 95 0; #X connect 93 0 96 0; #X connect 94 0 97 0; #X connect 95 0 98 0; #X connect 96 0 99 0; -#X connect 97 0 100 0; -#X connect 98 0 101 0; -#X connect 104 0 83 0; -#X connect 104 0 95 0; -#X connect 111 0 104 0; +#X connect 101 0 81 0; +#X connect 101 0 93 0; +#X connect 108 0 101 0; +#X connect 109 0 76 0; +#X connect 114 0 101 0; diff --git a/examples/15.OPENGL3.2/shader/03.matrix.frag b/examples/15.OPENGL3.2/shader/03.matrix.frag new file mode 100644 index 000000000..2f6fbf444 --- /dev/null +++ b/examples/15.OPENGL3.2/shader/03.matrix.frag @@ -0,0 +1,18 @@ +#version 150 + +// from geometry shader +in vec3 vertNormal; +in vec3 vertColor; + +// to rendering +out vec4 FragColor; + +void main() { + // Normalize the normal vector + vec3 normal = normalize(vertNormal); + + // color calculation + float color = abs(dot(vec3(0., 0., 1.),vertNormal)); + + FragColor = vec4(color*vertColor, 1.); +} diff --git a/examples/15.OPENGL3.2/shader/03.matrix.vert b/examples/15.OPENGL3.2/shader/03.matrix.vert new file mode 100644 index 000000000..833b89a84 --- /dev/null +++ b/examples/15.OPENGL3.2/shader/03.matrix.vert @@ -0,0 +1,21 @@ +#version 150 + +// from VBO +in vec3 position; +in vec3 normal; +in vec3 color; + +// to geometry shader +out vec3 vertNormal; +out vec3 vertColor; + +uniform mat4 modelMatrix; +uniform mat4 viewMatrix; +uniform mat4 projMatrix; + +void main() { + mat3 normalMatrix = mat3(transpose(inverse(viewMatrix * modelMatrix))); + vertNormal = normalMatrix * normal; + vertColor = color; + gl_Position = (projMatrix * viewMatrix * modelMatrix * vec4(position, 1.0)); +} From 92e3b75079983a0a7a8448edfd03d581a8ebafe9 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 09:55:41 +0200 Subject: [PATCH 333/387] clean --- examples/15.OPENGL3.2/04.model.pd | 85 ++++++++++++++----------------- 1 file changed, 39 insertions(+), 46 deletions(-) diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.OPENGL3.2/04.model.pd index a960ecb8a..1ab17893b 100644 --- a/examples/15.OPENGL3.2/04.model.pd +++ b/examples/15.OPENGL3.2/04.model.pd @@ -79,21 +79,17 @@ #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 105 pd gemwin; #X obj 303 646 t a a; -#X obj 582 108 gemhead; -#X floatatom 617 140 5 0 0 0 - - - 0; -#X floatatom 652 140 5 0 0 0 - - - 0; -#X floatatom 687 140 5 0 0 0 - - - 0; -#X floatatom 598 253 5 0 0 0 - - - 0; -#X floatatom 632 253 5 0 0 0 - - - 0; -#X floatatom 666 253 5 0 0 0 - - - 0; -#X obj 582 274 rotateXYZ; -#X obj 582 299 gemlist_matrix; -#X obj 663 326 list prepend transformation_matrix; -#X obj 663 348 list trim; -#X obj 582 163 translateXYZ 0 0 4; -#X obj 267 132 translateXYZ; -#X floatatom 330 106 5 0 0 0 - - - 0; -#X text 369 105 this transformation is ignored..., f 19; +#X obj 528 105 gemhead; +#X floatatom 563 137 5 0 0 0 - - - 0; +#X floatatom 598 137 5 0 0 0 - - - 0; +#X floatatom 544 250 5 0 0 0 - - - 0; +#X floatatom 578 250 5 0 0 0 - - - 0; +#X floatatom 612 250 5 0 0 0 - - - 0; +#X obj 528 271 rotateXYZ; +#X obj 528 296 gemlist_matrix; +#X obj 609 323 list prepend transformation_matrix; +#X obj 609 345 list trim; +#X obj 528 160 translateXYZ 0 0 4; #N canvas 1001 526 302 371 table 0; #X obj 29 30 table table_posX; #X obj 29 53 table table_posY; @@ -143,45 +139,42 @@ #X connect 14 0 12 0; #X connect 15 0 13 0; #X restore 40 259 pd modelfiler; -#X obj 582 208 scaleXYZ 0.003 0.003 0.003; +#X obj 528 205 scaleXYZ 0.003 0.003 0.003; #X obj 267 698 gemvertexbuffer \; draw tri; #X obj 267 400 glsl shader/04.model; #X obj 287 369 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X text 259 19 modelfiler load a 3d object into tables. The pipeline is unchange regarding previous examples, f 93; #X msg 384 472 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; -#X obj 59 447 text define; -#X obj 59 502 text define; #X obj 39 399 loadbang; -#X msg 59 423 read shader/04.model.frag; -#X msg 59 479 read shader/04.model.vert; +#X obj 55 506 textfile; +#X obj 56 454 textfile; +#X msg 55 482 read shader/04.model.frag cr; +#X msg 56 431 read shader/04.model.vert cr; #X connect 0 0 1 0; -#X connect 2 0 23 0; +#X connect 2 0 26 0; #X connect 3 0 10 0; #X connect 5 0 10 0; -#X connect 6 0 33 0; +#X connect 6 0 29 0; #X connect 6 1 3 0; -#X connect 10 0 29 0; +#X connect 10 0 25 0; #X connect 10 1 7 0; -#X connect 11 0 22 0; -#X connect 12 0 22 1; -#X connect 13 0 22 2; -#X connect 14 0 22 3; -#X connect 15 0 18 1; -#X connect 16 0 18 2; -#X connect 17 0 18 3; -#X connect 18 0 19 0; -#X connect 19 1 20 0; -#X connect 20 0 21 0; -#X connect 21 0 30 1; -#X connect 22 0 28 0; -#X connect 23 0 30 0; -#X connect 24 0 23 1; -#X connect 28 0 18 0; -#X connect 30 0 29 0; -#X connect 30 1 6 0; -#X connect 31 0 30 0; -#X connect 33 0 10 0; -#X connect 36 0 37 0; -#X connect 36 0 38 0; -#X connect 37 0 34 0; -#X connect 38 0 35 0; +#X connect 11 0 21 0; +#X connect 12 0 21 1; +#X connect 13 0 21 2; +#X connect 14 0 17 1; +#X connect 15 0 17 2; +#X connect 16 0 17 3; +#X connect 17 0 18 0; +#X connect 18 1 19 0; +#X connect 19 0 20 0; +#X connect 20 0 26 1; +#X connect 21 0 24 0; +#X connect 24 0 17 0; +#X connect 26 0 25 0; +#X connect 26 1 6 0; +#X connect 27 0 26 0; +#X connect 29 0 10 0; +#X connect 30 0 33 0; +#X connect 30 0 34 0; +#X connect 33 0 31 0; +#X connect 34 0 32 0; From 9fcbaca526e4e15c915d4ff02af5d95ea375681a Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 10:02:06 +0200 Subject: [PATCH 334/387] cleanup --- examples/15.OPENGL3.2/01.basic.pd | 14 ++++++--- examples/15.OPENGL3.2/02.transformation.pd | 12 +++++--- examples/15.OPENGL3.2/03.matrix.pd | 13 ++++++++ examples/15.OPENGL3.2/04.model.pd | 20 +++++++----- examples/15.OPENGL3.2/05.texture.pd | 36 ++++++++++++---------- 5 files changed, 62 insertions(+), 33 deletions(-) diff --git a/examples/15.OPENGL3.2/01.basic.pd b/examples/15.OPENGL3.2/01.basic.pd index 93317ea70..d23915307 100644 --- a/examples/15.OPENGL3.2/01.basic.pd +++ b/examples/15.OPENGL3.2/01.basic.pd @@ -95,15 +95,17 @@ #X obj 267 276 glsl shader/01.basic; #X obj 384 343 \$0; #X text 445 259 This example demonstrates how to use Vertex Buffer Objects (VBOs) in conjunction with shaders in OpenGL. It illustrates the process of creating and binding a VBO to store vertex data \, and then using a vertex shader and fragment shader to render that data., f 88; -#X text 60 527 click to see the shaders; +#X text 47 522 click to see the shaders; #X obj 39 399 loadbang; #X obj 267 588 gemvertexbuffer \; resize 3 \; draw tri; #X text 421 393 We are using attribute here \, since it's the way the shader will have access to the VBO data; #X obj 384 321 t b f; -#X obj 59 502 textfile; -#X obj 59 447 textfile; -#X msg 59 423 read shader/01.basic.frag cr; -#X msg 59 479 read shader/01.basic.vert cr; +#X obj 55 449 textfile; +#X obj 39 498 textfile; +#X msg 39 474 read shader/01.basic.frag cr; +#X msg 55 426 read shader/01.basic.vert cr; +#X msg 121 450 print; +#X msg 106 497 print; #X connect 0 0 1 0; #X connect 2 0 24 0; #X connect 3 0 11 0; @@ -124,3 +126,5 @@ #X connect 31 1 3 0; #X connect 34 0 33 0; #X connect 35 0 32 0; +#X connect 36 0 32 0; +#X connect 37 0 33 0; diff --git a/examples/15.OPENGL3.2/02.transformation.pd b/examples/15.OPENGL3.2/02.transformation.pd index 77d5a87e6..0a146de55 100644 --- a/examples/15.OPENGL3.2/02.transformation.pd +++ b/examples/15.OPENGL3.2/02.transformation.pd @@ -137,10 +137,12 @@ #X obj 458 408 t b f; #X obj 287 377 glsl shader/02.transformation; #X obj 39 399 loadbang; -#X obj 59 447 textfile; -#X msg 59 423 read shader/02.transformation.frag cr; -#X obj 59 502 textfile; -#X msg 59 479 read shader/02.transformation.vert cr; +#X obj 39 499 textfile; +#X msg 39 475 read shader/02.transformation.frag cr; +#X obj 59 452 textfile; +#X msg 59 429 read shader/02.transformation.vert cr; +#X msg 101 500 print; +#X msg 121 452 print; #X connect 0 0 1 0; #X connect 2 0 43 0; #X connect 3 0 12 0; @@ -183,3 +185,5 @@ #X connect 49 0 53 0; #X connect 51 0 50 0; #X connect 53 0 52 0; +#X connect 54 0 50 0; +#X connect 55 0 52 0; diff --git a/examples/15.OPENGL3.2/03.matrix.pd b/examples/15.OPENGL3.2/03.matrix.pd index c73d92ce9..1826ee450 100644 --- a/examples/15.OPENGL3.2/03.matrix.pd +++ b/examples/15.OPENGL3.2/03.matrix.pd @@ -262,6 +262,13 @@ #X obj 53 189 glsl shader/03.matrix; #X msg 221 380 print_attributes; #X msg 197 336 attribute position \$1_position \, attribute normal \$1_normal \, attribute color \$1_color; +#X obj 329 465 loadbang; +#X obj 329 565 textfile; +#X obj 349 518 textfile; +#X msg 391 566 print; +#X msg 411 518 print; +#X msg 349 495 read shader/03.matrix.vert cr; +#X msg 329 541 read shader/03.matrix.frag cr; #X connect 0 0 6 0; #X connect 1 0 29 0; #X connect 2 0 3 0; @@ -291,6 +298,12 @@ #X connect 29 1 24 0; #X connect 30 0 12 0; #X connect 31 0 12 0; +#X connect 32 0 38 0; +#X connect 32 0 37 0; +#X connect 35 0 33 0; +#X connect 36 0 34 0; +#X connect 37 0 34 0; +#X connect 38 0 33 0; #X restore 1228 514 pd shader; #X obj 1228 550 _gemwin; #X text 27 8 This patch create the various matrix used by the rendering pipeline, f 103; diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.OPENGL3.2/04.model.pd index 1ab17893b..2f0ea336d 100644 --- a/examples/15.OPENGL3.2/04.model.pd +++ b/examples/15.OPENGL3.2/04.model.pd @@ -1,4 +1,4 @@ -#N canvas 774 83 967 800 10; +#N canvas 753 73 967 800 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -145,11 +145,13 @@ #X obj 287 369 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X text 259 19 modelfiler load a 3d object into tables. The pipeline is unchange regarding previous examples, f 93; #X msg 384 472 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; -#X obj 39 399 loadbang; -#X obj 55 506 textfile; -#X obj 56 454 textfile; -#X msg 55 482 read shader/04.model.frag cr; -#X msg 56 431 read shader/04.model.vert cr; +#X obj 31 461 loadbang; +#X obj 31 561 textfile; +#X obj 51 514 textfile; +#X msg 93 562 print; +#X msg 113 514 print; +#X msg 51 491 read shader/04.model.vert cr; +#X msg 31 537 read shader/04.model.frag cr; #X connect 0 0 1 0; #X connect 2 0 26 0; #X connect 3 0 10 0; @@ -174,7 +176,9 @@ #X connect 26 1 6 0; #X connect 27 0 26 0; #X connect 29 0 10 0; -#X connect 30 0 33 0; -#X connect 30 0 34 0; +#X connect 30 0 36 0; +#X connect 30 0 35 0; #X connect 33 0 31 0; #X connect 34 0 32 0; +#X connect 35 0 32 0; +#X connect 36 0 31 0; diff --git a/examples/15.OPENGL3.2/05.texture.pd b/examples/15.OPENGL3.2/05.texture.pd index a3dc8c0b0..3452cfc27 100644 --- a/examples/15.OPENGL3.2/05.texture.pd +++ b/examples/15.OPENGL3.2/05.texture.pd @@ -101,13 +101,15 @@ #X msg 386 254 print; #X msg 554 315 Texture2 1; #X text 263 12 Using textures did not really change; -#X obj 59 447 text define; -#X obj 59 502 text define; #X obj 39 399 loadbang; -#X msg 59 423 read shader/03.texture.frag; -#X msg 59 479 read shader/03.texture.vert; #X obj 378 229 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X obj 368 281 glsl shader/05.texture; +#X msg 120 502 print; +#X msg 142 452 print; +#X obj 39 502 textfile; +#X obj 59 452 textfile; +#X msg 39 478 read shader/05.texture.frag cr; +#X msg 59 429 read shader/05.texture.vert cr; #X connect 0 0 1 0; #X connect 2 0 16 0; #X connect 3 0 12 0; @@ -125,16 +127,18 @@ #X connect 22 0 12 0; #X connect 23 0 27 0; #X connect 24 0 25 0; -#X connect 25 0 39 1; +#X connect 25 0 35 1; #X connect 26 0 21 0; -#X connect 27 0 39 0; -#X connect 30 0 39 0; -#X connect 31 0 39 1; -#X connect 35 0 36 0; -#X connect 35 0 37 0; -#X connect 36 0 33 0; -#X connect 37 0 34 0; -#X connect 38 0 39 0; -#X connect 39 0 28 0; -#X connect 39 1 6 0; -#X connect 39 1 31 0; +#X connect 27 0 35 0; +#X connect 30 0 35 0; +#X connect 31 0 35 1; +#X connect 33 0 40 0; +#X connect 33 0 41 0; +#X connect 34 0 35 0; +#X connect 35 0 28 0; +#X connect 35 1 6 0; +#X connect 35 1 31 0; +#X connect 36 0 38 0; +#X connect 37 0 39 0; +#X connect 40 0 38 0; +#X connect 41 0 39 0; From a23a541f28e203c5fa054dc8f00456f29733949c Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 11:16:29 +0200 Subject: [PATCH 335/387] simpler perspect matrix computation --- examples/15.OPENGL3.2/03.matrix.pd | 86 +++++++++++++++--------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/examples/15.OPENGL3.2/03.matrix.pd b/examples/15.OPENGL3.2/03.matrix.pd index 1826ee450..6f71c8b8c 100644 --- a/examples/15.OPENGL3.2/03.matrix.pd +++ b/examples/15.OPENGL3.2/03.matrix.pd @@ -1,4 +1,4 @@ -#N canvas 420 72 1450 697 12; +#N canvas 116 169 1450 697 12; #X obj 21 209 GEMglLoadIdentity; #X obj 21 174 gemhead; #X obj 21 255 translateXYZ; @@ -177,55 +177,51 @@ #X msg 37 83 \$1; #X msg 37 156 1 \$1; #X obj 37 181 /; -#X msg 158 81 \$3 \$4; -#X obj 158 106 -; -#X msg 158 130 1 \$1; -#X obj 158 154 /; +#X obj 323 190 -; #X obj 69 234 pack f f; #X msg 122 210 \$2; -#X msg 218 155 \$3 \$4; -#X obj 218 185 +; -#X obj 200 214 *; -#X msg 279 156 \$3 \$4; -#X obj 261 217 *; -#X obj 279 186 *; +#X msg 183 167 \$3 \$4; +#X obj 183 197 +; +#X msg 261 160 \$3 \$4; +#X obj 261 190 *; #X obj 37 209 t f f; -#X obj 261 243 * 2; #X msg 37 314 \$2 0 0 0 0 \$1 0 0 0 0 \$3 -1 0 0 \$4 0; #X obj 37 52 t a a a a a, f 35; #X obj 37 284 pack f f f f, f 32; #X obj 37 342 outlet; #X obj 69 259 /; -#X connect 0 0 21 0; +#X obj 183 240 /; +#X obj 261 217 * 2; +#X obj 261 243 /; +#X msg 323 165 \$3 \$4; +#X connect 0 0 15 0; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 3 0 1 0; #X connect 4 0 5 0; -#X connect 5 0 18 0; -#X connect 6 0 7 0; -#X connect 7 0 8 0; -#X connect 8 0 9 0; -#X connect 9 0 14 0; -#X connect 9 0 16 0; -#X connect 10 0 24 0; -#X connect 11 0 10 1; -#X connect 12 0 13 0; -#X connect 13 0 14 1; -#X connect 14 0 22 2; -#X connect 15 0 17 0; -#X connect 16 0 19 0; -#X connect 17 0 16 1; -#X connect 18 0 22 0; -#X connect 18 1 10 0; -#X connect 19 0 22 3; -#X connect 20 0 23 0; -#X connect 21 0 3 0; -#X connect 21 1 11 0; -#X connect 21 2 6 0; -#X connect 21 3 12 0; -#X connect 21 4 15 0; -#X connect 22 0 20 0; -#X connect 24 0 22 1; +#X connect 5 0 13 0; +#X connect 6 0 19 1; +#X connect 6 0 21 1; +#X connect 7 0 18 0; +#X connect 8 0 7 1; +#X connect 9 0 10 0; +#X connect 10 0 19 0; +#X connect 11 0 12 0; +#X connect 12 0 20 0; +#X connect 13 0 16 0; +#X connect 13 1 7 0; +#X connect 14 0 17 0; +#X connect 15 0 3 0; +#X connect 15 1 8 0; +#X connect 15 2 9 0; +#X connect 15 3 11 0; +#X connect 15 4 22 0; +#X connect 16 0 14 0; +#X connect 18 0 16 1; +#X connect 19 0 16 2; +#X connect 20 0 21 0; +#X connect 21 0 16 3; +#X connect 22 0 6 0; #X restore 843 484 pd build_perspective; #X text 274 38 The view matrix represent the camera position and orientation. It can be set via message to the gemwin object, f 31; #X text 535 34 Since the shader need only the multiplication of the model matrix and the view matrix \, you can get this combination directly : (not used in this example), f 35; @@ -309,12 +305,15 @@ #X text 27 8 This patch create the various matrix used by the rendering pipeline, f 103; #X text 834 28 The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; #X msg 843 427 1.57 1 0 20; -#X msg 1233 385 3.14159 2; -#X text 1282 412 90° fov (this is a very wild angle), f 21; #X text 948 429 Gem wild angle; #X text 959 460 smaller angle vision; #X text 1264 321 real gemwin aspect ratio; #X msg 870 457 0.5 1 0 20; +#X msg 1233 385 3.14159 4; +#X text 1282 412 45° fov (this is a wild angle), f 21; +#X floatatom 1139 586 5 0 0 0 - - - 0; +#X msg 1138 617 \$1 1 1 100; +#X msg 1169 481 1.57 1 1 100; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 3 0; @@ -399,5 +398,8 @@ #X connect 101 0 81 0; #X connect 101 0 93 0; #X connect 108 0 101 0; -#X connect 109 0 76 0; -#X connect 114 0 101 0; +#X connect 112 0 101 0; +#X connect 113 0 76 0; +#X connect 115 0 116 0; +#X connect 116 0 101 0; +#X connect 117 0 101 0; From 4b206f13acd1745b0220401f1c7701da205f53f2 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 11:17:59 +0200 Subject: [PATCH 336/387] make this example to work : better default value, riwrite the shader more comments ... --- examples/15.OPENGL3.2/06.lighting.pd | 139 +++++++++++---------- examples/15.OPENGL3.2/shader/06.light.frag | 72 ++++++----- examples/15.OPENGL3.2/shader/06.light.vert | 36 ++++-- 3 files changed, 141 insertions(+), 106 deletions(-) diff --git a/examples/15.OPENGL3.2/06.lighting.pd b/examples/15.OPENGL3.2/06.lighting.pd index 97c0a52db..8f0e279c8 100644 --- a/examples/15.OPENGL3.2/06.lighting.pd +++ b/examples/15.OPENGL3.2/06.lighting.pd @@ -1,4 +1,4 @@ -#N canvas 445 103 967 800 10; +#N canvas 817 105 967 800 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -80,18 +80,15 @@ #X restore 42 51 pd gemwin; #X obj 303 666 t a a; #X obj 401 77 gemhead; -#X floatatom 436 109 5 0 0 0 - - - 0; -#X floatatom 471 109 5 0 0 0 - - - 0; -#X floatatom 506 109 5 0 0 0 - - - 0; +#X floatatom 436 129 5 0 0 0 - - - 0; +#X floatatom 471 129 5 0 0 0 - - - 0; #X floatatom 417 222 5 0 0 0 - - - 0; #X floatatom 451 222 5 0 0 0 - - - 0; #X floatatom 485 222 5 0 0 0 - - - 0; #X obj 401 243 rotateXYZ; #X obj 401 268 gemlist_matrix; -#X obj 482 295 list prepend transformation_matrix; #X obj 482 317 list trim; -#X obj 401 132 translateXYZ 0 0 4; -#N canvas 1001 526 302 371 table 0; +#N canvas 325 467 302 371 table 0; #X obj 29 30 table table_posX; #X obj 29 53 table table_posY; #X obj 29 76 table table_posZ; @@ -101,7 +98,7 @@ #X obj 28 195 table table_colorR; #X obj 28 215 table table_colorG; #X obj 28 235 table table_colorB; -#X restore 42 175 pd table; +#X restore 41 229 pd table; #N canvas 1279 243 543 538 modelfiler 0; #X obj 81 277 modelfiler; #X msg 106 132 position table_pos; @@ -109,83 +106,89 @@ #X msg 136 212 normal table_normal; #X obj 81 25 loadbang; #X obj 144 24 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X msg 81 95 open ../data/venus.obj; #X obj 81 303 route vertices; -#X msg 81 332 resize \$1; #X obj 81 55 t b b b; -#X msg 201 361 sinesum 8192 0.5 0.25 0.25 0 0.2; #X obj 91 419 s table_colorR; #X obj 91 449 s table_colorG; #X obj 91 479 s table_colorB; -#X msg 219 383 sinesum 8192 0.5 -0.25 0.25 0 0.2; -#X msg 235 409 sinesum 8192 0.5 0.25 -0.25 0 0.2; -#X connect 0 0 7 0; +#X floatatom 110 363 10 0 0 0 - - - 0; +#X msg 81 95 open ../data/venus.obj; +#X msg 116 389 const 1; +#X msg 81 332 resize \$1 \, const 1; +#X connect 0 0 6 0; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 0; -#X connect 4 0 9 0; -#X connect 5 0 9 0; -#X connect 6 0 0 0; -#X connect 7 0 8 0; -#X connect 8 0 11 0; -#X connect 8 0 12 0; -#X connect 8 0 13 0; -#X connect 9 0 6 0; -#X connect 9 1 1 0; -#X connect 9 1 3 0; -#X connect 9 2 10 0; -#X connect 9 2 14 0; -#X connect 9 2 15 0; -#X connect 10 0 11 0; -#X connect 14 0 12 0; -#X connect 15 0 13 0; +#X connect 4 0 7 0; +#X connect 5 0 7 0; +#X connect 6 0 14 0; +#X connect 6 0 11 0; +#X connect 7 0 12 0; +#X connect 7 1 1 0; +#X connect 7 1 3 0; +#X connect 12 0 0 0; +#X connect 13 0 8 0; +#X connect 13 0 9 0; +#X connect 13 0 10 0; +#X connect 14 0 8 0; +#X connect 14 0 9 0; +#X connect 14 0 10 0; #X restore 40 205 pd modelfiler; -#X obj 401 177 scaleXYZ 0.003 0.003 0.003; #X msg 384 492 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute normal_X table_normalX \, attribute normal_Y table_normalY \, attribute normal_Z table_normalZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; -#X obj 267 718 gemvertexbuffer \; draw tri; #X text 269 10 This example introduces the Blinn-Phong lighting model \, which enhances flexibility \, improves light quality \, and optimizes rendering performance compared to the older fixed-function pipeline., f 86; -#X msg 726 249 5 3 1 1; #X listbox 726 276 20 0 0 0 - - - 0; -#X msg 726 303 LightPosition \$1 \$2 \$3 \$4; -#X msg 448 407 LightPosition 5 3 1 1 \, LightL 1 1 1 \, LightLa 1 1 1 \, MaterialKa 0.3 0.3 0.3 \, MaterialKd 0.1 0.1 0.1 \, MaterialKs 0.3 0.3 0.3 \, MaterialShininess 0.1; #X obj 288 333 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X obj 59 447 text define; -#X obj 59 502 text define; -#X obj 39 399 loadbang; -#X msg 59 423 read shader/08.light.vert; -#X msg 59 479 read shader/08.light.frag; +#X obj 30 402 loadbang; #X obj 267 370 glsl shader/06.light; +#X obj 47 457 textfile; +#X msg 109 457 print; +#X msg 47 433 read shader/06.light.vert cr; +#X msg 30 481 read shader/06.light.frag cr; +#X obj 30 504 textfile; +#X msg 93 504 print; +#X obj 482 295 list prepend modelMatrix; +#X obj 401 187 scaleXYZ 0.01 0.01 0.01; +#X obj 267 718 gemvertexbuffer \; draw tri; +#X obj 401 108 GEMglLoadIdentity; +#X obj 401 152 translateXYZ 0 0 0; +#X floatatom 506 129 5 0 0 0 - - - 0; +#X msg 726 303 LightPosition \$1 \$2 \$3 1; +#X msg 726 249 5 2 5; +#X msg 448 408 LightPosition 5 2 5 1 \, LightL 0.8 0.8 0.8 \, LightLa 0.2 0.2 0.2 \, MaterialKa 0.2 0.2 0.2 \, MaterialKd 0.7 0.7 0.7 \, MaterialKs 1 1 1 \, MaterialShininess 32 \, projMatrix 1 0 0 0 0 1 0 0 0 0 -1 -1 0 0 -2 0 \, viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; #X connect 0 0 1 0; -#X connect 2 0 39 0; +#X connect 2 0 27 0; #X connect 3 0 10 0; #X connect 5 0 10 0; -#X connect 6 0 26 0; +#X connect 6 0 22 0; #X connect 6 1 3 0; -#X connect 10 0 27 0; +#X connect 10 0 36 0; #X connect 10 1 7 0; -#X connect 11 0 22 0; -#X connect 12 0 22 1; -#X connect 13 0 22 2; -#X connect 14 0 22 3; -#X connect 15 0 18 1; -#X connect 16 0 18 2; -#X connect 17 0 18 3; -#X connect 18 0 19 0; -#X connect 19 1 20 0; -#X connect 20 0 21 0; -#X connect 21 0 39 1; -#X connect 22 0 25 0; -#X connect 25 0 18 0; -#X connect 26 0 10 0; -#X connect 29 0 30 0; -#X connect 30 0 31 0; -#X connect 31 0 39 1; -#X connect 32 0 39 1; -#X connect 33 0 39 0; -#X connect 36 0 37 0; -#X connect 36 0 38 0; -#X connect 37 0 34 0; +#X connect 11 0 37 0; +#X connect 12 0 38 1; +#X connect 13 0 38 2; +#X connect 14 0 17 1; +#X connect 15 0 17 2; +#X connect 16 0 17 3; +#X connect 17 0 18 0; +#X connect 18 1 34 0; +#X connect 19 0 27 1; +#X connect 22 0 10 0; +#X connect 24 0 40 0; +#X connect 25 0 27 0; +#X connect 26 0 30 0; +#X connect 26 0 31 0; +#X connect 27 0 36 0; +#X connect 27 1 6 0; +#X connect 27 1 42 0; +#X connect 29 0 28 0; +#X connect 30 0 28 0; +#X connect 31 0 32 0; +#X connect 33 0 32 0; +#X connect 34 0 19 0; +#X connect 35 0 17 0; +#X connect 37 0 38 0; #X connect 38 0 35 0; -#X connect 39 0 27 0; -#X connect 39 1 6 0; -#X connect 39 1 32 0; +#X connect 39 0 38 3; +#X connect 40 0 27 1; +#X connect 41 0 24 0; +#X connect 42 0 27 1; diff --git a/examples/15.OPENGL3.2/shader/06.light.frag b/examples/15.OPENGL3.2/shader/06.light.frag index 70a0d0ad9..269b4f360 100644 --- a/examples/15.OPENGL3.2/shader/06.light.frag +++ b/examples/15.OPENGL3.2/shader/06.light.frag @@ -1,39 +1,53 @@ #version 460 -// Cyrille Henry 2024 +// Cyrille Henry 2025 -// light description -uniform vec4 LightPosition; // Light position in eye coords. -uniform vec3 LightLa; // Ambient light intensity -uniform vec3 LightL; // Diffuse and specular light intensity +// Light in world space +uniform vec4 LightPosition; // Light position in world space +uniform vec3 LightLa; // Ambient intensity +uniform vec3 LightL; // Diffuse/specular intensity +uniform vec3 CameraPosition; // Camera position in world space -// material definition; -uniform vec3 MaterialKa; // Ambient reflectivity -uniform vec3 MaterialKd; // Diffuse reflectivity -uniform vec3 MaterialKs; // Specular reflectivity -uniform float MaterialShininess; // Specular shininess factor +// Material +uniform vec3 MaterialKa; // Ambient reflectivity +uniform vec3 MaterialKd; // Diffuse reflectivity +uniform vec3 MaterialKs; // Specular reflectivity +uniform float MaterialShininess; // Shininess in vec4 Color; in vec3 Normal; -in vec4 Position; - -out vec4 FragColor; -// The only output of this shader : the color of the pixel - -vec3 blinnPhong( vec3 position, vec3 n) { - vec3 ambient = LightLa * MaterialKa; - vec3 s = normalize( LightPosition.xyz - position ); - float sDotN = max( dot(s,n), 0.0 ); - vec3 diffuse = MaterialKd * sDotN; - vec3 spec = vec3(0.0); - if( sDotN > 0.0 ) { - vec3 v = normalize(-position.xyz); - vec3 h = normalize( v + s ); - spec = MaterialKs * pow( max( dot(h,n), 0.0 ), MaterialShininess ); - } - return ambient + LightL * (diffuse + spec); +in vec3 FragPos; // Fragment position in world space +in vec3 ViewPos; // Position in view space (for debugging) + +out vec4 FragColor; // Final color + +vec3 blinnPhong(vec3 position, vec3 n) { + + // Ambient component + vec3 ambient = LightLa * MaterialKa; + + // Vector to the light + vec3 lightDir = normalize(LightPosition.xyz - position); + + // Diffuse component + float diff = max(dot(n, lightDir), 0.0); + vec3 diffuse = MaterialKd * diff; + + // Vector to the viewer (camera) + vec3 viewDir = normalize(CameraPosition - position); + + // Specular component + vec3 specular = vec3(0.0); + if (diff > 0.0) { + vec3 halfwayDir = normalize(lightDir + viewDir); + float spec = pow(max(dot(n, halfwayDir), 0.0), MaterialShininess); + specular = MaterialKs * spec; + } + + return ambient + LightL * (diffuse + specular); } void main() { - mat3 normalMatrix = mat3(transpose(inverse(viewMatrix * modelMatrix))); - FragColor = Color * vec4(blinnPhong(Position.xyz, normalize(Normal)), 1.); + vec3 lighting = blinnPhong(FragPos, normalize(Normal)); + FragColor = Color * vec4(lighting, 1.0); } + diff --git a/examples/15.OPENGL3.2/shader/06.light.vert b/examples/15.OPENGL3.2/shader/06.light.vert index b94ba61bf..90befb8a7 100644 --- a/examples/15.OPENGL3.2/shader/06.light.vert +++ b/examples/15.OPENGL3.2/shader/06.light.vert @@ -1,6 +1,6 @@ #version 460 -// Cyrille Henry 2024 +// Cyrille Henry 2025 layout (location=0) in float positionX; layout (location=1) in float positionY; @@ -12,18 +12,36 @@ layout (location=6) in float colorR; layout (location=7) in float colorG; layout (location=8) in float colorB; -uniform mat4 transformation_matrix; +uniform mat4 modelMatrix; // Transforms from object space to world space +uniform mat4 viewMatrix; // Transforms from world space to camera space +uniform mat4 projMatrix; // Transforms from camera space to clip space out vec4 Color; out vec3 Normal; -out vec4 Position; +out vec3 FragPos; // Position in world space for lighting calculations +out vec3 ViewPos; // Position in view space void main() { - Color = vec4(colorR, colorG, colorB, 1.); - mat3 normalMatrix = mat3(transpose(inverse(transformation_matrix))); - Normal = normalMatrix * vec3(normal_X, normal_Y, normal_Z); - vec3 pos = vec3(positionX, positionY, positionZ); - Position = transformation_matrix * vec4(pos,1.0); - gl_Position = Position; + // Pass color as is + Color = vec4(colorR, colorG, colorB, 1.0); + + // Position in object space + vec4 objectPos = vec4(positionX, positionY, positionZ, 1.0); + + // Position in world space - for lighting calculations + vec4 worldPos = modelMatrix * objectPos; + FragPos = worldPos.xyz; + + // Position in view space + vec4 viewPos = viewMatrix * worldPos; + ViewPos = viewPos.xyz; + + // Final position in clip space - what the rendering hardware uses + gl_Position = projMatrix * viewPos; + // Equivalent to: gl_Position = projMatrix * viewMatrix * modelMatrix * objectPos; + + // Normal transformation - uses only the model matrix for lighting calculations in world space + mat3 normalMatrix = mat3(transpose(inverse(modelMatrix))); + Normal = normalize(normalMatrix * vec3(normal_X, normal_Y, normal_Z)); } From 889f41dff517b9e049d4e55474afc320518c9dcf Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 13:42:33 +0200 Subject: [PATCH 337/387] cleanup --- examples/15.OPENGL3.2/08.geometry.pd | 94 +++++++++++++++------------- 1 file changed, 50 insertions(+), 44 deletions(-) diff --git a/examples/15.OPENGL3.2/08.geometry.pd b/examples/15.OPENGL3.2/08.geometry.pd index bd34c082f..8721aa660 100644 --- a/examples/15.OPENGL3.2/08.geometry.pd +++ b/examples/15.OPENGL3.2/08.geometry.pd @@ -97,10 +97,6 @@ #X msg 718 255 lightPos 2 2 2; #X msg 718 282 lightColor 1 1 1; #X msg 718 309 ambientColor 0.2 0.2 0.2; -#X obj 167 53 table \$0_position 18; -#X obj 167 74 table \$0_color 18; -#X obj 167 95 table \$0_normal 18; -#X obj 167 116 table \$0_texcoord 12; #X msg 718 174 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; #X msg 718 201 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; #X obj 333 116 translateXYZ; @@ -126,61 +122,71 @@ #X text 754 9 version >=420; #X obj 714 5 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; #X obj 474 7 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; -#X text 744 461 add invocations; +#X text 744 461 invocations; #X restore 981 576 pd drawing_type; -#X text 449 12 This example introduce the Model Projection View matrix and a simple geometry shader; -#X obj 60 510 text define; -#X obj 60 565 text define; #X obj 40 462 loadbang; -#X msg 60 486 read shader/05.geometry.frag; -#X obj 60 615 text define; -#X msg 60 592 read shader/05.geometry.vert; -#X msg 60 542 read shader/05.geometry.geo; #X obj 333 226 glsl shader/08.geometry; +#X obj 60 510 textfile; +#X msg 60 486 read shader/08.geometry.frag cr; +#X msg 60 542 read shader/08.geometry.geom cr; +#X msg 60 592 read shader/08.geometry.vert cr; +#X obj 60 565 textfile; +#X obj 60 615 textfile; +#X text 449 12 This example introduce a simple geometry shader; +#X obj 167 53 table \$0_position 12; +#X obj 167 74 table \$0_color 12; +#X obj 167 95 table \$0_normal 12; +#X obj 167 116 table \$0_texcoord 8; +#X msg 119 511 print; +#X msg 122 566 print; +#X msg 123 614 print; #X connect 0 0 1 0; -#X connect 2 0 35 0; +#X connect 2 0 31 0; #X connect 3 0 8 0; #X connect 4 0 8 0; -#X connect 8 0 44 0; +#X connect 8 0 40 0; #X connect 8 1 5 0; -#X connect 9 0 43 0; -#X connect 12 0 40 0; +#X connect 9 0 39 0; +#X connect 12 0 36 0; #X connect 13 0 22 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 13 0; #X connect 16 1 3 0; -#X connect 17 0 41 0; -#X connect 19 0 42 0; -#X connect 21 0 54 0; +#X connect 17 0 37 0; +#X connect 19 0 38 0; +#X connect 21 0 43 0; #X connect 22 0 8 0; #X connect 23 0 24 0; #X connect 23 0 28 0; #X connect 23 0 27 0; #X connect 23 0 26 0; -#X connect 23 0 34 0; -#X connect 23 0 33 0; +#X connect 23 0 30 0; +#X connect 23 0 29 0; #X connect 23 0 25 0; -#X connect 24 0 54 1; -#X connect 25 0 54 1; -#X connect 26 0 54 1; -#X connect 27 0 54 1; -#X connect 28 0 54 1; -#X connect 33 0 54 1; -#X connect 34 0 54 1; -#X connect 35 0 54 0; -#X connect 36 0 35 1; -#X connect 37 0 54 1; -#X connect 40 0 11 0; -#X connect 41 0 18 0; -#X connect 42 0 20 0; -#X connect 43 0 10 0; -#X connect 49 0 50 0; -#X connect 49 0 53 0; -#X connect 49 0 52 0; -#X connect 50 0 47 0; -#X connect 52 0 51 0; -#X connect 53 0 48 0; -#X connect 54 0 44 0; -#X connect 54 1 15 0; -#X connect 54 1 23 0; +#X connect 24 0 43 1; +#X connect 25 0 43 1; +#X connect 26 0 43 1; +#X connect 27 0 43 1; +#X connect 28 0 43 1; +#X connect 29 0 43 1; +#X connect 30 0 43 1; +#X connect 31 0 43 0; +#X connect 32 0 31 1; +#X connect 33 0 43 1; +#X connect 36 0 11 0; +#X connect 37 0 18 0; +#X connect 38 0 20 0; +#X connect 39 0 10 0; +#X connect 42 0 45 0; +#X connect 42 0 46 0; +#X connect 42 0 47 0; +#X connect 43 0 40 0; +#X connect 43 1 15 0; +#X connect 43 1 23 0; +#X connect 45 0 44 0; +#X connect 46 0 48 0; +#X connect 47 0 49 0; +#X connect 55 0 44 0; +#X connect 56 0 48 0; +#X connect 57 0 49 0; From aedc445defd4da29995c416c98ee61beab090781 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 13:52:37 +0200 Subject: [PATCH 338/387] comment a test that cause more problem that it solve. --- src/Geos/gemvertexbuffer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Geos/gemvertexbuffer.cpp b/src/Geos/gemvertexbuffer.cpp index 3a77a7713..af4ac1d19 100644 --- a/src/Geos/gemvertexbuffer.cpp +++ b/src/Geos/gemvertexbuffer.cpp @@ -475,11 +475,13 @@ void gemvertexbuffer :: copyArray(const std::string&tab_name, t_word *vec; const bool interleaved = (0==dimen); - if(offset>vb.size*vb.dimen) { +/* + if(offset>vb.size*vb.dimen) { // should this test be diferent for interleaved or not copy? error("offset %d is bigger than vertexbuffer size (%d) for %s", offset, vb.size, tab_name.c_str()); return; } - + // ch 2025 : since the vb is resized before copying the element, this test look useless to me +*/ t_symbol*s=gensym(tab_name.c_str()); pd_findbyclass(s, garray_class); if (!(a = (t_garray *)pd_findbyclass(s, garray_class))) { From 0d568530075b9492353e139e85374fc78842b7dd Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 15:37:37 +0200 Subject: [PATCH 339/387] removed because I can't find the best way to do VBO primitives --- examples/15.OPENGL3.2/07.primitives.pd | 110 ------ examples/15.OPENGL3.2/VBOcircle.pd | 250 ------------- examples/15.OPENGL3.2/VBOline-help.pd | 78 ----- examples/15.OPENGL3.2/VBOline.pd | 166 --------- examples/15.OPENGL3.2/VBOmesh_quad.pd | 406 --------------------- examples/15.OPENGL3.2/VBOmesh_tri.pd | 465 ------------------------- examples/15.OPENGL3.2/VBOsquare.pd | 111 ------ 7 files changed, 1586 deletions(-) delete mode 100644 examples/15.OPENGL3.2/07.primitives.pd delete mode 100644 examples/15.OPENGL3.2/VBOcircle.pd delete mode 100644 examples/15.OPENGL3.2/VBOline-help.pd delete mode 100644 examples/15.OPENGL3.2/VBOline.pd delete mode 100644 examples/15.OPENGL3.2/VBOmesh_quad.pd delete mode 100644 examples/15.OPENGL3.2/VBOmesh_tri.pd delete mode 100644 examples/15.OPENGL3.2/VBOsquare.pd diff --git a/examples/15.OPENGL3.2/07.primitives.pd b/examples/15.OPENGL3.2/07.primitives.pd deleted file mode 100644 index 191bab3fc..000000000 --- a/examples/15.OPENGL3.2/07.primitives.pd +++ /dev/null @@ -1,110 +0,0 @@ -#N canvas 568 165 1140 655 12; -#X obj 469 431 VBOsphere; -#X obj 555 428 VBOcube; -#X obj 268 429 VBOcircle; -#X obj 354 429 BBOmesh_square; -#X obj 116 362 == 0; -#X obj 184 389 spigot; -#X obj 279 390 spigot; -#X obj 365 391 spigot; -#X obj 465 394 spigot; -#X obj 550 394 spigot; -#X obj 639 395 spigot; -#X obj 223 363 == 1; -#X obj 318 364 == 2; -#X obj 404 365 == 3; -#X obj 504 368 == 4; -#X obj 589 368 == 5; -#X obj 678 369 == 6; -#X obj 769 144 vradio 20 1 1 8 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0; -#X text 792 143 line; -#X text 792 166 square; -#X obj 77 252 rotateXYZ; -#X floatatom 98 222 5 0 0 0 - - - 0; -#X floatatom 145 222 5 0 0 0 - - - 0; -#X floatatom 190 222 5 0 0 0 - - - 0; -#X obj 77 41 gemhead; -#N canvas 340 107 682 322 gemwin 0; -#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 102 161 r \$0-gemstart; -#X obj 102 182 select 1 0; -#X msg 102 214 create \, 1; -#X msg 177 215 destroy; -#X obj 102 239 t a; -#X obj 318 54 inlet; -#X obj 318 255 gemwin; -#X obj 318 100 t a a; -#X obj 318 287 outlet; -#X obj 350 128 route create destroy; -#X obj 350 150 t b; -#X msg 350 172 1; -#X obj 390 150 t b; -#X msg 390 172 0; -#X obj 350 195 t f; -#X msg 350 219 set \$1; -#X text 118 122 rendering; -#X connect 1 0 2 0; -#X connect 2 0 3 0; -#X connect 2 1 4 0; -#X connect 3 0 5 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 7 0; -#X connect 8 1 10 0; -#X connect 10 0 11 0; -#X connect 10 1 13 0; -#X connect 11 0 12 0; -#X connect 12 0 15 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X coords 0 -1 1 1 85 40 1 100 100; -#X restore 398 91 pd gemwin; -#X obj 636 428 VBOplane; -#X obj 184 429 VBOsquare; -#X floatatom 195 157 5 0 0 0 - - - 0; -#X obj 77 132 pix_texture \; 0; -#X obj 77 388 spigot; -#X obj 77 189 scaleXYZ 1 1 1; -#X obj 77 431 VBOline \; res 3 \; width 3 \; pos 0 -1 0 0 \; pos 1 0 0 0 \; pos 2 1 0 0 \; color 1 1 1 1; -#X obj 165 47 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; -#X obj 77 85 pix_video \; 0; -#X text 221 12 this example demonstrate various abstraction that mimic simple primitives uving VBO, f 85; -#X connect 4 0 30 1; -#X connect 5 0 27 0; -#X connect 11 0 5 1; -#X connect 12 0 6 1; -#X connect 13 0 7 1; -#X connect 14 0 8 1; -#X connect 15 0 9 1; -#X connect 16 0 10 1; -#X connect 17 0 16 0; -#X connect 17 0 15 0; -#X connect 17 0 14 0; -#X connect 17 0 13 0; -#X connect 17 0 12 0; -#X connect 17 0 11 0; -#X connect 17 0 4 0; -#X connect 20 0 10 0; -#X connect 20 0 9 0; -#X connect 20 0 8 0; -#X connect 20 0 7 0; -#X connect 20 0 6 0; -#X connect 20 0 5 0; -#X connect 20 0 30 0; -#X connect 21 0 20 1; -#X connect 22 0 20 2; -#X connect 23 0 20 3; -#X connect 24 0 34 0; -#X connect 28 0 31 1; -#X connect 28 0 31 2; -#X connect 28 0 31 3; -#X connect 29 0 31 0; -#X connect 30 0 32 0; -#X connect 31 0 20 0; -#X connect 33 0 34 0; -#X connect 33 0 29 0; -#X connect 34 0 29 0; diff --git a/examples/15.OPENGL3.2/VBOcircle.pd b/examples/15.OPENGL3.2/VBOcircle.pd deleted file mode 100644 index 8b3c913ab..000000000 --- a/examples/15.OPENGL3.2/VBOcircle.pd +++ /dev/null @@ -1,250 +0,0 @@ -#N canvas 707 27 1210 853 12; -#X obj 34 27 inlet; -#X obj 276 113 gemargs; -#X obj 344 30 inlet; -#X text 418 245 forward to the corresponding table, f 21; -#X obj 407 380 send; -#X obj 481 294 list split 1; -#X obj 407 321 list trim; -#X obj 367 296 list split 1; -#X obj 683 251 unpack f f f f; -#X msg 683 417 const \$1; -#X obj 683 440 s table-\$0-colorR; -#X obj 261 21 loadbang; -#X msg 778 278 const \$1; -#X msg 746 324 const \$1; -#X msg 714 371 const \$1; -#X obj 714 394 s table-\$0-colorG; -#X obj 746 347 s table-\$0-colorB; -#X obj 778 301 s table-\$0-colorA; -#X obj 683 188 route color; -#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; -#X obj 344 476 delay 0; -#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; -#X text 694 213 RGB or RGBA value; -#X obj 344 505 \$0; -#X obj 261 614 \$0; -#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 261 48 t b b; -#X obj 344 245 t b a a; -#X obj 344 430 b; -#X msg 365 116 color 1 1 1 1; -#X obj 58 83 table table-\$0-posX 4; -#X obj 58 105 table table-\$0-posY 4; -#X obj 58 127 table table-\$0-posZ 4; -#X obj 58 152 table table-\$0-colorR 4; -#X obj 58 174 table table-\$0-colorG 4; -#X obj 58 196 table table-\$0-colorB 4; -#X obj 58 218 table table-\$0-colorA 4; -#X obj 58 243 table table-\$0-textureU 4; -#X obj 58 265 table table-\$0-textureV 4; -#X obj 58 290 table table-\$0-normalX 4; -#X obj 58 312 table table-\$0-normalY 4; -#X obj 58 334 table table-\$0-normalZ 4; -#X obj 34 775 outlet; -#X obj 481 318 list prepend \$0; -#X msg 481 341 symbol table-\$1-\$2; -#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; -#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; -#X obj 866 419 route draw; -#X obj 866 677 t a; -#X obj 866 445 route point points line lines fill; -#X msg 866 486 draw point; -#X obj 344 152 route table res, f 27; -#N canvas 822 119 722 770 resolution 0; -#X obj 42 10 inlet; -#X obj 137 90 + 2; -#N canvas 457 346 481 444 resize_tables 0; -#X obj 128 109 s table-\$0-posX; -#X obj 128 131 s table-\$0-posY; -#X obj 128 153 s table-\$0-posZ; -#X obj 128 177 s table-\$0-colorR; -#X obj 128 199 s table-\$0-colorG; -#X obj 128 221 s table-\$0-colorB; -#X obj 128 243 s table-\$0-colorA; -#X obj 128 266 s table-\$0-textureU; -#X obj 128 288 s table-\$0-textureV; -#X obj 128 313 s table-\$0-normalX; -#X obj 128 335 s table-\$0-normalY; -#X obj 128 357 s table-\$0-normalZ; -#X msg 90 54 resize \$1; -#X obj 88 23 inlet; -#X connect 12 0 0 0; -#X connect 12 0 11 0; -#X connect 12 0 10 0; -#X connect 12 0 9 0; -#X connect 12 0 8 0; -#X connect 12 0 7 0; -#X connect 12 0 6 0; -#X connect 12 0 5 0; -#X connect 12 0 4 0; -#X connect 12 0 3 0; -#X connect 12 0 2 0; -#X connect 12 0 1 0; -#X connect 13 0 12 0; -#X restore 137 117 pd resize_tables; -#X obj 42 58 t b f f; -#N canvas -10 69 452 340 init_tables 0; -#X obj 118 96 s table-\$0-posZ; -#X obj 118 256 s table-\$0-normalX; -#X obj 118 278 s table-\$0-normalY; -#X obj 98 16 inlet; -#X connect 3 0 2 0; -#X connect 3 0 1 0; -#X connect 3 0 0 0; -#X restore 73 343 pd init_tables; -#X msg 73 316 const 0; -#N canvas -10 69 452 340 init_tables 0; -#X obj 118 120 s table-\$0-colorR; -#X obj 118 142 s table-\$0-colorG; -#X obj 118 164 s table-\$0-colorB; -#X obj 118 186 s table-\$0-colorA; -#X obj 118 300 s table-\$0-normalZ; -#X obj 98 16 inlet; -#X connect 5 0 4 0; -#X connect 5 0 3 0; -#X connect 5 0 2 0; -#X connect 5 0 1 0; -#X connect 5 0 0 0; -#X restore 59 399 pd init_tables; -#X msg 59 372 const 1; -#X obj 141 200 until; -#X obj 201 239 f; -#X obj 264 305 + 1; -#X msg 201 191 0; -#X obj 201 354 /; -#X obj 141 152 t f b f, f 17; -#X obj 344 261 atan; -#X text 383 288 2 pi; -#X msg 344 234 1; -#X obj 344 208 loadbang; -#X obj 201 381 *; -#X obj 253 606 cos; -#X obj 473 614 sin; -#X obj 265 641 tabwrite table-\$0-posX; -#X obj 489 641 tabwrite table-\$0-posY; -#X obj 201 268 t f f; -#X obj 253 672 + 1; -#X obj 253 695 / 2; -#X obj 450 544 f; -#X obj 42 459 t b b; -#X msg 42 510 0; -#X msg 74 484 0; -#X obj 344 287 * 8; -#X obj 253 723 tabwrite table-\$0-textureU; -#X obj 473 720 tabwrite table-\$0-textureV; -#X obj 473 670 - 1; -#X obj 473 693 / -2; -#X obj 42 34 f 20; -#X connect 0 0 35 0; -#X connect 1 0 2 0; -#X connect 3 0 5 0; -#X connect 3 0 7 0; -#X connect 3 0 27 0; -#X connect 3 1 13 0; -#X connect 3 2 1 0; -#X connect 5 0 4 0; -#X connect 7 0 6 0; -#X connect 8 0 9 0; -#X connect 9 0 23 0; -#X connect 10 0 9 1; -#X connect 10 0 26 0; -#X connect 11 0 9 0; -#X connect 12 0 18 0; -#X connect 13 0 8 0; -#X connect 13 1 11 0; -#X connect 13 2 12 1; -#X connect 14 0 30 0; -#X connect 16 0 14 0; -#X connect 17 0 16 0; -#X connect 18 0 19 0; -#X connect 18 0 20 0; -#X connect 19 0 21 0; -#X connect 19 0 24 0; -#X connect 20 0 22 0; -#X connect 20 0 33 0; -#X connect 23 0 12 0; -#X connect 23 1 10 0; -#X connect 24 0 25 0; -#X connect 25 0 31 0; -#X connect 26 0 21 1; -#X connect 26 0 22 1; -#X connect 26 0 31 1; -#X connect 26 0 32 1; -#X connect 27 0 28 0; -#X connect 27 1 29 0; -#X connect 28 0 21 0; -#X connect 28 0 22 0; -#X connect 28 0 24 0; -#X connect 28 0 33 0; -#X connect 29 0 26 0; -#X connect 30 0 18 1; -#X connect 33 0 34 0; -#X connect 34 0 32 0; -#X connect 35 0 3 0; -#X restore 437 186 pd resolution; -#X msg 1063 486 draw trifan; -#X msg 78 662 resize \$1; -#X obj 217 9 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 77 635 + 2; -#X msg 960 487 draw linestrip; -#X obj 34 721 gemvertexbuffer \; draw trifan \;; -#X text 256 780 TODO : add a size message (is that really needed? a scaleXYZ object can be use); -#X text 252 823 TODO : line render is not good.; -#X connect 0 0 59 0; -#X connect 1 0 52 0; -#X connect 1 1 53 0; -#X connect 2 0 52 0; -#X connect 5 0 44 0; -#X connect 6 0 4 0; -#X connect 7 1 6 0; -#X connect 8 0 9 0; -#X connect 8 1 14 0; -#X connect 8 2 13 0; -#X connect 8 3 12 0; -#X connect 9 0 10 0; -#X connect 11 0 27 0; -#X connect 12 0 17 0; -#X connect 13 0 16 0; -#X connect 14 0 15 0; -#X connect 18 0 8 0; -#X connect 18 0 20 0; -#X connect 18 1 48 0; -#X connect 19 0 59 0; -#X connect 20 0 23 0; -#X connect 23 0 19 0; -#X connect 24 0 46 0; -#X connect 25 0 23 0; -#X connect 26 0 24 0; -#X connect 27 0 1 0; -#X connect 27 0 24 0; -#X connect 27 1 30 0; -#X connect 28 0 29 0; -#X connect 28 1 7 0; -#X connect 28 2 5 0; -#X connect 29 0 20 0; -#X connect 30 0 52 0; -#X connect 44 0 45 0; -#X connect 45 0 4 1; -#X connect 46 0 59 0; -#X connect 48 0 50 0; -#X connect 48 1 49 0; -#X connect 49 0 59 0; -#X connect 50 0 51 0; -#X connect 50 1 51 0; -#X connect 50 2 58 0; -#X connect 50 3 58 0; -#X connect 50 4 54 0; -#X connect 50 5 54 0; -#X connect 51 0 49 0; -#X connect 52 0 28 0; -#X connect 52 1 53 0; -#X connect 52 1 57 0; -#X connect 52 2 18 0; -#X connect 54 0 49 0; -#X connect 55 0 59 0; -#X connect 56 0 27 0; -#X connect 57 0 55 0; -#X connect 58 0 49 0; -#X connect 59 0 43 0; diff --git a/examples/15.OPENGL3.2/VBOline-help.pd b/examples/15.OPENGL3.2/VBOline-help.pd deleted file mode 100644 index 4590f8a0f..000000000 --- a/examples/15.OPENGL3.2/VBOline-help.pd +++ /dev/null @@ -1,78 +0,0 @@ -#N canvas 514 238 782 673 12; -#X declare -lib Gem; -#X text 476 8 GEM object; -#N canvas 484 243 450 300 META 0; -#X obj 10 25 declare -lib Gem; -#X text 10 65 KEYWORDS Gem openGL shape; -#X text 20 85 INLET_0 gemlist draw; -#X text 20 125 OUTLET_0 gemlist; -#X text 10 165 LICENSE GPL v2; -#X text 10 45 DESCRIPTION Renders a line using a VBO; -#X text 20 105 INLET_1 arguments; -#X text 10 145 AUTHOR Cyrille Henry; -#X restore 576 10 pd META; -#X text 471 43 Example:; -#X obj 469 73 cnv 15 280 580 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 481 165 cnv 15 260 390 empty empty empty 20 12 0 14 #14e814 #404040 0; -#X obj 475 108 gemhead; -#X msg 523 280 res \$1; -#X msg 554 356 color \$1 \$2 \$3 \$4; -#X msg 590 436 pos 0 \$1 \$2 \$3; -#X listbox 554 331 19 0 0 0 - - - 0; -#X msg 523 227 2; -#X floatatom 523 254 5 0 0 0 - - - 0; -#X listbox 590 410 14 0 0 0 - - - 0; -#X msg 590 384 0 0 0; -#X listbox 621 489 14 0 0 0 - - - 0; -#X msg 621 463 1 0 0; -#X msg 621 515 pos 1 \$1 \$2 \$3; -#X obj 475 138 alpha; -#X msg 502 197 width \$1; -#X floatatom 502 172 5 0 0 0 - - - 0; -#X msg 554 305 1 1 1 1; -#X obj 7 74 cnv 15 450 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 8 225 cnv 15 450 310 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X text 9 230 Inlets:; -#X obj 8 185 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X text 17 184 Arguments:; -#X text 27 256 Inlet 1: message: draw [line|fill|point]; -#X text 27 242 Inlet 1: gemlist; -#X text 9 429 Outlets:; -#X text 23 447 Outlet 1: gemlist; -#X text 17 11 Synopsis: [VBOline]; -#X text 37 38 Class: geometric object using Vertex Buffer Object; -#X text 7 78 Description: Renders a line; -#X text 24 101 This primitive create a line \, using only a framebuffer. It replace standard geo object when it's not possible to use them (like in shader version >150); -#X text 61 197 number of points in the line; -#X text 27 272 Inlet 2: message: res : number of point in the line; -#X text 27 288 Inlet 2: message: color float (R) float (G) float (B) float (A) : set the color of the line; -#X text 27 318 Inlet 2: message: pos float (Id) float (X) float (Y) float (Z): set the XYZ position of point: Id; -#X text 27 348 Inlet 2: message: table symbol (name) float (offset) floats (value) : send multiples data to the internal table.; -#X text 28 382 The internal table are : posX \, posY \, posZ \, colorR \, colorG \, colorB \, colorA; -#X obj 639 100 _gemwin; -#X obj 475 606 VBOline 3 \; width 2; -#X obj 475 574 GEMglPointSize 5; -#X text 16 491 internal tables (position and color) are reseted when the resolution is changed; -#X msg 612 175 draw line; -#X msg 628 199 draw point; -#X obj 487 234 t a; -#X connect 5 0 17 0; -#X connect 6 0 41 1; -#X connect 7 0 41 1; -#X connect 8 0 41 1; -#X connect 9 0 7 0; -#X connect 10 0 11 0; -#X connect 11 0 6 0; -#X connect 12 0 8 0; -#X connect 13 0 12 0; -#X connect 14 0 16 0; -#X connect 15 0 14 0; -#X connect 16 0 41 1; -#X connect 17 0 42 0; -#X connect 18 0 46 0; -#X connect 19 0 18 0; -#X connect 20 0 9 0; -#X connect 42 0 41 0; -#X connect 44 0 46 0; -#X connect 45 0 46 0; -#X connect 46 0 41 0; diff --git a/examples/15.OPENGL3.2/VBOline.pd b/examples/15.OPENGL3.2/VBOline.pd deleted file mode 100644 index 91099d145..000000000 --- a/examples/15.OPENGL3.2/VBOline.pd +++ /dev/null @@ -1,166 +0,0 @@ -#N canvas 270 128 1539 677 12; -#X obj 34 27 inlet; -#X obj 231 85 gemargs; -#X obj 314 30 inlet; -#X msg 346 218 resize \$1; -#X text 481 155 forward to the corresponding table, f 21; -#X obj 470 318 send; -#X obj 544 204 list split 1; -#X obj 470 231 list trim; -#X obj 58 83 table table-\$0-posX; -#X obj 58 105 table table-\$0-posY; -#X obj 58 127 table table-\$0-posZ; -#X obj 58 152 table table-\$0-colorR; -#X obj 58 174 table table-\$0-colorG; -#X obj 58 196 table table-\$0-colorB; -#X obj 58 218 table table-\$0-colorA; -#X obj 430 206 list split 1; -#X obj 653 221 unpack f f f f; -#X msg 653 387 const \$1; -#X obj 653 410 s table-\$0-colorR; -#X obj 231 21 loadbang; -#X msg 748 248 const \$1; -#X msg 716 294 const \$1; -#X msg 684 341 const \$1; -#X obj 684 364 s table-\$0-colorG; -#X obj 716 317 s table-\$0-colorB; -#X obj 748 271 s table-\$0-colorA; -#X obj 653 128 route color; -#X obj 920 126 route pos; -#X msg 552 505 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; -#X obj 552 446 delay 0; -#X obj 854 445 delay 0; -#X text 920 452 delay is here to limit the update rate of thevertex buffer once per input message, f 42; -#X text 664 153 RGB or RGBA value; -#X text 937 156 point number \, X Y Z position; -#X msg 854 504 position table-\$1-posX table-\$1-posY table-\$1-posZ, f 39; -#X obj 552 475 \$0; -#X obj 854 474 \$0; -#X obj 587 475 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 886 472 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 231 48 t b b; -#X obj 920 272 unpack f f f f; -#X obj 920 222 t a a; -#X msg 1166 269 \$1; -#X obj 951 310 tabwrite table-\$0-posX; -#X obj 1015 359 tabwrite table-\$0-posZ; -#X obj 983 334 tabwrite table-\$0-posY; -#X obj 314 122 route res table, f 27; -#X obj 407 155 t b a a; -#X obj 407 400 b; -#X obj 314 189 t b f; -#X obj 58 243 table table-\$0-textureU; -#X obj 58 265 table table-\$0-textureV; -#X obj 58 290 table table-\$0-normalX; -#X obj 58 312 table table-\$0-normalY; -#X obj 58 334 table table-\$0-normalZ; -#X obj 34 661 outlet; -#X obj 544 250 list prepend \$0; -#X msg 544 273 symbol table-\$1-\$2; -#N canvas -8 18 452 340 send_tables 0; -#X obj 118 52 s table-\$0-posX; -#X obj 118 74 s table-\$0-posY; -#X obj 118 96 s table-\$0-posZ; -#X obj 118 120 s table-\$0-colorR; -#X obj 118 142 s table-\$0-colorG; -#X obj 118 164 s table-\$0-colorB; -#X obj 118 186 s table-\$0-colorA; -#X obj 118 209 s table-\$0-textureU; -#X obj 118 231 s table-\$0-textureV; -#X obj 118 256 s table-\$0-normalX; -#X obj 118 278 s table-\$0-normalY; -#X obj 118 300 s table-\$0-normalZ; -#X obj 98 16 inlet; -#X connect 12 0 0 0; -#X connect 12 0 11 0; -#X connect 12 0 10 0; -#X connect 12 0 9 0; -#X connect 12 0 8 0; -#X connect 12 0 7 0; -#X connect 12 0 6 0; -#X connect 12 0 5 0; -#X connect 12 0 4 0; -#X connect 12 0 3 0; -#X connect 12 0 2 0; -#X connect 12 0 1 0; -#X restore 275 365 pd send_tables; -#X obj 314 161 f; -#X msg 330 77 res 2 \, color 1 1 1 1 \, pos 0 0 0 0 \, pos 1 1 0 0; -#X obj 198 45 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X floatatom 363 191 5 0 0 0 - - - 0; -#X obj 34 611 gemvertexbuffer \; draw linestrip \;; -#X obj 1231 121 route draw; -#X obj 1231 207 route line lines point points; -#X msg 1231 241 draw linestrip; -#X msg 1330 279 draw point; -#X obj 1241 349 print error : not a valid drawing type; -#X obj 1231 520 t a; -#X connect 0 0 63 0; -#X connect 1 0 46 0; -#X connect 1 1 59 0; -#X connect 2 0 46 0; -#X connect 3 0 63 0; -#X connect 3 0 58 0; -#X connect 6 0 56 0; -#X connect 7 0 5 0; -#X connect 15 1 7 0; -#X connect 16 0 17 0; -#X connect 16 1 22 0; -#X connect 16 2 21 0; -#X connect 16 3 20 0; -#X connect 17 0 18 0; -#X connect 19 0 39 0; -#X connect 20 0 25 0; -#X connect 21 0 24 0; -#X connect 22 0 23 0; -#X connect 26 0 16 0; -#X connect 26 0 29 0; -#X connect 26 1 27 0; -#X connect 27 0 30 0; -#X connect 27 0 41 0; -#X connect 27 1 64 0; -#X connect 28 0 63 0; -#X connect 29 0 35 0; -#X connect 30 0 36 0; -#X connect 34 0 63 0; -#X connect 35 0 28 0; -#X connect 36 0 34 0; -#X connect 37 0 35 0; -#X connect 38 0 36 0; -#X connect 39 0 1 0; -#X connect 39 1 60 0; -#X connect 40 1 43 0; -#X connect 40 2 45 0; -#X connect 40 3 44 0; -#X connect 41 0 40 0; -#X connect 41 1 42 0; -#X connect 42 0 44 1; -#X connect 42 0 45 1; -#X connect 42 0 43 1; -#X connect 46 0 59 0; -#X connect 46 1 47 0; -#X connect 46 2 26 0; -#X connect 47 0 48 0; -#X connect 47 1 15 0; -#X connect 47 2 6 0; -#X connect 48 0 29 0; -#X connect 48 0 30 0; -#X connect 49 0 48 0; -#X connect 49 1 3 0; -#X connect 56 0 57 0; -#X connect 57 0 5 1; -#X connect 59 0 49 0; -#X connect 59 0 62 0; -#X connect 60 0 46 0; -#X connect 61 0 1 0; -#X connect 63 0 55 0; -#X connect 64 0 65 0; -#X connect 64 1 63 0; -#X connect 65 0 66 0; -#X connect 65 1 66 0; -#X connect 65 2 67 0; -#X connect 65 3 67 0; -#X connect 65 4 68 0; -#X connect 66 0 69 0; -#X connect 67 0 69 0; -#X connect 69 0 63 0; diff --git a/examples/15.OPENGL3.2/VBOmesh_quad.pd b/examples/15.OPENGL3.2/VBOmesh_quad.pd deleted file mode 100644 index 56fa9884e..000000000 --- a/examples/15.OPENGL3.2/VBOmesh_quad.pd +++ /dev/null @@ -1,406 +0,0 @@ -#N canvas 495 59 1210 853 12; -#X obj 34 27 inlet; -#X obj 276 113 gemargs; -#X obj 344 30 inlet; -#X text 418 245 forward to the corresponding table, f 21; -#X obj 407 380 send; -#X obj 481 294 list split 1; -#X obj 407 321 list trim; -#X obj 367 296 list split 1; -#X obj 683 251 unpack f f f f; -#X msg 683 417 const \$1; -#X obj 683 440 s table-\$0-colorR; -#X obj 261 21 loadbang; -#X msg 778 278 const \$1; -#X msg 746 324 const \$1; -#X msg 714 371 const \$1; -#X obj 714 394 s table-\$0-colorG; -#X obj 746 347 s table-\$0-colorB; -#X obj 778 301 s table-\$0-colorA; -#X obj 683 188 route color; -#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; -#X obj 344 476 delay 0; -#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; -#X text 694 213 RGB or RGBA value; -#X obj 344 505 \$0; -#X obj 261 614 \$0; -#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 261 48 t b b; -#X obj 344 245 t b a a; -#X obj 344 430 b; -#X msg 365 116 color 1 1 1 1; -#X obj 58 83 table table-\$0-posX 4; -#X obj 58 105 table table-\$0-posY 4; -#X obj 58 127 table table-\$0-posZ 4; -#X obj 58 152 table table-\$0-colorR 4; -#X obj 58 174 table table-\$0-colorG 4; -#X obj 58 196 table table-\$0-colorB 4; -#X obj 58 218 table table-\$0-colorA 4; -#X obj 58 243 table table-\$0-textureU 4; -#X obj 58 265 table table-\$0-textureV 4; -#X obj 58 290 table table-\$0-normalX 4; -#X obj 58 312 table table-\$0-normalY 4; -#X obj 58 334 table table-\$0-normalZ 4; -#X obj 34 775 outlet; -#X obj 481 318 list prepend \$0; -#X msg 481 341 symbol table-\$1-\$2; -#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; -#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; -#X obj 866 419 route draw; -#X obj 866 677 t a; -#X obj 866 445 route point points line lines fill; -#X msg 866 486 draw point; -#X obj 344 152 route table res, f 27; -#N canvas 298 0 1413 927 resolution 0; -#X obj 42 10 inlet; -#N canvas 996 329 481 444 resize_tables 0; -#X obj 128 189 s table-\$0-posX; -#X obj 128 211 s table-\$0-posY; -#X obj 128 233 s table-\$0-posZ; -#X obj 128 257 s table-\$0-colorR; -#X obj 128 279 s table-\$0-colorG; -#X obj 128 301 s table-\$0-colorB; -#X obj 128 323 s table-\$0-colorA; -#X obj 128 346 s table-\$0-textureU; -#X obj 128 368 s table-\$0-textureV; -#X obj 128 393 s table-\$0-normalX; -#X obj 128 415 s table-\$0-normalY; -#X obj 128 437 s table-\$0-normalZ; -#X msg 90 134 resize \$1; -#X obj 90 23 inlet; -#X obj 90 50 t f f; -#X obj 90 77 *; -#X obj 90 104 * 4; -#X connect 12 0 0 0; -#X connect 12 0 11 0; -#X connect 12 0 10 0; -#X connect 12 0 9 0; -#X connect 12 0 8 0; -#X connect 12 0 7 0; -#X connect 12 0 6 0; -#X connect 12 0 5 0; -#X connect 12 0 4 0; -#X connect 12 0 3 0; -#X connect 12 0 2 0; -#X connect 12 0 1 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 14 1 15 1; -#X connect 15 0 16 0; -#X connect 16 0 12 0; -#X restore 143 89 pd resize_tables; -#X obj 42 58 t b f f; -#N canvas -10 69 452 340 init_tables 0; -#X obj 118 96 s table-\$0-posZ; -#X obj 118 256 s table-\$0-normalX; -#X obj 118 278 s table-\$0-normalY; -#X obj 98 16 inlet; -#X connect 3 0 2 0; -#X connect 3 0 1 0; -#X connect 3 0 0 0; -#X restore 54 156 pd init_tables; -#X msg 54 129 const 0; -#N canvas -10 69 452 340 init_tables 0; -#X obj 118 120 s table-\$0-colorR; -#X obj 118 142 s table-\$0-colorG; -#X obj 118 164 s table-\$0-colorB; -#X obj 118 186 s table-\$0-colorA; -#X obj 118 300 s table-\$0-normalZ; -#X obj 98 16 inlet; -#X connect 5 0 4 0; -#X connect 5 0 3 0; -#X connect 5 0 2 0; -#X connect 5 0 1 0; -#X connect 5 0 0 0; -#X restore 42 212 pd init_tables; -#X msg 42 185 const 1; -#X obj 193 163 until; -#X obj 233 191 f; -#X obj 296 254 + 1; -#X msg 251 164 0; -#X obj 193 135 t f b f, f 17; -#X obj 305 829 tabwrite table-\$0-posX; -#X obj 512 828 tabwrite table-\$0-posY; -#X obj 233 217 t f f; -#X obj 664 763 f; -#X obj 233 342 until; -#X obj 273 370 f; -#X obj 322 422 + 1; -#X msg 291 343 0; -#X obj 233 314 t f b f, f 17; -#X obj 233 288 f; -#X obj 233 263 t b f; -#X obj 273 584 /; -#X obj 304 584 /; -#X obj 379 584 /; -#X obj 419 584 /; -#X obj 379 560 + 1; -#X obj 485 585 /; -#X obj 525 584 /; -#X obj 591 584 /; -#X obj 631 584 /; -#X obj 485 561 + 1; -#X obj 525 560 + 1; -#X obj 631 560 + 1; -#X obj 273 494 t a a a a a, f 61; -#X obj 305 803 - 1; -#X obj 273 678 pack f f f; -#X obj 273 716 unpack f f f; -#X obj 474 640 + 1; -#X obj 580 639 + 2; -#X obj 686 638 + 3; -#X obj 499 363 *; -#X obj 273 396 t f f f; -#X obj 481 390 +; -#X obj 481 416 * 4; -#X obj 273 450 pack f f f f, f 30; -#X obj 273 536 unpack f f f f; -#X obj 379 536 unpack f f f f; -#X obj 485 536 unpack f f f f; -#X obj 591 536 unpack f f f f; -#X obj 411 232 f; -#X obj 42 34 f 5; -#X obj 305 780 * 2; -#X obj 512 781 * -2; -#X obj 512 804 + 1; -#X obj 414 90 inlet; -#X obj 1177 762 f; -#X obj 786 863 tabwrite table-\$0-textureU; -#X obj 998 867 tabwrite table-\$0-textureV; -#X obj 786 583 /; -#X obj 817 583 /; -#X obj 892 583 /; -#X obj 932 583 /; -#X obj 892 559 + 1; -#X obj 998 584 /; -#X obj 1038 583 /; -#X obj 1104 583 /; -#X obj 1144 583 /; -#X obj 998 560 + 1; -#X obj 1038 559 + 1; -#X obj 1144 559 + 1; -#X obj 786 493 t a a a a a, f 61; -#X obj 786 677 pack f f f; -#X obj 786 715 unpack f f f; -#X obj 987 639 + 1; -#X obj 1093 638 + 2; -#X obj 1199 637 + 3; -#X obj 786 535 unpack f f f f; -#X obj 892 535 unpack f f f f; -#X obj 998 535 unpack f f f f; -#X obj 1104 535 unpack f f f f; -#X obj 786 388 unpack f f f f, f 24; -#X obj 786 460 pack f f f f, f 25; -#X obj 786 424 + 0.5; -#X obj 839 424 + 0.5; -#X obj 891 424 + 1; -#X connect 0 0 52 0; -#X connect 2 0 4 0; -#X connect 2 0 6 0; -#X connect 2 1 11 0; -#X connect 2 2 1 0; -#X connect 2 2 51 0; -#X connect 4 0 3 0; -#X connect 6 0 5 0; -#X connect 7 0 8 0; -#X connect 8 0 14 0; -#X connect 9 0 8 1; -#X connect 10 0 8 1; -#X connect 11 0 7 0; -#X connect 11 1 10 0; -#X connect 11 2 21 1; -#X connect 11 2 42 1; -#X connect 14 0 22 0; -#X connect 14 1 9 0; -#X connect 15 0 12 1; -#X connect 15 0 13 1; -#X connect 16 0 17 0; -#X connect 17 0 43 0; -#X connect 18 0 17 1; -#X connect 19 0 17 1; -#X connect 20 0 16 0; -#X connect 20 1 19 0; -#X connect 21 0 20 0; -#X connect 22 0 21 0; -#X connect 22 1 42 0; -#X connect 22 1 46 1; -#X connect 23 0 37 0; -#X connect 24 0 37 1; -#X connect 25 0 37 0; -#X connect 26 0 37 1; -#X connect 27 0 25 0; -#X connect 28 0 37 0; -#X connect 29 0 37 1; -#X connect 30 0 37 0; -#X connect 31 0 37 1; -#X connect 32 0 28 0; -#X connect 33 0 29 0; -#X connect 34 0 31 0; -#X connect 35 0 47 0; -#X connect 35 1 48 0; -#X connect 35 2 49 0; -#X connect 35 3 50 0; -#X connect 36 0 12 0; -#X connect 37 0 38 0; -#X connect 38 0 53 0; -#X connect 38 1 54 0; -#X connect 38 2 15 0; -#X connect 39 0 37 2; -#X connect 40 0 37 2; -#X connect 41 0 37 2; -#X connect 42 0 44 1; -#X connect 43 0 46 0; -#X connect 43 1 18 0; -#X connect 43 2 44 0; -#X connect 44 0 45 0; -#X connect 45 0 46 3; -#X connect 46 0 35 0; -#X connect 46 0 82 0; -#X connect 47 0 23 0; -#X connect 47 1 24 0; -#X connect 47 2 23 1; -#X connect 47 2 24 1; -#X connect 47 3 37 2; -#X connect 48 0 27 0; -#X connect 48 1 26 0; -#X connect 48 2 25 1; -#X connect 48 2 26 1; -#X connect 48 3 39 0; -#X connect 49 0 32 0; -#X connect 49 1 33 0; -#X connect 49 2 28 1; -#X connect 49 2 29 1; -#X connect 49 3 40 0; -#X connect 50 0 30 0; -#X connect 50 1 34 0; -#X connect 50 2 30 1; -#X connect 50 2 31 1; -#X connect 50 3 41 0; -#X connect 51 0 46 2; -#X connect 52 0 2 0; -#X connect 53 0 36 0; -#X connect 54 0 55 0; -#X connect 55 0 13 0; -#X connect 57 0 58 1; -#X connect 57 0 59 1; -#X connect 60 0 73 0; -#X connect 61 0 73 1; -#X connect 62 0 73 0; -#X connect 63 0 73 1; -#X connect 64 0 62 0; -#X connect 65 0 73 0; -#X connect 66 0 73 1; -#X connect 67 0 73 0; -#X connect 68 0 73 1; -#X connect 69 0 65 0; -#X connect 70 0 66 0; -#X connect 71 0 68 0; -#X connect 72 0 78 0; -#X connect 72 1 79 0; -#X connect 72 2 80 0; -#X connect 72 3 81 0; -#X connect 73 0 74 0; -#X connect 74 0 58 0; -#X connect 74 1 59 0; -#X connect 74 2 57 0; -#X connect 75 0 73 2; -#X connect 76 0 73 2; -#X connect 77 0 73 2; -#X connect 78 0 60 0; -#X connect 78 1 61 0; -#X connect 78 2 60 1; -#X connect 78 2 61 1; -#X connect 78 3 73 2; -#X connect 79 0 64 0; -#X connect 79 1 63 0; -#X connect 79 2 62 1; -#X connect 79 2 63 1; -#X connect 79 3 75 0; -#X connect 80 0 69 0; -#X connect 80 1 70 0; -#X connect 80 2 65 1; -#X connect 80 2 66 1; -#X connect 80 3 76 0; -#X connect 81 0 67 0; -#X connect 81 1 71 0; -#X connect 81 2 67 1; -#X connect 81 2 68 1; -#X connect 81 3 77 0; -#X connect 82 0 84 0; -#X connect 82 1 85 0; -#X connect 82 2 86 0; -#X connect 82 3 83 3; -#X connect 83 0 72 0; -#X connect 84 0 83 0; -#X connect 85 0 83 1; -#X connect 86 0 83 2; -#X restore 437 186 pd resolution; -#X msg 1063 486 draw trifan; -#X msg 74 662 resize \$1; -#X obj 217 9 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X msg 960 487 draw linestrip; -#X obj 74 605 *; -#X obj 74 576 t f f; -#X obj 74 633 * 4; -#X obj 34 721 gemvertexbuffer \; draw quad \;; -#X text 259 786 TODO : draw line did not work correctly; -#X connect 0 0 61 0; -#X connect 1 0 52 0; -#X connect 1 1 53 0; -#X connect 2 0 52 0; -#X connect 5 0 44 0; -#X connect 6 0 4 0; -#X connect 7 1 6 0; -#X connect 8 0 9 0; -#X connect 8 1 14 0; -#X connect 8 2 13 0; -#X connect 8 3 12 0; -#X connect 9 0 10 0; -#X connect 11 0 27 0; -#X connect 12 0 17 0; -#X connect 13 0 16 0; -#X connect 14 0 15 0; -#X connect 18 0 8 0; -#X connect 18 0 20 0; -#X connect 18 1 48 0; -#X connect 19 0 61 0; -#X connect 20 0 23 0; -#X connect 23 0 19 0; -#X connect 24 0 46 0; -#X connect 25 0 23 0; -#X connect 26 0 24 0; -#X connect 27 0 1 0; -#X connect 27 0 24 0; -#X connect 27 1 30 0; -#X connect 28 0 29 0; -#X connect 28 1 7 0; -#X connect 28 2 5 0; -#X connect 29 0 20 0; -#X connect 30 0 52 0; -#X connect 44 0 45 0; -#X connect 45 0 4 1; -#X connect 46 0 61 0; -#X connect 48 0 50 0; -#X connect 48 1 49 0; -#X connect 49 0 61 0; -#X connect 50 0 51 0; -#X connect 50 1 51 0; -#X connect 50 2 57 0; -#X connect 50 3 57 0; -#X connect 50 4 54 0; -#X connect 50 5 54 0; -#X connect 51 0 49 0; -#X connect 52 0 28 0; -#X connect 52 1 53 0; -#X connect 52 1 59 0; -#X connect 52 2 18 0; -#X connect 54 0 49 0; -#X connect 55 0 61 0; -#X connect 56 0 27 0; -#X connect 57 0 49 0; -#X connect 58 0 60 0; -#X connect 59 0 58 0; -#X connect 59 1 58 1; -#X connect 60 0 55 0; -#X connect 61 0 43 0; diff --git a/examples/15.OPENGL3.2/VBOmesh_tri.pd b/examples/15.OPENGL3.2/VBOmesh_tri.pd deleted file mode 100644 index b184e3797..000000000 --- a/examples/15.OPENGL3.2/VBOmesh_tri.pd +++ /dev/null @@ -1,465 +0,0 @@ -#N canvas 495 59 1210 853 12; -#X obj 34 27 inlet; -#X obj 276 113 gemargs; -#X obj 344 30 inlet; -#X text 418 245 forward to the corresponding table, f 21; -#X obj 407 380 send; -#X obj 481 294 list split 1; -#X obj 407 321 list trim; -#X obj 367 296 list split 1; -#X obj 683 251 unpack f f f f; -#X msg 683 417 const \$1; -#X obj 683 440 s table-\$0-colorR; -#X obj 261 21 loadbang; -#X msg 778 278 const \$1; -#X msg 746 324 const \$1; -#X msg 714 371 const \$1; -#X obj 714 394 s table-\$0-colorG; -#X obj 746 347 s table-\$0-colorB; -#X obj 778 301 s table-\$0-colorA; -#X obj 683 188 route color; -#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; -#X obj 344 476 delay 0; -#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; -#X text 694 213 RGB or RGBA value; -#X obj 344 505 \$0; -#X obj 261 614 \$0; -#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 261 48 t b b; -#X obj 344 245 t b a a; -#X obj 344 430 b; -#X msg 365 116 color 1 1 1 1; -#X obj 58 83 table table-\$0-posX 4; -#X obj 58 105 table table-\$0-posY 4; -#X obj 58 127 table table-\$0-posZ 4; -#X obj 58 152 table table-\$0-colorR 4; -#X obj 58 174 table table-\$0-colorG 4; -#X obj 58 196 table table-\$0-colorB 4; -#X obj 58 218 table table-\$0-colorA 4; -#X obj 58 243 table table-\$0-textureU 4; -#X obj 58 265 table table-\$0-textureV 4; -#X obj 58 290 table table-\$0-normalX 4; -#X obj 58 312 table table-\$0-normalY 4; -#X obj 58 334 table table-\$0-normalZ 4; -#X obj 34 775 outlet; -#X obj 481 318 list prepend \$0; -#X msg 481 341 symbol table-\$1-\$2; -#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; -#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; -#X obj 866 419 route draw; -#X obj 866 677 t a; -#X obj 866 445 route point points line lines fill; -#X msg 866 486 draw point; -#X obj 344 152 route table res, f 27; -#N canvas 50 72 1769 922 resolution 0; -#X obj 42 10 inlet; -#N canvas 996 329 481 444 resize_tables 0; -#X obj 128 189 s table-\$0-posX; -#X obj 128 211 s table-\$0-posY; -#X obj 128 233 s table-\$0-posZ; -#X obj 128 257 s table-\$0-colorR; -#X obj 128 279 s table-\$0-colorG; -#X obj 128 301 s table-\$0-colorB; -#X obj 128 323 s table-\$0-colorA; -#X obj 128 346 s table-\$0-textureU; -#X obj 128 368 s table-\$0-textureV; -#X obj 128 393 s table-\$0-normalX; -#X obj 128 415 s table-\$0-normalY; -#X obj 128 437 s table-\$0-normalZ; -#X msg 90 134 resize \$1; -#X obj 90 23 inlet; -#X obj 90 50 t f f; -#X obj 90 77 *; -#X obj 90 104 * 6; -#X connect 12 0 0 0; -#X connect 12 0 11 0; -#X connect 12 0 10 0; -#X connect 12 0 9 0; -#X connect 12 0 8 0; -#X connect 12 0 7 0; -#X connect 12 0 6 0; -#X connect 12 0 5 0; -#X connect 12 0 4 0; -#X connect 12 0 3 0; -#X connect 12 0 2 0; -#X connect 12 0 1 0; -#X connect 13 0 14 0; -#X connect 14 0 15 0; -#X connect 14 1 15 1; -#X connect 15 0 16 0; -#X connect 16 0 12 0; -#X restore 143 89 pd resize_tables; -#X obj 42 58 t b f f; -#N canvas -10 69 452 340 init_tables 0; -#X obj 118 96 s table-\$0-posZ; -#X obj 118 256 s table-\$0-normalX; -#X obj 118 278 s table-\$0-normalY; -#X obj 98 16 inlet; -#X connect 3 0 2 0; -#X connect 3 0 1 0; -#X connect 3 0 0 0; -#X restore 54 156 pd init_tables; -#X msg 54 129 const 0; -#N canvas -10 69 452 340 init_tables 0; -#X obj 118 120 s table-\$0-colorR; -#X obj 118 142 s table-\$0-colorG; -#X obj 118 164 s table-\$0-colorB; -#X obj 118 186 s table-\$0-colorA; -#X obj 118 300 s table-\$0-normalZ; -#X obj 98 16 inlet; -#X connect 5 0 4 0; -#X connect 5 0 3 0; -#X connect 5 0 2 0; -#X connect 5 0 1 0; -#X connect 5 0 0 0; -#X restore 42 212 pd init_tables; -#X msg 42 185 const 1; -#X obj 193 163 until; -#X obj 233 191 f; -#X obj 296 254 + 1; -#X msg 251 164 0; -#X obj 193 135 t f b f, f 17; -#X obj 274 802 tabwrite table-\$0-posX; -#X obj 481 801 tabwrite table-\$0-posY; -#X obj 233 217 t f f; -#X obj 632 736 f; -#X obj 233 342 until; -#X obj 273 370 f; -#X obj 322 422 + 1; -#X msg 291 343 0; -#X obj 233 314 t f b f, f 17; -#X obj 233 288 f; -#X obj 233 263 t b f; -#X obj 273 584 /; -#X obj 304 584 /; -#X obj 379 584 /; -#X obj 419 584 /; -#X obj 379 560 + 1; -#X obj 485 585 /; -#X obj 525 584 /; -#X obj 591 584 /; -#X obj 631 584 /; -#X obj 485 561 + 1; -#X obj 525 560 + 1; -#X obj 274 776 - 1; -#X obj 273 678 pack f f f; -#X obj 273 716 unpack f f f; -#X obj 474 640 + 1; -#X obj 580 639 + 2; -#X obj 686 638 + 3; -#X obj 499 363 *; -#X obj 273 396 t f f f; -#X obj 481 390 +; -#X obj 273 450 pack f f f f, f 30; -#X obj 273 536 unpack f f f f; -#X obj 379 536 unpack f f f f; -#X obj 485 536 unpack f f f f; -#X obj 591 536 unpack f f f f; -#X obj 411 232 f; -#X obj 42 34 f 5; -#X obj 274 753 * 2; -#X obj 481 754 * -2; -#X obj 481 777 + 1; -#X obj 1337 762 f; -#X obj 946 833 tabwrite table-\$0-textureU; -#X obj 1158 837 tabwrite table-\$0-textureV; -#X obj 946 583 /; -#X obj 977 583 /; -#X obj 1052 583 /; -#X obj 1092 583 /; -#X obj 1052 559 + 1; -#X obj 1158 584 /; -#X obj 1198 583 /; -#X obj 1264 583 /; -#X obj 1304 583 /; -#X obj 1158 560 + 1; -#X obj 1198 559 + 1; -#X obj 946 677 pack f f f; -#X obj 946 715 unpack f f f; -#X obj 1147 639 + 1; -#X obj 1253 638 + 2; -#X obj 1359 637 + 3; -#X obj 946 535 unpack f f f f; -#X obj 1052 535 unpack f f f f; -#X obj 1158 535 unpack f f f f; -#X obj 1264 535 unpack f f f f; -#X obj 946 388 unpack f f f f, f 24; -#X obj 946 460 pack f f f f, f 25; -#X obj 946 424 + 0.5; -#X obj 1001 424 + 0.5; -#X obj 1056 424 + 1; -#X obj 481 416 * 6; -#X obj 273 494 t a a a a a a, f 76; -#X obj 700 584 /; -#X obj 740 583 /; -#X obj 806 583 /; -#X obj 846 583 /; -#X obj 700 560 + 1; -#X obj 740 559 + 1; -#X obj 846 559 + 1; -#X obj 700 535 unpack f f f f; -#X obj 806 535 unpack f f f f; -#X obj 795 638 + 4; -#X obj 901 637 + 5; -#X obj 1374 584 /; -#X obj 1414 583 /; -#X obj 1480 583 /; -#X obj 1520 583 /; -#X obj 1374 560 + 1; -#X obj 1414 559 + 1; -#X obj 1520 559 + 1; -#X obj 1374 535 unpack f f f f; -#X obj 1480 535 unpack f f f f; -#X obj 946 493 t a a a a a a, f 77; -#X obj 1469 638 + 4; -#X obj 1575 637 + 5; -#X connect 0 0 49 0; -#X connect 2 0 4 0; -#X connect 2 0 6 0; -#X connect 2 1 11 0; -#X connect 2 2 1 0; -#X connect 2 2 48 0; -#X connect 4 0 3 0; -#X connect 6 0 5 0; -#X connect 7 0 8 0; -#X connect 8 0 14 0; -#X connect 9 0 8 1; -#X connect 10 0 8 1; -#X connect 11 0 7 0; -#X connect 11 1 10 0; -#X connect 11 2 21 1; -#X connect 11 2 40 1; -#X connect 14 0 22 0; -#X connect 14 1 9 0; -#X connect 15 0 12 1; -#X connect 15 0 13 1; -#X connect 16 0 17 0; -#X connect 17 0 41 0; -#X connect 18 0 17 1; -#X connect 19 0 17 1; -#X connect 20 0 16 0; -#X connect 20 1 19 0; -#X connect 21 0 20 0; -#X connect 22 0 21 0; -#X connect 22 1 40 0; -#X connect 22 1 43 1; -#X connect 23 0 35 0; -#X connect 24 0 35 1; -#X connect 25 0 35 0; -#X connect 26 0 35 1; -#X connect 27 0 25 0; -#X connect 28 0 35 0; -#X connect 29 0 35 1; -#X connect 30 0 35 0; -#X connect 31 0 35 1; -#X connect 32 0 28 0; -#X connect 33 0 29 0; -#X connect 34 0 12 0; -#X connect 35 0 36 0; -#X connect 36 0 50 0; -#X connect 36 1 51 0; -#X connect 36 2 15 0; -#X connect 37 0 35 2; -#X connect 38 0 35 2; -#X connect 39 0 35 2; -#X connect 40 0 42 1; -#X connect 41 0 43 0; -#X connect 41 1 18 0; -#X connect 41 2 42 0; -#X connect 42 0 81 0; -#X connect 43 0 76 0; -#X connect 43 0 82 0; -#X connect 44 0 23 0; -#X connect 44 1 24 0; -#X connect 44 2 23 1; -#X connect 44 2 24 1; -#X connect 44 3 35 2; -#X connect 45 0 27 0; -#X connect 45 1 26 0; -#X connect 45 2 25 1; -#X connect 45 2 26 1; -#X connect 45 3 37 0; -#X connect 46 0 32 0; -#X connect 46 1 33 0; -#X connect 46 2 28 1; -#X connect 46 2 29 1; -#X connect 46 3 38 0; -#X connect 47 0 30 0; -#X connect 47 1 31 0; -#X connect 47 2 30 1; -#X connect 47 2 31 1; -#X connect 47 3 39 0; -#X connect 48 0 43 2; -#X connect 49 0 2 0; -#X connect 50 0 34 0; -#X connect 51 0 52 0; -#X connect 52 0 13 0; -#X connect 53 0 54 1; -#X connect 53 0 55 1; -#X connect 56 0 67 0; -#X connect 57 0 67 1; -#X connect 58 0 67 0; -#X connect 59 0 67 1; -#X connect 60 0 58 0; -#X connect 61 0 67 0; -#X connect 62 0 67 1; -#X connect 63 0 67 0; -#X connect 64 0 67 1; -#X connect 65 0 61 0; -#X connect 66 0 62 0; -#X connect 67 0 68 0; -#X connect 68 0 54 0; -#X connect 68 1 55 0; -#X connect 68 2 53 0; -#X connect 69 0 67 2; -#X connect 70 0 67 2; -#X connect 71 0 67 2; -#X connect 72 0 56 0; -#X connect 72 1 57 0; -#X connect 72 2 56 1; -#X connect 72 2 57 1; -#X connect 72 3 67 2; -#X connect 73 0 60 0; -#X connect 73 1 59 0; -#X connect 73 2 58 1; -#X connect 73 2 59 1; -#X connect 73 3 69 0; -#X connect 74 0 65 0; -#X connect 74 1 66 0; -#X connect 74 2 61 1; -#X connect 74 2 62 1; -#X connect 74 3 70 0; -#X connect 75 0 63 0; -#X connect 75 1 64 0; -#X connect 75 2 63 1; -#X connect 75 2 64 1; -#X connect 75 3 71 0; -#X connect 76 0 78 0; -#X connect 76 1 79 0; -#X connect 76 2 80 0; -#X connect 76 3 77 3; -#X connect 77 0 103 0; -#X connect 78 0 77 0; -#X connect 79 0 77 1; -#X connect 80 0 77 2; -#X connect 81 0 43 3; -#X connect 82 0 44 0; -#X connect 82 1 45 0; -#X connect 82 2 46 0; -#X connect 82 3 47 0; -#X connect 82 4 90 0; -#X connect 82 5 91 0; -#X connect 83 0 35 0; -#X connect 84 0 35 1; -#X connect 85 0 35 0; -#X connect 86 0 35 1; -#X connect 87 0 83 0; -#X connect 88 0 84 0; -#X connect 89 0 86 0; -#X connect 90 0 87 0; -#X connect 90 1 88 0; -#X connect 90 2 83 1; -#X connect 90 2 84 1; -#X connect 90 3 92 0; -#X connect 91 0 85 0; -#X connect 91 1 89 0; -#X connect 91 2 85 1; -#X connect 91 2 86 1; -#X connect 91 3 93 0; -#X connect 92 0 35 2; -#X connect 93 0 35 2; -#X connect 94 0 67 0; -#X connect 95 0 67 1; -#X connect 96 0 67 0; -#X connect 97 0 67 1; -#X connect 98 0 94 0; -#X connect 99 0 95 0; -#X connect 100 0 97 0; -#X connect 101 0 98 0; -#X connect 101 1 99 0; -#X connect 101 2 94 1; -#X connect 101 2 95 1; -#X connect 101 3 104 0; -#X connect 102 0 96 0; -#X connect 102 1 100 0; -#X connect 102 2 96 1; -#X connect 102 2 97 1; -#X connect 102 3 105 0; -#X connect 103 0 72 0; -#X connect 103 1 73 0; -#X connect 103 2 74 0; -#X connect 103 3 75 0; -#X connect 103 4 101 0; -#X connect 103 5 102 0; -#X connect 104 0 67 2; -#X connect 105 0 67 2; -#X restore 437 186 pd resolution; -#X msg 1063 486 draw trifan; -#X msg 74 662 resize \$1; -#X obj 217 9 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X msg 960 487 draw linestrip; -#X obj 74 605 *; -#X obj 74 576 t f f; -#X text 259 786 TODO : draw line did not work correctly; -#X obj 34 721 gemvertexbuffer \; draw tri \;; -#X obj 74 633 * 6; -#X connect 0 0 61 0; -#X connect 1 0 52 0; -#X connect 1 1 53 0; -#X connect 2 0 52 0; -#X connect 5 0 44 0; -#X connect 6 0 4 0; -#X connect 7 1 6 0; -#X connect 8 0 9 0; -#X connect 8 1 14 0; -#X connect 8 2 13 0; -#X connect 8 3 12 0; -#X connect 9 0 10 0; -#X connect 11 0 27 0; -#X connect 12 0 17 0; -#X connect 13 0 16 0; -#X connect 14 0 15 0; -#X connect 18 0 8 0; -#X connect 18 0 20 0; -#X connect 18 1 48 0; -#X connect 19 0 61 0; -#X connect 20 0 23 0; -#X connect 23 0 19 0; -#X connect 24 0 46 0; -#X connect 25 0 23 0; -#X connect 26 0 24 0; -#X connect 27 0 1 0; -#X connect 27 0 24 0; -#X connect 27 1 30 0; -#X connect 28 0 29 0; -#X connect 28 1 7 0; -#X connect 28 2 5 0; -#X connect 29 0 20 0; -#X connect 30 0 52 0; -#X connect 44 0 45 0; -#X connect 45 0 4 1; -#X connect 46 0 61 0; -#X connect 48 0 50 0; -#X connect 48 1 49 0; -#X connect 49 0 61 0; -#X connect 50 0 51 0; -#X connect 50 1 51 0; -#X connect 50 2 57 0; -#X connect 50 3 57 0; -#X connect 50 4 54 0; -#X connect 50 5 54 0; -#X connect 51 0 49 0; -#X connect 52 0 28 0; -#X connect 52 1 53 0; -#X connect 52 1 59 0; -#X connect 52 2 18 0; -#X connect 54 0 49 0; -#X connect 55 0 61 0; -#X connect 56 0 27 0; -#X connect 57 0 49 0; -#X connect 58 0 62 0; -#X connect 59 0 58 0; -#X connect 59 1 58 1; -#X connect 61 0 43 0; -#X connect 62 0 55 0; diff --git a/examples/15.OPENGL3.2/VBOsquare.pd b/examples/15.OPENGL3.2/VBOsquare.pd deleted file mode 100644 index 5b7db22f7..000000000 --- a/examples/15.OPENGL3.2/VBOsquare.pd +++ /dev/null @@ -1,111 +0,0 @@ -#N canvas 565 54 1206 873 12; -#X obj 34 27 inlet; -#X obj 276 113 gemargs; -#X obj 344 30 inlet; -#X text 418 185 forward to the corresponding table, f 21; -#X obj 407 320 send; -#X obj 481 234 list split 1; -#X obj 407 261 list trim; -#X obj 367 236 list split 1; -#X obj 683 251 unpack f f f f; -#X msg 683 417 const \$1; -#X obj 683 440 s table-\$0-colorR; -#X obj 261 21 loadbang; -#X msg 778 278 const \$1; -#X msg 746 324 const \$1; -#X msg 714 371 const \$1; -#X obj 714 394 s table-\$0-colorG; -#X obj 746 347 s table-\$0-colorB; -#X obj 778 301 s table-\$0-colorA; -#X obj 683 188 route color; -#X msg 344 535 color table-\$1-colorR table-\$1-colorG table-\$1-colorB table-\$1-colorA, f 39; -#X obj 344 476 delay 0; -#X text 426 479 delay is here to limit the update rate of thevertex buffer once per input message, f 45; -#X text 694 213 RGB or RGBA value; -#X obj 344 505 \$0; -#X obj 261 614 \$0; -#X obj 379 505 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 293 612 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000; -#X obj 261 48 t b b; -#X obj 344 185 t b a a; -#X obj 344 430 b; -#X msg 365 116 color 1 1 1 1; -#X obj 344 152 route table, f 27; -#X obj 58 83 table table-\$0-posX 4; -#X obj 58 105 table table-\$0-posY 4; -#X obj 58 127 table table-\$0-posZ 4; -#X obj 58 152 table table-\$0-colorR 4; -#X obj 58 174 table table-\$0-colorG 4; -#X obj 58 196 table table-\$0-colorB 4; -#X obj 58 218 table table-\$0-colorA 4; -#X obj 58 243 table table-\$0-textureU 4; -#X obj 58 265 table table-\$0-textureV 4; -#X obj 58 290 table table-\$0-normalX 4; -#X obj 58 312 table table-\$0-normalY 4; -#X obj 58 334 table table-\$0-normalZ 4; -#X obj 34 775 outlet; -#X obj 481 258 list prepend \$0; -#X msg 481 281 symbol table-\$1-\$2; -#X msg 261 644 position table-\$1-posX table-\$1-posY table-\$1-posZ \, texture table-\$1-textureU table-\$1-textureV \, normal table-\$1-normalX table-\$1-normalY table-\$1-normalZ; -#X text 257 722 TODO : for rectangle texturing \, the textureU table must be multiply by the image size X \, and textureV table must be multiply by the image size Y; -#X text 254 780 TODO : add a size message for the square (is that really needed? a scaleXYZ object can be use); -#X obj 866 189 route draw; -#X obj 868 677 t a; -#X obj 866 215 route point points line lines fill; -#X obj 34 721 gemvertexbuffer \; draw quad \; resize 4 \;; -#X msg 491 99 posX 0 -1 1 1 -1 \, posY 0 -1 -1 1 1 \, textureU 0 0 1 1 0 \, textureV 0 1 1 0 0 \, normalZ 0 1 1 1 1; -#X msg 1063 256 draw quad; -#X msg 960 257 draw lineloop; -#X msg 866 256 draw point; -#X connect 0 0 53 0; -#X connect 1 0 31 0; -#X connect 2 0 31 0; -#X connect 5 0 45 0; -#X connect 6 0 4 0; -#X connect 7 1 6 0; -#X connect 8 0 9 0; -#X connect 8 1 14 0; -#X connect 8 2 13 0; -#X connect 8 3 12 0; -#X connect 9 0 10 0; -#X connect 11 0 27 0; -#X connect 12 0 17 0; -#X connect 13 0 16 0; -#X connect 14 0 15 0; -#X connect 18 0 8 0; -#X connect 18 0 20 0; -#X connect 18 1 50 0; -#X connect 19 0 53 0; -#X connect 20 0 23 0; -#X connect 23 0 19 0; -#X connect 24 0 47 0; -#X connect 25 0 23 0; -#X connect 26 0 24 0; -#X connect 27 0 1 0; -#X connect 27 0 24 0; -#X connect 27 1 30 0; -#X connect 27 1 54 0; -#X connect 28 0 29 0; -#X connect 28 1 7 0; -#X connect 28 2 5 0; -#X connect 29 0 20 0; -#X connect 30 0 31 0; -#X connect 31 0 28 0; -#X connect 31 1 18 0; -#X connect 45 0 46 0; -#X connect 46 0 4 1; -#X connect 47 0 53 0; -#X connect 50 0 52 0; -#X connect 50 1 51 0; -#X connect 51 0 53 0; -#X connect 52 0 57 0; -#X connect 52 1 57 0; -#X connect 52 2 56 0; -#X connect 52 3 56 0; -#X connect 52 4 55 0; -#X connect 52 5 55 0; -#X connect 53 0 44 0; -#X connect 54 0 28 0; -#X connect 55 0 51 0; -#X connect 56 0 51 0; -#X connect 57 0 51 0; From 5f7c6ae19060602b12747880a2276f1363294904 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 15:43:16 +0200 Subject: [PATCH 340/387] reorder example --- .../{08.geometry.pd => 07.geometry.pd} | 50 +++++++++---------- .../{08.geometry.frag => 07.geometry.frag} | 0 .../{08.geometry.geom => 07.geometry.geom} | 0 .../{08.geometry.vert => 07.geometry.vert} | 0 4 files changed, 25 insertions(+), 25 deletions(-) rename examples/15.OPENGL3.2/{08.geometry.pd => 07.geometry.pd} (90%) rename examples/15.OPENGL3.2/shader/{08.geometry.frag => 07.geometry.frag} (100%) rename examples/15.OPENGL3.2/shader/{08.geometry.geom => 07.geometry.geom} (100%) rename examples/15.OPENGL3.2/shader/{08.geometry.vert => 07.geometry.vert} (100%) diff --git a/examples/15.OPENGL3.2/08.geometry.pd b/examples/15.OPENGL3.2/07.geometry.pd similarity index 90% rename from examples/15.OPENGL3.2/08.geometry.pd rename to examples/15.OPENGL3.2/07.geometry.pd index 8721aa660..834fa4ff4 100644 --- a/examples/15.OPENGL3.2/08.geometry.pd +++ b/examples/15.OPENGL3.2/07.geometry.pd @@ -125,11 +125,7 @@ #X text 744 461 invocations; #X restore 981 576 pd drawing_type; #X obj 40 462 loadbang; -#X obj 333 226 glsl shader/08.geometry; #X obj 60 510 textfile; -#X msg 60 486 read shader/08.geometry.frag cr; -#X msg 60 542 read shader/08.geometry.geom cr; -#X msg 60 592 read shader/08.geometry.vert cr; #X obj 60 565 textfile; #X obj 60 615 textfile; #X text 449 12 This example introduce a simple geometry shader; @@ -140,6 +136,10 @@ #X msg 119 511 print; #X msg 122 566 print; #X msg 123 614 print; +#X msg 60 486 read shader/07.geometry.frag cr; +#X msg 60 542 read shader/07.geometry.geom cr; +#X msg 60 592 read shader/07.geometry.vert cr; +#X obj 333 226 glsl shader/07.geometry; #X connect 0 0 1 0; #X connect 2 0 31 0; #X connect 3 0 8 0; @@ -155,7 +155,7 @@ #X connect 16 1 3 0; #X connect 17 0 37 0; #X connect 19 0 38 0; -#X connect 21 0 43 0; +#X connect 21 0 57 0; #X connect 22 0 8 0; #X connect 23 0 24 0; #X connect 23 0 28 0; @@ -164,29 +164,29 @@ #X connect 23 0 30 0; #X connect 23 0 29 0; #X connect 23 0 25 0; -#X connect 24 0 43 1; -#X connect 25 0 43 1; -#X connect 26 0 43 1; -#X connect 27 0 43 1; -#X connect 28 0 43 1; -#X connect 29 0 43 1; -#X connect 30 0 43 1; -#X connect 31 0 43 0; +#X connect 24 0 57 1; +#X connect 25 0 57 1; +#X connect 26 0 57 1; +#X connect 27 0 57 1; +#X connect 28 0 57 1; +#X connect 29 0 57 1; +#X connect 30 0 57 1; +#X connect 31 0 57 0; #X connect 32 0 31 1; -#X connect 33 0 43 1; +#X connect 33 0 57 1; #X connect 36 0 11 0; #X connect 37 0 18 0; #X connect 38 0 20 0; #X connect 39 0 10 0; -#X connect 42 0 45 0; -#X connect 42 0 46 0; -#X connect 42 0 47 0; -#X connect 43 0 40 0; -#X connect 43 1 15 0; -#X connect 43 1 23 0; -#X connect 45 0 44 0; -#X connect 46 0 48 0; -#X connect 47 0 49 0; +#X connect 42 0 54 0; +#X connect 42 0 55 0; +#X connect 42 0 56 0; +#X connect 51 0 43 0; +#X connect 52 0 44 0; +#X connect 53 0 45 0; +#X connect 54 0 43 0; #X connect 55 0 44 0; -#X connect 56 0 48 0; -#X connect 57 0 49 0; +#X connect 56 0 45 0; +#X connect 57 0 40 0; +#X connect 57 1 15 0; +#X connect 57 1 23 0; diff --git a/examples/15.OPENGL3.2/shader/08.geometry.frag b/examples/15.OPENGL3.2/shader/07.geometry.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/08.geometry.frag rename to examples/15.OPENGL3.2/shader/07.geometry.frag diff --git a/examples/15.OPENGL3.2/shader/08.geometry.geom b/examples/15.OPENGL3.2/shader/07.geometry.geom similarity index 100% rename from examples/15.OPENGL3.2/shader/08.geometry.geom rename to examples/15.OPENGL3.2/shader/07.geometry.geom diff --git a/examples/15.OPENGL3.2/shader/08.geometry.vert b/examples/15.OPENGL3.2/shader/07.geometry.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/08.geometry.vert rename to examples/15.OPENGL3.2/shader/07.geometry.vert From 662e171db2e9b67a5f672ec7bf416f3ef2ac10da Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 15:49:50 +0200 Subject: [PATCH 341/387] typo --- examples/15.OPENGL3.2/03.matrix.pd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/15.OPENGL3.2/03.matrix.pd b/examples/15.OPENGL3.2/03.matrix.pd index 6f71c8b8c..9a8b325f9 100644 --- a/examples/15.OPENGL3.2/03.matrix.pd +++ b/examples/15.OPENGL3.2/03.matrix.pd @@ -1,4 +1,4 @@ -#N canvas 116 169 1450 697 12; +#N canvas 506 110 1450 697 12; #X obj 21 209 GEMglLoadIdentity; #X obj 21 174 gemhead; #X obj 21 255 translateXYZ; @@ -306,7 +306,6 @@ #X text 834 28 The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; #X msg 843 427 1.57 1 0 20; #X text 948 429 Gem wild angle; -#X text 959 460 smaller angle vision; #X text 1264 321 real gemwin aspect ratio; #X msg 870 457 0.5 1 0 20; #X msg 1233 385 3.14159 4; @@ -314,6 +313,7 @@ #X floatatom 1139 586 5 0 0 0 - - - 0; #X msg 1138 617 \$1 1 1 100; #X msg 1169 481 1.57 1 1 100; +#X text 959 460 smaller vision angle; #X connect 0 0 2 0; #X connect 1 0 0 0; #X connect 2 0 3 0; @@ -398,8 +398,8 @@ #X connect 101 0 81 0; #X connect 101 0 93 0; #X connect 108 0 101 0; -#X connect 112 0 101 0; -#X connect 113 0 76 0; -#X connect 115 0 116 0; +#X connect 111 0 101 0; +#X connect 112 0 76 0; +#X connect 114 0 115 0; +#X connect 115 0 101 0; #X connect 116 0 101 0; -#X connect 117 0 101 0; From 746c577161e1f37461adab8c4cdbf8873607df85 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 15:49:57 +0200 Subject: [PATCH 342/387] cleanup --- examples/15.OPENGL3.2/07.geometry.pd | 56 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/examples/15.OPENGL3.2/07.geometry.pd b/examples/15.OPENGL3.2/07.geometry.pd index 834fa4ff4..0df86de5b 100644 --- a/examples/15.OPENGL3.2/07.geometry.pd +++ b/examples/15.OPENGL3.2/07.geometry.pd @@ -1,4 +1,4 @@ -#N canvas 245 206 1145 664 10; +#N canvas 201 198 1145 664 10; #X declare -lib Gem; #N canvas 640 443 450 300 fps 0; #X obj 60 28 gemhead; @@ -101,7 +101,6 @@ #X msg 718 201 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; #X obj 333 116 translateXYZ; #X floatatom 356 90 5 0 0 0 - - - 0; -#X obj 413 187 r shader_matrix; #X text 399 89 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117; #X text 165 32 tables used by the vertex buffer; #X msg 37 275 0 1 0 0 0 1 0 0 0 1 1 1 0; @@ -144,18 +143,18 @@ #X connect 2 0 31 0; #X connect 3 0 8 0; #X connect 4 0 8 0; -#X connect 8 0 40 0; +#X connect 8 0 39 0; #X connect 8 1 5 0; -#X connect 9 0 39 0; -#X connect 12 0 36 0; +#X connect 9 0 38 0; +#X connect 12 0 35 0; #X connect 13 0 22 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 13 0; #X connect 16 1 3 0; -#X connect 17 0 37 0; -#X connect 19 0 38 0; -#X connect 21 0 57 0; +#X connect 17 0 36 0; +#X connect 19 0 37 0; +#X connect 21 0 56 0; #X connect 22 0 8 0; #X connect 23 0 24 0; #X connect 23 0 28 0; @@ -164,29 +163,28 @@ #X connect 23 0 30 0; #X connect 23 0 29 0; #X connect 23 0 25 0; -#X connect 24 0 57 1; -#X connect 25 0 57 1; -#X connect 26 0 57 1; -#X connect 27 0 57 1; -#X connect 28 0 57 1; -#X connect 29 0 57 1; -#X connect 30 0 57 1; -#X connect 31 0 57 0; +#X connect 24 0 56 1; +#X connect 25 0 56 1; +#X connect 26 0 56 1; +#X connect 27 0 56 1; +#X connect 28 0 56 1; +#X connect 29 0 56 1; +#X connect 30 0 56 1; +#X connect 31 0 56 0; #X connect 32 0 31 1; -#X connect 33 0 57 1; -#X connect 36 0 11 0; -#X connect 37 0 18 0; -#X connect 38 0 20 0; -#X connect 39 0 10 0; -#X connect 42 0 54 0; -#X connect 42 0 55 0; -#X connect 42 0 56 0; +#X connect 35 0 11 0; +#X connect 36 0 18 0; +#X connect 37 0 20 0; +#X connect 38 0 10 0; +#X connect 41 0 53 0; +#X connect 41 0 54 0; +#X connect 41 0 55 0; +#X connect 50 0 42 0; #X connect 51 0 43 0; #X connect 52 0 44 0; -#X connect 53 0 45 0; +#X connect 53 0 42 0; #X connect 54 0 43 0; #X connect 55 0 44 0; -#X connect 56 0 45 0; -#X connect 57 0 40 0; -#X connect 57 1 15 0; -#X connect 57 1 23 0; +#X connect 56 0 39 0; +#X connect 56 1 15 0; +#X connect 56 1 23 0; From 8747344a3388a9cca339bab207539f23613f70b8 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 16:57:11 +0200 Subject: [PATCH 343/387] new axample --- examples/15.OPENGL3.2/08.adjency.pd | 145 +++++++++++++++++++ examples/15.OPENGL3.2/shader/08.adjency.frag | 12 ++ examples/15.OPENGL3.2/shader/08.adjency.geom | 47 ++++++ examples/15.OPENGL3.2/shader/08.adjency.vert | 13 ++ 4 files changed, 217 insertions(+) create mode 100644 examples/15.OPENGL3.2/08.adjency.pd create mode 100644 examples/15.OPENGL3.2/shader/08.adjency.frag create mode 100644 examples/15.OPENGL3.2/shader/08.adjency.geom create mode 100644 examples/15.OPENGL3.2/shader/08.adjency.vert diff --git a/examples/15.OPENGL3.2/08.adjency.pd b/examples/15.OPENGL3.2/08.adjency.pd new file mode 100644 index 000000000..ccb4b90be --- /dev/null +++ b/examples/15.OPENGL3.2/08.adjency.pd @@ -0,0 +1,145 @@ +#N canvas 651 236 1145 664 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X obj 328 157 gemhead; +#X msg 484 360 program \$1; +#X msg 495 383 print_attributes; +#X obj 484 431 print vb; +#X obj 44 9 declare -lib Gem; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 457 407 t a a; +#X obj 37 174 loadbang; +#X obj 457 301 f \$0; +#X obj 477 230 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X floatatom 457 255 5 0 0 0 - - - 0; +#X obj 457 278 t b f; +#X obj 340 184 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X text 38 299 tables used by the vertex buffer; +#X obj 40 462 loadbang; +#X obj 60 510 textfile; +#X obj 60 565 textfile; +#X obj 60 615 textfile; +#X msg 119 511 print; +#X msg 122 566 print; +#X msg 123 614 print; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0_positionY 10 float 3; +#A 0 -0.27142 0.557135 0.485707 -0.0857122 0.0571443 -0.371423 0.228574 0.442858 -0.471418 0.0571475; +#X coords 0 1 10 -1 200 140 1 0 0; +#X restore 881 424 graph; +#X msg 60 486 read shader/08.adjency.frag cr; +#X msg 60 542 read shader/08.adjency.geom cr; +#X msg 60 592 read shader/08.adjency.vert cr; +#X obj 328 209 glsl shader/08.adjency; +#X obj 455 512 f \$0; +#X obj 455 465 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 37 218 s \$0_positionX; +#X msg 457 325 attribute positionX \$1_positionX \, attribute positionY \$1_positionY, f 67; +#X msg 455 536 attribute positionY \$1_positionY; +#X msg 37 196 0 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8; +#X obj 35 270 table \$0_positionX 10; +#X obj 328 569 gemvertexbuffer \; resize 10 \; draw linestripadj; +#X obj 455 488 metro 50; +#X text 480 465 <- switch on to update the positoin \, and play with the tab ->, f 64; +#X text 449 12 This example introduce adjacency; +#X text 323 32 This shader demonstrates cubic interpolation using adjacency information in a geometry shader. It takes a sequence of points and creates a smooth curved line passing through them \, using neighboring points to calculate the curve's trajectory., f 94; +#X text 321 85 The vertex shader passes the input points to the geometry shader \, which uses the GL_LINES_ADJACENCY primitive type to access four consecutive vertices at once. For each set of four points \, it performs cubic interpolation to generate a smooth curve segment between the middle two points \, while using the outer points to influence the curvature., f 94; +#X connect 0 0 1 0; +#X connect 2 0 27 0; +#X connect 3 0 8 0; +#X connect 4 0 8 0; +#X connect 8 0 35 0; +#X connect 8 1 5 0; +#X connect 9 0 33 0; +#X connect 10 0 31 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 13 0 10 0; +#X connect 13 1 3 0; +#X connect 14 0 27 0; +#X connect 16 0 24 0; +#X connect 16 0 25 0; +#X connect 16 0 26 0; +#X connect 20 0 17 0; +#X connect 21 0 18 0; +#X connect 22 0 19 0; +#X connect 24 0 17 0; +#X connect 25 0 18 0; +#X connect 26 0 19 0; +#X connect 27 0 35 0; +#X connect 27 1 12 0; +#X connect 28 0 32 0; +#X connect 29 0 36 0; +#X connect 31 0 8 0; +#X connect 32 0 35 0; +#X connect 33 0 30 0; +#X connect 36 0 28 0; diff --git a/examples/15.OPENGL3.2/shader/08.adjency.frag b/examples/15.OPENGL3.2/shader/08.adjency.frag new file mode 100644 index 000000000..708b85194 --- /dev/null +++ b/examples/15.OPENGL3.2/shader/08.adjency.frag @@ -0,0 +1,12 @@ +#version 150 + +// from geometry shader +in vec3 geomPosition; + +// to rendering +out vec4 fragColor; + + +void main() { + fragColor = vec4(1.); +} diff --git a/examples/15.OPENGL3.2/shader/08.adjency.geom b/examples/15.OPENGL3.2/shader/08.adjency.geom new file mode 100644 index 000000000..400a5f51b --- /dev/null +++ b/examples/15.OPENGL3.2/shader/08.adjency.geom @@ -0,0 +1,47 @@ +#version 150 + +layout(lines_adjacency) in; +layout(line_strip, max_vertices = 256) out; + +// from vertex shader +in vec3 vertPosition[]; + +// to fragment shader +out vec3 geomPosition; + +const int NUM_SEGMENTS = 8; + +vec3 cubicInterpolate(vec3 p0, vec3 p1, vec3 p2, vec3 p3, float t) { + float t2 = t * t; + float t3 = t2 * t; + + vec3 a = -0.5 * p0 + 1.5 * p1 - 1.5 * p2 + 0.5 * p3; + vec3 b = p0 - 2.5 * p1 + 2.0 * p2 - 0.5 * p3; + vec3 c = -0.5 * p0 + 0.5 * p2; + vec3 d = p1; + + return a * t3 + b * t2 + c * t + d; +} + +void main() { + vec3 p0 = gl_in[0].gl_Position.xyz; + vec3 p1 = gl_in[1].gl_Position.xyz; + vec3 p2 = gl_in[2].gl_Position.xyz; + vec3 p3 = gl_in[3].gl_Position.xyz; + + //only generate a curve between point 1 and 2 + for (int j = 0; j <= NUM_SEGMENTS; j++) { + float t = float(j) / float(NUM_SEGMENTS); + vec3 interpolatedPosition = mix(p1, p2, t); + // adjusting point position thanks to adjacency points + if (j > 0 && j < NUM_SEGMENTS) { + vec3 cubicPos = cubicInterpolate(p0, p1, p2, p3, t); + interpolatedPosition = cubicPos; + } + + geomPosition = interpolatedPosition; + gl_Position = vec4(interpolatedPosition, 1.0); + EmitVertex(); + } + EndPrimitive(); +} diff --git a/examples/15.OPENGL3.2/shader/08.adjency.vert b/examples/15.OPENGL3.2/shader/08.adjency.vert new file mode 100644 index 000000000..9706e8fbe --- /dev/null +++ b/examples/15.OPENGL3.2/shader/08.adjency.vert @@ -0,0 +1,13 @@ +#version 150 + +// from VBO +in float positionX; +in float positionY; + +// to geometry shader +out vec3 vertPosition; + +void main() { + vertPosition = vec3(positionX, positionY, 0.0); + gl_Position = vec4(positionX, positionY, 0.0, 1.0); +} From 6ff886f9fed4dc3b4930f24740b1e72fb94a7af3 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 17:08:23 +0200 Subject: [PATCH 344/387] more explanation --- examples/15.OPENGL3.2/07.geometry.pd | 49 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/examples/15.OPENGL3.2/07.geometry.pd b/examples/15.OPENGL3.2/07.geometry.pd index 0df86de5b..8a603f262 100644 --- a/examples/15.OPENGL3.2/07.geometry.pd +++ b/examples/15.OPENGL3.2/07.geometry.pd @@ -32,10 +32,10 @@ #X connect 8 0 7 0; #X restore 44 104 pd fps; #X floatatom 44 127 5 0 0 1 fps - - 0; -#X obj 333 64 gemhead; -#X msg 495 377 program \$1; -#X msg 506 400 print_attributes; -#X obj 495 448 print vb; +#X obj 333 104 gemhead; +#X msg 495 417 program \$1; +#X msg 506 440 print_attributes; +#X obj 495 488 print vb; #X obj 44 9 declare -lib Gem; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; @@ -76,38 +76,38 @@ #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 42 51 pd gemwin; -#X obj 468 424 t a a; +#X obj 468 464 t a a; #X obj 37 174 loadbang; #X obj 37 228 s \$0_position; #X obj 37 295 s \$0_color; #X obj 37 255 loadbang; -#X obj 468 318 f \$0; -#X obj 488 247 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X floatatom 468 272 5 0 0 0 - - - 0; -#X obj 468 295 t b f; +#X obj 468 358 f \$0; +#X obj 488 287 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X floatatom 468 312 5 0 0 0 - - - 0; +#X obj 468 335 t b f; #X obj 37 319 loadbang; #X obj 37 359 s \$0_normal; #X obj 36 381 loadbang; #X obj 36 422 s \$0_texcoord; -#X obj 345 201 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X msg 468 342 attribute position \$1_position \, attribute normal \$1_normal \, attribute texCoord \$1_texcoord; -#X obj 691 131 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X msg 718 147 modelMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1; -#X msg 718 228 normalMatrix 1 0 0 0 1 0 0 0 1; -#X msg 718 255 lightPos 2 2 2; -#X msg 718 282 lightColor 1 1 1; -#X msg 718 309 ambientColor 0.2 0.2 0.2; -#X msg 718 174 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; -#X msg 718 201 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; -#X obj 333 116 translateXYZ; -#X floatatom 356 90 5 0 0 0 - - - 0; -#X text 399 89 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117; +#X obj 345 241 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X msg 468 382 attribute position \$1_position \, attribute normal \$1_normal \, attribute texCoord \$1_texcoord; +#X obj 691 171 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X msg 718 187 modelMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1; +#X msg 718 268 normalMatrix 1 0 0 0 1 0 0 0 1; +#X msg 718 295 lightPos 2 2 2; +#X msg 718 322 lightColor 1 1 1; +#X msg 718 349 ambientColor 0.2 0.2 0.2; +#X msg 718 214 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1; +#X msg 718 241 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0; +#X obj 333 156 translateXYZ; +#X floatatom 356 130 5 0 0 0 - - - 0; +#X text 399 129 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117; #X text 165 32 tables used by the vertex buffer; #X msg 37 275 0 1 0 0 0 1 0 0 0 1 1 1 0; #X msg 37 339 0 0 0 1 0 0 1 0 0 1 0 0 1; #X msg 36 401 0 0 0 0 1 1 0 1 1; #X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37; -#X obj 333 486 gemvertexbuffer \; resize 4 \; draw tristrip; +#X obj 333 526 gemvertexbuffer \; resize 4 \; draw tristrip; #N canvas 125 216 972 620 drawing_type 0; #X text 40 50 VBO draw type : same as all openGL primitive; #X text 46 433 geometry shader out type :; @@ -138,7 +138,8 @@ #X msg 60 486 read shader/07.geometry.frag cr; #X msg 60 542 read shader/07.geometry.geom cr; #X msg 60 592 read shader/07.geometry.vert cr; -#X obj 333 226 glsl shader/07.geometry; +#X obj 333 266 glsl shader/07.geometry; +#X text 422 39 A geometry shader sits between the vertex and fragment shaders in the graphics pipeline \, allowing for the creation \, modification \, or removal of primitives to dynamically generate new geometry based on the input vertices., f 80; #X connect 0 0 1 0; #X connect 2 0 31 0; #X connect 3 0 8 0; From 833027d6a010758f788770ec3d8e2af840bcbc3c Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 18 Apr 2025 17:10:42 +0200 Subject: [PATCH 345/387] spelling : rename exemple --- .../{08.adjency.pd => 08.adjacency.pd} | 46 +++++++++---------- .../{08.adjency.frag => 08.adjacency.frag} | 0 .../{08.adjency.geom => 08.adjacency.geom} | 0 .../{08.adjency.vert => 08.adjacency.vert} | 0 4 files changed, 23 insertions(+), 23 deletions(-) rename examples/15.OPENGL3.2/{08.adjency.pd => 08.adjacency.pd} (87%) rename examples/15.OPENGL3.2/shader/{08.adjency.frag => 08.adjacency.frag} (100%) rename examples/15.OPENGL3.2/shader/{08.adjency.geom => 08.adjacency.geom} (100%) rename examples/15.OPENGL3.2/shader/{08.adjency.vert => 08.adjacency.vert} (100%) diff --git a/examples/15.OPENGL3.2/08.adjency.pd b/examples/15.OPENGL3.2/08.adjacency.pd similarity index 87% rename from examples/15.OPENGL3.2/08.adjency.pd rename to examples/15.OPENGL3.2/08.adjacency.pd index ccb4b90be..ae4130b39 100644 --- a/examples/15.OPENGL3.2/08.adjency.pd +++ b/examples/15.OPENGL3.2/08.adjacency.pd @@ -96,10 +96,6 @@ #A 0 -0.27142 0.557135 0.485707 -0.0857122 0.0571443 -0.371423 0.228574 0.442858 -0.471418 0.0571475; #X coords 0 1 10 -1 200 140 1 0 0; #X restore 881 424 graph; -#X msg 60 486 read shader/08.adjency.frag cr; -#X msg 60 542 read shader/08.adjency.geom cr; -#X msg 60 592 read shader/08.adjency.vert cr; -#X obj 328 209 glsl shader/08.adjency; #X obj 455 512 f \$0; #X obj 455 465 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 37 218 s \$0_positionX; @@ -113,33 +109,37 @@ #X text 449 12 This example introduce adjacency; #X text 323 32 This shader demonstrates cubic interpolation using adjacency information in a geometry shader. It takes a sequence of points and creates a smooth curved line passing through them \, using neighboring points to calculate the curve's trajectory., f 94; #X text 321 85 The vertex shader passes the input points to the geometry shader \, which uses the GL_LINES_ADJACENCY primitive type to access four consecutive vertices at once. For each set of four points \, it performs cubic interpolation to generate a smooth curve segment between the middle two points \, while using the outer points to influence the curvature., f 94; +#X obj 328 209 glsl shader/08.adjacency; +#X msg 60 486 read shader/08.adjacency.frag cr; +#X msg 60 542 read shader/08.adjacency.geom cr; +#X msg 60 592 read shader/08.adjacency.vert cr; #X connect 0 0 1 0; -#X connect 2 0 27 0; +#X connect 2 0 37 0; #X connect 3 0 8 0; #X connect 4 0 8 0; -#X connect 8 0 35 0; +#X connect 8 0 31 0; #X connect 8 1 5 0; -#X connect 9 0 33 0; -#X connect 10 0 31 0; +#X connect 9 0 29 0; +#X connect 10 0 27 0; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 10 0; #X connect 13 1 3 0; -#X connect 14 0 27 0; -#X connect 16 0 24 0; -#X connect 16 0 25 0; -#X connect 16 0 26 0; +#X connect 14 0 37 0; +#X connect 16 0 39 0; +#X connect 16 0 40 0; +#X connect 16 0 38 0; #X connect 20 0 17 0; #X connect 21 0 18 0; #X connect 22 0 19 0; -#X connect 24 0 17 0; -#X connect 25 0 18 0; -#X connect 26 0 19 0; -#X connect 27 0 35 0; -#X connect 27 1 12 0; -#X connect 28 0 32 0; -#X connect 29 0 36 0; -#X connect 31 0 8 0; -#X connect 32 0 35 0; -#X connect 33 0 30 0; -#X connect 36 0 28 0; +#X connect 24 0 28 0; +#X connect 25 0 32 0; +#X connect 27 0 8 0; +#X connect 28 0 31 0; +#X connect 29 0 26 0; +#X connect 32 0 24 0; +#X connect 37 0 31 0; +#X connect 37 1 12 0; +#X connect 38 0 17 0; +#X connect 39 0 18 0; +#X connect 40 0 19 0; diff --git a/examples/15.OPENGL3.2/shader/08.adjency.frag b/examples/15.OPENGL3.2/shader/08.adjacency.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/08.adjency.frag rename to examples/15.OPENGL3.2/shader/08.adjacency.frag diff --git a/examples/15.OPENGL3.2/shader/08.adjency.geom b/examples/15.OPENGL3.2/shader/08.adjacency.geom similarity index 100% rename from examples/15.OPENGL3.2/shader/08.adjency.geom rename to examples/15.OPENGL3.2/shader/08.adjacency.geom diff --git a/examples/15.OPENGL3.2/shader/08.adjency.vert b/examples/15.OPENGL3.2/shader/08.adjacency.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/08.adjency.vert rename to examples/15.OPENGL3.2/shader/08.adjacency.vert From f0620ef2f293911b12d7dff3fd732eaa01a5167e Mon Sep 17 00:00:00 2001 From: chnry Date: Sun, 20 Apr 2025 11:37:04 +0200 Subject: [PATCH 346/387] add draw patch GL_PATCHES : it's mandatory for teselarisation shader. --- src/Base/GemShape.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Base/GemShape.cpp b/src/Base/GemShape.cpp index cbd5bdb91..fe3b58da0 100644 --- a/src/Base/GemShape.cpp +++ b/src/Base/GemShape.cpp @@ -66,6 +66,10 @@ static void initialize_drawtypes(std::map&drawtypes) drawtypes["strip"]=GL_TRIANGLE_STRIP; drawtypes["fill"]=GL_POLYGON; + + drawtypes["patch"]=GL_PATCHES; + drawtypes["patches"]=GL_PATCHES; + } } From 1199ff8960a0b0226b2951c2a0cd6a45e5073461 Mon Sep 17 00:00:00 2001 From: chnry Date: Sun, 20 Apr 2025 11:38:09 +0200 Subject: [PATCH 347/387] put the shaders in the execution order --- abstractions/glsl.pd | 104 +++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/abstractions/glsl.pd b/abstractions/glsl.pd index d08587a04..85f8c377a 100644 --- a/abstractions/glsl.pd +++ b/abstractions/glsl.pd @@ -1,4 +1,4 @@ -#N canvas 632 136 668 783 10; +#N canvas 791 129 668 783 10; #X msg 72 338 print; #X obj 118 626 glsl_program; #X msg 72 620 print; @@ -15,71 +15,71 @@ #X obj 227 189 t b a; #X msg 33 124 print; #X obj 33 103 t b; -#X obj 118 339 _glsl.compile vertex vert, f 30; -#X msg 72 368 print; -#X msg 72 398 print; -#X obj 118 369 _glsl.compile geometry geom, f 30; -#X obj 118 399 _glsl.compile fragment frag, f 30; +#X msg 72 468 print; +#X msg 72 498 print; +#X obj 118 469 _glsl.compile geometry geom, f 30; #X obj 223 578 list prepend link; #X obj 223 601 list trim; -#X listbox 286 601 20 0 0 0 - - - 0; +#X listbox 286 601 23 0 0 0 - - - 0; #X obj 118 44 route print bang symbol open; -#X msg 72 469 print; -#X obj 118 469 _glsl.compile tesscontrol tesc; -#X obj 118 492 _glsl.compile tesseval tese, f 30; -#X obj 223 556 pack 0 0 0 0 0; -#X msg 72 492 print; -#X obj 33 145 t a a a a a a; +#X obj 33 295 t a a a a a a; #X text 270 193 This abstraction can be useful to load a vertex+fragment shader. Shader location is relative to this abstraction parent patch path.; #X obj 383 361 t a; -#X connect 0 0 16 0; +#X obj 118 339 _glsl.compile vertex vert, f 30; +#X msg 72 399 print; +#X obj 118 399 _glsl.compile tesscontrol tesc; +#X obj 118 422 _glsl.compile tesseval tese, f 30; +#X msg 72 422 print; +#X obj 223 556 pack 0 0 0 0 0; +#X obj 118 499 _glsl.compile fragment frag, f 30; +#X connect 0 0 26 0; #X connect 1 0 4 0; #X connect 1 1 7 0; #X connect 2 0 1 0; -#X connect 3 0 24 0; -#X connect 5 0 32 0; -#X connect 6 0 16 0; +#X connect 3 0 22 0; +#X connect 5 0 25 0; +#X connect 6 0 26 0; #X connect 7 0 8 0; -#X connect 9 0 32 0; +#X connect 9 0 25 0; #X connect 9 1 11 0; #X connect 10 0 9 0; #X connect 11 1 13 0; -#X connect 12 0 16 1; +#X connect 12 0 26 1; #X connect 13 0 12 0; #X connect 13 1 12 1; -#X connect 14 0 30 0; +#X connect 14 0 23 0; #X connect 15 0 14 0; -#X connect 16 0 19 0; -#X connect 16 1 28 2; -#X connect 16 2 19 1; -#X connect 17 0 19 0; -#X connect 18 0 20 0; +#X connect 16 0 18 0; +#X connect 17 0 32 0; +#X connect 18 0 32 0; +#X connect 18 1 31 1; +#X connect 18 2 32 1; #X connect 19 0 20 0; -#X connect 19 1 28 1; -#X connect 19 2 20 1; -#X connect 20 0 26 0; -#X connect 20 1 28 0; -#X connect 20 2 26 1; -#X connect 21 0 22 0; -#X connect 21 0 23 0; -#X connect 22 0 1 0; -#X connect 24 0 15 0; -#X connect 24 1 12 0; -#X connect 24 2 13 0; -#X connect 24 3 13 0; -#X connect 24 4 6 0; -#X connect 25 0 26 0; -#X connect 26 0 27 0; -#X connect 26 1 28 4; -#X connect 26 2 27 1; -#X connect 27 0 1 0; -#X connect 27 1 28 3; -#X connect 28 0 21 0; -#X connect 29 0 27 0; -#X connect 30 0 1 0; -#X connect 30 1 27 0; -#X connect 30 2 26 0; -#X connect 30 3 20 0; -#X connect 30 4 19 0; -#X connect 30 5 16 0; +#X connect 19 0 21 0; +#X connect 20 0 1 0; +#X connect 22 0 15 0; +#X connect 22 1 12 0; +#X connect 22 2 13 0; +#X connect 22 3 13 0; +#X connect 22 4 6 0; +#X connect 23 0 1 0; +#X connect 23 1 32 0; +#X connect 23 2 18 0; +#X connect 23 3 29 0; +#X connect 23 4 28 0; +#X connect 23 5 26 0; +#X connect 25 0 1 0; +#X connect 26 0 28 0; +#X connect 26 1 31 4; +#X connect 26 2 28 1; +#X connect 27 0 28 0; +#X connect 28 0 29 0; +#X connect 28 1 31 3; +#X connect 28 2 29 1; +#X connect 29 0 18 0; +#X connect 29 1 31 2; +#X connect 29 2 18 1; +#X connect 30 0 29 0; +#X connect 31 0 19 0; #X connect 32 0 1 0; +#X connect 32 1 31 0; From bf839cad518dbbf917f0e4713282f5a7208a80cc Mon Sep 17 00:00:00 2001 From: chnry Date: Sun, 20 Apr 2025 12:51:01 +0200 Subject: [PATCH 348/387] add a new wrapper for a specific openGL fonction that is mandatory for teselarisation shader --- src/openGL/GEMglPatchParameteri.cpp | 84 +++++++++++++++++++++++++++++ src/openGL/GEMglPatchParameteri.h | 58 ++++++++++++++++++++ src/openGL/Makefile.am | 4 +- 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 src/openGL/GEMglPatchParameteri.cpp create mode 100644 src/openGL/GEMglPatchParameteri.h diff --git a/src/openGL/GEMglPatchParameteri.cpp b/src/openGL/GEMglPatchParameteri.cpp new file mode 100644 index 000000000..3e88916bb --- /dev/null +++ b/src/openGL/GEMglPatchParameteri.cpp @@ -0,0 +1,84 @@ +//////////////////////////////////////////////////////// +// +// GEM - Graphics Environment for Multimedia +// +// Implementation file +// +// Copyright (c) 2002-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at +// zmoelnig@iem.at +// For information on usage and redistribution, and for a DISCLAIMER +// * OF ALL WARRANTIES, see the file, "GEM.LICENSE.TERMS" +// +// this file has been generated... +//////////////////////////////////////////////////////// + +#include "GEMglPatchParameteri.h" + +CPPEXTERN_NEW_WITH_ONE_ARG ( GEMglPatchParameteri, t_floatarg, A_DEFFLOAT); + +///////////////////////////////////////////////////////// +// +// GEMglViewport +// +///////////////////////////////////////////////////////// +// Constructor +// +GEMglPatchParameteri :: GEMglPatchParameteri (t_floatarg arg0) : + param(static_cast(arg0)) +{ + m_inlet[0] = inlet_new(this->x_obj, &this->x_obj->ob_pd, &s_float, + gensym("param")); +} +///////////////////////////////////////////////////////// +// Destructor +// +GEMglPatchParameteri :: ~GEMglPatchParameteri () +{ + inlet_free(m_inlet[0]); +} + +////////////////// +// extension check +bool GEMglPatchParameteri :: isRunnable(void) +{ + if(GLEW_VERSION_1_1) { // TODO : put the correct version + return true; + } + error("your system does not support OpenGL-1.1"); + return false; +} + +///////////////////////////////////////////////////////// +// Render +// +void GEMglPatchParameteri :: render(GemState *state) +{ + glPatchParameteri (GL_PATCH_VERTICES, param); +} + +///////////////////////////////////////////////////////// +// Variables +// + +void GEMglPatchParameteri :: paramMess (t_float arg0) // FUN +{ + param = static_cast(arg0); + setModified(); +} + + +///////////////////////////////////////////////////////// +// static member functions +// + +void GEMglPatchParameteri :: obj_setupCallback(t_class *classPtr) +{ + class_addmethod(classPtr, + reinterpret_cast(&GEMglPatchParameteri::paramMessCallback), + gensym("param"), A_DEFFLOAT, A_NULL); +} + +void GEMglPatchParameteri :: paramMessCallback (void* data, t_float arg0) +{ + GetMyClass(data)->paramMess ( static_cast(arg0)); +} diff --git a/src/openGL/GEMglPatchParameteri.h b/src/openGL/GEMglPatchParameteri.h new file mode 100644 index 000000000..86155b0ac --- /dev/null +++ b/src/openGL/GEMglPatchParameteri.h @@ -0,0 +1,58 @@ +/* ------------------------------------------------------------------ + * GEM - Graphics Environment for Multimedia + * + * Copyright (c) 2002-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at + * zmoelnig@iem.at + * For information on usage and redistribution, and for a DISCLAIMER + * OF ALL WARRANTIES, see the file, "GEM.LICENSE.TERMS" + * + * this file has been generated... + * ------------------------------------------------------------------ + */ + +#ifndef _INCLUDE__GEM_OPENGL_GEMGLPATCHPARAMETERI_H_ +#define _INCLUDE__GEM_OPENGL_GEMGLPATCHPARAMETERI_H_ + +#include "Base/GemGLBase.h" + +/* + CLASS + GEMglPatchParameteri + KEYWORDS + openGL 0 + DESCRIPTION + wrapper for the openGL-function + "glPatchParameteri(GLint param)" + */ + +class GEM_EXTERN GEMglPatchParameteri : public GemGLBase +{ + CPPEXTERN_HEADER(GEMglPatchParameteri, GemGLBase); + +public: + // Constructor + GEMglPatchParameteri (t_float); // CON + +protected: + // Destructor + virtual ~GEMglPatchParameteri (); + // check extensions + virtual bool isRunnable(void); + + // Do the rendering + virtual void render (GemState *state); + + // variables + GLint param; // VAR + virtual void paramMess(t_float); // FUN + + +private: + + // we need some inlets + t_inlet *m_inlet[1]; + + // static member functions + static void paramMessCallback (void*, t_float); +}; +#endif // for header file diff --git a/src/openGL/Makefile.am b/src/openGL/Makefile.am index 7217fb444..37bd63b40 100644 --- a/src/openGL/Makefile.am +++ b/src/openGL/Makefile.am @@ -626,5 +626,7 @@ libopenGL_la_SOURCES= \ GEMglViewport.cpp \ GEMglViewport.h \ GLdefine.cpp \ - GLdefine.h + GLdefine.h \ + GEMglPatchParameteri.cpp \ + GEMglPatchParameteri.h From 014013907a911db6ec69e57ceca9f14d14527e57 Mon Sep 17 00:00:00 2001 From: chnry Date: Sun, 20 Apr 2025 13:57:10 +0200 Subject: [PATCH 349/387] teselarisation shader exemple --- examples/15.OPENGL3.2/09.tesel.pd | 137 +++++++++++++++++++++ examples/15.OPENGL3.2/shader/09.tesel.frag | 15 +++ examples/15.OPENGL3.2/shader/09.tesel.tesc | 29 +++++ examples/15.OPENGL3.2/shader/09.tesel.tese | 38 ++++++ examples/15.OPENGL3.2/shader/09.tesel.vert | 15 +++ 5 files changed, 234 insertions(+) create mode 100644 examples/15.OPENGL3.2/09.tesel.pd create mode 100644 examples/15.OPENGL3.2/shader/09.tesel.frag create mode 100644 examples/15.OPENGL3.2/shader/09.tesel.tesc create mode 100644 examples/15.OPENGL3.2/shader/09.tesel.tese create mode 100644 examples/15.OPENGL3.2/shader/09.tesel.vert diff --git a/examples/15.OPENGL3.2/09.tesel.pd b/examples/15.OPENGL3.2/09.tesel.pd new file mode 100644 index 000000000..4c02c61c2 --- /dev/null +++ b/examples/15.OPENGL3.2/09.tesel.pd @@ -0,0 +1,137 @@ +#N canvas 661 224 1019 676 10; +#X declare -lib Gem; +#N canvas 640 443 450 300 fps 0; +#X obj 60 28 gemhead; +#X obj 60 68 realtime; +#X obj 60 48 t b b; +#X obj 60 130 /; +#X msg 60 110 1000 \$1; +#X obj 60 235 outlet; +#X obj 60 152 + 0.5; +#X obj 60 214 i; +#N canvas 3 119 450 300 iir 0; +#X obj 63 31 inlet; +#X obj 63 81 +; +#X obj 63 107 / 21; +#X obj 119 138 * 20; +#X obj 63 176 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 3 0 1 1; +#X restore 60 182 pd iir; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 2 1 1 1; +#X connect 3 0 6 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X restore 44 104 pd fps; +#X floatatom 44 127 5 0 0 1 fps - - 0; +#X obj 302 246 gemhead; +#X msg 458 469 program \$1; +#X msg 469 492 print_attributes; +#X obj 458 540 print vb; +#X obj 44 9 declare -lib Gem; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 42 51 pd gemwin; +#X obj 431 516 t a a; +#X obj 37 174 loadbang; +#X obj 431 410 f \$0; +#X obj 451 339 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X floatatom 431 364 5 0 0 0 - - - 0; +#X obj 431 387 t b f; +#X obj 314 303 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 40 402 loadbang; +#X obj 60 450 textfile; +#X obj 60 505 textfile; +#X obj 60 555 textfile; +#X msg 119 451 print; +#X msg 122 506 print; +#X msg 123 554 print; +#X text 453 11 This example introduce teselarisation shader; +#X obj 302 328 glsl shader/09.tesel; +#X obj 302 277 GEMglPatchParameteri 3; +#X obj 37 218 s \$0_position; +#X msg 37 196 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; +#X obj 302 578 gemvertexbuffer \; resize 3 \; draw patches; +#X msg 431 434 attribute position \$1_position, f 32; +#X obj 37 259 table \$0_position 9; +#X msg 60 426 read shader/09.tesel.vert cr; +#X obj 60 605 textfile; +#X msg 123 604 print; +#X msg 60 480 read shader/09.tesel.tesc cr; +#X msg 60 532 read shader/09.tesel.tese cr; +#X msg 60 582 read shader/09.tesel.frag cr; +#X text 283 34 This shader pipeline performs tessellation on a triangle primitive. Here's how it works: \; \; - The vertex shader (09.tesel.vert) passes the original triangle vertices without modification. \; - The tessellation control shader (09.tesel.tesc) sets up tessellation levels (5.0 for inner and outer edges) and passes vertex data to the tessellation evaluation shader. \; - The tessellation evaluation shader (09.tesel.tese) subdivides the triangle into smaller triangles based on the tessellation levels and interpolates positions and normals for each new vertex. It also calculates pseudo random colors for each new vertex using cosine functions based on position. \; - Finally \, the fragment shader (09.tesel.frag) renders each fragment with the color computed during tessellation. \; \; The result is a single triangle subdivided into many smaller triangles with a procedural color pattern that creates a visual effect with color variations based on position., f 94; +#X connect 0 0 1 0; +#X connect 2 0 24 0; +#X connect 3 0 8 0; +#X connect 4 0 8 0; +#X connect 8 0 27 0; +#X connect 8 1 5 0; +#X connect 9 0 26 0; +#X connect 10 0 28 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 13 0 10 0; +#X connect 13 1 3 0; +#X connect 14 0 23 0; +#X connect 15 0 33 0; +#X connect 15 0 34 0; +#X connect 15 0 30 0; +#X connect 15 0 35 0; +#X connect 19 0 16 0; +#X connect 20 0 17 0; +#X connect 21 0 18 0; +#X connect 23 0 27 0; +#X connect 23 1 12 0; +#X connect 24 0 23 0; +#X connect 26 0 25 0; +#X connect 28 0 8 0; +#X connect 30 0 16 0; +#X connect 32 0 31 0; +#X connect 33 0 17 0; +#X connect 34 0 18 0; +#X connect 35 0 31 0; diff --git a/examples/15.OPENGL3.2/shader/09.tesel.frag b/examples/15.OPENGL3.2/shader/09.tesel.frag new file mode 100644 index 000000000..d93a86c12 --- /dev/null +++ b/examples/15.OPENGL3.2/shader/09.tesel.frag @@ -0,0 +1,15 @@ +#version 400 + +in VS_OUT { + vec3 pos; + vec3 norm; + vec3 color; +} fs_in; + +out vec4 FragColor; + +void main() { +// interpolation of the color computed at each vertices, after subdivision by the teselarisation shader + FragColor = vec4(fs_in.color, 1.0); +} + diff --git a/examples/15.OPENGL3.2/shader/09.tesel.tesc b/examples/15.OPENGL3.2/shader/09.tesel.tesc new file mode 100644 index 000000000..b45663851 --- /dev/null +++ b/examples/15.OPENGL3.2/shader/09.tesel.tesc @@ -0,0 +1,29 @@ +#version 400 + +layout(vertices = 3) out; + +in VS_OUT { + vec3 pos; + vec3 norm; + vec3 color; +} tcs_in[]; + +out TCS_OUT { + vec3 pos; + vec3 norm; + vec3 color; +} tcs_out[]; + +void main() { + // tessellarisation level + gl_TessLevelInner[0] = 5.0; + gl_TessLevelOuter[0] = 5.0; + gl_TessLevelOuter[1] = 5.0; + gl_TessLevelOuter[2] = 5.0; + + // Pass this data to control vertex + tcs_out[gl_InvocationID].pos = tcs_in[gl_InvocationID].pos; + tcs_out[gl_InvocationID].norm = tcs_in[gl_InvocationID].norm; + tcs_out[gl_InvocationID].color = tcs_in[gl_InvocationID].color; +} + diff --git a/examples/15.OPENGL3.2/shader/09.tesel.tese b/examples/15.OPENGL3.2/shader/09.tesel.tese new file mode 100644 index 000000000..5d882d216 --- /dev/null +++ b/examples/15.OPENGL3.2/shader/09.tesel.tese @@ -0,0 +1,38 @@ +#version 400 + +layout(triangles, equal_spacing, cw) in; + +in TCS_OUT { + vec3 pos; + vec3 norm; + vec3 color; +} tes_in[]; + +out VS_OUT { + vec3 pos; + vec3 norm; + vec3 color; +} vs_out; + +void main() { + // interpolate vertex position + vec3 p0 = tes_in[0].pos; + vec3 p1 = tes_in[1].pos; + vec3 p2 = tes_in[2].pos; + + vec3 n0 = tes_in[0].norm; + vec3 n1 = tes_in[1].norm; + vec3 n2 = tes_in[2].norm; + + vec3 pos = (gl_TessCoord.x * p0) + (gl_TessCoord.y * p1) + (gl_TessCoord.z * p2); + vec3 norm = normalize((gl_TessCoord.x * n0) + (gl_TessCoord.y * n1) + (gl_TessCoord.z * n2)); + + vs_out.pos = pos; + vs_out.norm = norm; + gl_Position = vec4(pos, 1.0); + vec3 mycolor; // custom color at each vertices after subdivision + mycolor.rg = cos(1.+12.12*pos.xy); + mycolor.b = cos(1.+12.12*pos.x*pos.y); + vs_out.color = vec3(0.5)+0.5*mycolor; +} + diff --git a/examples/15.OPENGL3.2/shader/09.tesel.vert b/examples/15.OPENGL3.2/shader/09.tesel.vert new file mode 100644 index 000000000..824d3c25a --- /dev/null +++ b/examples/15.OPENGL3.2/shader/09.tesel.vert @@ -0,0 +1,15 @@ +#version 400 + +layout(location = 0) in vec3 position; + +out VS_OUT { + vec3 pos; + vec3 norm; + vec3 color; +} vs_out; + +void main() { + vs_out.pos = position; + vs_out.norm = vec3(0.,0.,1.); + gl_Position = vec4(position, 1.0); +} From 136e6ae14ee2ace70a7861e1aa104fe4f79d8259 Mon Sep 17 00:00:00 2001 From: chnry Date: Sun, 20 Apr 2025 14:19:38 +0200 Subject: [PATCH 350/387] more comment in the shaders files --- examples/{15.OPENGL3.2 => 15.openGL3.2}/01.basic.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/02.transformation.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/03.matrix.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/04.model.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/05.texture.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/06.lighting.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/07.geometry.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/08.adjacency.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/09.tesel.pd | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/01.basic.frag | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/01.basic.vert | 0 .../shader/02.transformation.frag | 0 .../shader/02.transformation.vert | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/03.matrix.frag | 3 +++ examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/03.matrix.vert | 2 ++ examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/04.model.frag | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/04.model.vert | 0 .../{15.OPENGL3.2 => 15.openGL3.2}/shader/05.texture.frag | 0 .../{15.OPENGL3.2 => 15.openGL3.2}/shader/05.texture.vert | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/06.light.frag | 0 examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/06.light.vert | 0 .../{15.OPENGL3.2 => 15.openGL3.2}/shader/07.geometry.frag | 1 + .../{15.OPENGL3.2 => 15.openGL3.2}/shader/07.geometry.geom | 1 + .../{15.OPENGL3.2 => 15.openGL3.2}/shader/07.geometry.vert | 3 ++- .../{15.OPENGL3.2 => 15.openGL3.2}/shader/08.adjacency.frag | 2 +- .../{15.OPENGL3.2 => 15.openGL3.2}/shader/08.adjacency.geom | 4 ++++ .../{15.OPENGL3.2 => 15.openGL3.2}/shader/08.adjacency.vert | 1 + examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.frag | 1 + examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.tesc | 3 ++- examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.tese | 3 ++- examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.vert | 1 + 31 files changed, 21 insertions(+), 4 deletions(-) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/01.basic.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/02.transformation.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/03.matrix.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/04.model.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/05.texture.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/06.lighting.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/07.geometry.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/08.adjacency.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/09.tesel.pd (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/01.basic.frag (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/01.basic.vert (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/02.transformation.frag (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/02.transformation.vert (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/03.matrix.frag (82%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/03.matrix.vert (84%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/04.model.frag (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/04.model.vert (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/05.texture.frag (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/05.texture.vert (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/06.light.frag (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/06.light.vert (100%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/07.geometry.frag (98%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/07.geometry.geom (97%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/07.geometry.vert (91%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/08.adjacency.frag (86%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/08.adjacency.geom (87%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/08.adjacency.vert (91%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.frag (92%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.tesc (89%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.tese (88%) rename examples/{15.OPENGL3.2 => 15.openGL3.2}/shader/09.tesel.vert (91%) diff --git a/examples/15.OPENGL3.2/01.basic.pd b/examples/15.openGL3.2/01.basic.pd similarity index 100% rename from examples/15.OPENGL3.2/01.basic.pd rename to examples/15.openGL3.2/01.basic.pd diff --git a/examples/15.OPENGL3.2/02.transformation.pd b/examples/15.openGL3.2/02.transformation.pd similarity index 100% rename from examples/15.OPENGL3.2/02.transformation.pd rename to examples/15.openGL3.2/02.transformation.pd diff --git a/examples/15.OPENGL3.2/03.matrix.pd b/examples/15.openGL3.2/03.matrix.pd similarity index 100% rename from examples/15.OPENGL3.2/03.matrix.pd rename to examples/15.openGL3.2/03.matrix.pd diff --git a/examples/15.OPENGL3.2/04.model.pd b/examples/15.openGL3.2/04.model.pd similarity index 100% rename from examples/15.OPENGL3.2/04.model.pd rename to examples/15.openGL3.2/04.model.pd diff --git a/examples/15.OPENGL3.2/05.texture.pd b/examples/15.openGL3.2/05.texture.pd similarity index 100% rename from examples/15.OPENGL3.2/05.texture.pd rename to examples/15.openGL3.2/05.texture.pd diff --git a/examples/15.OPENGL3.2/06.lighting.pd b/examples/15.openGL3.2/06.lighting.pd similarity index 100% rename from examples/15.OPENGL3.2/06.lighting.pd rename to examples/15.openGL3.2/06.lighting.pd diff --git a/examples/15.OPENGL3.2/07.geometry.pd b/examples/15.openGL3.2/07.geometry.pd similarity index 100% rename from examples/15.OPENGL3.2/07.geometry.pd rename to examples/15.openGL3.2/07.geometry.pd diff --git a/examples/15.OPENGL3.2/08.adjacency.pd b/examples/15.openGL3.2/08.adjacency.pd similarity index 100% rename from examples/15.OPENGL3.2/08.adjacency.pd rename to examples/15.openGL3.2/08.adjacency.pd diff --git a/examples/15.OPENGL3.2/09.tesel.pd b/examples/15.openGL3.2/09.tesel.pd similarity index 100% rename from examples/15.OPENGL3.2/09.tesel.pd rename to examples/15.openGL3.2/09.tesel.pd diff --git a/examples/15.OPENGL3.2/shader/01.basic.frag b/examples/15.openGL3.2/shader/01.basic.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/01.basic.frag rename to examples/15.openGL3.2/shader/01.basic.frag diff --git a/examples/15.OPENGL3.2/shader/01.basic.vert b/examples/15.openGL3.2/shader/01.basic.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/01.basic.vert rename to examples/15.openGL3.2/shader/01.basic.vert diff --git a/examples/15.OPENGL3.2/shader/02.transformation.frag b/examples/15.openGL3.2/shader/02.transformation.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/02.transformation.frag rename to examples/15.openGL3.2/shader/02.transformation.frag diff --git a/examples/15.OPENGL3.2/shader/02.transformation.vert b/examples/15.openGL3.2/shader/02.transformation.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/02.transformation.vert rename to examples/15.openGL3.2/shader/02.transformation.vert diff --git a/examples/15.OPENGL3.2/shader/03.matrix.frag b/examples/15.openGL3.2/shader/03.matrix.frag similarity index 82% rename from examples/15.OPENGL3.2/shader/03.matrix.frag rename to examples/15.openGL3.2/shader/03.matrix.frag index 2f6fbf444..520bfd514 100644 --- a/examples/15.OPENGL3.2/shader/03.matrix.frag +++ b/examples/15.openGL3.2/shader/03.matrix.frag @@ -1,4 +1,7 @@ #version 150 +// Cyrille Henry 2025 + +// simple shader that compute very simple light // from geometry shader in vec3 vertNormal; diff --git a/examples/15.OPENGL3.2/shader/03.matrix.vert b/examples/15.openGL3.2/shader/03.matrix.vert similarity index 84% rename from examples/15.OPENGL3.2/shader/03.matrix.vert rename to examples/15.openGL3.2/shader/03.matrix.vert index 833b89a84..b353d2ebf 100644 --- a/examples/15.OPENGL3.2/shader/03.matrix.vert +++ b/examples/15.openGL3.2/shader/03.matrix.vert @@ -1,4 +1,5 @@ #version 150 +// Cyrille Henry 2025 // from VBO in vec3 position; @@ -9,6 +10,7 @@ in vec3 color; out vec3 vertNormal; out vec3 vertColor; +// the model view projection matrix used for transformation uniform mat4 modelMatrix; uniform mat4 viewMatrix; uniform mat4 projMatrix; diff --git a/examples/15.OPENGL3.2/shader/04.model.frag b/examples/15.openGL3.2/shader/04.model.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/04.model.frag rename to examples/15.openGL3.2/shader/04.model.frag diff --git a/examples/15.OPENGL3.2/shader/04.model.vert b/examples/15.openGL3.2/shader/04.model.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/04.model.vert rename to examples/15.openGL3.2/shader/04.model.vert diff --git a/examples/15.OPENGL3.2/shader/05.texture.frag b/examples/15.openGL3.2/shader/05.texture.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/05.texture.frag rename to examples/15.openGL3.2/shader/05.texture.frag diff --git a/examples/15.OPENGL3.2/shader/05.texture.vert b/examples/15.openGL3.2/shader/05.texture.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/05.texture.vert rename to examples/15.openGL3.2/shader/05.texture.vert diff --git a/examples/15.OPENGL3.2/shader/06.light.frag b/examples/15.openGL3.2/shader/06.light.frag similarity index 100% rename from examples/15.OPENGL3.2/shader/06.light.frag rename to examples/15.openGL3.2/shader/06.light.frag diff --git a/examples/15.OPENGL3.2/shader/06.light.vert b/examples/15.openGL3.2/shader/06.light.vert similarity index 100% rename from examples/15.OPENGL3.2/shader/06.light.vert rename to examples/15.openGL3.2/shader/06.light.vert diff --git a/examples/15.OPENGL3.2/shader/07.geometry.frag b/examples/15.openGL3.2/shader/07.geometry.frag similarity index 98% rename from examples/15.OPENGL3.2/shader/07.geometry.frag rename to examples/15.openGL3.2/shader/07.geometry.frag index 824eb58ac..e766ffa53 100644 --- a/examples/15.OPENGL3.2/shader/07.geometry.frag +++ b/examples/15.openGL3.2/shader/07.geometry.frag @@ -1,4 +1,5 @@ #version 150 +// Cyrille Henry 2025 // from geometry shader in vec3 geomPosition; diff --git a/examples/15.OPENGL3.2/shader/07.geometry.geom b/examples/15.openGL3.2/shader/07.geometry.geom similarity index 97% rename from examples/15.OPENGL3.2/shader/07.geometry.geom rename to examples/15.openGL3.2/shader/07.geometry.geom index 384adfd1d..995a3405a 100644 --- a/examples/15.OPENGL3.2/shader/07.geometry.geom +++ b/examples/15.openGL3.2/shader/07.geometry.geom @@ -1,4 +1,5 @@ #version 150 +// Cyrille Henry 2025 layout(triangles) in; // the triangle_strip is split in multiples triangles before this shader diff --git a/examples/15.OPENGL3.2/shader/07.geometry.vert b/examples/15.openGL3.2/shader/07.geometry.vert similarity index 91% rename from examples/15.OPENGL3.2/shader/07.geometry.vert rename to examples/15.openGL3.2/shader/07.geometry.vert index ae724e55b..e57cc512c 100644 --- a/examples/15.OPENGL3.2/shader/07.geometry.vert +++ b/examples/15.openGL3.2/shader/07.geometry.vert @@ -1,4 +1,5 @@ #version 150 +// Cyrille Henry 2025 // from VBO in vec3 position; @@ -10,6 +11,7 @@ out vec3 vertPosition; out vec3 vertNormal; out vec2 vertTexCoord; +// transformation matrices uniform mat4 modelMatrix; uniform mat4 viewMatrix; uniform mat4 projMatrix; @@ -19,6 +21,5 @@ void main() { vertPosition = vec3(modelMatrix * vec4(position, 1.0)); vertNormal = normalMatrix * normal; vertTexCoord = texCoord; - gl_Position = projMatrix * viewMatrix * modelMatrix * vec4(position, 1.0); } diff --git a/examples/15.OPENGL3.2/shader/08.adjacency.frag b/examples/15.openGL3.2/shader/08.adjacency.frag similarity index 86% rename from examples/15.OPENGL3.2/shader/08.adjacency.frag rename to examples/15.openGL3.2/shader/08.adjacency.frag index 708b85194..1a3c0911a 100644 --- a/examples/15.OPENGL3.2/shader/08.adjacency.frag +++ b/examples/15.openGL3.2/shader/08.adjacency.frag @@ -1,4 +1,5 @@ #version 150 +// Cyrille Henry 2025 // from geometry shader in vec3 geomPosition; @@ -6,7 +7,6 @@ in vec3 geomPosition; // to rendering out vec4 fragColor; - void main() { fragColor = vec4(1.); } diff --git a/examples/15.OPENGL3.2/shader/08.adjacency.geom b/examples/15.openGL3.2/shader/08.adjacency.geom similarity index 87% rename from examples/15.OPENGL3.2/shader/08.adjacency.geom rename to examples/15.openGL3.2/shader/08.adjacency.geom index 400a5f51b..97c3366b4 100644 --- a/examples/15.OPENGL3.2/shader/08.adjacency.geom +++ b/examples/15.openGL3.2/shader/08.adjacency.geom @@ -1,4 +1,8 @@ #version 150 +// Cyrille Henry 2025 + +// this shader add vertices between 2 vertices of the original geometry. +// It use 4 vertices input, in order to do a cubix interpolation, for smooth rendering. layout(lines_adjacency) in; layout(line_strip, max_vertices = 256) out; diff --git a/examples/15.OPENGL3.2/shader/08.adjacency.vert b/examples/15.openGL3.2/shader/08.adjacency.vert similarity index 91% rename from examples/15.OPENGL3.2/shader/08.adjacency.vert rename to examples/15.openGL3.2/shader/08.adjacency.vert index 9706e8fbe..89703691e 100644 --- a/examples/15.OPENGL3.2/shader/08.adjacency.vert +++ b/examples/15.openGL3.2/shader/08.adjacency.vert @@ -1,4 +1,5 @@ #version 150 +// Cyrille Henry 2025 // from VBO in float positionX; diff --git a/examples/15.OPENGL3.2/shader/09.tesel.frag b/examples/15.openGL3.2/shader/09.tesel.frag similarity index 92% rename from examples/15.OPENGL3.2/shader/09.tesel.frag rename to examples/15.openGL3.2/shader/09.tesel.frag index d93a86c12..cc08f484b 100644 --- a/examples/15.OPENGL3.2/shader/09.tesel.frag +++ b/examples/15.openGL3.2/shader/09.tesel.frag @@ -1,4 +1,5 @@ #version 400 +// Cyrille Henry 2025 in VS_OUT { vec3 pos; diff --git a/examples/15.OPENGL3.2/shader/09.tesel.tesc b/examples/15.openGL3.2/shader/09.tesel.tesc similarity index 89% rename from examples/15.OPENGL3.2/shader/09.tesel.tesc rename to examples/15.openGL3.2/shader/09.tesel.tesc index b45663851..23579618c 100644 --- a/examples/15.OPENGL3.2/shader/09.tesel.tesc +++ b/examples/15.openGL3.2/shader/09.tesel.tesc @@ -1,6 +1,7 @@ #version 400 +// Cyrille Henry 2025 -layout(vertices = 3) out; +layout(vertices = 3) out; // traw triangle in VS_OUT { vec3 pos; diff --git a/examples/15.OPENGL3.2/shader/09.tesel.tese b/examples/15.openGL3.2/shader/09.tesel.tese similarity index 88% rename from examples/15.OPENGL3.2/shader/09.tesel.tese rename to examples/15.openGL3.2/shader/09.tesel.tese index 5d882d216..ee15f4070 100644 --- a/examples/15.OPENGL3.2/shader/09.tesel.tese +++ b/examples/15.openGL3.2/shader/09.tesel.tese @@ -1,4 +1,5 @@ #version 400 +// Cyrille Henry 2025 layout(triangles, equal_spacing, cw) in; @@ -30,7 +31,7 @@ void main() { vs_out.pos = pos; vs_out.norm = norm; gl_Position = vec4(pos, 1.0); - vec3 mycolor; // custom color at each vertices after subdivision + vec3 mycolor; // custom pseudo random color at each vertices after subdivision mycolor.rg = cos(1.+12.12*pos.xy); mycolor.b = cos(1.+12.12*pos.x*pos.y); vs_out.color = vec3(0.5)+0.5*mycolor; diff --git a/examples/15.OPENGL3.2/shader/09.tesel.vert b/examples/15.openGL3.2/shader/09.tesel.vert similarity index 91% rename from examples/15.OPENGL3.2/shader/09.tesel.vert rename to examples/15.openGL3.2/shader/09.tesel.vert index 824d3c25a..bc35a9cc5 100644 --- a/examples/15.OPENGL3.2/shader/09.tesel.vert +++ b/examples/15.openGL3.2/shader/09.tesel.vert @@ -1,4 +1,5 @@ #version 400 +// Cyrille Henry 2025 layout(location = 0) in vec3 position; From c797b0478a7c2ced86451009c9377f9922a9431a Mon Sep 17 00:00:00 2001 From: cyrille henry Date: Tue, 22 Apr 2025 14:34:02 +0200 Subject: [PATCH 351/387] a new example to querry the GPU important information (#492) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * a new example to querry the GPU important information * Fix typos and add query_GPU to build system also, GL_MAX_TEXTURE_SIZE returns a single value (rather than a pair) --------- Co-authored-by: IOhannes m zmölnig --- examples/02.advanced/24.query_GPU.pd | 81 ++++++++++++++++++++++++++++ examples/Makefile.am | 1 + 2 files changed, 82 insertions(+) create mode 100644 examples/02.advanced/24.query_GPU.pd diff --git a/examples/02.advanced/24.query_GPU.pd b/examples/02.advanced/24.query_GPU.pd new file mode 100644 index 000000000..414b4aa9f --- /dev/null +++ b/examples/02.advanced/24.query_GPU.pd @@ -0,0 +1,81 @@ +#N canvas 795 186 742 548 12; +#X obj 30 65 gemwin; +#X obj 37 171 GEMglGetIntegerv GL_MAX_VIEWPORT_DIMS; +#X obj 37 141 gemhead; +#X msg 30 14 create \, 1; +#X msg 49 41 destroy; +#X msg 453 170 \$1 \$2; +#X listbox 510 170 20 0 0 0 - - - 0; +#X obj 37 195 GEMglGetIntegerv GL_MAX_TEXTURE_SIZE; +#X obj 37 220 GEMglGetIntegerv GL_MAX_TEXTURE_IMAGE_UNITS; +#X obj 37 246 GEMglGetIntegerv GL_MAX_VERTEX_ATTRIBS; +#X obj 37 272 GEMglGetIntegerv GL_MAX_VERTEX_UNIFORM_COMPONENTS; +#X obj 37 297 GEMglGetIntegerv GL_MAX_VARYING_FLOATS; +#X msg 453 193 \$1; +#X listbox 510 193 20 0 0 0 - - - 0; +#X listbox 510 220 20 0 0 0 - - - 0; +#X listbox 510 243 20 0 0 0 - - - 0; +#X listbox 510 273 20 0 0 0 - - - 0; +#X listbox 510 303 20 0 0 0 - - - 0; +#X msg 453 220 \$1; +#X msg 453 243 \$1; +#X msg 453 273 \$1; +#X msg 453 296 \$1; +#X listbox 510 320 20 0 0 0 - - - 0; +#X listbox 510 343 20 0 0 0 - - - 0; +#X listbox 510 370 20 0 0 0 - - - 0; +#X listbox 510 393 20 0 0 0 - - - 0; +#X listbox 510 423 20 0 0 0 - - - 0; +#X listbox 510 453 20 0 0 0 - - - 0; +#X msg 453 370 \$1; +#X msg 453 393 \$1; +#X msg 453 423 \$1; +#X msg 453 453 \$1; +#X obj 37 321 GEMglGetIntegerv GL_MAX_GEOMETRY_INPUT_COMPONENTS; +#X msg 453 343 \$1; +#X obj 37 345 GEMglGetIntegerv GL_MAX_GEOMETRY_OUTPUT_COMPONENTS; +#X obj 37 370 GEMglGetIntegerv GL_MAX_GEOMETRY_OUTPUT_VERTICES; +#X obj 37 396 GEMglGetIntegerv GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS; +#X obj 37 422 GEMglGetIntegerv GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS; +#X obj 37 447 GEMglGetIntegerv GL_MAX_UNIFORM_BLOCK_SIZE; +#X msg 453 320 \$1; +#X text 190 21 This patch queries your GPU for its limitations.; +#X text 191 51 All GPUs have different hardware limitations.; +#X connect 1 0 7 0; +#X connect 1 1 5 0; +#X connect 2 0 1 0; +#X connect 3 0 0 0; +#X connect 4 0 0 0; +#X connect 5 0 6 0; +#X connect 7 0 8 0; +#X connect 7 1 12 0; +#X connect 8 0 9 0; +#X connect 8 1 18 0; +#X connect 9 0 10 0; +#X connect 9 1 19 0; +#X connect 10 0 11 0; +#X connect 10 1 20 0; +#X connect 11 0 32 0; +#X connect 11 1 21 0; +#X connect 12 0 13 0; +#X connect 18 0 14 0; +#X connect 19 0 15 0; +#X connect 20 0 16 0; +#X connect 21 0 17 0; +#X connect 28 0 24 0; +#X connect 29 0 25 0; +#X connect 30 0 26 0; +#X connect 31 0 27 0; +#X connect 32 0 34 0; +#X connect 32 1 39 0; +#X connect 33 0 23 0; +#X connect 34 0 35 0; +#X connect 34 1 33 0; +#X connect 35 0 36 0; +#X connect 35 1 28 0; +#X connect 36 0 37 0; +#X connect 36 1 29 0; +#X connect 37 0 38 0; +#X connect 37 1 30 0; +#X connect 38 1 31 0; +#X connect 39 0 22 0; diff --git a/examples/Makefile.am b/examples/Makefile.am index 5eeb90614..0249f8191 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -38,6 +38,7 @@ nobase_dist_gemexamples_DATA = \ 02.advanced/21.basic_LSystem.pd \ 02.advanced/22.double-iterative.pd \ 02.advanced/23.SplitScreen.pd \ + 02.advanced/24.query_GPU.pd \ 02.advanced/snapshotHD.pd \ 03.lighting/01.world_light.pd \ 03.lighting/02.light.pd \ From 9c70db7381ce9f3be298e49eed94f726e9853523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 9 Apr 2025 15:55:47 +0200 Subject: [PATCH 352/387] [pix_write] fix setting format Closes: https://github.com/umlaeute/Gem/issues/484 --- src/Pixes/pix_write.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Pixes/pix_write.cpp b/src/Pixes/pix_write.cpp index 4d6679cc1..29a58a406 100644 --- a/src/Pixes/pix_write.cpp +++ b/src/Pixes/pix_write.cpp @@ -123,6 +123,22 @@ void pix_write :: doWrite(void) int width = m_width; int height = m_height; + int format = GEM_RGBA; + switch(m_color) { + case 1: + format = GEM_GRAY; + break; + case 3: + format = GEM_RGB; + break; + case 4: + format = GEM_RGBA; + break; + default: + error("unknown format 0x%X", format); + return; + } + GemMan::getDimen(((m_width >0)?NULL:&width ), ((m_height>0)?NULL:&height)); @@ -130,7 +146,7 @@ void pix_write :: doWrite(void) m_originalImage->ysize = height; #ifndef __APPLE__ - m_originalImage->setFormat(m_color); + m_originalImage->setFormat(format); #else m_originalImage->setFormat(GEM_RGBA); #endif /* APPLE */ From 4e43953008710364d8777f8c0b6af290963861ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 14:13:20 +0200 Subject: [PATCH 353/387] film: enumerate actual useable plugins (in the correct order) not just the "available" plugins --- src/plugins/film.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/film.cpp b/src/plugins/film.cpp index 8ce043895..f3d52337f 100644 --- a/src/plugins/film.cpp +++ b/src/plugins/film.cpp @@ -206,10 +206,10 @@ class filmMeta : public gem::plugins::film } static bool firsttime=true; - if(firsttime && ids.size()>0) { + if(firsttime && m_ids.size()>0) { startpost("GEM: film loading plugins:"); - for(unsigned int i=0; i Date: Tue, 22 Apr 2025 14:13:35 +0200 Subject: [PATCH 354/387] whitespace --- src/plugins/film.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/film.cpp b/src/plugins/film.cpp index f3d52337f..7785fd238 100644 --- a/src/plugins/film.cpp +++ b/src/plugins/film.cpp @@ -242,8 +242,10 @@ class filmMeta : public gem::plugins::film std::string id=backends[j]; for(unsigned int i=0; iopen(name, requestprops)) { + if(id==m_ids[i] + && (tried=true) + && m_handles[i]->open(name, requestprops) + ) { m_handle=m_handles[i]; break; } From 559035c68faeac17bcfb3dd72a598b7d66f531ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 14:14:32 +0200 Subject: [PATCH 355/387] film: clear backends property before loading via to filmImage() so the "image" backend actually works Closes: https://github.com/umlaeute/Gem/issues/481 --- src/plugins/film.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/film.cpp b/src/plugins/film.cpp index 7785fd238..131aada0c 100644 --- a/src/plugins/film.cpp +++ b/src/plugins/film.cpp @@ -54,6 +54,11 @@ class filmIMAGE : public gem::plugins::film const gem::Properties&requestprops) { gem::Properties props=requestprops; + if(props.type("_backends")!=gem::Properties::UNSET) { + /* backends might be 'image' (which is a valid for film, + * but not for imageloader), so remove it */ + props.erase("_backends"); + } m_image.newfilm=true; return m_handle->load(name, m_image.image, props); } From fd62211becc24cf7e750e61b4f2f63d4ab73f3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 14:21:11 +0200 Subject: [PATCH 356/387] gmerlin: fail to load movies with 0x0 framesize Related: https://github.com/umlaeute/Gem/issues/481 --- plugins/GMERLIN/filmGMERLIN.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/GMERLIN/filmGMERLIN.cpp b/plugins/GMERLIN/filmGMERLIN.cpp index e81f127d2..0fe27569a 100644 --- a/plugins/GMERLIN/filmGMERLIN.cpp +++ b/plugins/GMERLIN/filmGMERLIN.cpp @@ -266,6 +266,12 @@ bool filmGMERLIN :: open(const std::string&sfilename, m_gframe = gavl_video_frame_create_nopad(gformat); + /* check if we have a valid dimension */ + if(!gformat->frame_width || !gformat->frame_height) { + close(); + return false; + } + gavl_video_format_t finalformat[1]; finalformat->frame_width = gformat->frame_width; finalformat->frame_height = gformat->frame_height; From eef4cbc75121733b76e8d4ff8c1c5bc5db06e630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 14:42:06 +0200 Subject: [PATCH 357/387] fix spelling mistakes --- examples/15.openGL3.2/02.transformation.pd | 4 ++-- examples/15.openGL3.2/03.matrix.pd | 14 +++++++------- examples/15.openGL3.2/04.model.pd | 2 +- examples/15.openGL3.2/07.geometry.pd | 8 ++++---- examples/15.openGL3.2/08.adjacency.pd | 6 +++--- examples/15.openGL3.2/09.tesel.pd | 2 +- examples/15.openGL3.2/shader/01.basic.vert | 2 +- .../15.openGL3.2/shader/02.transformation.vert | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/15.openGL3.2/02.transformation.pd b/examples/15.openGL3.2/02.transformation.pd index 0a146de55..51c72ff2d 100644 --- a/examples/15.openGL3.2/02.transformation.pd +++ b/examples/15.openGL3.2/02.transformation.pd @@ -128,12 +128,12 @@ #X obj 614 271 list prepend transformation_matrix; #X obj 614 293 list trim; #X obj 533 78 translateXYZ 0 0 4; -#X text 583 350 The transformation matrix is not send to the shader \, we need to create one and pass it (like a standard variable) to the shader; +#X text 583 350 The transformation matrix is not sent to the shader \, we need to create one and pass it (like a standard variable) to the shader; #X obj 287 638 gemvertexbuffer \; resize 9 \; draw tri; #X obj 287 162 translateXYZ; #X floatatom 310 117 5 0 0 0 - - - 0; #X text 349 116 this transformation is ignored..., f 19; -#X text 586 402 Z translation have no effect since the perspective is not yet implemented; +#X text 586 402 Z translation has no effect since the perspective is not yet implemented; #X obj 458 408 t b f; #X obj 287 377 glsl shader/02.transformation; #X obj 39 399 loadbang; diff --git a/examples/15.openGL3.2/03.matrix.pd b/examples/15.openGL3.2/03.matrix.pd index 9a8b325f9..3e064ef8d 100644 --- a/examples/15.openGL3.2/03.matrix.pd +++ b/examples/15.openGL3.2/03.matrix.pd @@ -144,7 +144,7 @@ #X msg 843 193 -4 4 -4 4 0 20; #X text 853 399 fovY (field of view) \, aspect ratio \, nearZ \, farZ; #X text 840 378 perspective projection :; -#X text 838 162 orthographique projection :; +#X text 838 162 orthographic projection :; #X obj 1233 413 /; #X obj 1232 272 r __gem; #X obj 1232 297 route dimen; @@ -169,7 +169,7 @@ #X obj 27 598 s shader_matrix; #X obj 287 596 s shader_matrix; #X obj 814 670 s shader_matrix; -#X text 27 35 The model matrix combine the geometry transformation. It can be computed with specific library \, or with standard openGL object., f 30; +#X text 27 35 The model matrix combines the geometry transformations. It can be computed with a specific library \, or with standard openGL objects., f 30; #N canvas 234 350 511 439 build_perspective 0; #X obj 37 24 inlet; #X obj 37 108 * 0.5; @@ -223,8 +223,8 @@ #X connect 21 0 16 3; #X connect 22 0 6 0; #X restore 843 484 pd build_perspective; -#X text 274 38 The view matrix represent the camera position and orientation. It can be set via message to the gemwin object, f 31; -#X text 535 34 Since the shader need only the multiplication of the model matrix and the view matrix \, you can get this combination directly : (not used in this example), f 35; +#X text 274 38 The view matrix represents the camera position and orientation. It can be set via a message to the gemwin object, f 31; +#X text 535 34 Since the shader needs only the multiplication of the model matrix and the view matrix \, you can get this combination directly : (not used in this example), f 35; #N canvas 130 82 1016 644 shader 0; #X obj 53 27 gemhead; #X obj 65 164 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; @@ -235,7 +235,7 @@ #X obj 53 79 translateXYZ; #X floatatom 76 53 5 0 0 0 - - - 0; #X obj 133 150 r shader_matrix; -#X text 119 52 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117; +#X text 119 52 <- this is useless since the shader can't access the transformation matrix. See next patch for more explanations, f 117; #X msg 229 283 program \$1; #X obj 229 432 print vb; #X obj 197 408 t a a; @@ -302,8 +302,8 @@ #X connect 38 0 33 0; #X restore 1228 514 pd shader; #X obj 1228 550 _gemwin; -#X text 27 8 This patch create the various matrix used by the rendering pipeline, f 103; -#X text 834 28 The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance).represent the camera; +#X text 27 8 This patch creates the various matrices used by the rendering pipeline, f 103; +#X text 834 28 The projection matrix transforms 3D coordinates from view space to clip space \, defining what is visible to the camera. It determines how objects are projected onto the 2D screen \, either with perspective effects (objects appear smaller with distance) or orthographically (maintaining consistent size regardless of distance). it represents the camera; #X msg 843 427 1.57 1 0 20; #X text 948 429 Gem wild angle; #X text 1264 321 real gemwin aspect ratio; diff --git a/examples/15.openGL3.2/04.model.pd b/examples/15.openGL3.2/04.model.pd index 2f0ea336d..5e7967684 100644 --- a/examples/15.openGL3.2/04.model.pd +++ b/examples/15.openGL3.2/04.model.pd @@ -143,7 +143,7 @@ #X obj 267 698 gemvertexbuffer \; draw tri; #X obj 267 400 glsl shader/04.model; #X obj 287 369 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; -#X text 259 19 modelfiler load a 3d object into tables. The pipeline is unchange regarding previous examples, f 93; +#X text 259 19 modelfiler loads a 3d object into tables. The pipeline is unchanges regarding the previous examples, f 93; #X msg 384 472 attribute positionX table_posX \, attribute positionY table_posY \, attribute positionZ table_posZ \, attribute colorR table_colorR \, attribute colorG table_colorG \, attribute colorB table_colorB, f 67; #X obj 31 461 loadbang; #X obj 31 561 textfile; diff --git a/examples/15.openGL3.2/07.geometry.pd b/examples/15.openGL3.2/07.geometry.pd index 8a603f262..ec02a6a61 100644 --- a/examples/15.openGL3.2/07.geometry.pd +++ b/examples/15.openGL3.2/07.geometry.pd @@ -119,15 +119,15 @@ #X text 529 13 version >=410; #X text 501 370 GL_PATCHES for teselarisation; #X text 754 9 version >=420; -#X obj 714 5 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; -#X obj 474 7 cnv 18 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; +#X obj 714 5 cnv 2 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; +#X obj 474 7 cnv 2 2 600 empty empty empty 20 12 0 10 #202020 #404040 0; #X text 744 461 invocations; #X restore 981 576 pd drawing_type; #X obj 40 462 loadbang; #X obj 60 510 textfile; #X obj 60 565 textfile; #X obj 60 615 textfile; -#X text 449 12 This example introduce a simple geometry shader; +#X text 449 12 This example introduces a simple geometry shader; #X obj 167 53 table \$0_position 12; #X obj 167 74 table \$0_color 12; #X obj 167 95 table \$0_normal 12; @@ -139,7 +139,7 @@ #X msg 60 542 read shader/07.geometry.geom cr; #X msg 60 592 read shader/07.geometry.vert cr; #X obj 333 266 glsl shader/07.geometry; -#X text 422 39 A geometry shader sits between the vertex and fragment shaders in the graphics pipeline \, allowing for the creation \, modification \, or removal of primitives to dynamically generate new geometry based on the input vertices., f 80; +#X text 422 39 A geometry shader sits between the vertex and fragment shaders in the graphics pipeline \, allowing for the creation \, modification \, or removal of primitives to dynamically generate new geometries based on the input vertices., f 80; #X connect 0 0 1 0; #X connect 2 0 31 0; #X connect 3 0 8 0; diff --git a/examples/15.openGL3.2/08.adjacency.pd b/examples/15.openGL3.2/08.adjacency.pd index ae4130b39..353b4252f 100644 --- a/examples/15.openGL3.2/08.adjacency.pd +++ b/examples/15.openGL3.2/08.adjacency.pd @@ -105,9 +105,9 @@ #X obj 35 270 table \$0_positionX 10; #X obj 328 569 gemvertexbuffer \; resize 10 \; draw linestripadj; #X obj 455 488 metro 50; -#X text 480 465 <- switch on to update the positoin \, and play with the tab ->, f 64; -#X text 449 12 This example introduce adjacency; -#X text 323 32 This shader demonstrates cubic interpolation using adjacency information in a geometry shader. It takes a sequence of points and creates a smooth curved line passing through them \, using neighboring points to calculate the curve's trajectory., f 94; +#X text 480 465 <- switch on to update the position \, and play with the tab ->, f 64; +#X text 449 12 This example introduces adjacency; +#X text 323 32 This shader demonstrates cubic interpolation using adjacency information in a geometry shader. It takes a sequence of points and creates a smooth curved line passing through them \, using neighbouring points to calculate the curve's trajectory., f 94; #X text 321 85 The vertex shader passes the input points to the geometry shader \, which uses the GL_LINES_ADJACENCY primitive type to access four consecutive vertices at once. For each set of four points \, it performs cubic interpolation to generate a smooth curve segment between the middle two points \, while using the outer points to influence the curvature., f 94; #X obj 328 209 glsl shader/08.adjacency; #X msg 60 486 read shader/08.adjacency.frag cr; diff --git a/examples/15.openGL3.2/09.tesel.pd b/examples/15.openGL3.2/09.tesel.pd index 4c02c61c2..b87c3977d 100644 --- a/examples/15.openGL3.2/09.tesel.pd +++ b/examples/15.openGL3.2/09.tesel.pd @@ -90,7 +90,7 @@ #X msg 119 451 print; #X msg 122 506 print; #X msg 123 554 print; -#X text 453 11 This example introduce teselarisation shader; +#X text 453 11 This example introduces tessellation shaders; #X obj 302 328 glsl shader/09.tesel; #X obj 302 277 GEMglPatchParameteri 3; #X obj 37 218 s \$0_position; diff --git a/examples/15.openGL3.2/shader/01.basic.vert b/examples/15.openGL3.2/shader/01.basic.vert index 88ec8aca4..0255b675d 100644 --- a/examples/15.openGL3.2/shader/01.basic.vert +++ b/examples/15.openGL3.2/shader/01.basic.vert @@ -18,7 +18,7 @@ out vec3 Color_to_frag; void main() { Color_to_frag = color; - // initialise the variable to pass to the frag shader with data comming from the VBO + // initialise the variable to pass to the frag shader with data coming from the VBO gl_Position = vec4(position,1.0); // update vertex position from the VBO; // No perspective is apply in this example diff --git a/examples/15.openGL3.2/shader/02.transformation.vert b/examples/15.openGL3.2/shader/02.transformation.vert index 686f893c0..c71a4c166 100644 --- a/examples/15.openGL3.2/shader/02.transformation.vert +++ b/examples/15.openGL3.2/shader/02.transformation.vert @@ -14,7 +14,7 @@ layout (location=1) in vec3 color; uniform mat4 transformation_matrix; // The transformation matrix we want to apply to the vertex. // The shader did not receive the transformation matrix from the pipeline, -// so we need to creater one and pass it as an argument. +// so we need to create one and pass it as an argument. // In this example, we use gemlist_matrix in the patch to get the transformation matrix. // The perspective matrix (set with the perspec message to gemwin) is not used. @@ -25,7 +25,7 @@ out vec3 Color_to_frag; void main() { Color_to_frag = color; - // initialise the variable to pass to the frag shader with data comming from the VBO + // initialise the variable to pass to the frag shader with data coming from the VBO gl_Position = transformation_matrix * vec4(position,1.0); // update vertex position from the VBO // No perspective is apply in this example From 35632400f88656679ce2088c577d3ec98d8496cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 14:59:06 +0200 Subject: [PATCH 358/387] renamed "09.tesel" to "09.tesselation" and add new examples to build system --- .../{09.tesel.pd => 09.tessellation.pd} | 12 +++--- .../{09.tesel.frag => 09.tessellation.frag} | 0 .../{09.tesel.tesc => 09.tessellation.tesc} | 0 .../{09.tesel.tese => 09.tessellation.tese} | 0 .../{09.tesel.vert => 09.tessellation.vert} | 0 examples/Makefile.am | 43 +++++++++++++------ 6 files changed, 37 insertions(+), 18 deletions(-) rename examples/15.openGL3.2/{09.tesel.pd => 09.tessellation.pd} (75%) rename examples/15.openGL3.2/shader/{09.tesel.frag => 09.tessellation.frag} (100%) rename examples/15.openGL3.2/shader/{09.tesel.tesc => 09.tessellation.tesc} (100%) rename examples/15.openGL3.2/shader/{09.tesel.tese => 09.tessellation.tese} (100%) rename examples/15.openGL3.2/shader/{09.tesel.vert => 09.tessellation.vert} (100%) diff --git a/examples/15.openGL3.2/09.tesel.pd b/examples/15.openGL3.2/09.tessellation.pd similarity index 75% rename from examples/15.openGL3.2/09.tesel.pd rename to examples/15.openGL3.2/09.tessellation.pd index b87c3977d..9a1eded5b 100644 --- a/examples/15.openGL3.2/09.tesel.pd +++ b/examples/15.openGL3.2/09.tessellation.pd @@ -91,20 +91,20 @@ #X msg 122 506 print; #X msg 123 554 print; #X text 453 11 This example introduces tessellation shaders; -#X obj 302 328 glsl shader/09.tesel; +#X obj 302 328 glsl shader/09.tessellation; #X obj 302 277 GEMglPatchParameteri 3; #X obj 37 218 s \$0_position; #X msg 37 196 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0; #X obj 302 578 gemvertexbuffer \; resize 3 \; draw patches; #X msg 431 434 attribute position \$1_position, f 32; #X obj 37 259 table \$0_position 9; -#X msg 60 426 read shader/09.tesel.vert cr; +#X msg 60 426 read shader/09.tessellation.vert cr; #X obj 60 605 textfile; #X msg 123 604 print; -#X msg 60 480 read shader/09.tesel.tesc cr; -#X msg 60 532 read shader/09.tesel.tese cr; -#X msg 60 582 read shader/09.tesel.frag cr; -#X text 283 34 This shader pipeline performs tessellation on a triangle primitive. Here's how it works: \; \; - The vertex shader (09.tesel.vert) passes the original triangle vertices without modification. \; - The tessellation control shader (09.tesel.tesc) sets up tessellation levels (5.0 for inner and outer edges) and passes vertex data to the tessellation evaluation shader. \; - The tessellation evaluation shader (09.tesel.tese) subdivides the triangle into smaller triangles based on the tessellation levels and interpolates positions and normals for each new vertex. It also calculates pseudo random colors for each new vertex using cosine functions based on position. \; - Finally \, the fragment shader (09.tesel.frag) renders each fragment with the color computed during tessellation. \; \; The result is a single triangle subdivided into many smaller triangles with a procedural color pattern that creates a visual effect with color variations based on position., f 94; +#X msg 60 480 read shader/09.tessellation.tesc cr; +#X msg 60 532 read shader/09.tessellation.tese cr; +#X msg 60 582 read shader/09.tessellation.frag cr; +#X text 283 34 This shader pipeline performs tessellation on a triangle primitive. Here's how it works: \; \; - The vertex shader (09.tessellation.vert) passes the original triangle vertices without modification. \; - The tessellation control shader (09.tessellation.tesc) sets up tessellation levels (5.0 for inner and outer edges) and passes vertex data to the tessellation evaluation shader. \; - The tessellation evaluation shader (09.tessellation.tese) subdivides the triangle into smaller triangles based on the tessellation levels and interpolates positions and normals for each new vertex. It also calculates pseudo random colors for each new vertex using cosine functions based on position. \; - Finally \, the fragment shader (09.tessellation.frag) renders each fragment with the color computed during tessellation. \; \; The result is a single triangle subdivided into many smaller triangles with a procedural color pattern that creates a visual effect with color variations based on position., f 94; #X connect 0 0 1 0; #X connect 2 0 24 0; #X connect 3 0 8 0; diff --git a/examples/15.openGL3.2/shader/09.tesel.frag b/examples/15.openGL3.2/shader/09.tessellation.frag similarity index 100% rename from examples/15.openGL3.2/shader/09.tesel.frag rename to examples/15.openGL3.2/shader/09.tessellation.frag diff --git a/examples/15.openGL3.2/shader/09.tesel.tesc b/examples/15.openGL3.2/shader/09.tessellation.tesc similarity index 100% rename from examples/15.openGL3.2/shader/09.tesel.tesc rename to examples/15.openGL3.2/shader/09.tessellation.tesc diff --git a/examples/15.openGL3.2/shader/09.tesel.tese b/examples/15.openGL3.2/shader/09.tessellation.tese similarity index 100% rename from examples/15.openGL3.2/shader/09.tesel.tese rename to examples/15.openGL3.2/shader/09.tessellation.tese diff --git a/examples/15.openGL3.2/shader/09.tesel.vert b/examples/15.openGL3.2/shader/09.tessellation.vert similarity index 100% rename from examples/15.openGL3.2/shader/09.tesel.vert rename to examples/15.openGL3.2/shader/09.tessellation.vert diff --git a/examples/Makefile.am b/examples/Makefile.am index 5eeb90614..f7cf67a64 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -223,18 +223,37 @@ nobase_dist_gemexamples_DATA = \ 14.multiple_windows/01.basic_example.pd \ 14.multiple_windows/02.switch_context.pd \ 14.multiple_windows/03.texture_sharing.pd \ - 15.GLSL4/01.basic.pd \ - 15.GLSL4/02.transformation.pd \ - 15.GLSL4/03.texture.pd \ - 15.GLSL4/shader/01.basic.frag \ - 15.GLSL4/shader/01.basic.vert \ - 15.GLSL4/shader/02.transformation.frag \ - 15.GLSL4/shader/02.transformation.vert \ - 15.GLSL4/shader/03.texture.frag \ - 15.GLSL4/shader/03.texture.vert \ - 15.GLSL4/04.model.pd \ - 15.GLSL4/shader/04.model.vert \ - 15.GLSL4/shader/04.model.frag \ + 15.openGL3.2/01.basic.pd \ + 15.openGL3.2/02.transformation.pd \ + 15.openGL3.2/03.matrix.pd \ + 15.openGL3.2/04.model.pd \ + 15.openGL3.2/05.texture.pd \ + 15.openGL3.2/06.lighting.pd \ + 15.openGL3.2/07.geometry.pd \ + 15.openGL3.2/08.adjacency.pd \ + 15.openGL3.2/09.tessellation.pd \ + 15.openGL3.2/shader/01.basic.frag \ + 15.openGL3.2/shader/01.basic.vert \ + 15.openGL3.2/shader/02.transformation.frag \ + 15.openGL3.2/shader/02.transformation.vert \ + 15.openGL3.2/shader/03.matrix.frag \ + 15.openGL3.2/shader/03.matrix.vert \ + 15.openGL3.2/shader/04.model.frag \ + 15.openGL3.2/shader/04.model.vert \ + 15.openGL3.2/shader/05.texture.frag \ + 15.openGL3.2/shader/05.texture.vert \ + 15.openGL3.2/shader/06.light.frag \ + 15.openGL3.2/shader/06.light.vert \ + 15.openGL3.2/shader/07.geometry.frag \ + 15.openGL3.2/shader/07.geometry.geom \ + 15.openGL3.2/shader/07.geometry.vert \ + 15.openGL3.2/shader/08.adjacency.frag \ + 15.openGL3.2/shader/08.adjacency.geom \ + 15.openGL3.2/shader/08.adjacency.vert \ + 15.openGL3.2/shader/09.tessellation.frag \ + 15.openGL3.2/shader/09.tessellation.tesc \ + 15.openGL3.2/shader/09.tessellation.tese \ + 15.openGL3.2/shader/09.tessellation.vert \ 99.games/puzzle.pd \ data/img1.jpg \ data/img2.jpg \ From bd1d59955144b143a6904f1c2e7c2ae019fc3c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 15:00:19 +0200 Subject: [PATCH 359/387] cleanup --- examples/15.openGL3.2/09.tessellation.pd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/15.openGL3.2/09.tessellation.pd b/examples/15.openGL3.2/09.tessellation.pd index 9a1eded5b..9b31b2178 100644 --- a/examples/15.openGL3.2/09.tessellation.pd +++ b/examples/15.openGL3.2/09.tessellation.pd @@ -79,7 +79,7 @@ #X obj 431 516 t a a; #X obj 37 174 loadbang; #X obj 431 410 f \$0; -#X obj 451 339 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; +#X obj 481 346 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X floatatom 431 364 5 0 0 0 - - - 0; #X obj 431 387 t b f; #X obj 314 303 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; From f5d0dcda0ebf51dc8ea5ab3bf0e36e06da8bb5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 15:49:18 +0200 Subject: [PATCH 360/387] Add modelfiler-help to the buildsystem --- help/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/help/Makefile.am b/help/Makefile.am index 776507b2d..69cc59a4a 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -73,6 +73,7 @@ dist_gemhelp_DATA += \ mesh_line-help.pd \ mesh_square-help.pd \ model-help.pd \ + modelfiler-help.pd \ multimodel-help.pd \ newWave-help.pd \ ortho-help.pd \ From c99d1e6e635a822f094cd9c0b6280e98b7b8dbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 16:13:56 +0200 Subject: [PATCH 361/387] [modelfiler]-help use explicit tablenames --- help/modelfiler-help.pd | 80 +++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/help/modelfiler-help.pd b/help/modelfiler-help.pd index 5d4a73ba3..428606376 100644 --- a/help/modelfiler-help.pd +++ b/help/modelfiler-help.pd @@ -10,21 +10,19 @@ #X text 17 181 Arguments:; #X text 452 8 GEM object; #X obj 474 96 cnv 15 220 430 empty empty empty 20 12 0 14 #64fc64 #404040 0; -#X text 33 14 Synopsis: [model]; -#X text 7 79 Description: Renders an Alias/Wavefront-Model.; #X text 63 192 optional: name of a OBJ-file to be loaded; #X obj 474 533 cnv 15 80 30 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 477 107 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X obj 477 125 openpanel; #X msg 477 146 open \$1; #X text 27 260 Inlet 1: message: open ; -#X msg 506 384 backend OBJ; -#X msg 515 404 backend ASSIMP3; +#X msg 506 394 backend OBJ; +#X msg 515 414 backend ASSIMP3; #X text 27 342 Inlet 1: message: backend :: choose which backend to use first to open the model; -#X msg 513 427 backend; +#X msg 513 437 backend; #X obj 477 225 t a; -#X text 550 451 query backends; -#X obj 494 454 t a; +#X text 550 461 query backends; +#X obj 494 464 t a; #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; #X text 10 135 AUTHOR IOhannes m zmölnig; @@ -62,10 +60,7 @@ #X connect 10 0 16 0; #X restore 353 468 pd properties; #X obj 477 539 modelfiler; -#X msg 569 427 loader; -#X msg 515 214 position table_pos; -#X msg 527 240 color table_color; -#X msg 539 269 normal table_normal; +#X msg 569 437 loader; #X obj 13 508 table table_posX; #X obj 13 528 table table_posY; #X obj 13 549 table table_posZ; @@ -77,33 +72,48 @@ #X obj 238 548 table table_colorB; #X msg 495 172 open ../examples/data/venus.obj; #X obj 477 574 print; -#X obj 489 340 t a; -#X text 16 96 The model object load a 3D-models that are saved in Alias/Wavefront's OBJ-format into various tables.; -#X text 27 277 Inlet 1 : message: position tablename; -#X text 27 293 Inlet 1 : message: color tablename; -#X text 27 309 Inlet 1 : message: normal tablename; +#X obj 489 360 t a; #X obj 507 505 r \$0-ctl; -#X text 28 324 Inlet 1 : message: texture tablename; #X text 13 384 Outlets:; -#X text 33 409 Outlet 1 : vertices float : number of vertices copied to table; #X obj 238 568 table table_colorA; #X obj 354 508 table table_texU; #X obj 354 528 table table_texV; -#X msg 554 295 texture table_tex; -#X connect 14 0 15 0; -#X connect 15 0 16 0; +#X text 7 79 Description: loads a 3D model into a table; +#X text 33 14 Synopsis: [modelfiler]; +#X msg 515 204 symbol table_pos; +#X msg 515 224 position \$1X \$1Y \$1Z; +#X msg 527 250 symbol table_color; +#X msg 527 270 color \$1R \$1G \$1B \$1A; +#X msg 534 296 symbol table_normal; +#X msg 534 316 normal \$1X \$1Y \$1Z; +#X msg 564 342 symbol table_tex; +#X msg 564 362 texture \$1U \$1V; +#X text 45 607 see also:; +#X obj 113 605 gemvertexbuffer; +#X text 33 409 Outlet 1 : vertices float : number of vertices copied to tables; +#X text 27 277 Inlet 1 : message: position ; +#X text 27 293 Inlet 1 : message: color ; +#X text 27 309 Inlet 1 : message: normal ; +#X text 28 324 Inlet 1 : message: texture ; +#X text 16 96 The [modelfilter] object loads the data from a 3D model into various tables \, so they can be used e.g. with VBOs (e.g. [gemvertexbuffer]); +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 14 0 20 0; #X connect 16 0 22 0; -#X connect 18 0 24 0; -#X connect 19 0 24 0; -#X connect 21 0 24 0; -#X connect 22 0 29 0; -#X connect 24 0 29 0; -#X connect 29 0 44 0; -#X connect 30 0 24 0; -#X connect 31 0 45 0; -#X connect 32 0 45 0; -#X connect 33 0 45 0; -#X connect 43 0 22 0; -#X connect 45 0 29 0; -#X connect 50 0 29 0; -#X connect 57 0 45 0; +#X connect 17 0 22 0; +#X connect 19 0 22 0; +#X connect 20 0 27 0; +#X connect 22 0 27 0; +#X connect 27 0 39 0; +#X connect 28 0 22 0; +#X connect 38 0 20 0; +#X connect 40 0 27 0; +#X connect 41 0 27 0; +#X connect 48 0 49 0; +#X connect 49 0 40 0; +#X connect 50 0 51 0; +#X connect 51 0 40 0; +#X connect 52 0 53 0; +#X connect 53 0 40 0; +#X connect 54 0 55 0; +#X connect 55 0 40 0; From 648c67c0cf01d79672bb4c513a7ae1727810fb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 22 Apr 2025 16:20:21 +0200 Subject: [PATCH 362/387] GLSL/04.model use explicit tablenames for [modelfiler] --- examples/15.openGL3.2/04.model.pd | 54 ++++++++++++++++--------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/examples/15.openGL3.2/04.model.pd b/examples/15.openGL3.2/04.model.pd index 5e7967684..1dbc6857d 100644 --- a/examples/15.openGL3.2/04.model.pd +++ b/examples/15.openGL3.2/04.model.pd @@ -100,12 +100,10 @@ #X obj 28 195 table table_colorR; #X obj 28 215 table table_colorG; #X obj 28 235 table table_colorB; +#X obj 28 255 table table_colorA; #X restore 42 229 pd table; #N canvas 1279 243 543 538 modelfiler 0; #X obj 81 277 modelfiler; -#X msg 106 132 position table_pos; -#X msg 118 158 color table_color; -#X msg 136 212 normal table_normal; #X obj 81 25 loadbang; #X obj 144 24 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000; #X msg 81 95 open ../data/venus.obj; @@ -113,31 +111,35 @@ #X msg 81 332 resize \$1; #X obj 81 55 t b b b; #X msg 201 361 sinesum 8192 0.5 0.25 0.25 0 0.2; -#X obj 91 419 s table_colorR; -#X obj 91 449 s table_colorG; -#X obj 91 479 s table_colorB; -#X msg 219 383 sinesum 8192 0.5 -0.25 0.25 0 0.2; -#X msg 235 409 sinesum 8192 0.5 0.25 -0.25 0 0.2; -#X connect 0 0 7 0; -#X connect 1 0 0 0; -#X connect 2 0 0 0; +#X obj 81 419 s table_colorR; +#X obj 100 449 s table_colorG; +#X obj 120 479 s table_colorB; +#X msg 220 383 sinesum 8192 0.5 -0.25 0.25 0 0.2; +#X msg 240 409 sinesum 8192 0.5 0.25 -0.25 0 0.2; +#X msg 100 140 list table_pos table_color table_normal; +#X msg 100 163 position \$1X \$1Y \$1Z \, color \$2R \$2G \$2B \$2A \, normal \$3X \$3Y \$3Z, f 22; +#X obj 201 338 t b b b; +#X obj 81 355 t a a a; +#X connect 0 0 4 0; +#X connect 1 0 6 0; +#X connect 2 0 6 0; #X connect 3 0 0 0; -#X connect 4 0 9 0; -#X connect 5 0 9 0; -#X connect 6 0 0 0; +#X connect 4 0 5 0; +#X connect 5 0 16 0; +#X connect 6 0 3 0; +#X connect 6 1 13 0; +#X connect 6 2 15 0; #X connect 7 0 8 0; -#X connect 8 0 11 0; -#X connect 8 0 12 0; -#X connect 8 0 13 0; -#X connect 9 0 6 0; -#X connect 9 1 1 0; -#X connect 9 1 3 0; -#X connect 9 2 10 0; -#X connect 9 2 14 0; -#X connect 9 2 15 0; -#X connect 10 0 11 0; -#X connect 14 0 12 0; -#X connect 15 0 13 0; +#X connect 11 0 9 0; +#X connect 12 0 10 0; +#X connect 13 0 14 0; +#X connect 14 0 0 0; +#X connect 15 0 7 0; +#X connect 15 1 11 0; +#X connect 15 2 12 0; +#X connect 16 0 8 0; +#X connect 16 1 9 0; +#X connect 16 2 10 0; #X restore 40 259 pd modelfiler; #X obj 528 205 scaleXYZ 0.003 0.003 0.003; #X obj 267 698 gemvertexbuffer \; draw tri; From 7dcd52a6d7120dd750379b78ab641cb90c65c230 Mon Sep 17 00:00:00 2001 From: chnry Date: Tue, 22 Apr 2025 21:15:06 +0200 Subject: [PATCH 363/387] use the correct drawing mode for the 1st part of the sphere --- src/Geos/sphere.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Geos/sphere.cpp b/src/Geos/sphere.cpp index 861d14e6e..ef735f720 100644 --- a/src/Geos/sphere.cpp +++ b/src/Geos/sphere.cpp @@ -242,6 +242,9 @@ void sphere :: renderShape(GemState *state) oldTexture = texType; } + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, type); + src = 0; if (!texType) { /* draw +Z end as a triangle fan */ @@ -269,9 +272,6 @@ void sphere :: renderShape(GemState *state) imax = stacks - 1; } - glPushAttrib(GL_POLYGON_BIT); - glPolygonMode(GL_FRONT_AND_BACK, type); - /* draw intermediate stacks as quad strips */ for (i = imin; i < imax; i++) { glBegin(GL_QUAD_STRIP); From 20e29f7bde8b75f16eb9b90c28bd62b29975efb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 23 Apr 2025 14:58:00 +0200 Subject: [PATCH 364/387] drop ambient/shininess/specular from [gemwin] Closes: https://github.com/umlaeute/Gem/issues/220 --- abstractions/gemwin.pd | 50 ++---------------- help/gemwin-help.pd | 115 ++++++++--------------------------------- 2 files changed, 24 insertions(+), 141 deletions(-) diff --git a/abstractions/gemwin.pd b/abstractions/gemwin.pd index 2d4c67a88..126b93fe8 100644 --- a/abstractions/gemwin.pd +++ b/abstractions/gemwin.pd @@ -667,50 +667,18 @@ #X connect 1 0 2 0; #X connect 3 0 0 0; #X restore 118 54 pd reset; -#N canvas 0 50 975 410 lighting 0; +#N canvas 940 756 975 410 lighting 0; #X obj 97 48 inlet; #X obj 97 69 route lighting ambient specular shininess; #X obj 97 97 i; #X obj 97 122 > 0; #X obj 97 149 s \$0-lighting; -#X obj 488 53 r \$0-reset; -#X msg 204 215 0.1 0.1 0.1 1; -#X obj 84 213 pack 0 0 0 1; -#X obj 84 186 t l b; -#X msg 165 188 1; -#X obj 84 234 s \$0-ambient; -#X obj 84 289 pack 0 0 0 1; -#X obj 84 262 t l b; -#X msg 165 264 1; -#X msg 273 255 1 1 1 1; -#X obj 84 314 s \$0-specular; -#X msg 543 128 100; -#X obj 436 133 f; -#X obj 436 159 s \$0-shininess; #X obj 356 48 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; -#X connect 1 1 8 0; -#X connect 1 2 12 0; -#X connect 1 3 17 0; -#X connect 1 4 19 0; +#X connect 1 4 5 0; #X connect 2 0 3 0; #X connect 3 0 4 0; -#X connect 5 0 6 0; -#X connect 5 0 14 0; -#X connect 5 0 16 0; -#X connect 6 0 8 0; -#X connect 7 0 10 0; -#X connect 8 0 7 0; -#X connect 8 1 9 0; -#X connect 9 0 7 3; -#X connect 11 0 15 0; -#X connect 12 0 11 0; -#X connect 12 1 13 0; -#X connect 13 0 11 3; -#X connect 14 0 12 0; -#X connect 16 0 17 0; -#X connect 17 0 18 0; #X restore 118 193 pd lighting; #N canvas 0 106 1001 529 window 0; #X obj 111 53 inlet; @@ -1302,26 +1270,14 @@ #X obj 179 65 t b b; #X obj 179 88 GLdefine GL_FRONT_AND_BACK; #X obj 206 117 GLdefine GL_DIFFUSE; -#X obj 61 211 GEMglMaterialfv GL_FRONT_AND_BACK GL_AMBIENT 0.1 0.1 0.1 1; -#X obj 426 211 r \$0-ambient; -#X obj 61 251 GEMglMaterialfv GL_FRONT_AND_BACK GL_SPECULAR 1 1 1 1; -#X obj 427 251 r \$0-specular; -#X obj 61 281 GEMglMaterialfv GL_FRONT_AND_BACK GL_SHININESS 100; -#X obj 426 281 r \$0-shininess; #X connect 0 0 3 0; -#X connect 2 0 8 0; +#X connect 2 0 1 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 6 0 3 1; #X connect 7 0 3 2; -#X connect 8 0 10 0; -#X connect 9 0 8 3; -#X connect 10 0 12 0; -#X connect 11 0 10 3; -#X connect 12 0 1 0; -#X connect 13 0 12 3; #X restore 391 286 pd color_material; #X f 28; #X floatatom 327 133 5 0 0 0 - - - 0; diff --git a/help/gemwin-help.pd b/help/gemwin-help.pd index dc0b8807c..785375165 100644 --- a/help/gemwin-help.pd +++ b/help/gemwin-help.pd @@ -1,4 +1,4 @@ -#N canvas 126 111 676 689 10; +#N canvas 596 196 676 689 10; #X declare -lib Gem; #X text 452 8 GEM object; #X obj 7 193 cnv 15 430 480 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; @@ -129,69 +129,14 @@ #X connect 17 0 14 0; #X restore 30 367 pd more window properties; #X text 29 558 lighting 0|1 : turn lighting off/on (default:0); -#N canvas 190 228 580 527 more 0; +#N canvas 742 344 580 384 more 0; #X text 105 134 lighting 1/0 : turn lighting on/off; -#X text 263 186 ambient R G B : the ambient lighting color; -#X text 269 240 specular R G B : the specular lighting color; -#X text 197 277 shininess num : the shininess value; -#X text 132 326 fogmode 0/1/2/3 : set the fog mode (OFF/LINEAR/EXP/EXP^2); -#X text 298 447 fogcolor R G B : the color of the fog; -#X text 219 367 fog num : the fog density; +#X text 132 196 fogmode 0/1/2/3 : set the fog mode (OFF/LINEAR/EXP/EXP^2); +#X text 298 317 fogcolor R G B : the color of the fog; +#X text 219 237 fog num : the fog density; #X text 24 11 messages to the [gemwin] regarding lighting effects; #X obj 24 116 tgl 15 0 empty empty empty 0 -6 0 10 #fcfcfc #000000 #000000 0 1; #X msg 24 134 lighting \$1; -#N canvas 714 134 566 458 color 0; -#X obj 103 100 hsl 128 15 0 1 0 0 empty empty R 12 8 1 12 #fce0e0 #000000 #000000 0 1; -#X obj 236 100 hsl 128 15 0 1 0 0 empty empty G 12 8 1 12 #d8fcd8 #000000 #000000 0 1; -#X obj 370 100 hsl 128 15 0 1 0 0 empty empty B 12 8 1 12 #dce4fc #000000 #000000 0 1; -#X obj 100 329 outlet; -#X obj 132 253 list; -#X msg 132 273 set ambient \$1 \$2 \$3; -#X obj 233 144 t b f; -#X obj 367 144 t b f; -#X obj 100 201 pack 0 0 0; -#X obj 100 230 t b a; -#X connect 0 0 8 0; -#X connect 1 0 6 0; -#X connect 2 0 7 0; -#X connect 4 0 5 0; -#X connect 5 0 3 0; -#X connect 6 0 8 0; -#X connect 6 1 8 1; -#X connect 7 0 8 0; -#X connect 7 1 8 2; -#X connect 8 0 9 0; -#X connect 9 0 3 0; -#X connect 9 1 4 0; -#X coords 0 -1 1 1 400 13 1 100 100; -#X restore 35 165 pd color sliders; -#X msg 35 187 ambient 0 0 0; -#N canvas 714 134 566 366 color 0; -#X obj 103 100 hsl 128 15 0 1 0 0 empty empty R 12 8 1 12 #fce0e0 #000000 #000000 0 1; -#X obj 236 100 hsl 128 15 0 1 0 0 empty empty G 12 8 1 12 #d8fcd8 #000000 #000000 0 1; -#X obj 370 100 hsl 128 15 0 1 0 0 empty empty B 12 8 1 12 #dce4fc #000000 #000000 0 1; -#X obj 100 299 outlet; -#X obj 132 223 list; -#X msg 132 242 set specular \$1 \$2 \$3; -#X obj 233 124 t b f; -#X obj 367 124 t b f; -#X obj 100 171 pack 0 0 0; -#X obj 100 199 t b a; -#X connect 0 0 8 0; -#X connect 1 0 6 0; -#X connect 2 0 7 0; -#X connect 4 0 5 0; -#X connect 5 0 3 0; -#X connect 6 0 8 0; -#X connect 6 1 8 1; -#X connect 7 0 8 0; -#X connect 7 1 8 2; -#X connect 8 0 9 0; -#X connect 9 0 3 0; -#X connect 9 1 4 0; -#X coords 0 -1 1 1 400 13 1 100 100; -#X restore 42 219 pd color sliders; -#X msg 42 241 specular 0 0 0; #N canvas 710 134 570 462 color 0; #X obj 103 100 hsl 128 15 0 1 0 0 empty empty R 12 8 1 12 #fce0e0 #000000 #000000 0 1; #X obj 236 100 hsl 128 15 0 1 0 0 empty empty G 12 8 1 12 #d8fcd8 #000000 #000000 0 1; @@ -216,9 +161,9 @@ #X connect 9 0 3 0; #X connect 9 1 4 0; #X coords 0 -1 1 1 400 13 1 100 100; -#X restore 54 426 pd color sliders; -#X msg 54 448 fogcolor 0 0 0; -#X msg 59 338 fogmode 0; +#X restore 54 296 pd color sliders; +#X msg 54 318 fogcolor 0 0 0; +#X msg 59 208 fogmode 0; #N canvas 889 134 348 479 fog 0; #X obj 84 239 outlet; #X obj 100 101 hradio 15 1 0 4 empty empty empty 0 -6 0 10 #fcfcfc #000000 #000000 0; @@ -229,20 +174,8 @@ #X connect 3 0 0 0; #X connect 3 1 2 0; #X coords 0 -1 1 1 60 13 1 100 100; -#X restore 59 314 pd fog; -#X msg 50 288 shininess 0; -#N canvas 889 134 356 487 fog 0; -#X obj 84 239 outlet; -#X obj 84 140 trigger bang float; -#X msg 207 182 set shininess \$1; -#X obj 103 101 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 10 #fcfcfc #000000 #000000 0 1; -#X connect 1 0 0 0; -#X connect 1 1 2 0; -#X connect 2 0 0 0; -#X connect 3 0 1 0; -#X coords 0 -1 1 1 133 13 1 100 100; -#X restore 50 266 pd fog; -#X msg 60 388 fog 0; +#X restore 59 184 pd fog; +#X msg 60 258 fog 0; #N canvas 889 134 364 495 fog 0; #X obj 84 239 outlet; #X obj 84 140 trigger bang float; @@ -253,26 +186,20 @@ #X connect 2 0 1 0; #X connect 3 0 0 0; #X coords 0 -1 1 1 133 13 1 100 100; -#X restore 60 366 pd fog; +#X restore 60 236 pd fog; #X obj 24 68 gemhead; #X obj 24 90 world_light; -#X obj 24 475 s \$0-gemwin-in; +#X obj 24 345 s \$0-gemwin-in; #X text 23 34 Be careful: when you activate lighting \, you must have some lights to see something \, such as:; -#X connect 8 0 9 0; -#X connect 9 0 24 0; -#X connect 10 0 11 0; -#X connect 11 0 24 0; -#X connect 12 0 13 0; -#X connect 13 0 24 0; -#X connect 14 0 15 0; -#X connect 15 0 24 0; -#X connect 16 0 24 0; -#X connect 17 0 16 0; -#X connect 18 0 24 0; -#X connect 19 0 18 0; -#X connect 20 0 24 0; -#X connect 21 0 20 0; -#X connect 22 0 23 0; +#X connect 5 0 6 0; +#X connect 6 0 15 0; +#X connect 7 0 8 0; +#X connect 8 0 15 0; +#X connect 9 0 15 0; +#X connect 10 0 9 0; +#X connect 11 0 15 0; +#X connect 12 0 11 0; +#X connect 13 0 14 0; #X restore 30 575 pd more lighting; #X obj 490 242 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X text 29 635 stereo 0|1|2|3 : set 3D stereo-mode to off(0) \, 2-screen-mode(1) \, Red/Green-mode(2); From a4a7bf03a9716b4f178554245fdfb55cb1099879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 30 Apr 2025 22:47:45 +0200 Subject: [PATCH 365/387] Fix crash with [pix_rtx] the buffer is really imagesize*xsize, rather than *ysize... Closes: https://github.com/umlaeute/Gem/issues/501 --- src/Pixes/pix_rtx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pixes/pix_rtx.cpp b/src/Pixes/pix_rtx.cpp index 26091abae..a0752ecfc 100644 --- a/src/Pixes/pix_rtx.cpp +++ b/src/Pixes/pix_rtx.cpp @@ -47,7 +47,7 @@ bool refresh_buffer(const imageStruct&reference, imageStruct&buffer) // only 1 channel !!, to keep data-size handy unsigned char*data = buffer.data; size_t imagesize = reference.xsize * reference.ysize * reference.csize * sizeof(unsigned char); - size_t dataSize = imagesize * reference.ysize; + size_t dataSize = imagesize * reference.xsize; bool refresh= (reference.xsize != buffer.xsize) || (reference.ysize != buffer.ysize) || From 9f5c6585f9c725bdc582f865f27d671a0f3d341d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 6 May 2025 17:31:41 +0200 Subject: [PATCH 366/387] [ci] force-uninstall zstd/xz/lz4 on macOS (so we can re-install them) --- .git-ci/gitlab-iem.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 1d0f2ef00..60452822d 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -191,6 +191,8 @@ stages: - export PDDIR=$(find /Applications/Pd*.app/Contents/Resources -maxdepth 1 -type d -print -quit) - echo "PD=${PD}" - echo "PDDIR=${PDDIR}" + # urgh: these are provided as fat variants, but must be uninstalled manually, for whatever reason. + - brew --force --ignore-dependencies zstd xz lz4 - brew bundle --no-upgrade --file=.git-ci/macOS.brew || true - brew list --full-name || true - libtoolize --version || glibtoolize --version || brew install libtool || true From 2269d2b0611fc5673416a0a0b45e4d80f3eb3330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 6 May 2025 17:46:39 +0200 Subject: [PATCH 367/387] [ci] fix 'brew uninstall' invocation --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 60452822d..cac2b00a3 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -192,7 +192,7 @@ stages: - echo "PD=${PD}" - echo "PDDIR=${PDDIR}" # urgh: these are provided as fat variants, but must be uninstalled manually, for whatever reason. - - brew --force --ignore-dependencies zstd xz lz4 + - brew uninstall --force --ignore-dependencies zstd xz lz4 - brew bundle --no-upgrade --file=.git-ci/macOS.brew || true - brew list --full-name || true - libtoolize --version || glibtoolize --version || brew install libtool || true From b295338b44ff0bf4d39a80e0a127ed8813711d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 6 May 2025 17:47:00 +0200 Subject: [PATCH 368/387] [ci] another fallback method to install gitlab-runner on homebrew --- .git-ci/gitlab-iem.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index cac2b00a3..72901e4c8 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -163,7 +163,17 @@ stages: - brew list --full-name || true - brew update || true # make sure we have a good gitlab runner + - mkdir -p /usr/local/bin/ + - | + : "${GITLAB_ARCH:=$(uname -m | sed -e 's|^x86_64$|amd64|' -e 's|^aarch64$|arm64|')}" + - | + : "${GITLAB_OS:=$(uname -s | tr '[:upper:]' '[:lower:]')}" + - | + : "${GITLAB_VERSION:=latest}" + - | + echo "fallback gitlab-runner ${GITLAB_VERSION} ${GITLAB_OS}-${GITLAB_ARCH}" - (which gitlab-runner; gitlab-runner --version) || brew install gitlab-runner || true + - (which gitlab-runner; gitlab-runner --version) || curl -o /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/${GITLAB_VERSION}/binaries/gitlab-runner-${GITLAB_OS}-${GITLAB_ARCH}" && chmod +x /usr/local/bin/gitlab-runner || true - (which gitlab-runner; gitlab-runner --version) || true # download Pd From 9d57ad8b5abac4b9b2f608d5273a6ce85615e718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 6 May 2025 17:57:28 +0200 Subject: [PATCH 369/387] [ci] use default git-submodule depth --- .git-ci/gitlab-iem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 72901e4c8..908909a2a 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -25,7 +25,7 @@ variables: value: "gemglfw3window" description: "default window backend" GIT_SUBMODULE_STRATEGY: recursive - GIT_SUBMODULE_DEPTH: 1 + #GIT_SUBMODULE_DEPTH: 1 stages: - build From afcb8dbb0a1e780f02c9ceca67db22e72fc4d1db Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 30 May 2025 10:05:26 +0200 Subject: [PATCH 370/387] There was no feedback example that use framebuffer until now. --- examples/10.glsl/04.game_of_life_bis.pd | 107 ++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 examples/10.glsl/04.game_of_life_bis.pd diff --git a/examples/10.glsl/04.game_of_life_bis.pd b/examples/10.glsl/04.game_of_life_bis.pd new file mode 100644 index 000000000..25873a283 --- /dev/null +++ b/examples/10.glsl/04.game_of_life_bis.pd @@ -0,0 +1,107 @@ +#N canvas 597 250 1243 650 10; +#X declare -lib Gem; +#X obj 438 310 alpha; +#X obj 438 360 square 4; +#X msg 450 214 print; +#X obj 438 334 colorRGB 1 1 1 1; +#X obj 411 489 rectangle; +#X floatatom 441 442 5 0 0 0 - - - 0; +#X floatatom 496 443 5 0 0 0 - - - 0; +#X obj 441 461 / 100; +#X obj 496 464 / 100; +#X text 142 91 <----- 1; +#N canvas 87 154 247 179 Gem.init 0; +#X obj 118 46 loadbang; +#X msg 118 81 reset; +#X obj 118 113 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X restore 49 42 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 49 68 pd gemwin; +#X obj 47 8 declare -lib Gem; +#X obj 438 236 glsl shader/game; +#X obj 411 70 gemframebuffer \; dimen 500 500 \; rectangle 0; +#X obj 438 186 translateXYZ 0 0 -4; +#X obj 411 42 gemhead 10; +#X obj 411 414 spigot 0; +#X obj 456 389 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 736 266 square 4; +#X obj 736 127 gemframebuffer \; dimen 500 500 \; rectangle 0; +#X obj 736 185 translateXYZ 0 0 -4; +#X obj 736 96 gemhead 20; +#X obj 438 272 pix_texture \; rectangle 0; +#X obj 736 218 pix_texture \; rectangle 0; +#X obj 882 481 square 4; +#X obj 882 433 pix_texture \; rectangle 0; +#X obj 882 311 gemhead 30; +#X text 43 129 This is the same as previous example \, but it use framebuffer to avoid the slow snap2text object, f 50; +#X text 45 178 Rendering is made in a framebuffer that is used as texture to render in an other frambuffer \, that is used as a texture for next frame (it is not possible to use the rendering frambuffer as a texture to the render because it is cleared befor the rendering), f 52; +#X obj 411 120 t a a; +#X text 483 390 <- render any prmitive to initialize the process; +#X text 816 96 feedback; +#X text 958 310 rendering in the Gem window; +#X text 462 124 The triger allow to detach the texture for the 2nd part of the rendering, f 39; +#X connect 0 0 3 0; +#X connect 2 0 13 0; +#X connect 3 0 1 0; +#X connect 5 0 7 0; +#X connect 6 0 8 0; +#X connect 7 0 4 1; +#X connect 8 0 4 2; +#X connect 10 0 11 0; +#X connect 13 0 23 0; +#X connect 14 0 30 0; +#X connect 14 1 24 1; +#X connect 15 0 13 0; +#X connect 16 0 14 0; +#X connect 17 0 4 0; +#X connect 18 0 17 1; +#X connect 20 0 21 0; +#X connect 20 1 23 1; +#X connect 20 1 26 1; +#X connect 21 0 24 0; +#X connect 22 0 20 0; +#X connect 23 0 0 0; +#X connect 24 0 19 0; +#X connect 26 0 25 0; +#X connect 27 0 26 0; +#X connect 30 0 17 0; +#X connect 30 1 15 0; From d9d546ef67abcf02dad2b12177b2201bec0d8534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 2 Jun 2025 18:49:06 +0200 Subject: [PATCH 371/387] fix spelling errors --- examples/10.glsl/04.game_of_life_bis.pd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/10.glsl/04.game_of_life_bis.pd b/examples/10.glsl/04.game_of_life_bis.pd index 25873a283..42b089725 100644 --- a/examples/10.glsl/04.game_of_life_bis.pd +++ b/examples/10.glsl/04.game_of_life_bis.pd @@ -72,13 +72,13 @@ #X obj 882 481 square 4; #X obj 882 433 pix_texture \; rectangle 0; #X obj 882 311 gemhead 30; -#X text 43 129 This is the same as previous example \, but it use framebuffer to avoid the slow snap2text object, f 50; -#X text 45 178 Rendering is made in a framebuffer that is used as texture to render in an other frambuffer \, that is used as a texture for next frame (it is not possible to use the rendering frambuffer as a texture to the render because it is cleared befor the rendering), f 52; +#X text 43 129 This is the same as previous example \, but it uses a framebuffer to avoid the slow snap2text object, f 50; +#X text 45 178 Rendering is made in a framebuffer that is used as texture to render in an other framebuffer \, that is used as a texture for next frame (it is not possible to use the rendering framebuffer as a texture to the render because it is cleared before the rendering), f 52; #X obj 411 120 t a a; -#X text 483 390 <- render any prmitive to initialize the process; +#X text 483 390 <- render any primitive to initialize the process; #X text 816 96 feedback; #X text 958 310 rendering in the Gem window; -#X text 462 124 The triger allow to detach the texture for the 2nd part of the rendering, f 39; +#X text 462 124 The trigger allows us to detach the texture for the 2nd part of the rendering, f 39; #X connect 0 0 3 0; #X connect 2 0 13 0; #X connect 3 0 1 0; From b4e8e43c7726cf1358a18a3e27f885f929bb4710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 2 Jun 2025 18:49:27 +0200 Subject: [PATCH 372/387] Add new example to the build-system --- examples/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Makefile.am b/examples/Makefile.am index aa6dcbf1b..f4c05a301 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -121,6 +121,7 @@ nobase_dist_gemexamples_DATA = \ 10.glsl/02.primitive_distortion.pd \ 10.glsl/03.texture_distortion.pd \ 10.glsl/04.game_of_life.pd \ + 10.glsl/04.game_of_life_bis.pd \ 10.glsl/05.multitexture.pd \ 10.glsl/05.multitexture_bis.pd \ 10.glsl/05.multitexture_basic.pd \ From 2f303d5818d072e93218c0c1b0dd30b167c92979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 4 Jun 2025 08:52:21 +0200 Subject: [PATCH 373/387] GLSL: Use 'textureSize' rather than 'textureSize2DRect' - it doesn't require the 'lod' parameter (for nvidia) - it does require openGL-3.0 (#version130) Closes: https://github.com/umlaeute/Gem/issues/505 --- examples/10.glsl/shader/GLSL_mix.frag | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/10.glsl/shader/GLSL_mix.frag b/examples/10.glsl/shader/GLSL_mix.frag index 7ab878f69..d210ed6a1 100644 --- a/examples/10.glsl/shader/GLSL_mix.frag +++ b/examples/10.glsl/shader/GLSL_mix.frag @@ -1,4 +1,5 @@ //jack/RYBN 2010 +#version 130 #extension GL_EXT_gpu_shader4 : enable #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect Ttex1; @@ -7,9 +8,9 @@ uniform sampler2DRect tex0; uniform float style; uniform float mix_factor; varying vec2 texcoord0; -ivec2 size1 = textureSize2DRect(Ttex1,0); -ivec2 size2 = textureSize2DRect(Ttex2,0); -ivec2 size0 = textureSize2DRect(tex0,0); +ivec2 size1 = textureSize(Ttex1); +ivec2 size2 = textureSize(Ttex2); +ivec2 size0 = textureSize(tex0); void main (void) { From e93becf3f7a6c408220436ac8b745054356a2ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 4 Jun 2025 09:26:16 +0200 Subject: [PATCH 374/387] [ci] try harder to install automake --- .git-ci/gitlab-iem.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.git-ci/gitlab-iem.yml b/.git-ci/gitlab-iem.yml index 908909a2a..da6bc05fb 100644 --- a/.git-ci/gitlab-iem.yml +++ b/.git-ci/gitlab-iem.yml @@ -203,6 +203,10 @@ stages: - echo "PDDIR=${PDDIR}" # urgh: these are provided as fat variants, but must be uninstalled manually, for whatever reason. - brew uninstall --force --ignore-dependencies zstd xz lz4 + # urgh, the gnu servers timeout, so try to install these files multiple times... + - which automake || brew install automake || true + - which -s libtoolize || which -s glibtoolize || brew install libtool || true + # install the real stuff - brew bundle --no-upgrade --file=.git-ci/macOS.brew || true - brew list --full-name || true - libtoolize --version || glibtoolize --version || brew install libtool || true From 10c451b940d460397b34a467a5d59198de6c86e4 Mon Sep 17 00:00:00 2001 From: chnry Date: Sun, 29 Jun 2025 13:13:23 +0200 Subject: [PATCH 375/387] adding a new feedback example --- examples/02.advanced/25.feedback.pd | 119 ++++++++++++++++++++++++++++ examples/Makefile.am | 1 + 2 files changed, 120 insertions(+) create mode 100644 examples/02.advanced/25.feedback.pd diff --git a/examples/02.advanced/25.feedback.pd b/examples/02.advanced/25.feedback.pd new file mode 100644 index 000000000..a6dfb1c81 --- /dev/null +++ b/examples/02.advanced/25.feedback.pd @@ -0,0 +1,119 @@ +#N canvas 550 258 1097 614 12; +#X declare -lib Gem; +#X text 120 105 <----- 1; +#N canvas 87 154 247 179 Gem.init 0; +#X obj 118 46 loadbang; +#X msg 118 81 reset; +#X obj 118 113 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X restore 27 54 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 27 82 pd gemwin; +#X obj 28 547 circle; +#X floatatom 69 490 5 0 0 0 - - - 0; +#X floatatom 110 491 5 0 0 0 - - - 0; +#X obj 28 252 t a a; +#X obj 60 355 square 4; +#X obj 60 330 pix_texture; +#X obj 28 225 translateXYZ 0 0 -4; +#X obj 446 300 translateXYZ 0 0 -4; +#X obj 446 514 pix_texture; +#X obj 787 263 gemhead 30; +#X text 862 262 rendering in the Gem window; +#X obj 787 297 pix_texture; +#X obj 787 322 square 4; +#X obj 28 152 gemhead 10; +#X obj 446 191 gemhead 20; +#X obj 27 17 declare -lib Gem; +#N canvas 0 0 450 300 clearZ 0; +#X obj 120 48 loadbang; +#X obj 55 95 GEMglClear; +#X obj 120 72 GLdefine GL_DEPTH_BUFFER_BIT; +#X obj 55 19 inlet; +#X obj 55 141 outlet; +#X obj 182 50 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 1 1; +#X connect 3 0 1 0; +#X connect 5 0 2 0; +#X restore 28 410 pd clearZ; +#X obj 28 519 translateXYZ 0 0 0; +#X obj 446 269 alpha; +#X obj 28 180 gemframebuffer \; dimen 400 400; +#X obj 446 219 gemframebuffer \; dimen 400 400; +#X floatatom 526 543 5 0 0 0 - - - 0; +#X obj 446 542 square 4.1; +#X text 168 490 <----- 2; +#X text 105 395 "Clear the Z buffer in order to enforce the render on top of the feedback texture", f 25; +#X text 156 332 feedback texture; +#X text 104 548 render somthing simple; +#X text 460 342 A shader can be inserted here for more complex feedback loop, f 21; +#X text 608 426 change the color of the feedback loop for a simple effect, f 33; +#X text 581 541 <----- 3; +#X text 654 542 zoom effect; +#X obj 446 432 colorRGB 0.9 1 0 0.95; +#X text 109 152 main render in a framebuffer; +#X text 529 191 feedback render; +#X text 309 15 A framebuffer image is persistent \, so you can use it to create feedback in an efficient way.; +#X connect 1 0 2 0; +#X connect 4 0 20 1; +#X connect 5 0 20 2; +#X connect 6 0 19 0; +#X connect 6 1 8 0; +#X connect 8 0 7 0; +#X connect 9 0 6 0; +#X connect 10 0 34 0; +#X connect 11 0 25 0; +#X connect 12 0 14 0; +#X connect 14 0 15 0; +#X connect 16 0 22 0; +#X connect 17 0 23 0; +#X connect 19 0 20 0; +#X connect 20 0 3 0; +#X connect 21 0 10 0; +#X connect 22 0 9 0; +#X connect 22 1 11 1; +#X connect 22 1 14 1; +#X connect 23 0 21 0; +#X connect 23 1 8 1; +#X connect 24 0 25 1; +#X connect 34 0 11 0; diff --git a/examples/Makefile.am b/examples/Makefile.am index f4c05a301..7ded2cd94 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -39,6 +39,7 @@ nobase_dist_gemexamples_DATA = \ 02.advanced/22.double-iterative.pd \ 02.advanced/23.SplitScreen.pd \ 02.advanced/24.query_GPU.pd \ + 02.advanced/25.feedback.pd \ 02.advanced/snapshotHD.pd \ 03.lighting/01.world_light.pd \ 03.lighting/02.light.pd \ From c2299ac1d4541aa48febe27eb9347d80fa7c4c10 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 17 Oct 2025 14:13:21 +0200 Subject: [PATCH 376/387] add 3 messages to gemframbuffer : - quality - repeat They are usually useless since a framebuffer is send to a texture, this flag can be set on the corresponding texture. however, when using the texunit message, this framebuffer can be accesed directlly from a shader. In this situation this flag should be set directlly in the framebuffer. a 3rd message is added : -clear it allow to disable the gl_clear function (color and depth buffer) This is usefull to add remanence to a buffer, without having to add an other (memory) buffer --- src/Controls/gemframebuffer.cpp | 39 ++++++++++++++++++++++++++++----- src/Controls/gemframebuffer.h | 7 ++++++ 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index d2dfe8257..897b35892 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -48,7 +48,7 @@ gemframebuffer :: gemframebuffer(int argc, t_atom*argv) m_rectangle(false), m_canRectangle(0), m_internalformat(GL_RGB8), m_format(GL_RGB), m_wantFormat(GL_RGB), m_type(GL_UNSIGNED_BYTE), - m_outTexInfo(NULL) + m_outTexInfo(NULL), m_quality(GL_NEAREST), m_repeat(GL_CLAMP_TO_EDGE), m_clear(true) { // create an outlet to send out texture info: // - ID @@ -220,7 +220,7 @@ void gemframebuffer :: render(GemState *state) glClearColor( m_FBOcolor[0], m_FBOcolor[1], m_FBOcolor[2], m_FBOcolor[3] ); // Clear the buffers and reset the model view matrix. - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + if(m_clear) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // We need a one-to-one mapping of pixels to texels in order to // ensure every element of our texture is processed. By setting our @@ -379,6 +379,8 @@ void gemframebuffer :: printInfo() m_format, m_internalformat); verbose(0, "type: %s [%d]", type.c_str(), m_type); verbose(0, "texunit: %d", m_texunit); + verbose(0, "repeat: %d", (m_repeat == GL_REPEAT)); + verbose(0, "quality: %d", (m_quality == GL_LINEAR)); } ///////////////////////////////////////////////////////// @@ -409,10 +411,12 @@ void gemframebuffer :: initFBO() // 2.13.2006 // GL_LINEAR causes fallback to software shader // so switching back to GL_NEAREST - glTexParameteri(m_texTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(m_texTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + // 2025 : it's ok now to have nearest or linear + glTexParameteri(m_texTarget, GL_TEXTURE_MIN_FILTER, m_quality); + glTexParameteri(m_texTarget, GL_TEXTURE_MAG_FILTER, m_quality); - GLuint wrapmode = (GLEW_EXT_texture_edge_clamp)?GL_CLAMP_TO_EDGE:GL_CLAMP; + GLuint wrapmode = m_repeat; + if (wrapmode == GL_CLAMP_TO_EDGE) (GLEW_EXT_texture_edge_clamp)?GL_CLAMP_TO_EDGE:GL_CLAMP; glTexParameterf(m_texTarget, GL_TEXTURE_WRAP_S, wrapmode); glTexParameterf(m_texTarget, GL_TEXTURE_WRAP_T, wrapmode); @@ -666,7 +670,29 @@ void gemframebuffer :: texunitMess(int unit) m_texunit=static_cast(unit); } +void gemframebuffer :: qualityMess(int quality) +{ + if(quality) + m_quality=GL_LINEAR; + else + m_quality=GL_NEAREST; + setModified(); +} + +void gemframebuffer :: repeatMess(int repeat) +{ + if(repeat) + m_repeat=GL_REPEAT; + else + m_repeat=GL_CLAMP_TO_EDGE; + setModified(); +} + +void gemframebuffer :: clearMess(bool clear) +{ + m_clear = clear; +} //////////////////////////////////////////////////////// // static member function @@ -682,6 +708,9 @@ void gemframebuffer :: obj_setupCallback(t_class *classPtr) CPPEXTERN_MSG1(classPtr, "type", typeMess, std::string); CPPEXTERN_MSG1(classPtr, "rectangle", rectangleMess, bool); CPPEXTERN_MSG1(classPtr, "texunit", texunitMess, int); + CPPEXTERN_MSG1(classPtr, "quality", qualityMess, int); + CPPEXTERN_MSG1(classPtr, "repeat", repeatMess, int); + CPPEXTERN_MSG1(classPtr, "clear", clearMess, bool); /* legacy */ CPPEXTERN_MSG2(classPtr, "dim", dimMess, int, int); diff --git a/src/Controls/gemframebuffer.h b/src/Controls/gemframebuffer.h index c6b4204a7..a98682b37 100644 --- a/src/Controls/gemframebuffer.h +++ b/src/Controls/gemframebuffer.h @@ -78,6 +78,10 @@ class GEM_EXTERN gemframebuffer : public GemBase virtual void rectangleMess(bool mode); virtual void texunitMess(int mode); + virtual void qualityMess(int mode); + virtual void repeatMess(int mode); + virtual void clearMess(bool mode); + virtual void fixFormat(GLenum wantedFormat); virtual void printInfo(void); @@ -101,6 +105,9 @@ class GEM_EXTERN gemframebuffer : public GemBase GLfloat m_FBOcolor[4]; t_outlet *m_outTexInfo; GLfloat m_perspect[6]; + GLint m_quality; + GLint m_repeat; + bool m_clear; void bangMess(void); }; From fdbb26815a4b4a2dcf837d5ee1148d7a543ada18 Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 17 Oct 2025 14:20:42 +0200 Subject: [PATCH 377/387] add this messages to the help file --- help/gemframebuffer-help.pd | 110 +++++++++++++++++++++--------------- 1 file changed, 66 insertions(+), 44 deletions(-) diff --git a/help/gemframebuffer-help.pd b/help/gemframebuffer-help.pd index 969363228..9a67aa4cf 100644 --- a/help/gemframebuffer-help.pd +++ b/help/gemframebuffer-help.pd @@ -1,26 +1,26 @@ -#N canvas 617 195 896 632 10; +#N canvas 607 67 896 750 10; #X declare -lib Gem; -#X obj 465 39 cnv 15 420 570 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 472 321 cnv 15 100 30 empty empty empty 20 12 0 14 #b8b8b8 #404040 0; -#X obj 474 48 cnv 15 400 250 empty empty empty 20 12 0 14 #14e814 #404040 0; +#X obj 465 39 cnv 15 420 700 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 441 cnv 15 100 30 empty empty empty 20 12 0 14 #b8b8b8 #404040 0; +#X obj 474 48 cnv 15 400 370 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 477 71 gemhead 20; -#X obj 664 336 gemhead; +#X obj 664 456 gemhead; #X msg 615 136 dimen 320 240; -#X obj 477 498 rotateXYZ; -#X floatatom 794 457 5 0 0 0 - - - 0; -#X msg 762 144 color 0 0 1 0; +#X obj 477 618 rotateXYZ; +#X floatatom 794 577 5 0 0 0 - - - 0; +#X msg 762 119 color 0 0 1 0; #X msg 602 117 dimen 1024 1024; -#X msg 751 104 color 0 0 0 0; -#X obj 477 452 t a b; -#X floatatom 717 499 5 0 0 0 - - - 0; +#X msg 751 79 color 0 0 0 0; +#X obj 477 572 t a b; +#X floatatom 717 619 5 0 0 0 - - - 0; #X msg 549 262 rectangle \$1; #X obj 549 244 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 509 131 type FLOAT; -#X obj 664 304 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#X obj 477 412 translateXYZ 0 0 -4; -#X obj 477 328 gemframebuffer; -#X obj 664 361 pix_texture; -#X obj 664 388 t a b; +#X obj 664 438 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 477 532 translateXYZ 0 0 -4; +#X obj 477 448 gemframebuffer; +#X obj 664 481 pix_texture; +#X obj 664 508 t a b; #X msg 531 217 texunit \$1; #X msg 495 92 type BYTE; #X msg 503 112 type INT; @@ -28,10 +28,10 @@ #X msg 649 188 format RGB; #X msg 668 230 format RGBA; #X msg 680 250 format RGB32; -#X obj 664 517 square 2; -#X obj 664 479 rotateXYZ -40 0 200; -#X floatatom 707 459 5 0 0 0 - - - 0; -#X obj 477 517 pqtorusknots; +#X obj 664 637 square 2; +#X obj 664 599 rotateXYZ -40 0 200; +#X floatatom 707 579 5 0 0 0 - - - 0; +#X obj 477 637 pqtorusknots; #N canvas 0 50 450 300 rotation 0; #X obj 33 19 inlet; #X obj 33 110 % 360; @@ -61,7 +61,7 @@ #X connect 9 0 12 0; #X connect 11 0 5 0; #X connect 12 0 8 0; -#X restore 509 473 pd rotation; +#X restore 509 593 pd rotation; #X floatatom 531 197 5 0 0 0 - - - 0; #N canvas 125 50 450 300 rotation 0; #X obj 112 29 inlet; @@ -74,33 +74,33 @@ #X connect 1 0 3 0; #X connect 2 0 4 0; #X connect 4 0 1 0; -#X restore 794 432 pd rotation; -#X obj 762 123 loadbang; -#X obj 477 432 color 1 0 0; +#X restore 794 552 pd rotation; +#X obj 762 99 loadbang; +#X obj 477 552 color 1 0 0; #X obj 649 275 t a; #X obj 585 154 t a; #X obj 751 165 t a; #X obj 495 160 t a; -#X floatatom 563 391 5 0 0 0 - - - 0; -#X floatatom 607 392 5 0 0 0 - - - 0; -#X floatatom 520 391 5 0 0 0 - - - 0; +#X floatatom 563 511 5 0 0 0 - - - 0; +#X floatatom 607 512 5 0 0 0 - - - 0; +#X floatatom 520 511 5 0 0 0 - - - 0; #X obj 495 184 t a; -#X obj 470 544 cnv 15 410 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X msg 717 574 color 0 0 0 0; -#X msg 706 552 color 0 1 1 0; -#X msg 597 555 lighting \$1; -#X obj 575 556 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#X obj 597 582 t a; +#X obj 470 674 cnv 15 410 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X msg 717 704 color 0 0 0 0; +#X msg 706 682 color 0 1 1 0; +#X msg 597 685 lighting \$1; +#X obj 575 686 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 597 712 t a; #X text 476 52 Example:; #X text 699 10 GEM object; #X obj 7 71 cnv 15 450 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 7 238 cnv 15 450 370 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 7 238 cnv 15 450 500 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 10 244 Inlets:; #X obj 7 205 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 14 204 Arguments:; #X text 28 263 Inlet 1: gemlist; -#X text 15 553 Outlets:; -#X text 31 569 Outlet 1: gemlist; +#X text 15 677 Outlets:; +#X text 31 693 Outlet 1: gemlist; #X text 60 217 ; #X text 102 29 Synopsis: [gemframebuffer]; #X text 122 45 Class: framebuffer object; @@ -120,16 +120,16 @@ #X text 100 326 (color format of the framebuffer); #X text 102 395 (background color of the framebuffer); #X obj 556 71 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X floatatom 493 353 5 0 0 0 - - - 0; -#X obj 477 372 scaleXYZ; -#X floatatom 563 356 5 0 0 0 - - - 0; -#X floatatom 528 355 5 0 0 0 - - - 0; +#X floatatom 493 473 5 0 0 0 - - - 0; +#X obj 477 492 scaleXYZ; +#X floatatom 563 476 5 0 0 0 - - - 0; +#X floatatom 528 475 5 0 0 0 - - - 0; #X msg 585 60 perspec -1 1 -1 1 1 20; #X msg 593 86 perspec -1 1 -1 1 3 75; #X text 98 527 (frustum of the framebuffer); #X text 752 59 default; #X text 11 153 NOTE: the default view-point of [gemframebuffer] is at the origin 0/0/0 \, unlike [gemwin] where it is at 0/0/4. You might want to manually insert a [translateXYZ 0 0 -4]., f 72; -#X text 31 587 Outlet 2: texture info : <0.>; +#X text 31 711 Outlet 2: texture info : <0.>; #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; #X text 10 45 DESCRIPTION Renders a scene in a texture \, for later use.; @@ -143,9 +143,24 @@ #X text 22 512 Inlet 1: message: perspec , f 66; #X msg 685 270 format RGBA32F; #X text 27 310 Inlet 1: message: format [RGB|RGBA|RGB32|RGBA32F|YUV]; -#X obj 475 553 _gemwin; -#X obj 809 577 world_light; -#X obj 809 554 gemhead 1; +#X obj 475 683 _gemwin; +#X obj 809 707 world_light; +#X obj 809 684 gemhead 1; +#X msg 672 322 quality \$1; +#X msg 685 362 repeat \$1; +#X obj 672 301 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 685 342 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 672 387 t a; +#X msg 790 366 clear \$1; +#X obj 790 343 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 23 545 Inlet 1: message: clear [0|1] (default : 1); +#X text 65 562 0 to disable the clearing of the color and depth buffer at every rendering; +#X text 22 590 Inlet 1: message: quality [0|1]; +#X text 76 606 GL_NEAREST (default) | GL_LINEAR; +#X text 73 621 (useful only with a direct access from a shader); +#X text 73 665 (useful only with a direct access from a shader); +#X text 22 634 Inlet 1: message: repeat [0|1]; +#X text 75 649 CLAMP_TO_EDGE (default) or REPEAT; #X connect 3 0 18 0; #X connect 4 0 19 0; #X connect 5 0 38 0; @@ -205,3 +220,10 @@ #X connect 85 0 38 0; #X connect 92 0 37 0; #X connect 96 0 95 0; +#X connect 97 0 101 0; +#X connect 98 0 101 0; +#X connect 99 0 97 0; +#X connect 100 0 98 0; +#X connect 101 0 18 0; +#X connect 102 0 101 0; +#X connect 103 0 102 0; From 81b0d47507d59cf55706a05b3ba4b069bf43bead Mon Sep 17 00:00:00 2001 From: chnry Date: Fri, 17 Oct 2025 14:21:10 +0200 Subject: [PATCH 378/387] add an example of remanance --- examples/09.openGL/06.clear_framebuffer.pd | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 examples/09.openGL/06.clear_framebuffer.pd diff --git a/examples/09.openGL/06.clear_framebuffer.pd b/examples/09.openGL/06.clear_framebuffer.pd new file mode 100644 index 000000000..d87d7d3f4 --- /dev/null +++ b/examples/09.openGL/06.clear_framebuffer.pd @@ -0,0 +1,52 @@ +#N canvas 684 195 706 671 12; +#X obj 42 172 gemhead; +#X obj 42 323 translateXYZ 0 0 -4; +#X obj 42 637 circle 1; +#X obj 524 191 gemhead; +#X obj 524 479 square 4; +#X obj 36 54 gemwin \; reset \; create \; 1, f 21; +#X obj 524 405 pix_texture; +#X obj 42 483 t a b; +#X obj 42 553 accumrotate 0 0 0; +#X obj 42 584 translateXYZ 2 0 0; +#X msg 74 510 10; +#X obj 42 199 alpha; +#X obj 42 612 colorRGB 1 1 1 1; +#X msg 146 172 clear \$1; +#X obj 146 138 tgl 20 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 1; +#X obj 524 439 pix_coordinate; +#X floatatom 124 510 5 0 0 0 - - - 0; +#X obj 42 349 color 0 0 0 0.1; +#X obj 42 373 square 4; +#X obj 107 397 loadbang; +#X obj 42 444 GEMglClear; +#X obj 107 421 GLdefine GL_DEPTH_BUFFER_BIT; +#X obj 169 399 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; +#X text 132 445 <- depth is not cleared in "clear 0" mode; +#X obj 42 224 gemframebuffer \; format RGBA \; dimen 400 400 \; color 0 0 0 0.5 \; clear 0; +#X msg 65 20 destroy; +#X text 240 24 This is an example of simple remanence: the buffer is not cleared between 2 images. A black \, mostly transparent square is drawn in order to darken the old image.; +#X connect 0 0 11 0; +#X connect 1 0 17 0; +#X connect 3 0 6 0; +#X connect 6 0 15 0; +#X connect 7 0 8 0; +#X connect 7 1 10 0; +#X connect 8 0 9 0; +#X connect 9 0 12 0; +#X connect 10 0 8 3; +#X connect 11 0 24 0; +#X connect 12 0 2 0; +#X connect 13 0 24 0; +#X connect 14 0 13 0; +#X connect 15 0 4 0; +#X connect 16 0 8 3; +#X connect 17 0 18 0; +#X connect 18 0 20 0; +#X connect 19 0 21 0; +#X connect 20 0 7 0; +#X connect 21 0 20 1; +#X connect 22 0 21 0; +#X connect 24 0 1 0; +#X connect 24 1 6 1; +#X connect 25 0 5 0; From fd6022e38e8af849f6a1d7e370496f7bd36ae0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 21 Oct 2025 12:07:10 +0200 Subject: [PATCH 379/387] indentation --- src/Controls/gemframebuffer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index 897b35892..2b19ac48e 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -48,7 +48,8 @@ gemframebuffer :: gemframebuffer(int argc, t_atom*argv) m_rectangle(false), m_canRectangle(0), m_internalformat(GL_RGB8), m_format(GL_RGB), m_wantFormat(GL_RGB), m_type(GL_UNSIGNED_BYTE), - m_outTexInfo(NULL), m_quality(GL_NEAREST), m_repeat(GL_CLAMP_TO_EDGE), m_clear(true) + m_outTexInfo(NULL), + m_quality(GL_NEAREST), m_repeat(GL_CLAMP_TO_EDGE), m_clear(true) { // create an outlet to send out texture info: // - ID @@ -674,17 +675,17 @@ void gemframebuffer :: qualityMess(int quality) { if(quality) m_quality=GL_LINEAR; - else - m_quality=GL_NEAREST; + else + m_quality=GL_NEAREST; setModified(); } void gemframebuffer :: repeatMess(int repeat) { - if(repeat) + if(repeat) m_repeat=GL_REPEAT; else - m_repeat=GL_CLAMP_TO_EDGE; + m_repeat=GL_CLAMP_TO_EDGE; setModified(); } From 4e261537040516cc8a4ef4f5cdf0b03e45c657e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 21 Oct 2025 12:08:10 +0200 Subject: [PATCH 380/387] move comma to the beginning of initialization list --- src/Controls/gemframebuffer.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index 2b19ac48e..2cd847590 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -41,15 +41,15 @@ CPPEXTERN_NEW_WITH_GIMME(gemframebuffer); */ gemframebuffer :: gemframebuffer(int argc, t_atom*argv) - : m_haveinit(false), m_wantinit(false), m_frameBufferIndex(0), - m_depthBufferIndex(0), - m_offScreenID(0), m_texTarget(GL_TEXTURE_2D), m_texunit(0), - m_width(256), m_height(256), - m_rectangle(false), m_canRectangle(0), - m_internalformat(GL_RGB8), m_format(GL_RGB), m_wantFormat(GL_RGB), - m_type(GL_UNSIGNED_BYTE), - m_outTexInfo(NULL), - m_quality(GL_NEAREST), m_repeat(GL_CLAMP_TO_EDGE), m_clear(true) + : m_haveinit(false), m_wantinit(false), m_frameBufferIndex(0) + , m_depthBufferIndex(0) + , m_offScreenID(0), m_texTarget(GL_TEXTURE_2D), m_texunit(0) + , m_width(256), m_height(256) + , m_rectangle(false), m_canRectangle(0) + , m_internalformat(GL_RGB8), m_format(GL_RGB), m_wantFormat(GL_RGB) + , m_type(GL_UNSIGNED_BYTE) + , m_outTexInfo(NULL) + , m_quality(GL_NEAREST), m_repeat(GL_CLAMP_TO_EDGE), m_clear(true) { // create an outlet to send out texture info: // - ID From 9ba218cda1612b1d7cdfca47742532f9808c1cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 21 Oct 2025 12:08:26 +0200 Subject: [PATCH 381/387] [gemframebuffer] also show m_clear value --- src/Controls/gemframebuffer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index 2cd847590..7536a613b 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -382,6 +382,7 @@ void gemframebuffer :: printInfo() verbose(0, "texunit: %d", m_texunit); verbose(0, "repeat: %d", (m_repeat == GL_REPEAT)); verbose(0, "quality: %d", (m_quality == GL_LINEAR)); + verbose(0, "clear: %d", m_clear); } ///////////////////////////////////////////////////////// From 3385f6f7861f2672a6f9a7869b731dedd3d3e9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 5 Nov 2025 11:03:10 +0100 Subject: [PATCH 382/387] [gemframebuffer] "verbose" message by default, the object is not silent (e.g. in initFBO()) --- src/Controls/gemframebuffer.cpp | 12 +++++++++++- src/Controls/gemframebuffer.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index 7536a613b..e79bcaae7 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -50,6 +50,7 @@ gemframebuffer :: gemframebuffer(int argc, t_atom*argv) , m_type(GL_UNSIGNED_BYTE) , m_outTexInfo(NULL) , m_quality(GL_NEAREST), m_repeat(GL_CLAMP_TO_EDGE), m_clear(true) + , m_verbose(false) { // create an outlet to send out texture info: // - ID @@ -468,7 +469,8 @@ void gemframebuffer :: initFBO() m_haveinit = true; m_wantinit = false; - printInfo(); + if (m_verbose) + printInfo(); } //////////////////////////////////////////////////////// @@ -696,6 +698,13 @@ void gemframebuffer :: clearMess(bool clear) m_clear = clear; } +void gemframebuffer :: verboseMess(bool verbose) +{ + m_verbose = verbose; + if (m_verbose) + printInfo(); +} + //////////////////////////////////////////////////////// // static member function // @@ -713,6 +722,7 @@ void gemframebuffer :: obj_setupCallback(t_class *classPtr) CPPEXTERN_MSG1(classPtr, "quality", qualityMess, int); CPPEXTERN_MSG1(classPtr, "repeat", repeatMess, int); CPPEXTERN_MSG1(classPtr, "clear", clearMess, bool); + CPPEXTERN_MSG1(classPtr, "verbose", verboseMess, bool); /* legacy */ CPPEXTERN_MSG2(classPtr, "dim", dimMess, int, int); diff --git a/src/Controls/gemframebuffer.h b/src/Controls/gemframebuffer.h index a98682b37..01266b538 100644 --- a/src/Controls/gemframebuffer.h +++ b/src/Controls/gemframebuffer.h @@ -81,6 +81,7 @@ class GEM_EXTERN gemframebuffer : public GemBase virtual void qualityMess(int mode); virtual void repeatMess(int mode); virtual void clearMess(bool mode); + virtual void verboseMess(bool mode); virtual void fixFormat(GLenum wantedFormat); @@ -109,6 +110,8 @@ class GEM_EXTERN gemframebuffer : public GemBase GLint m_repeat; bool m_clear; + bool m_verbose; // print debugging info when changing parametres + void bangMess(void); }; From 38cdc0463f1f503738d23e5f583241df0e75fcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 5 Nov 2025 11:09:36 +0100 Subject: [PATCH 383/387] gemframebuffer-help: alignment --- help/gemframebuffer-help.pd | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/help/gemframebuffer-help.pd b/help/gemframebuffer-help.pd index 9a67aa4cf..23917500e 100644 --- a/help/gemframebuffer-help.pd +++ b/help/gemframebuffer-help.pd @@ -14,9 +14,9 @@ #X obj 477 572 t a b; #X floatatom 717 619 5 0 0 0 - - - 0; #X msg 549 262 rectangle \$1; -#X obj 549 244 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 549 242 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 509 131 type FLOAT; -#X obj 664 438 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 664 436 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 477 532 translateXYZ 0 0 -4; #X obj 477 448 gemframebuffer; #X obj 664 481 pix_texture; @@ -61,7 +61,7 @@ #X connect 9 0 12 0; #X connect 11 0 5 0; #X connect 12 0 8 0; -#X restore 509 593 pd rotation; +#X restore 504 593 pd rotation; #X floatatom 531 197 5 0 0 0 - - - 0; #N canvas 125 50 450 300 rotation 0; #X obj 112 29 inlet; @@ -86,50 +86,50 @@ #X floatatom 520 511 5 0 0 0 - - - 0; #X obj 495 184 t a; #X obj 470 674 cnv 15 410 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X msg 717 704 color 0 0 0 0; +#X msg 706 702 color 0 0 0 0; #X msg 706 682 color 0 1 1 0; #X msg 597 685 lighting \$1; -#X obj 575 686 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 575 685 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 597 712 t a; #X text 476 52 Example:; #X text 699 10 GEM object; #X obj 7 71 cnv 15 450 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X obj 7 238 cnv 15 450 500 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X text 10 244 Inlets:; +#X text 10 294 Inlets:; #X obj 7 205 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 14 204 Arguments:; -#X text 28 263 Inlet 1: gemlist; -#X text 15 677 Outlets:; -#X text 31 693 Outlet 1: gemlist; +#X text 30 313 Inlet 1: gemlist; +#X text 10 237 Outlets:; +#X text 30 253 Outlet 1: gemlist; #X text 60 217 ; #X text 102 29 Synopsis: [gemframebuffer]; #X text 122 45 Class: framebuffer object; #X text 12 80 Description: Renders a scene in a texture \, for later use.; #X text 12 98 this example renders a scene (pqtorusknots) into a framebuffer \, which is then used as a texture onto a square., f 72; #X text 13 128 you need framebuffer support (and its driver) on your gfx-card, f 72; -#X text 28 277 Inlet 1: message: type [BYTE | INT | FLOAT]; -#X text 27 345 Inlet 1: message: dimen ; -#X text 27 379 Inlet 1: message: color ; -#X text 26 460 Inlet 1: message: texunit ; -#X text 26 415 Inlet 1: message: rectangle [0|1]; -#X text 103 292 (type of the framebuffer data); -#X text 102 360 (dimension of the framebuffer texture); -#X text 106 495 (useful only with shader); -#X text 106 478 (change texunit of the texture); -#X text 104 432 (texturing mode \; rectangle (1) or normalized (0)); -#X text 100 326 (color format of the framebuffer); -#X text 102 395 (background color of the framebuffer); -#X obj 556 71 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 30 327 Inlet 1: message: type [BYTE | INT | FLOAT]; +#X text 30 395 Inlet 1: message: dimen ; +#X text 30 429 Inlet 1: message: color ; +#X text 30 510 Inlet 1: message: texunit ; +#X text 30 465 Inlet 1: message: rectangle [0|1]; +#X text 103 342 (type of the framebuffer data); +#X text 102 410 (dimension of the framebuffer texture); +#X text 106 545 (useful only with shader); +#X text 106 528 (change texunit of the texture); +#X text 104 482 (texturing mode \; rectangle (1) or normalized (0)); +#X text 100 376 (color format of the framebuffer); +#X text 102 445 (background color of the framebuffer); +#X obj 546 71 tgl 18 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; #X floatatom 493 473 5 0 0 0 - - - 0; #X obj 477 492 scaleXYZ; #X floatatom 563 476 5 0 0 0 - - - 0; #X floatatom 528 475 5 0 0 0 - - - 0; #X msg 585 60 perspec -1 1 -1 1 1 20; #X msg 593 86 perspec -1 1 -1 1 3 75; -#X text 98 527 (frustum of the framebuffer); +#X text 98 577 (frustum of the framebuffer); #X text 752 59 default; #X text 11 153 NOTE: the default view-point of [gemframebuffer] is at the origin 0/0/0 \, unlike [gemwin] where it is at 0/0/4. You might want to manually insert a [translateXYZ 0 0 -4]., f 72; -#X text 31 711 Outlet 2: texture info : <0.>; +#X text 31 271 Outlet 2: texture info : <0.>; #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; #X text 10 45 DESCRIPTION Renders a scene in a texture \, for later use.; @@ -140,27 +140,27 @@ #X text 10 145 AUTHOR IOhannes m zmölnig; #X text 10 165 LICENSE GPL v2; #X restore 778 8 pd META; -#X text 22 512 Inlet 1: message: perspec , f 66; +#X text 30 562 Inlet 1: message: perspec , f 66; #X msg 685 270 format RGBA32F; -#X text 27 310 Inlet 1: message: format [RGB|RGBA|RGB32|RGBA32F|YUV]; +#X text 30 360 Inlet 1: message: format [RGB|RGBA|RGB32|RGBA32F|YUV]; #X obj 475 683 _gemwin; #X obj 809 707 world_light; #X obj 809 684 gemhead 1; #X msg 672 322 quality \$1; #X msg 685 362 repeat \$1; -#X obj 672 301 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X obj 672 302 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 685 342 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 672 387 t a; #X msg 790 366 clear \$1; -#X obj 790 343 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X text 23 545 Inlet 1: message: clear [0|1] (default : 1); -#X text 65 562 0 to disable the clearing of the color and depth buffer at every rendering; -#X text 22 590 Inlet 1: message: quality [0|1]; -#X text 76 606 GL_NEAREST (default) | GL_LINEAR; -#X text 73 621 (useful only with a direct access from a shader); -#X text 73 665 (useful only with a direct access from a shader); -#X text 22 634 Inlet 1: message: repeat [0|1]; -#X text 75 649 CLAMP_TO_EDGE (default) or REPEAT; +#X obj 790 346 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X text 30 595 Inlet 1: message: clear [0|1] (default : 1); +#X text 65 612 0 to disable the clearing of the color and depth buffer at every rendering; +#X text 30 640 Inlet 1: message: quality [0|1]; +#X text 76 656 GL_NEAREST (default) | GL_LINEAR; +#X text 73 671 (useful only with a direct access from a shader); +#X text 73 715 (useful only with a direct access from a shader); +#X text 30 684 Inlet 1: message: repeat [0|1]; +#X text 75 699 CLAMP_TO_EDGE (default) or REPEAT; #X connect 3 0 18 0; #X connect 4 0 19 0; #X connect 5 0 38 0; From 468ea695bca56a5adcbf90c1c76dd2fbec35625a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 5 Nov 2025 11:19:24 +0100 Subject: [PATCH 384/387] gemframebuffer: document "verbose" message --- help/gemframebuffer-help.pd | 110 +++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 51 deletions(-) diff --git a/help/gemframebuffer-help.pd b/help/gemframebuffer-help.pd index 23917500e..a6a3452f6 100644 --- a/help/gemframebuffer-help.pd +++ b/help/gemframebuffer-help.pd @@ -1,26 +1,26 @@ -#N canvas 607 67 896 750 10; +#N canvas 0 0 896 796 10; #X declare -lib Gem; -#X obj 465 39 cnv 15 420 700 empty empty empty 20 12 0 14 #dce4fc #404040 0; -#X obj 472 441 cnv 15 100 30 empty empty empty 20 12 0 14 #b8b8b8 #404040 0; +#X obj 465 39 cnv 15 420 750 empty empty empty 20 12 0 14 #dce4fc #404040 0; +#X obj 472 464 cnv 15 100 30 empty empty empty 20 12 0 14 #b8b8b8 #404040 0; #X obj 474 48 cnv 15 400 370 empty empty empty 20 12 0 14 #14e814 #404040 0; #X obj 477 71 gemhead 20; -#X obj 664 456 gemhead; +#X obj 664 479 gemhead; #X msg 615 136 dimen 320 240; -#X obj 477 618 rotateXYZ; -#X floatatom 794 577 5 0 0 0 - - - 0; +#X obj 477 641 rotateXYZ; +#X floatatom 794 600 5 0 0 0 - - - 0; #X msg 762 119 color 0 0 1 0; #X msg 602 117 dimen 1024 1024; #X msg 751 79 color 0 0 0 0; -#X obj 477 572 t a b; -#X floatatom 717 619 5 0 0 0 - - - 0; +#X obj 477 595 t a b; +#X floatatom 717 642 5 0 0 0 - - - 0; #X msg 549 262 rectangle \$1; #X obj 549 242 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 509 131 type FLOAT; -#X obj 664 436 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#X obj 477 532 translateXYZ 0 0 -4; -#X obj 477 448 gemframebuffer; -#X obj 664 481 pix_texture; -#X obj 664 508 t a b; +#X obj 664 459 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 477 555 translateXYZ 0 0 -4; +#X obj 477 471 gemframebuffer; +#X obj 664 504 pix_texture; +#X obj 664 531 t a b; #X msg 531 217 texunit \$1; #X msg 495 92 type BYTE; #X msg 503 112 type INT; @@ -28,10 +28,10 @@ #X msg 649 188 format RGB; #X msg 668 230 format RGBA; #X msg 680 250 format RGB32; -#X obj 664 637 square 2; -#X obj 664 599 rotateXYZ -40 0 200; -#X floatatom 707 579 5 0 0 0 - - - 0; -#X obj 477 637 pqtorusknots; +#X obj 664 660 square 2; +#X obj 664 622 rotateXYZ -40 0 200; +#X floatatom 707 602 5 0 0 0 - - - 0; +#X obj 477 661 pqtorusknots; #N canvas 0 50 450 300 rotation 0; #X obj 33 19 inlet; #X obj 33 110 % 360; @@ -61,7 +61,7 @@ #X connect 9 0 12 0; #X connect 11 0 5 0; #X connect 12 0 8 0; -#X restore 504 593 pd rotation; +#X restore 504 616 pd rotation; #X floatatom 531 197 5 0 0 0 - - - 0; #N canvas 125 50 450 300 rotation 0; #X obj 112 29 inlet; @@ -74,27 +74,27 @@ #X connect 1 0 3 0; #X connect 2 0 4 0; #X connect 4 0 1 0; -#X restore 794 552 pd rotation; +#X restore 794 575 pd rotation; #X obj 762 99 loadbang; -#X obj 477 552 color 1 0 0; +#X obj 477 575 color 1 0 0; #X obj 649 275 t a; #X obj 585 154 t a; #X obj 751 165 t a; #X obj 495 160 t a; -#X floatatom 563 511 5 0 0 0 - - - 0; -#X floatatom 607 512 5 0 0 0 - - - 0; -#X floatatom 520 511 5 0 0 0 - - - 0; +#X floatatom 563 534 5 0 0 0 - - - 0; +#X floatatom 607 535 5 0 0 0 - - - 0; +#X floatatom 520 534 5 0 0 0 - - - 0; #X obj 495 184 t a; -#X obj 470 674 cnv 15 410 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; -#X msg 706 702 color 0 0 0 0; -#X msg 706 682 color 0 1 1 0; -#X msg 597 685 lighting \$1; -#X obj 575 685 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; -#X obj 597 712 t a; +#X obj 470 724 cnv 15 410 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0; +#X msg 706 752 color 0 0 0 0; +#X msg 706 732 color 0 1 1 0; +#X msg 597 735 lighting \$1; +#X obj 575 735 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; +#X obj 597 762 t a; #X text 476 52 Example:; #X text 699 10 GEM object; #X obj 7 71 cnv 15 450 130 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; -#X obj 7 238 cnv 15 450 500 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; +#X obj 7 238 cnv 15 450 550 empty empty empty 20 12 0 14 #e0e0e0 #404040 0; #X text 10 294 Inlets:; #X obj 7 205 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0; #X text 14 204 Arguments:; @@ -120,16 +120,15 @@ #X text 100 376 (color format of the framebuffer); #X text 102 445 (background color of the framebuffer); #X obj 546 71 tgl 18 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; -#X floatatom 493 473 5 0 0 0 - - - 0; -#X obj 477 492 scaleXYZ; -#X floatatom 563 476 5 0 0 0 - - - 0; -#X floatatom 528 475 5 0 0 0 - - - 0; +#X floatatom 493 496 5 0 0 0 - - - 0; +#X obj 477 515 scaleXYZ; +#X floatatom 563 499 5 0 0 0 - - - 0; +#X floatatom 528 498 5 0 0 0 - - - 0; #X msg 585 60 perspec -1 1 -1 1 1 20; #X msg 593 86 perspec -1 1 -1 1 3 75; #X text 98 577 (frustum of the framebuffer); #X text 752 59 default; #X text 11 153 NOTE: the default view-point of [gemframebuffer] is at the origin 0/0/0 \, unlike [gemwin] where it is at 0/0/4. You might want to manually insert a [translateXYZ 0 0 -4]., f 72; -#X text 31 271 Outlet 2: texture info : <0.>; #N canvas 484 243 450 300 META 0; #X obj 10 25 declare -lib Gem; #X text 10 45 DESCRIPTION Renders a scene in a texture \, for later use.; @@ -143,14 +142,14 @@ #X text 30 562 Inlet 1: message: perspec , f 66; #X msg 685 270 format RGBA32F; #X text 30 360 Inlet 1: message: format [RGB|RGBA|RGB32|RGBA32F|YUV]; -#X obj 475 683 _gemwin; -#X obj 809 707 world_light; -#X obj 809 684 gemhead 1; +#X obj 475 733 _gemwin; +#X obj 809 757 world_light; +#X obj 809 734 gemhead 1; #X msg 672 322 quality \$1; #X msg 685 362 repeat \$1; #X obj 672 302 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X obj 685 342 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; -#X obj 672 387 t a; +#X obj 649 387 t a; #X msg 790 366 clear \$1; #X obj 790 346 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; #X text 30 595 Inlet 1: message: clear [0|1] (default : 1); @@ -161,6 +160,12 @@ #X text 73 715 (useful only with a direct access from a shader); #X text 30 684 Inlet 1: message: repeat [0|1]; #X text 75 699 CLAMP_TO_EDGE (default) or REPEAT; +#X obj 506 361 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1; +#X msg 506 381 verbose \$1; +#X text 30 734 Inlet 1: message: verbose [0|1]; +#X text 31 271 Outlet 2: texture info : , f 67; +#X text 75 749 verbose printout when rebuilding the framebuffer or not (default is non-verbose); +#X obj 495 328 t a; #X connect 3 0 18 0; #X connect 4 0 19 0; #X connect 5 0 38 0; @@ -172,7 +177,7 @@ #X connect 11 0 6 0; #X connect 11 1 32 0; #X connect 12 0 28 1; -#X connect 13 0 18 0; +#X connect 13 0 116 0; #X connect 14 0 13 0; #X connect 15 0 40 0; #X connect 16 0 4 0; @@ -182,7 +187,7 @@ #X connect 19 0 20 0; #X connect 20 0 29 0; #X connect 20 1 34 0; -#X connect 21 0 18 0; +#X connect 21 0 116 0; #X connect 22 0 40 0; #X connect 23 0 40 0; #X connect 24 0 37 0; @@ -198,19 +203,19 @@ #X connect 34 0 7 0; #X connect 35 0 8 0; #X connect 36 0 11 0; -#X connect 37 0 18 0; +#X connect 37 0 100 0; #X connect 38 0 44 0; #X connect 39 0 44 0; #X connect 40 0 44 0; #X connect 41 0 17 2; #X connect 42 0 17 3; #X connect 43 0 17 1; -#X connect 44 0 18 0; +#X connect 44 0 116 0; #X connect 46 0 50 0; #X connect 47 0 50 0; #X connect 48 0 50 0; #X connect 49 0 48 0; -#X connect 50 0 94 0; +#X connect 50 0 93 0; #X connect 79 0 3 0; #X connect 80 0 81 1; #X connect 81 0 17 0; @@ -218,12 +223,15 @@ #X connect 83 0 81 2; #X connect 84 0 38 0; #X connect 85 0 38 0; -#X connect 92 0 37 0; -#X connect 96 0 95 0; -#X connect 97 0 101 0; -#X connect 98 0 101 0; +#X connect 91 0 37 0; +#X connect 95 0 94 0; +#X connect 96 0 100 0; +#X connect 97 0 100 0; +#X connect 98 0 96 0; #X connect 99 0 97 0; -#X connect 100 0 98 0; -#X connect 101 0 18 0; +#X connect 100 0 18 0; +#X connect 101 0 100 0; #X connect 102 0 101 0; -#X connect 103 0 102 0; +#X connect 111 0 112 0; +#X connect 112 0 18 0; +#X connect 116 0 18 0; From 6d83c3ae1100835c6591cae373eb91841bb83258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 5 Nov 2025 11:24:07 +0100 Subject: [PATCH 385/387] fix comments --- src/Controls/gemframebuffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Controls/gemframebuffer.cpp b/src/Controls/gemframebuffer.cpp index e79bcaae7..09b21c960 100644 --- a/src/Controls/gemframebuffer.cpp +++ b/src/Controls/gemframebuffer.cpp @@ -33,7 +33,7 @@ CPPEXTERN_NEW_WITH_GIMME(gemframebuffer); /* args: * : width(256), height(256), format(RGB), type(uchar) * s : width(), height(), format(format), type() - * f : width()dimen, height(dimen), format(), type() + * f : width(dimen), height(dimen), format(), type() * ss : width(), height(), format(format), type(type) * ff : width(width), height(height), format(), type() * ffs : width(width), height(height), format(format), type() @@ -292,13 +292,13 @@ void gemframebuffer :: postrender(GemState *state) glViewport( m_vp[0], m_vp[1], m_vp[2], m_vp[3] ); // now that the render is done, - // send textureID, w, h, textureTarget to outlet + // send textureID, w, h, textureType and upside_down to outlet t_atom ap[5]; SETFLOAT(ap+0, static_cast(m_offScreenID)); SETFLOAT(ap+1, w); SETFLOAT(ap+2, h); SETFLOAT(ap+3, m_texTarget); - SETFLOAT(ap+4, static_cast(0.)); + SETFLOAT(ap+4, static_cast(0.)); // always correct outlet_list(m_outTexInfo, 0, 5, ap); glActiveTexture(GL_TEXTURE0_ARB); From 814b071be52c8128e953bc98f0d00aac31002f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 5 Nov 2025 11:26:17 +0100 Subject: [PATCH 386/387] clear-framebuffer example: Use [_gemwin] also, i think creating a window on load is rude. --- examples/09.openGL/06.clear_framebuffer.pd | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/examples/09.openGL/06.clear_framebuffer.pd b/examples/09.openGL/06.clear_framebuffer.pd index d87d7d3f4..d305b7b4e 100644 --- a/examples/09.openGL/06.clear_framebuffer.pd +++ b/examples/09.openGL/06.clear_framebuffer.pd @@ -4,7 +4,6 @@ #X obj 42 637 circle 1; #X obj 524 191 gemhead; #X obj 524 479 square 4; -#X obj 36 54 gemwin \; reset \; create \; 1, f 21; #X obj 524 405 pix_texture; #X obj 42 483 t a b; #X obj 42 553 accumrotate 0 0 0; @@ -24,29 +23,28 @@ #X obj 169 399 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000; #X text 132 445 <- depth is not cleared in "clear 0" mode; #X obj 42 224 gemframebuffer \; format RGBA \; dimen 400 400 \; color 0 0 0 0.5 \; clear 0; -#X msg 65 20 destroy; #X text 240 24 This is an example of simple remanence: the buffer is not cleared between 2 images. A black \, mostly transparent square is drawn in order to darken the old image.; -#X connect 0 0 11 0; -#X connect 1 0 17 0; -#X connect 3 0 6 0; -#X connect 6 0 15 0; +#X obj 43 45 _gemwin; +#X connect 0 0 10 0; +#X connect 1 0 16 0; +#X connect 3 0 5 0; +#X connect 5 0 14 0; +#X connect 6 0 7 0; +#X connect 6 1 9 0; #X connect 7 0 8 0; -#X connect 7 1 10 0; -#X connect 8 0 9 0; -#X connect 9 0 12 0; -#X connect 10 0 8 3; -#X connect 11 0 24 0; -#X connect 12 0 2 0; -#X connect 13 0 24 0; -#X connect 14 0 13 0; -#X connect 15 0 4 0; -#X connect 16 0 8 3; -#X connect 17 0 18 0; +#X connect 8 0 11 0; +#X connect 9 0 7 3; +#X connect 10 0 23 0; +#X connect 11 0 2 0; +#X connect 12 0 23 0; +#X connect 13 0 12 0; +#X connect 14 0 4 0; +#X connect 15 0 7 3; +#X connect 16 0 17 0; +#X connect 17 0 19 0; #X connect 18 0 20 0; -#X connect 19 0 21 0; -#X connect 20 0 7 0; -#X connect 21 0 20 1; -#X connect 22 0 21 0; -#X connect 24 0 1 0; -#X connect 24 1 6 1; -#X connect 25 0 5 0; +#X connect 19 0 6 0; +#X connect 20 0 19 1; +#X connect 21 0 20 0; +#X connect 23 0 1 0; +#X connect 23 1 5 1; From a0705649953ea82cd4c416ef1706d78c3a955eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 5 Nov 2025 11:27:17 +0100 Subject: [PATCH 387/387] Install 09.openGL/06.clear_framebuffer.pd --- examples/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Makefile.am b/examples/Makefile.am index 7ded2cd94..3b65b081a 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -118,6 +118,7 @@ nobase_dist_gemexamples_DATA = \ 09.openGL/03.stencilBuffer.pd \ 09.openGL/04.clearZ.pd \ 09.openGL/05.load_identity_matrix.pd \ + 09.openGL/06.clear_framebuffer.pd \ 10.glsl/01.simple_texture.pd \ 10.glsl/02.primitive_distortion.pd \ 10.glsl/03.texture_distortion.pd \