• Advertisement
Sign in to follow this  

Effect files

This topic is 4714 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi Effect files are increasingly being used by applications, now the question is that can I use binary files (I mean not ascii files such as .FX files) for effects? because using the ascii format enables everyone to change our effect and it is not good. Also is there program that I can take advantage of for compiling and assembling effect files? thanks in advance galaxyroad.com

Share this post


Link to post
Share on other sites
Advertisement
The DirectX SDK comes with an effect compiler fxc. Look for it in the utilities directory and look for indformation about it in the documentation. If you really want to keep people out of your application data consider using some sort of encryption.

Share this post


Link to post
Share on other sites
I agree. Although leaving effects just sitting in a folder may seem harmless (only use graphics dudes know them, right [wink]), it's not very desirable to have your shaders stolen and game tampered with (maybe hacks).

Nowadays, many games use a unified resource system. All of the games files are stored in one big archive (exactly like a zip file), so that people can't poke at the game's resources. It seems to work pretty well, but it's a bit of work to implement.

Share this post


Link to post
Share on other sites
You can get by with a pretty crude system. Just write a small program that scans a single directory and creates a list of { filename, size, byte offset } nodes. Save this list as the header, then save each file's byte data. You could also convert or compress the files as you store them. In your game, you would have to scan the header list for a filename and seek to it's offset. You also have to convert all API loading methods to FromMemory type methods.

I would recommend supporting both normal file loading and the datafile loading in your engine. It will be a pain having to recompile your datafile every time the content changes during development.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement