OpenGL shader is not working in 4.0.0
-
Hi everyone,
I used some OpenGL shaders in my project, which worked fine in HISE 3.6.2. Now I moved to 4.0.0, and in HISE everything seems to be working fine, but as soon as I export it into a plugin, it doesn't work anymore.
Mac: The plugin is not opening in my DAW, it says "It could not be opened".
Win: The plugin starts properly in my DAW, but the shader panel is not showing anything.As soon as I remove my shader, the plugin works fine again on my Mac as well.
Do you have any idea what can be the problem?
Thanks!
Gábor -
Hi again,
Is there anyone who successfully used a shader in HISE 4.0.0?
Any help would be greatly appreciated.Thanks!
-
@Gabor-K keep in mind that macOS doesn't support openGL anymore
-
Thanks @aaronventure ! The intereting point is that my plugin worked properly with HISE 3.6.2, and I could export it, and use as a plugin on my Mac. Now I can't.
-
@Gabor-K Does it work now if you export it again from the previous version?
-
@d-healey I just exported it again from 3.6.2, and it still works fine.
-
@Gabor-K OpenGL shaders is a very volatile system and whether it works correctly depends on many different factors.
Do the OpenGL examples from the snippet browser run on your system?
-
@Christoph-Hart
I tried the Morphball snippet, and it works fine in HISE (Morphball is showing up, and reacts to the sound), but not in the exported plugin (only the keyboard is visible at the bottom). -
Is there anyone who works with shaders in HISE 4.0.0? If yes, at least I would know that I have some problems with my setup.
If someone is working with shaders, is there anything special in making it work besides enabling OpenGL?Thanks in advance!
-
@Gabor-K I was using it on mac but I stopped. It wasn't working anymore and the performances weren't what I expected. In the end even when enabling the flag it simply didn't worked so I dropped it all...
-
Actually I noticed that there's an issue with the embedding of the shader code when exporting the plugin.
I'll take a look at it later, but I also second @ustk's experience, in the end OpenGL is too brittle (especially macOS) to work reliably. If it's for a nice-to-have eye candy add on then go for it, but I wouldn't recommend using it as a core feature of your interface (anymore).
-
Thanks @ustk and @Christoph-Hart !
Yeah it would be definitely just an eye candy. We already designed the GUI of our product to have that in 3.6.2, and comitted to it, so we would stick to that whenever it is possible in version 4.0.0 as well.
@Christoph-Hart Please let me know when you could take a look, your help would be greatly appreciated. :folded_hands:
-
@Gabor-K sure. I think I broke it when reworking the handling of external files to be included in HiseSnippets a few months ago, so thanks for the heads up. I'll let you know when it's fixed.
-
Alright, I checked again on my studio mac and the Morph Ball example does work in the compiled plugin, so it's not an issue of the file system. However there are a few pitfalls:
- Since the example snippet is embedding the GLSL file, it will not be written to disk so if you copy over the example as is and then export your project as plugin / standalone app, it will not contain the file content and the shader will appear empty. In order to make it work, you have to explicitely copy over the embedded files (using File -> Copy embedded files to project folder), then load the snippet and export
- You also have to enable OpenGL in the GeneralSettings.xml file (or through something on your interface that enables OpenGL). If I do these two things then it shows up properly (both on Windows and macOS).
Can you make a test project with only that shader of yours that causes the problem and see if it compiles, if not, then send it to me and I'll check. I haven't changed too much on the internals of the shaders so I wouldn't know what might be the issue until I can debug it, but if it worked with 3.6.2 we'll get it working again.
-
Thanks @Christoph-Hart !
I went through your points and everything seems to be working well now, even the shader we use in our plugin! I'm not 100% sure what made it work, as OpenGL was already enabled in the GeneralSettings.xml file, but everything is running smoothly now.
Thanks again for your time!
-
@Gabor-K haha that‘s always the least satisfying fix :)
But it goes to show how fragile Open GL is (or has become) on macOS. Which is a shame because you can do really cool stuff with it).
-