# directx 10 fx file question

## Recommended Posts

anyone know how to declare rendertargets and set them in an fx file? I know there is an interface to get and set them as well as depth/stencil views. But, I have found nothing in the sdk docs, samples , or online on how that works in the fx file or for that matter any good in depth info on the fx file format.

##### Share on other sites
What do you want exactly?
You can use something like this, to output to multiple render targets at the same time:
struct PS_Output{	float  a : SV_Target0;	float2 b : SV_Target1;	float3 c : SV_Target2;	float4 d : SV_Target3;};

The render targets are declared and set in the application, as you say.

##### Share on other sites
There is an interface ID3D10EffectRenderTargetView in the D3D10 Effect classes. Its a variable type so I would need to know what name to use in getting the variable from the effect class. I assume there must be a way to name the rendertargets, unless the name is the semantic. I have been trying to find any info on this and have been unsuccessful.I have a solution that works now but using that variable would be simpler from my code perspective as the render target would become another variable to set once in the effect class and not need to change in the future.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628375
• Total Posts
2982310

• 10
• 9
• 14
• 24
• 11