Saving ShaderAttrib to a bam file

So far, I’m the only one who is confused that I can save a shader object to a bam file and later upload it.

shader = Shader.load(Shader.SL_GLSL, vertex="shaders/vertex.glsl", fragment="shaders/fragment.glsl")

file = BamFile()
file.open_write('shader.bam')
writer = file.get_writer()
writer.write_object(shader)
writer.flush()
file.close()

However, this breaks down if you save the model with the assigned shader.

:util(warning): Objects of type ShaderAttrib cannot be read; bam file is invalid.

This is at least strange.

It’s not properly supported.

It will be supported with the new shaderpipeline in 1.11.

2 Likes