Jump to content
  • Advertisement
Sign in to follow this  
mrman102938

Cube Mapping Gone Bad

This topic is 4421 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 using the high level shader language in DirectX 9 to do some cube mapping. It almost works except that there are some stray black pixels appearing on the textured faces. I am completely foxed as to what is causing it as there is no black on the original textures and the lighting is off. Can anyone suggest what the problem might be? My pixel shader looks like this: struct VS_OUTPUT { float4 Position : POSITION; // vertex position float3 TextureUVW : TEXCOORD0; // vertex texture coords }; struct PS_OUTPUT { float4 RGBColor : COLOR0; // Pixel color }; PS_OUTPUT emap_ps( VS_OUTPUT In ) { PS_OUTPUT Output; Output.RGBColor = texCUBE(emapsampler, In.TextureUVW); return Output; } And my sampler looks like this: samplerCUBE emapsampler = sampler_state { Texture = <g_texturecube>; MipFilter = Point; MinFilter = Point; MagFilter = Point; }; My video card is a Radeon 9600.

Share this post


Link to post
Share on other sites
Advertisement
Code looks accurate to me. Could you explain a bit what you mean by "stray black pixels appearing on the textured faces". Are they scattered, or do they form lines (cracks) or some other way to explain it? Or they just single pixels or bigger areas?

Do you get them with linear filtering too?

A screenshot, if possible, would be the best solution. You can use ImageShack to host an image and link to it from here.

Hope this helps.

Share this post


Link to post
Share on other sites
Try to disable mipmapping: MipFilter = None;
It seems that low mip levels in the cubemap texture are completly black.

Share this post


Link to post
Share on other sites
Thanks! Thats fixed it. I think my brain was so overloaded with my recent change from directx 8 to directx 9 that I didnt notice that small detail.

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!