138 个问题
How to sample a R8_UINT texture in hlsl/direct12?
pixelhistory
0
信誉分
I'm a newbie in DX12 and trying to visualize Stencil buffer onto screen. I've been copied stencil plane slice into a DXGI_FORMAT_R8_UINT texture, but when HLSL samples this texture it just returns 0, and finally my render result is a black screen.
Here is the texture2d info from PIX:
the sampling code is very straightforward, but when I debug pixel history at uv coordinate (0.398125, 0.534167), it just return a very small value from Sample expression:
Texture2D gDiffuseMap : register(t0);
SamplerState gsamAnisotropicWrap : register(s4);
float4 PS_PixelOverdraw(VertexOut pin) : SV_TARGET
{
float4 diffuseAlbedo = gDiffuseMap.Sample(gsamAnisotropicWrap, pin.TexC);
return float4(diffuseAlbedo.xyz, 1.0f);
}
Finally, the whole output is a black screen.
Windows 开发 | Windows API - Win32
登录以回答