Help!! With Id3dxFragment linker
Question for the Black belts out there: I am writing a material editor application where i would like to let the user select different pre-written pixel and vertex fragments to work with to create a combined "effect". The interface finds all of the constants and displays the allowing the user to change things like material diffuse, specular power etc. I am familiar with how to use the fragment linker but I think i am missing something conceptually whenusing with with pixel fragments. In the dx samples they make it look like the fragment linker may be used to cascade outputs of fragments, i.e. linking a fragment for diffuse or ambient lighting followed by fragment for animation or not (as per the samples) How can i do this with pixel fragments without using multiple passes? Example: I would like to be able to write a fragment that does nothing but apply a texture, and then have another fragment that modulates that tex by a color. (generalized code)
float4 PS_Texture(inout float4 outColor: r_Color1) : Color
{
r_Color1 = tex2d(someSampler, texcoord);
return r_Color1;
}
pixel_fragment myfrag1 = compile pixel_fragment()etc.
float4 PS_ModColor(float4 outColor : r_Color1): Color
{
r_Color1 *= someModColor;
return r_Color1;
}
pixel_fragment myfrag = compile pixel_fragment()etc.
Is it possible to do something like this and if so how? When i link pixel fragments it executes one and never gets to execute the other , unlike the vertex fragments. If it is not possible what is the point of linking pixel fragments?

