I'll just leave this here...
-
I wonder if we could use a tool like this to come up with visuals?
Its very similar to Touch Designer and could help us peeps that are less code savvy
-
@briandoliveira said in I'll just leave this here...:
I wonder if we could use a tool like this to come up with visuals?
Its very similar to Touch Designer and could help us peeps that are less code savvy
Nodes looks really interesting as well!! I have to take a closer look later.
Shader Code is quite special imho. Itβs not immediately accessible I find. But the possibilities with OpenGL to create graphics that you can influence with a mouse or otherwise in real-time and hook it up to your instrument and its functionalities are quite astonishing. At least if youβre into that kind of thing. Itβs like a multiverse filmstrip! π€―π₯³π€―
-
@Christoph-Hart said in I'll just leave this here...:
No, I was refering to the
ERROR 0:16'}': syntax error: syntax error
message. You can ignore any message that starts with Line XX, Column YY - these are HiseScript errors which you don't need to bother about for this issue. The OpenGL errors start with
ERROR:
Try to reproduce the one above, then add a few lines in the main function and check whether the line number increases (so that it points to an error at the end of the file vs. at the beginning (where I had to add some boilerplate code).
So this is today's macOS - HISE - OpenGL error:
Adding lines doesn't change anything. It'll come up fairly regularly... Maybe it helps... -
But the line number is different. Can you check the file in another text editor to check whether there is a duplicate
}
at the end of your shader file? I remember there was an issue with the new code editor that somehow hides the last character... -
@Christoph-Hart said in I'll just leave this here...:
But the line number is different. Can you check the file in another text editor to check whether there is a duplicate
}
at the end of your shader file? I remember there was an issue with the new code editor that somehow hides the last character...Well. That
}
was on me and my own stupidity! Didn't even have to open another text editor... Sorry...But I could swear that unknown error is Catalina related... If I were on Mojave, it'd probably be working! Damn... This is bugging me...
-
@Christoph-Hart I finally got it working on my MacBook Air 2014... Re-installed everything... Went back to Catalina and compiled HISE etc. Also openGL seems to be working. But I do get this a lot:
Interface:! ERROR: No definition of main in fragment shaderAlso with the "simpler" examples on shadertoy.
Am I missing something?
@Dominik-Mayer's snippet works just fine now!
My 2019 MacPro beast machine still does throw me the Interface:! Unknown Error -
@Christoph-Hart Hey Christoph. I've been noticing some changes on the HISE / shader code - front...
I manage to get it to show the shaders occasionally. I still get an unknown error (both on my MacBook Air 2014 and my MacPro 2019). So, one out of 10 times I hit compile, it acutally shows me the shaders... but very inconsistently...
Really excited about this!
(dev branch, latest commit, 1f682f5)
This one I found while trying some shadertoy examples:
-
-
Is it possible to have multiple shader-panels in one interface?
-
Yes, you can even have multiple shaders per panel.
-
Content.makeFrontInterface(600, 500); const var Panel1 = Content.getComponent("Panel1"); const var Panel2 = Content.getComponent("Panel2"); const var shader = Content.createShader("shader"); shader.setFragmentShader("shader.glsl"); const var shader2 = Content.createShader("shader2"); shader2.setFragmentShader("shader2.glsl"); Panel1.setPaintRoutine(function(g) { g.applyShader(shader, [0, 0, this.getWidth(), this.getHeight()]); }); Panel2.setPaintRoutine(function(g) { g.applyShader(shader2, [0, 0, this.getWidth(), this.getHeight()]); });
Something along those lines?
-
Yes, but you don't need the
setFragmentShader
calls, if you create a shader it automatically compiles it (the call is only required if you want to change the code dynamically). -
oh and you can use
this.getLocalBounds(0)
instead of[0, 0, this.getWidth(), this.getHeight()]
. Less typing, more fun. -
@Christoph-Hart Got it! It's pretty crazy really... Mind blown... π€―
So far my compiled plugin crashes (some GL problems) when I open it...
and...
somehow both shaders react to the sliders on the ui... even though only one shader has these inputs...lots to learn...
-
@Christoph-Hart Is it possible to send values from shaders back to the onInit???
I understand how I can add a uniform float and influence it with a knob, panel, timer, etc... but can I do the same thing backwards from a shader variable?
I hope that makes sense...
-
No, it's a unidirectional communication and the uniform variables are read only in GLSL - it will be accessed by each pixel calculation so it can't change.
-
@Christoph-Hart How is iTime related to timer objects in HISE?
I have a synth timer running in my instrument and the shader panel just runs along with it although I don't pass it anything...
Also when I drag a knob the shader starts moving along. Without me setting up a callback that passes a uniform variable into it...
Got me thinking that maybe a knob also runs on an internal timer-like object... π€―EDIT: It seems like iTime is always running... also while editing the shader keeps changing in the background and visually only shows updates when hovering over UI elements and interacting with them. When I hit compile it catches up with iTime and all is in sync again...
-
Maybe I should hit the screensaver business after all...
Hoping to pass the obligatory psychedelically-influenced first phase of shader coding soon to produce more meaningful and interesting stuff...
-
Yeah, I've been there too. The moment where you stare at a real screensaver and think "Wow that's really beautiful, I wonder how they programmed that" is the moment you need to reevaluate some life choices :)
But have you started playing around with 3D ray marching? That's where the real fun begins :)
-
@Christoph-Hart I wanted to dive in shaper code, but I find the code style just :face_vomiting:
So I postpone this moment the more I can and push even more the panel's paintRoutine in the waiting