Jump to content
  • Advertisement
Sign in to follow this  
ADT_Clone

HLSL Error: Missing texture object

This topic is 2610 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 am quite new to HLSL, however I am getting an error which really makes no sense.

I am using Render Monkey, and have set up my Texture Reference properly. This is the code for the pixel shader:



sampler3D threeDTexture;

struct PS_INPUT
{
float3 Texcoord : TEXCOORD0;

};

float4 ps_main( PS_INPUT Input ) : COLOR0
{
return tex3D( threeDTexture, Input.Texcoord );

}


threeDTexture is a 3d Texture. As I said before, I have made the appropriate reference to it in the pass, however I still get the following error:



Compiling pixel shader API(D3D) /../Textured/Pass 0/Pixel Shader/ ...success
Compiling vertex shader API(D3D) /../Textured/Pass 0/Vertex Shader/ ...success
RENDERING ERROR(s):
Missing texture object named 'threeDTexture' in pixel shader 'Pixel Shader' in pass 'Pass 0'


Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Im not sure how texture samplers work in DirectX 9, but it should be something like this:

sampler TextureSampler = sampler_state
{
Texture = <g_TextureName>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
};

Share this post


Link to post
Share on other sites
Thank you for the reply.

I did realise that this is a rendering error in Render Monkey, so maybe there isn't actually anything wrong with my HLSL code.

I'm quite new to shaders, so maybe the question I'm asking is what is the recommended method for testing them?

Should I use a program like Render Monkey, is there another program that is better suited or should I just test it in my 3d engine?

Share this post


Link to post
Share on other sites
I have fixed this error, it seemed that I couldn't access a texture like that in the pixel shader. I moved it to the vertex shader and it all worked.

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!