Blender as a GLSL editor

I’m thinking that it’s probably worth it to extend the .egg format until we get a native COLLADA loader, I’ve been thinking about doing this for a long time now. I’m excited about the idea of exporting shaders from Blender to Panda.

I’m thinking that there could be entries at the top of an .egg file, similar to how there are and entries. Each entry could specify either paths to the appropriate shader files, or embed the actual shader code, ie:

<Shader> shader1 {
  <Scalar> language { glsl }
  <Scalar> fragment-file { filename1.sha }
  <Scalar> vertex-file { filename2.sha }
}

Or, in the case of a Blender exporter it may be best to avoid using a separate file, and embed the contents directly:

<Shader> shader1 {
  <Scalar> language { glsl }
  <Scalar> fragment-code {
    .. shader code goes here ..
  }
  <Scalar> vertex-code {
    .. shader code goes here ..
  }
}

Or for Cg shaders, which are often (but not necessarily) combined in a single file:

<Shader> shader1 {
  combined-filename.sha
  <Scalar> language { cg }
}

Then, we have an on the polygons to apply the shader just as there are and entries.

Simple shader inputs could be specified on the level if necessary, as follows:

<Group> mygroup {
  <Param> myFloat { 1.03 }
  <Param> myVec { 1 1 0 }
  <Param> myNodeRef { <Ref> { someGroup } }
  ...
}

What do you guys think? If drwr is also onboard with this, then I can probably make this happen before the next release.