Attaching Blender shaders with glsl shaders in the same program.

Hello,

Is it possible to attach glsl shaders to the shaders from blender?

I know I can replace the shader with the setsource(vertexshader, fragmentshader, 1), but how could I mix this with the original blender shader? More specifically, is it possible to write some glsl and use the output for the diffuse color of a material, or use glsl to apply some other drawcalls after the blender shader is called?

Ok, I think I got it! :slight_smile:

For those interested, the module gpu has a function called export_shader() that converts a material into glsl that I can then link to other shaders!

Even better, it seems to work with Cycles material also! :slight_smile:

1 Like