Reputation: 1021
I've got some material parameters stored in the FBX file (DiffuseFactor, ShininessExponent, SpecularFactor and others), but I can't get to them using Effect.Parameters nor BasicEffect (they've got only the basic stuff - like EmmisiveColor or alpha). I know, that I can try to write a Effect-derived class, but is there any other way? A built-in feature or maybe some half-raw parameters stored somewhere?
Upvotes: 0
Views: 1026
Reputation: 949
If you create a custom model processor (for the content pipeline) and override the ConvertMaterial method you can access this type of data in the input MaterialContent.OpaqueData collection.
I know if you output an EffectMaterialContent from this method like they do in the Skinned Model sample, you can attach this data to the EffectMaterialContent's OpaqueData collection and it will be visible in the shader using the names you supply. This was as of XNA 3.1 anyway, I'm not sure if there's a better/alternate way to do this now.
EDIT: Wow, didn't realize this question was almost a year old.
Upvotes: 1