[DX10] FX File Deployment

Started by
4 comments, last by MJP 12 years, 8 months ago
I'm still wholly and completely new to graphics programming in general, let alone DirectX 10+. I did scan through the FAQ for this and honestly any search time I tried online related "FX" to the Java UI framework. If there is a better term to describe these files I'd love to hear it.

I'm wondering how seasoned hobbyists, and professionals deal with FX file deployment, since any of the DX applications that I have on my machines expose no FX file in their flat file installation.

Also, a side hobbyist question. Why aren't these FX files exposed to the end users? It seems like having these available to the end user would be a source of modding "fun".
Advertisement
Most big budget commercial games don't use the Effects framework, and instead have their own material/shader management systems built into their engine. But even if they did use effects, they would likely compile them ahead of time because compiling a lot of shaders can take a looooong time. If you only have a few shaders it doesn't matter, but a lot of commercial games will have hundreds or thousands of shader permutations. Aside from that, a lot of companies probably also don't want people ripping off their source code or doing something unintended with it.

If you want to precompile your effect files so that you don't have to distribute the source code, it's really easy. Just use fxc.exe to precompile the effect to a binary output file, then at runtime load all of the data in that file and pass the pointer to D3D10CreateEffectFromMemory. Or if you want to just distribute the source code and compile at runtime, you can do that too.
As demonstrated by my rather dumb post I am embeding my shader files directly in my C headers. This avoids any runtime loading/compiling, which makes life easier (of course you usually need this for other games assets, shaders are a weird intermediate step between code and assets).

Of course runtime loading/compiling can be a godsend if you want to edit shaders on the fly and see the results in real time.
Since I'm obviously new to this whole world of programming and skimming through various tutorial libraries I don't see a lot of discussion on this, I have another question. Is it possible to contain this within the binary? Keep everything nice and self contained, etc.

I honestly wasn't aware that it's possible to use another effects framework. I guess this relates to the question in a previous thread, to which I would amend. What's the simplest way to display a spliced photo/image onto a quad. I don't obviously possess the ability or knowledge to even begin a search on this it would seem as my attempts have been futile. With the answer you have given me, about not being bound to the DirectX (or HLSL?) effects system, my desired function seems incredibly simple, and it would seem to me, again with an obvious lack of understanding, that the DirectX effects system is incredibly complex for what I need.

Going through the Microsoft tutorials, I don't find a link between them and what I seek. I'm perfectly capable of reading, if there are better sources I would appreciate a direction. As much as I might appreciate a handout, I am not seeking one. This isn't for any coursework, I'm merely a hobbyist that's never done anything with graphics programming since the Mode13 days.

Since I'm obviously new to this whole world of programming and skimming through various tutorial libraries I don't see a lot of discussion on this, I have another question. Is it possible to contain this within the binary? Keep everything nice and self contained, etc.

The way I describe above (where the shader binary is embeded in the C header file) will do this
Yeah you can make a header, or you can embed the binary data as a resource in the executable.

The absolute simplest path to drawing an image on a quad would be to use ID3DX10Sprite. It can render a sprite with a given size, rotation, and position.

This topic is closed to new replies.

Advertisement