Sign in to follow this  

HLSL Error: Missing texture object

This topic is 2391 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:

[code]

sampler3D threeDTexture;

struct PS_INPUT
{
float3 Texcoord : TEXCOORD0;

};

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

}[/code]

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:

[i]

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'[/i]

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Im not sure how texture samplers work in DirectX 9, but it should be something like this:
[code]
sampler TextureSampler = sampler_state
{
Texture = <g_TextureName>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
};
[/code]

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

This topic is 2391 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.

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