The rules for resolving SIDs, and FX SIDs in particular, are not very clear. With regard to FX SIDs in particular, how do I know at which element to start the search for a particular SID? Consider, for example, the “texture” atttibute of <texture> element:
<effect id="Scene_Material_fx"> <profile_COMMON> <newparam sid="acorn_png_surface"> <surface type="2D"> <init_from>acorn_png_img</init_from> </surface> </newparam> <newparam sid="acorn_png_sampler"> <sampler2D> <source>acorn_png_surface</source> </sampler2D> </newparam> <technique sid="default"> <phong> ... <diffuse> <texture texture="acorn_png_sampler" texcoord="diffuse_TEXCOORD"></texture> </diffuse> ... </phong> </technique> </profile_COMMON> </effect>
I can find the SID referenced by texture if I start the search at <profile_COMMON>, which is the great-great-grandparent of the <texture> element that contains the reference. How, then, is the ID of this starting element determined? Is it defined somewhere in the spec?
Is there a limit to how close to the document root the sid referenced by a particular <texture> element may be found? In the above example, could it possibly appear outside of <profile_COMMON>, such as inside its <effect> parent? Which is the “rootmost” element at which I am guaranteed to find the referenced sid by drilling down from that element?