Jump to content

  • Log In with Google      Sign In   
  • Create Account


Textures are grainy and pixels move when moving the camera


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Corvwyn   Members   -  Reputation: 331

Like
0Likes
Like

Posted 03 November 2012 - 08:14 AM

I've recently moved to the Windows SDK, so I've stopped using the D3DX libraries. I now use D3DCompiler for shaders and DirectXTex for loading textures (CreateDDSTextureFromFile).

I've noticed that my textures are grainy, and when I move the camera the grain(pixels) move around as well. I'm basically using the rastertek directx 11 tutorials, but converted them to use DirectXMath and the libraries I explained below.

I've uploaded a video on youtube that explains this better. Remember to turn on 720p and full screen viewing.


I've tried to compare flags and such when loading the textures/compilers, but I haven't found anything. Does anyone know what could cause this? I can provide code if necessary.

Edited by Corvwyn, 03 November 2012 - 08:22 AM.


Sponsor:

#2 Plerion   Members   -  Reputation: 364

Like
2Likes
Like

Posted 03 November 2012 - 08:25 AM

Hey Corvwyn

What filters are you using for sampling? Min/Mip and Mag?

Seems like the textures are rendered on a high resolution with small pixel coverage resulting in changes on small movement.

Greetings

#3 Corvwyn   Members   -  Reputation: 331

Like
0Likes
Like

Posted 03 November 2012 - 08:31 AM

I'm using D3D11_FILTER_MIN_MAG_MIP_LINEAR. It seems to work with the rastertek examples. The textures are also grainy when the camera stands still.

Haven't really had the chance to look into this much, but getting artifacts like this starts the learning process Posted Image

Edited by Corvwyn, 03 November 2012 - 08:45 AM.


#4 kauna   Crossbones+   -  Reputation: 2284

Like
2Likes
Like

Posted 03 November 2012 - 10:08 AM

Missing mipmaps perhaps?

Cheers!

#5 mhagain   Crossbones+   -  Reputation: 7594

Like
1Likes
Like

Posted 03 November 2012 - 10:25 AM

Yup, this is definitely broken mipmapping. As well as the filters check for any LOD bias, min LOD and max LOD settings in your sampler states. Also ensure that you're actually specifying creation of a full mipmap chain in your CreateTexture calls.

Edited by mhagain, 03 November 2012 - 10:35 AM.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#6 Corvwyn   Members   -  Reputation: 331

Like
0Likes
Like

Posted 04 November 2012 - 04:29 AM

Thanks. I'll look into that.

#7 Corvwyn   Members   -  Reputation: 331

Like
0Likes
Like

Posted 05 November 2012 - 12:54 AM

I tried converting the texture to .png and loading it with CreateWICTextureFromFile (http://directxtk.cod...Title=DirectXTK), and everything looks good. Since the dds file is more effective, I want to use that instead though.

The texture viewer I use shows that the .dds file contains all the mip maps (512x512 down to 1x1), but the call to CreateDDSTextureFromFile doesn't seem to be sufficient to load them. The documentation says that the loader supports mipmaps though (http://directxtk.cod...Title=DirectXTK).

The sampler uses these settings for LOD, which looks correct:
samplerDesc.MipLODBias = 0.0f;
samplerDesc.MinLOD = 0;
samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;

The only reference I see to creating a full mipmap chain is in the depthbuffer (setting this to 0 has no effect):
depthBufferDesc.MipLevels = 1;

Apparently the old D3DXLoadTextureFromFile is different and uses mipmaps correctly. Since the dds already has mipmaps, GenerateMips shouldn't be necessary, right?

Edited by Corvwyn, 05 November 2012 - 01:00 AM.


#8 Corvwyn   Members   -  Reputation: 331

Like
0Likes
Like

Posted 06 November 2012 - 12:46 AM

Any ideas?

#9 Corvwyn   Members   -  Reputation: 331

Like
0Likes
Like

Posted 06 November 2012 - 02:09 PM

Apparently the dds file did have corrupt mipmaps or something. I generated some mipmaps from the dds plugin in gimp, and everything seems to work! Seems like the other tool I used couldn't detect if the mipmaps were corrupt or not.

Edited by Corvwyn, 06 November 2012 - 02:09 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS