I'll just leave this here...
-
If you add some empty lines in your main method, does the line number at the syntax error message change?
-
@Christoph-Hart The error I get for @Dominik-Mayer's example is this one:
No specific lines are mentioned. One error per compile...And the following line 11 error is for Console.print(shader.getOpenGLStatistics());
The line number changes when adding empty lines.EDIT: Just to be sure. Are there any specific flags, checkboxes that I need to set in Projucer that I might have forgotten?
EDIT 2:
I haven't seen this one before...
-
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).
-
@Christoph-Hart I got the error... then added a few lines... got the same error... added a few more lines... same error... So it stayed the same, 3 times...
Though if you asked my how I reproduced them systematically... Couldn't say... there's (at least) no apparent system to it... clicking... compiling... changing windows selection seems to have an influence. (Canvas: Interface back to Script Editor... selecting panel... compiling with shift-f5 from the shader code window...) It's a nasty business.
So here's that nasty bugger once more:
-
@UrsBollhalder
Just a random guess:
Did you make sure to get rid of the ""s around "shader"?. It should look like this:g.applyShader(shader, [0, 0, this.getWidth(), this.getHeight()]);
Found this in your earlier snippet, but hope you've gotten rid of it by now..
All bests,
Dominik -
@Dominik-Mayer I think I got rid of it, yes! But Iβll double check when I get back!
-
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...