Cube Mapping Gone Bad
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.
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.
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.
Heres a picture showing the problem. The cube map consists of 6 images with the numbers 0 -> 5 on them. The black pixels seem to occur between the edges of the texture and especially on the corners between 3 images of the cube map.
[img=http://img143.imageshack.us/img143/2240/bug1si.jpg]
[img=http://img143.imageshack.us/img143/2240/bug1si.jpg]
Try to disable mipmapping: MipFilter = None;
It seems that low mip levels in the cubemap texture are completly black.
It seems that low mip levels in the cubemap texture are completly black.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement