Jump to content
  • Advertisement
Sign in to follow this  
akira32

D3DXCompileShaderFromFile and D3DXCreateEffectFromFile

This topic is 4016 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

What is the difference of D3DXCompileShaderFromFile and D3DXCreateEffectFromFile? D3DXCompileShaderFromFile is used for CG file? D3DXCreateEffectFromFile is used for effect file?

Share this post


Link to post
Share on other sites
Advertisement
It doesn't technically matter which type of file you pass it (D3DXCompileShaderFromFile will be happy enough being passed an effect file), but as Evil Steve said, the two functions correspond to two different objects. One compiles a single shader (that is a vertex shader, or a pixel shader) and returns a buffer of compiled bytecode & symbolic data. The other loads an entire effect file, attempts to compile all contained shaders and enumerates its techniques, materials and textures, returning the cocktail as an ID3DXEffect.

While intrinsically associated, shaders and effects are two very different things, at differing levels of abstraction. I suggest you read up on both before deciding which to use, as you can do the job of an effect using shaders, and vice-versa, but you'd be shooting yourself in the foot to do so.

Admiral

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!