Skip to content

Having stair step problem on image bounderies and texture filtering(bilinear, trilinear or anisotropic) is having no effect on image quality. #16

Description

@champ011

Hi,
I have imported your TextureUWP project for plugin build. I am streaming H264 encoded frames(webcam via Gstreamer) and rendering it on the cube(Hololens). I am having stair step issue on the edges of object in image frame. I have tried different texture sampling techniques but these have no(zero) effect on image quality. I have added below code snippet in TextureUWP.cpp file:

void CreateSampler()
{ //Called at intialization
ZeroMemory(&samplerDesc, sizeof(D3D11_SAMPLER_DESC));
D3D11_TEXTURE_ADDRESS_MODE addressMode = D3D11_TEXTURE_ADDRESS_CLAMP
samplerDesc.AddressU = addressMode;
samplerDesc.AddressV = addressMode;
samplerDesc.AddressW = addressMode;
samplerDesc.ComparisonFunc = D3D11_COMPARISON_FUNC::D3D11_COMPARISON_NEVER;
samplerDesc.Filter = D3D11_FILTER::D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT;//D3D11_FILTER_ANISOTROPIC;
samplerDesc.MaxAnisotropy = 16;
samplerDesc.MaxLOD = FLT_MAX;
samplerDesc.MinLOD = FLT_MIN;
samplerDesc.MipLODBias = 0;
}

Here I'm creating the sampler.
void UpdateUnityTexture(void* textureHandle, int rowPitch, void* dataPtr)
{
ID3D11Texture2D* d3dtex = (ID3D11Texture2D*)textureHandle;
assert(d3dtex);

ID3D11DeviceContext* ctx = NULL;
m_Device->GetImmediateContext(&ctx);
//New inserted lines
ID3D11SamplerState* sampler = NULL;
m_Device->CreateSamplerState(&samplerDesc, &sampler);
ctx->PSSetSamplers(0, 1, &sampler);
//
ctx->UpdateSubresource(d3dtex, 0, NULL, dataPtr, rowPitch, 0);
ctx->Release();
}

I have not used directX before. Am I doing it right? Please help.

Thanks
Azam

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions