Original Post
I've built a program that exports files from a custom type into x files, but some of the data is a bit tricky to display unless you know the render states, so I want to use fx files to do that. I read that effect data can also be stored in x files and would prefere to use this method, but it looks like the x files only store references to an fx file like it would with the textures. Is that true or is there a way to have the x files store all the render state information? I've been trying to store this info in an fx file and have the x file (the mesh) have all the info it needs to make use of the effects, but most of the examples I've seen are either a lot more complicated than I need right now or don't explain what is being done. I want to use the same render states for all of the mesh, but I'd also prefer if the user didn't need to know what's in the fx file and that programs (or as many as possible) could figure out what do do with it ar runtime.
D3DDevice.RenderState.AlphaTestEnable = true;
D3DDevice.RenderState.AlphaFunction = Compare.Greater;
D3DDevice.RenderState.ReferenceAlpha = 0xA0;
D3DDevice.RenderState.ColorVertex = true;
D3DDevice.RenderState.Lighting = false;
D3DDevice.RenderState.AmbientMaterialSource = ColorSource.Color1;
D3DDevice.SetTextureStageState(
0, TextureStageStates.ColorOperation, (int)TextureOperation.Modulate4X
); So I'm looking for a simple example of an fx file, but one that can be loaded by programs that don't have any prior knowledge on what's in the file. I think I've seen that it can be done, but havn't found any simple enough examples.