• Advertisement
Sign in to follow this  

use a shader within cpp file

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement