Jump to content
  • Advertisement
Sign in to follow this  
lucaswrk

Moiré pattern brick texture tilling

This topic is 1269 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 have a grid terrain with a brick texture tilled over it, but I'm getting some Moiré patterns when moving the camera around:

 

42W8gI1.jpg

 

5Lglfx5.jpg

Here is the sampler desc:

D3D11_SAMPLER_DESC samplerDesc = {};
samplerDesc.Filter = D3D11_FILTER_ANISOTROPIC;
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.MaxAnisotropy = 8;

The texture is a 512x512 .dds file with 10 mipmap levels created with nvidia texture tools on photoshop and it's tilled 64 times so that the bricks looks small. If I decrease the tilling number, the Moiré Effect decreases a little too.

My guess is that I'm repeating the texture too much and therefore causing minification, but the mipmaps should handle this, right?


Share this post


Link to post
Share on other sites
Advertisement
you should setup the whole sampler description (inspecting the documentation) to avoid implicitly set values. e.g. your MaxLod is 0 and therefor the highest res mipmap is always used. set it to D3D11_FLOAT32_MAX and it might already fix the aliasing. Max anisotropic can also be increased to 16 for better quality.

Share this post


Link to post
Share on other sites

you should setup the whole sampler description (inspecting the documentation) to avoid implicitly set values. e.g. your MaxLod is 0 and therefor the highest res mipmap is always used. set it to D3D11_FLOAT32_MAX and it might already fix the aliasing. Max anisotropic can also be increased to 16 for better quality.

ok, I will try this tonight.

 

Also, does the texture resource / shader resource view actually contain mips?

Yes it does. I'm using CreateDDSTextureFromFile function from DirectxTex.

 

---

 

Thank you all for the replies. I will give a feedback as soon as possible.

Share this post


Link to post
Share on other sites

I followed what @Krypt0n said and that solved the problem. Here is my sampler now:

D3D11_SAMPLER_DESC samplerDesc;
ZeroMemory(&samplerDesc, sizeof(samplerDesc));
samplerDesc.Filter = D3D11_FILTER_ANISOTROPIC;
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;
samplerDesc.MaxAnisotropy = 16;

And some images:

hYnbPma.jpg

pyq3Xsh.png

 

I truly appreciate the help. Thanks :)

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!