Previous topicNext topic

Render GLSL Shader using C++ Plugin

Questions, comments, feedback, etc.
Post Reply
coolhand2120
Posts: 9
Joined: Fri May 24, 2019 9:03 am

Render GLSL Shader using C++ Plugin

Post by coolhand2120 »

Like the topic says. I have compiled the shader code using:

glShaderSource(vertexShader, 1, const_cast<const char**>(&src), NULL);

glCompileShader(vertexShader);

I've used glGetShaderInfoLog to check for errors in the shader code, no shader errors.

Using
GLuint shaderProgram = glCreateProgram();

glAttachShader(shaderProgram, vertexShader);

To attach the shader.

There's more code, but it's likely not the correct code so I won't bother posting what I have unless it's asked for. The code runs and I have no errors.

As you can probably guess there's no output into the magic video window. I'm kinda lost here, not sure how to get this into the magic window from this code.

Any help would be wonderful!

Thanks!
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Render GLSL Shader using C++ Plugin

Post by Magic »

If you’re new to C++ and/or programming in general it might be pretty hard for you to get something like that to work.

Is there some reason that the existing GLSL/ISF functionality in Magic isn’t sufficient for you?
coolhand2120
Posts: 9
Joined: Fri May 24, 2019 9:03 am

Re: Render GLSL Shader using C++ Plugin

Post by coolhand2120 »

I am not new to programming. I've been programming for almost 30 years. I've been programming in C++ and GLSL shaders for about 150 lines of code. I'm more used to C#, Java, py, go.

I am trying to side load GLSL shaders via HTTP requests to a popular GLSL shader website. I want to pass an ID to the shader and wire everything up automatically. Produce the correct in/outs prams etc.

I have everything working (network, parsing, compiling, etc.) besides the GLSL part (I think, hard to tell without video output).

I can get the shader to compile without errors. I just don't know how to attach it. I can figure out how to wire up the params and maybe even dynamically create/destroy the inputs/fields etc. based on the JSON from the HTTP response.

I know I'm likely missing fragment/vertex shader linking, program linking etc. This is what I need help with.

If you still think I'm hopelessly lost I might not pursue it, but I feel like I just need help with the GLSL part.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Render GLSL Shader using C++ Plugin

Post by Magic »

Honestly I think it will be much more complicated than you think, and maybe even outside the scope of what help I can provide to you via the forums, even if just from a practical standpoint... in my experience, diagnosing OpenGL problems can take hours and that's free time I just don't have. If you really want to nail this down then I'd suggest contacting us for premium services through our web site.
coolhand2120
Posts: 9
Joined: Fri May 24, 2019 9:03 am

Re: Render GLSL Shader using C++ Plugin

Post by coolhand2120 »

Thanks for the assessment!
Post Reply