Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Beginner question. Synopsis: my water effects does something that causes the drawing of my sky sphere to throw an exeption when run in full screen. The exception is:

XNA Framework HiDef profile requires TextureFilter to be Point when using texture format Vector4.

This happens both when I start in full screen directly or switch to full screen from windowed. It does NOT happen, however, if I comment out the drawing of my water.

So, what in my water effect can possibly cause the drawing of my sky sphere to choke???

share|improve this question
    
Does your shader change the render states in any way? –  ClassicThunder Feb 17 '12 at 14:24
3  
It might be helpful if you could show some code, especially around the area where you hit that error. –  Nic Foster Feb 17 '12 at 15:09
    
Are you using BasicEffect or a custom shader? –  David Lively Jul 28 '12 at 20:14
    
With "water effect" I ment a custom shader. :-) –  danbystrom Jul 30 '12 at 6:55
add comment

2 Answers 2

You need to set the SamplerState[0] to SamplerState.PointClamp before your DrawIndexedPrimitive call.

share|improve this answer
    
Thank you so much! –  Lone Coder Jul 12 '13 at 16:44
add comment

I think I solved the problem. I was confronted with the same problem: I used a SurfaceFormat.Single-Texture to make some displacement in my HeightmapShader and everything works until I change the resolution (switched to Full-screen or back). During this switch my SkyboxDrawer complains about exact the same thing. But my Skybox-texture was in SurfaceFormat.Color, so the exception doesn't make sense at all.

So I start googling and found out, that Sharwn Hargreaves (a programmer of XNA with a great blog on XNA and other stuff) mentioned that there is a bug in XNA4.0 connected to the correct sync of settings of the sampler states with their C# counterparts.

My sampler looks like the following, so I thought all that should be done, was done.

texture Texture;
sampler TextureSampler = sampler_state
{
    Texture = <Texture>;
    MinFilter = POINT;
    MagFilter = POINT;
    MipFilter = POINT;   
    AddressU  = Wrap;
    AddressV  = Wrap;
};

But what really solved the problem was setting the VertexTextureSampler before drawing my Heightmap. This made the given exception in my SkyboxDrawer disappear.

GraphicsDevice.VertexSamplerStates[0] = SamplerState.PointClamp;

For completeness: My SkyboxDrawer uses the BasicShader whereas my HeightmapDrawer uses a custom HeightmapShader. So the only connection between them are the states in the grafics pipeline.

But there is a unsolved "problem". As far as I know a vertex textures sampler in XNA only can use floating point based formats like SurfaceFormat.Single, SurfaceFormat.Vector2, SurfaceFormat.HalfSingle and so on. These formats require POINT sampling. So why the hell am I able to change the GraficsDevice.VertexTextureSampler[*] to something else?! Did I miss something?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.