Sign in to follow this  
coreSOLO

use a shader within cpp file

Recommended Posts

I have written a simple shader in a FX file. Also tested it with rendermonkey. Now how do I load and use this shader in my DX9 VC++ code? I need the shader to be available even if the FX file is not in the same directory as EXE file. Please suggest...

Share this post


Link to post
Share on other sites
The FXC tool can precompile your shaders to a header file (located in the Utilities folder of the DX SDK). Look up the /Fh flag in particular. Then you can use something like D3DXCreateEffect to load it.

Share this post


Link to post
Share on other sites
You could try to look into the DirectX sample applications. They've got a Basic HLSL sample.
Besides from that:

Quote:
Original post by Daniel Talagrand
Then you can use something like D3DXCreateEffect to load it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this