Jump to content
  • Advertisement
Sign in to follow this  
PAiNIC

Using Texture Shaders without Effect files

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

If anyone has done any work using Texture Shaders outside of FX files, I'm running into problems when trying to fill a Volume texture using D3DXFillVolumeTextureTX. I'm trying to compile the texture shader using D3DXCompileShaderFromFile. Then I call D3DXCrateTextureShader passing in the DWORD* buffer pointer from the compile function. I then set appropriate constants in the constant table and call D3DXFillVolumeTextureTX passing in my volume texture and the created Texture Shader. However, I'm running into issues. The main one is that I can't decide which shader profile to pass into the compiler. The MSDN says that the texture shader function should declare POSITION and PSIZE semantics, and return a COLOR semantic. Obviously these are illegal input semantics for a Pixel Shader, and compile fails. However, Vertex Shaders also need to write a POSITION output, so without hacking that in compile also fails for a Vertex Shader profile. Using the HLSL function defined in the MSDN under D3DXFillTextureTX won't compile under vertex or pixel shader profiles (just placed in a text file and compiled), and I assume this is because I'm trying to do it without Effects files. Anyone have any idea what I can do?

Share this post


Link to post
Share on other sites
Advertisement
Answered my own question.
For anyone in future who's interested, I had to pass the shader profile "tx_1_0" into the D3DXCompileShaderFromFile function

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!