ID3D11Texture3D* pTexture3D;
D3D11_SUBRESOURCE_DATA initialData;
initialData.pSysMem = data;
initialData.SysMemPitch = 32 * 2;
initialData.SysMemSlicePitch = 32 * 32 * 2;
hr = g_pd3dDevice->CreateTexture3D( &texDesc, &initialData, &pTexture3D );
Like the code show that i want to load a data to a 3D texture, and the initialData loaded data from a file and the value are all positive. But when i sampling the 3D texture, i got a negative value. sampling code is:
g_Texture3D.SampleLevel(BilinearWrappedSampler, uvw, 0);