ColladaFX shared parameter refencing

I’ve been looking around try to find an example of how to share parameters between the profile_CG and profile_COMMON. I haven’t found any examples of what this would look like, but from reading the specification, I created this Collada document below. This validates against the schema, but neither FCollada nor COLLADA_DOM are capable of handling an effect like this.

Is there a collada library that supports shared parameters yet that can be used to verify this document against?

Are there any examples of effects that share parameters between profiles in the wild yet?

Are there any other expected problems with defining an effects like this?

<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns=""
    <effect id="e">
      <newparam sid="diffuseSurface">
        <surface type="2D">
      <newparam sid="diffuseSampler">
      <newparam sid="ambientColor">
        <float4>0 0 0 1</float4>
          <pass sid="p">
            <shader stage="VERTEX">
              <name source="vs">main</name>
            <shader stage="FRAGMENT">
              <name source="fs">main</name>
              <bind symbol="g_diffuse"><param ref="diffuseSampler"/></bind>
              <bind symbol="g_ambient"><param ref="ambientColor"/></bind>
        <technique sid="Blinn">
            <ambient><param ref="ambientColor"/></ambient>
            <diffuse><texture texture="diffuseSampler" texcoord="TEX0"/></diffuse>

Your example looks right to me. What do you mean when you say that the DOM doesn’t handle an effect like that? It’s up to the client to resolve SID values, so as long as the DOM reads in all the data correctly I would think that it succeeded.

I’m not sure of what apps (if any) support shared parameters properly. Did you try Feeling Viewer?

To be me more accurate, Collada_DOM parses it okay.

The fact that you cannot cast between domCommon_newparam_type and domFx_newparam_common make it non-trivial to add support to Collada_FX / Collada_RT (or at least, I could not find a way to easily cast between them).

Yeah, since those are completely distinct types in the schema, the DOM code generator creates distinct classes for each. You can’t cast between them. You have to write two paths unfortunately.

If you use the daeSIDResolver class to resolve the sid to an element, you can figure out which type of <newparam> it is as follows:

if (domFx_newparam_common* param = daeSafeCast<domFx_newparam_common>(element)) {
    // do stuff
else if (domCommon_newparam_type* param = daeSafeCast<domCommon_newparam_type>(element)) {
    // do stuff

So the DOM shouldn’t be a limiting factor in RT’s ability to support shared parameters.