gl3 package update 0.1.1

    Jitter

    Rob Ramirez's icon
    Rob Ramirez's icon
    Rob Ramirez
    Sep 16 2019 | 6:43 pm
    Hey everyone, there is an update to the gl3 package currently live in the Package Manager.
    Big thanks to everyone who has taken it for a spin and provided your feedback and bug reports.
    Changelist below: - jit.gl.slab fix read message (affecting some vizzie modules) - jit.gl.mesh fix draw_modes that require splitting on matrix input rows - put in some checks and warnings for opengl versions on specific features, prevent crashing - allow OpenGL 3.2 supported contexts on Mac - better error reporting when encountering unsupported hardware - jit.gl.sketch fix cmd_enable message - jit.gl.buffer fix context rebuilding when @texbuf enabled - fix tb.point.lights.jxs lighting calculation - jit.gl.texture fix for file read with @type float32 - jit.gl.mesh handle non-standard planecounts on input matrix

    • Guillaume's icon
      Guillaume's icon
      Guillaume
      Sep 18 2019 | 4:54 pm
      Hey this package is great thank you very much for that. I especially like the shadertoy loader. Is it working also with Multipass shaders ?
      Share
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Sep 19 2019 | 5:27 pm
      hey GUILLAUME, the shadertoy loader is there mainly as as starting point (I am just now noticing that it will fail on any shaders that have cubemaps as input channels). I believe multi-pass shaders will just involve creating a jit.gl.slab for each buffer, and sending them as inputs to the main slab (don't use the leftmost inlet, that's just there to map to window size). if there's a particular one you're interested in please take a crack at it and post here if you get stuck.
    • billyanok's icon
      billyanok's icon
      billyanok
      Sep 19 2019 | 7:59 pm
      Hey, Are there any issues using GL3 on standalones?
      Thx, Bill
    • Guillaume's icon
      Guillaume's icon
      Guillaume
      Sep 20 2019 | 5:28 am
      Thank you Rob, I will try to post something today :)
    • Guillaume's icon
      Guillaume's icon
      Guillaume
      Sep 20 2019 | 2:10 pm
      it's perfeclty working yes!
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Sep 20 2019 | 3:35 pm
      @BILLYANOK, I just tested and it does seem to work OK, but you'll have to manually copy the gl3 package into the c74/resources/packages folder of your standalone. You will also have to ensure that your app preference glengine setting is set to gl3. you can either manage this file yourself, or the first time you launch your app open a file with the a loadbang on a message box with: ; max glengine gl3 @GUILLAUME please share!
    • billyanok's icon
      billyanok's icon
      billyanok
      Sep 20 2019 | 4:37 pm
      Rob, Thank you for the reply. Curious, How would I "manage this file yourself.."? Is this in the Plist file? Bill
    • billyanok's icon
      billyanok's icon
      billyanok
      Sep 20 2019 | 5:41 pm
      Hey Rob, The message box with "; max glengine gl3" and copying GL3 folder works a treat. ThX! Bill
    • Guillaume's icon
      Guillaume's icon
      Guillaume
      Sep 22 2019 | 5:42 pm
      I'm so happy for the shadertoy loader, in 10min we can have beautifull results, I share the patch
      glitch2.gl3.jxs
      jxs 4.04 KB
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Sep 23 2019 | 3:50 pm
      very cool!
    • Guillaume's icon
      Guillaume's icon
      Guillaume
      Oct 01 2019 | 1:42 pm
      hey Rob, I tried another shadertoy code, and I have this error: error C1503: undefined variable "iChannelResolution"
      I think max doesn't understand what is "iChannelResolution[0].xy" variable. I think is the resolution of the channel 0 in pixel. Do you know by what I need to replace this expression ?
      by the way is this one : https://www.shadertoy.com/view/ldV3Wc
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Oct 01 2019 | 2:03 pm
      unforutnately the iChannelResolution uniform array does not easily map to Jitter's builtin texture-dimension state uniforms which are not passed as an array (TEXDIM0, TEXDIM1, etc). so you must first add in the uniform declarations and bindings for any of these variables used, noting that in the shadertoy jxs template the iChannel0 texture is actually bound to jitter texture 1 (first texture is simply a dummy texture) <param name="iChannelResolution0" type="vec2" state="TEXDIM1" /> <param name="iChannelResolution1" type="vec2" state="TEXDIM2" /> <bind param="iChannelResolution0" program="fp" /> <bind param="iChannelResolution1" program="fp" /> ... uniform vec2 iChannelResolution0; uniform vec2 iChannelResolution1; finally you must find and replace the array with your newly declared uniform, e.g. find iChannelResolution[0] and replace with iChannelResolution0.
      we can add all the declarations to the template for a future gl3 package update, leaving the only task for users the search and replace in the pasted in shadertoy glsl.
    • billyanok's icon
      billyanok's icon
      billyanok
      Oct 02 2019 | 8:41 am
      Guillaume, Did you manage to get this working? I must have missed something very simple? No errors in console. Thx, Bill
    • Guillaume's icon
      Guillaume's icon
      Guillaume
      Oct 02 2019 | 9:12 am
      Hey thanks Rob, no errors in the console now with your code. But at the end my window is black so for me is not working but I don't know why and the code from shadertoy is too much complicated for me to understand... I will post the patch here if someone want to look inside
    • Guillaume's icon
      Guillaume's icon
      Guillaume
      Oct 02 2019 | 9:21 am
      So here is the patch. I tried to clean up so I hope it will be readable for you. I think problems starts in the jit.gl.slab buffer C. Have a nice day guys
    • Jaky's icon
      Jaky's icon
      Jaky
      Oct 02 2019 | 2:36 pm
      Hi there, very exciting upgrade! thanks
      I get this error message from 3D texture 1 & 2 in the xample patches
      jit.gl.texture: update_teximage_state: GL Error: Out of memory
      GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
      I am on a i7 + GTX 1060
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Oct 03 2019 | 2:24 pm
      hi JAKY, thanks much for testing. see the thread here regarding your report: https://cycling74.com/forums/issues-with-certain-gl3-features
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Oct 03 2019 | 2:32 pm
      GUILLAUME, I'll try to find some time to look at this in more detail in the not too distant future, but hopefully some others can also take a look.
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Feb 22 2021 | 6:32 pm
      Hi Rob, seconding Byllianok, how can I create this file in order to have the external always to start with the gl3 engine? What's the syntax and where should it be put in the resources? Thank you!
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Feb 22 2021 | 7:16 pm
      check out the "preffilename" attribute in the standalone object's reference page.
      you could write out this preference file to the correct location using some script as part of the application install process.
      easier may be to create a loader patch that first sets the preference via the ; max glengine gl3 message, and then loads the guts of the patch. As long as that preference is set prior to any jitter objects instantiating then you should be good.
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Feb 22 2021 | 7:24 pm
      Thank you a lot for the fast reply!
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Feb 25 2021 | 8:22 pm
      Hi again Rob, using a ; max glengine gl3 message prompts the user to restart the application with a pop-up dialogue. Could you elaborate on the preference file further? This should fix the issue with the pop-up box.
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Feb 26 2021 | 5:47 pm
      the message needs to be sent before any jitter objects are loaded (otherwise you get the restart dialog), so your app probably needs to have some type of loader patch that sets the pref and then immediately loads the "guts" of the app (either via scripting or pcontrol "load" message).
      i've never tried messing with the standalone preference files, so the standalone object reference is your friend (as well as tim places's standalone walkthrough videos). In theory, you can copy the standalone preference file to the appropriate place via some installer script.
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Feb 27 2021 | 10:41 am
      Thank you very much Rob!
      So, for what I see there is no way on the standalone object to set the GL engine. Am I missing something?
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Feb 27 2021 | 10:23 pm
      Also, changing the engine and then using the pcontrol to load the main patch, prompts the dialogue box to restart Max. That's the loader patch I'm using:
      Max Patcher
      In Max, select New From Clipboard.
      Show Text
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Feb 27 2021 | 10:28 pm
      Ok, I simply wrote: max glengine gl3 inside one of the txt files in the init folder of the standalone and it seems to work!
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Mar 01 2021 | 4:29 pm
      yes, that's the ticket! nice find!
    • Jaehoon Choi's icon
      Jaehoon Choi's icon
      Jaehoon Choi
      Mar 06 2021 | 4:27 pm
      Hello everyone! I have a question related to shadertoy in Max. I trying to implement a shadertoy which takes audio as an input for iChannel (https://www.shadertoy.com/view/lsV3W1) Does anyone know how to take audio as an input to jit.gl.slab in Max?
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Mar 08 2021 | 4:26 pm
      the ISF package has a pretty great audio-to-texture utility for its audio-reactive shaders. I went ahead and adapted that to the format expected by shadertoy (512x2 texture, fft in first row, waveform in second) and ported the basic shadertoy sound shader.
      this should give you enough to go on to port any audio based shader you like.
    • πŸ‘½Rβˆ†Jβˆ† The Resident βˆ†lienπŸ‘½'s icon
      πŸ‘½Rβˆ†Jβˆ† The Resident βˆ†lienπŸ‘½'s icon
      Thank you so much for those, Rob!
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Mar 09 2021 | 6:26 pm
      That's amazing Rob!! Can I ask you what's the purpose of the [jit.scissors @rows 1 @columns 2] object? And the jit.expr with the log is to uniformly represent the frequency spectrum? Thank you!
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Mar 10 2021 | 3:52 pm
      the scissors is just chopping the lower half of the spectrum, as the upper half is redundant i believe? and that's my guess as well on the jit.expr.
      lots of ideas in this domain to be mined searching the forums for "spectroscope" or some variation (including the origins of the ISF patcher). This one is pretty interesting as well.
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Mar 11 2021 | 8:53 am
      Amazing! Thank you
    • Jaehoon Choi's icon
      Jaehoon Choi's icon
      Jaehoon Choi
      Mar 12 2021 | 11:30 am
      Thank you so much!!
    • Jaehoon Choi's icon
      Jaehoon Choi's icon
      Jaehoon Choi
      Mar 13 2021 | 3:51 pm
      Hello Rob, I succeeded getting the audio input part working. Thanks alot! I have one more question related to Rob's patch. The shadertoy that I would want to implement has one buffer and one image. The buffer takes the audio signal in iChannel0(which is now working!), and takes itself to iChannel1.
      For Multi-buffer shadertoy, I tried the technique introduced by Federico in his youtube channel(you are awesome Federico!!). However, the patch Rob created takes iChannel0, which was the texture converted from the audio in his original patch, in the right inlet, whereas Ferderico took iChannel0 input to the left inlet, and iChannel1 input to the right inlet through a [jit.gl.slab @automatic0 @thru 0].
      Did the syntax for jit.gl.slab have changed then before?; which totally makes sense since this tutorial was made almost 3 years ago. If this is the case, I would appreciate it if anyone knows how to deal with multi-buffer shadertoy in the current version.
      Thanks! All of you are amazing :)
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Mar 15 2021 | 6:50 pm
      it depends on how your shader is structured. for the shadertoy example distributed with gl3, the leftmost inlet is simply used to size and trigger the output, and otherwise is ignored in the shader. This is not a requirement, but seemed to me at the time to make porting between the 2 spaces easier. I've also since realized that it probably makes more sense to require @rectangle 0 on all slabs and texture inputs, which gives better compatibility with Shadertoy source.
      Implementing shadertoy buffers requires a separate jit.gl.slab for each buffer, so it probably makes sense to implement a more specific shader (rather than the general purpose one provided with the package). It also requires implementing some kind of initialization stage (ie sending a "dummy" texture input at the desired dimensions and texture type), and in cases where the buffer takes itself as input, a loopback stage (an extra jit.gl.slab to store the output and then patched back into the input).
      I've got an example of this working for a fairly complicated shadertoy effect, but it requires an update to the gl3 engine to fix a bug with cubemap inputs. I will try and push this update out sometime this week, but in the meantime I've attached the shader and patch here. This archive also contains updated versions of the gl3 extension for both Mac and Windows, that should work with the current release version of Max 8, simply replace these files in Documents/Max 8/Packages/gl3/extensions.
    • πŸ‘½Rβˆ†Jβˆ† The Resident βˆ†lienπŸ‘½'s icon
      πŸ‘½Rβˆ†Jβˆ† The Resident βˆ†lienπŸ‘½'s icon
      an emoji rendering of my reaction to your molten-bismuth: πŸ€―πŸ’¨πŸŒŠ thanks again, Rob! πŸŒšπŸ†πŸŒ (also, just noticed that gl3 itself is a max extern(.mxo/.mxe64)...interesting πŸ€”πŸ§πŸ€“)
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Mar 15 2021 | 10:06 pm
      always glad to get an emoji symphony Raja! and yes, that particular shadertoy is a beauty. all kudos to the original author, i just copied and pasted and moved some boxes around.