Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Aug 2012
Offline Last Active Mar 24 2015 07:38 AM

Posts I've Made

In Topic: Moiré pattern brick texture tilling

24 February 2015 - 03:50 PM

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:




I truly appreciate the help. Thanks :)

In Topic: Moiré pattern brick texture tilling

24 February 2015 - 07:34 AM

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.

In Topic: How does "DXUTGetGlobalResourceCache().CreateTextureFromFile" correctly?

19 December 2014 - 07:57 AM



thank you all for repley!


Yes it is possible to use a other method to handle texturs! 


In the DXUT folder of my project in Visual Studio 12, i cant find DDSTextureLoader and WICTextureLoader. So i loaded from 

your link and copyed&pasted WICTextureLoader.h und WICTextureLoader.cpp in my projektfolder. After that i included WICTextureLoader.h

and tried the example from: https://directxtk.codeplex.com/wikipage?title=WICTextureLoader&referringTitle=Home


Now i have two variant:



hr = CreateWICTextureFromFile( pd3dDevice, L"Holz.jpg", nullptr, &g_pRV, 0 );
Here the compiler returns three error, from "c:\program files (x86)\windows kits\8.0\include\shared\dxgi1_2.h(1274)".
I think the errors are in my code and not in dxgi1_2.h !!
ComPtr<ID3D11ShaderResourceView> srv;
hr = CreateWICTextureFromFile( pd3dDevice, immContext.Get(), L"Holz.jpg", nullptr, srv.GetAddressOf() );
Here i have trouble with immContext, because i dont know what variable it is!?
Have somebody a idea?
Thanks again!
p.s.: I dont have permission to upload a fil, so i uploaded it here: https://mega.co.nz/#!sMMw0ZYA!RuoDX6uDX0ULm2302h28wF21FDlS97EdaQT54aAN-Ik



Make sure you are calling CreateWICTextureFromFile from the WICTextureLoader.h you have just created. I can't read your code right now, so here is an simplified example of how I call this function (note the DirectX namespace; TextureMgr is my class that holds this function; md3dDevice is a raw pointer to a ID3D11Device):

#include "WICTextureLoader.h"

ID3D11ShaderResourceView* TextureMgr::CreateTexture(std::wstring filename)
	ID3D11ShaderResourceView* srv = 0;

	DirectX::CreateWICTextureFromFile(md3dDevice, filename.c_str(), nullptr, &srv);

	return srv;

In Topic: How does "DXUTGetGlobalResourceCache().CreateTextureFromFile" correctly?

17 December 2014 - 05:34 AM

This Toolkit is a bit complex solution, it is possible to use DDSTextureLoader, which is a part of the new DXUT also.

Actually, DirectXTK has DDSTextureLoader and WICTextureLoader. Again, it is possible to rip these files to your own project.

In Topic: How does "DXUTGetGlobalResourceCache().CreateTextureFromFile" correctly?

16 December 2014 - 11:21 AM

Hello Meho, maybe the ID3D11DeviceContext *pContext parameter is missing on the call? Also, I recommend you to use DirectX Tool Kit for a more "modern" texture loading, you can get more info here and here is the source (you can copy the .h and .cpp files to your project, there is no need to use the entire DirectXTK library).