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="http://www.collada.org/2005/11/COLLADASchema"
version="1.4.1">
<asset>
<created>2000-01-01T00:00:00Z</created>
<modified>2000-01-01T00:00:00Z</modified>
</asset>
<library_effects>
<effect id="e">
<newparam sid="diffuseSurface">
<surface type="2D">
<format>RGB</format>
<init_as_null/>
</surface>
</newparam>
<newparam sid="diffuseSampler">
<semantic>DIFFUSE</semantic>
<sampler2D><source>diffuseSurface</source></sampler2D>
</newparam>
<newparam sid="ambientColor">
<semantic>AMBIENT</semantic>
<float4>0 0 0 1</float4>
</newparam>
<profile_CG>
<technique>
<pass sid="p">
<shader stage="VERTEX">
<name source="vs">main</name>
</shader>
<shader stage="FRAGMENT">
<name source="fs">main</name>
<bind symbol="g_diffuse"><param ref="diffuseSampler"/></bind>
<bind symbol="g_ambient"><param ref="ambientColor"/></bind>
</shader>
</pass>
</technique>
</profile_CG>
<profile_COMMON>
<technique sid="Blinn">
<blinn>
<ambient><param ref="ambientColor"/></ambient>
<diffuse><texture texture="diffuseSampler" texcoord="TEX0"/></diffuse>
</blinn>
</technique>
</profile_COMMON>
</effect>
</library_effects>
</COLLADA>