Skip to main content
GameDev.net gamedev.net
🔒 Locked

Using Texture Shaders without Effect files

Started by PAiNIC Aug 27, 2005 at 3:25 AM 0 replies 650+ views
Original Post
PAiNIC
PAiNIC
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?
PAiNIC
PAiNIC
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.