I'll just leave this here...
-
Question regarding exporting a standalone application with inserted shaders. I'm not a wiz in scripting, although learning. I did manage to get shaders working in interface designer, but whenever I export it to standalone the shaders are not visible.
I assume it's something obvious I might have forgotten to include, but couldn't find what might be wrong.
-
@fellowfinch Use OpenGL is disabled by default in a plugin that runs.
You need to compile HISE with the use_opengl flag enabled (it's somewhere in the projucer). You can see that in the General Settings file in the AppData folder of your plugin.
Also if you want to make sure that it gets set to 1, you can just tweak or create that file with the correct flag on install.
-
@aaronventure
thank you for your reply, however I still can't get HISE to export it with shaders.I did the following;
- opened projucer and opened the HISE standalone file
- in hi_core module I chose "enabled" on USE_OPENGL and in juce_opengl I flagged use global path
- compiled it in xCode as a standalsone and opened the file in my Build folder
- in my project I went to "Settings" - Development and flagged "Use Open GL"
- exported as a standalone, and once the build was finished, opened it up but its lacking the shaders in the GUI
@aaronventure said in I'll just leave this here...:
You can see that in the General Settings file in the AppData folder of your plugin.
Can't seem to find this particular folder, also probably should mention I'm using a Mac.
@aaronventure said in I'll just leave this here...:
Also if you want to make sure that it gets set to 1, you can just tweak or create that file with the correct flag on install.
Still learning... how exactly do I do this? I tried searching for the files via search and opening up in Sublime to see if there is any file I can change that "open GL" is set to 1. I'm aware this strategy might not be viable...
I can provide any screenshots that might help to pinpoint the problem :)
-
@fellowfinch /Users/YOURNAME/Library/Application Support/Company Name/Project Name/`
-
aha, I though you were referring to the folder where my project is stored.
I went into the path
/Users/YOURNAME/Library/Application Support/HISE/`to the HISE General Settings and changed the "0" to 1, like so;
<?xml version="1.0" encoding="UTF-8"?> <GLOBAL_SETTINGS DISK_MODE="0" SCALE_FACTOR="1.0" VOICE_AMOUNT_MULTIPLIER="2" GLOBAL_BPM="-1.0" MIDI_CHANNELS="1" OPEN_GL="1"/>
Sadly, when I tried exporting to standalone the shader files did not appear. Even though I can see that there is an include_juce_opengl file in the arm64 folder of the build.
I tried recompiling the HISE standalone app again, making double sure that the openGL was enabled and tried again, yet no shaders are present.Just to make sure, shaders should appear by exporting the hise project and then finding it in the Binary folder as an exec file?
-
@fellowfinch if it's standalone, yes, it's .exe.
can you also try calling Settings.setEnableOpenGL(true) in your on init script?
-
@aaronventure said in I'll just leave this here...:
Settings.setEnableOpenGL(true)
Content.makeFrontInterface(850, 420); Settings.setEnableOpenGL(true); //our sampler const var Sampler1 = Synth.getChildSynth("Sampler1"); //sample maps array const var SampleMaps = Sampler.getSampleMapList(); const var ComboBox1 = Content.getComponent("ComboBox1"); //combo box ComboBox1.set("items", SampleMaps.join("\n")); inline function onComboBox1Control(component, value) { Sampler1.asSampler().loadSampleMap(SampleMaps[value-1]); }; Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control); //image input const var pnlBCK = Content.getComponent("pnlBCK"); pnlBCK.loadImage("{PROJECT_FOLDER}test.png", "bck"); pnlBCK.setPaintRoutine(function(g) { var a = this.getLocalBounds(0); g.drawImage("bck", a, 0, 0); }); //shaders //static shader const var Panel1 = Content.getComponent("Panel1"); const var shader = Content.createShader("shader"); Panel1.setPaintRoutine(function(g) { g.applyShader(shader, [0, 0, this.getWidth(), this.getHeight()]); }); //earth shader const var Panel2 = Content.getComponent("Panel2"); const var shader2 = Content.createShader("shader2"); Panel2.setPaintRoutine(function(g) { g.applyShader(shader2, [0, 0, this.getWidth(), this.getHeight()]); });
ran this and compiled ok, the generalSettings file also has a "1", alas shader is not seen in the exported file. I can interact and manipulate it normally inside of HISE though...
-
@fellowfinch alright, this is the last one I have, then I'm all out of ideas.
There's a FloatingTile component with ContentType = CustomSettings, and one of them is a switch for enabling open GL. can you add that to your plugin, compile it, see if that works.
-
@fellowfinch do you have a graphics card that will render OpenGL?
-
@aaronventure said in I'll just leave this here...:
There's a FloatingTile component with ContentType = CustomSettings, and one of them is a switch for enabling open GL. can you add that to your plugin, compile it, see if that works.
Added this tile and checked if openGL is set to "true", compiled it and it did not work. Bummer :/
@Lindon said in I'll just leave this here...:
@fellowfinch do you have a graphics card that will render OpenGL?
I'm running an M1 Mac 14", I think it should handle the shaders
here are the specs
https://support.apple.com/kb/SP854?viewlocale=en_AM&locale=en_AMIs there any chance of ziping the project file here so anyone can try running it at their end and seeing if it works and maybe it's just my computer or? We can even do it through DM, if anyone has the willpower and time to help me pinpoint the problem.
-
@fellowfinch Didn't Mac deprecate OpenGL and switch to Metal?
Edit: Yup, here - https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html
-
@d-healey said in I'll just leave this here...:
@fellowfinch Didn't Mac deprecate OpenGL and switch to Metal?
Edit: Yup, here - https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html
yep there you go - no OpenGL on your machine.
-
@d-healey Oh well, good to know.
Apple gonna Apple.
-
ahaaa, thank you for clarifying! I assume HISE does not support anything via Metal? Meaning I'm out of the lovely shaders for my plugs:anxious_face_with_sweat:
-
@fellowfinch You can try webview which will run a frontend in the native browser so you can use WebGL (check if that will work in Safari), but the limitation is that you cannot display any other components on top of the webview.
-
I have checked and indeed my browser supports webGL, but wouldn't this be a tad bad since the end users might not get the shader graphics due to them being on different systems?
I assume you can port openGL shaders to Metal shaders but HISE may not support that? Or am I thinking wrongly here...
-
@fellowfinch webview will run in whatever native browser is there on each OS. I think the native browsers on MacOS, Windows and Debian all support the latest stuff, no?
You'll have to get a Windows setup going anyway in order to compile the Windows plugins, so you'll be able to check.
-
@aaronventure said in I'll just leave this here...:
Debian all support the latest stuff, no?
Webview isn't implemented on Linux. As far as I know (and hope!) there is no such thing as a native browser on Debian.
-
@fellowfinch Did you ever resolve this issue? I just spent over a month learning shaders just to learn Mac doesn't support OpenGL. I would hate to scrap my beautiful animation that works in the windows version.
-
@obolig Sadly no :/
I just decided to scrap it and focus on other stuff. If anyone finds a possible solution so animation would work on Standalone, AU on Mac etc please let us know :)
As far as I understand the only shaders that would work would be Metal, so a converter would be an option here. MoltenGL is a bit pricey but allegedly it can convert openGL stuff to Metal quite seamlessly.