Jump to content
  • Advertisement
Sign in to follow this  
CadeF

[Resolved][MDX]Problem with sampling cubemap from HLSL shader when not texture 0

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

Hey everyone, I've got a small problem. I've got a cube map(R32F, dynamic + rendertarget) which I'm trying to sample in my HLSL shader. If I sample it from stage 0, D3DDevice.SetTexture(0, CubeTex) texture texture0; samplerCUBE texSamplerCUBE0 : TEXUNIT0 = sampler_state { Texture = (texture0); MIPFILTER = LINEAR; MAGFILTER = LINEAR; MINFILTER = LINEAR; }; It samples correctly If I sample it from any other stage, example, stage 1 D3DDevice.SetTexture(1, CubeTex) texture texture1; samplerCUBE texSamplerCUBE1 : TEXUNIT1 = sampler_state { Texture = (texture1); MIPFILTER = LINEAR; MAGFILTER = LINEAR; MINFILTER = LINEAR; }; It samples black.
Vertex Structure
        Dim Pos as Vector3
        Dim Normal As Vector3
        Dim TexCoord As Vector2
        Dim Tangent As Vector3
        Dim Binormal As Vector3

Vertex Format
        VertexFormats.Position Or VertexFormats.Normal Or VertexFormats.Texture1 Or VertexTextureCoordinate.Size3(1) Or VertexTextureCoordinate.Size3(1)        


Any ideas? [Edited by - CadeF on January 27, 2006 1:08:12 AM]

Share this post


Link to post
Share on other sites
Advertisement
Can't you just set the texture as a parameter on the effect, bypassing the stages entirely? All C# code I've seen uses this approach (using Effect.SetValue), so I'm a bit at a loss why you would want to use the stages with device.SetTexture anyway. Hence, forgive me if this is a dumb suggestion [wink]

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!