Effect file integration
Just wondering how you guys integrate DX Effect files into your engines?
I see 2 possibilities
A)For every effect there is a c++ class associated with it, with member functions for setting any effect specific paramaters (e.g. SetFrenselTerm()).
B)A generic effect class that can load any .fx file and exposes its parameter via funcs like SetFloat, SetFloat4, SetMatrix, etc.
A Pros:
-Damn easy to implement and maintain
-I can implement a fixed function class with the same interface, therefore not having to use a .fx file (if not needed)
-Potentially very fast, we dont have to look up what function we have to call, or iterate
A Cons:
-Have to implement a new class for each effect type
-Harder to integrate with something like FX composer
B Pros:
-Potentially no new code for a new effect
B Cons:
-Seems less optimal because of generality
-Overhead of having to figure out what fuction we have to call for what parameter
(e.g. I have parameters A:float, B:float2, C:float3, D:float4 in Effect1, being used for 2 meshes Mesh1 and Mesh2. Each mesh has its own specific values for A,B,C,D it wants to set before it draws. The mesh class does not know about the parameters A,B,C,D or there coresponding values at compile time, only at runtime after loading from a file giving the a list of string param name, type, and string param values that need to be set in the effect. For each frame i have to iterate through a list of GENERIC parameters (param Handle and VOID* pairs), then use the type info to determine what corresponding set function to call and cast to the proper type.)
Does anyone have any experience with this? Any suggestions?

