>>107976650
To give you an idea of how the framework creates textures, here's the 4 gbuffers for my deferred effect
auto albedoRes = TextureBuilder()
.withTexture(TextureOptions{
.width = w,
.height = h,
.format = DXGI_FORMAT_R8G8B8A8_UNORM,
.miscFlags = 0
})
.withRTV()
.withSRV()
.build(device, context);
if (!isOk(albedoRes))
{
return error(albedoRes);
}
auto normalRes = TextureBuilder()
.withTexture(TextureOptions{
.width = w,
.height = h,
.format = DXGI_FORMAT_R8G8B8A8_UNORM,
.miscFlags = 0
})
.withRTV()
.withSRV()
.build(device, context);
if (!isOk(normalRes))
{
return error(normalRes);
}
auto positionRes = TextureBuilder()
.withTexture(TextureOptions{
.width = w,
.height = h,
.format = DXGI_FORMAT_R32G32B32A32_FLOAT,
.miscFlags = 0
})
.withRTV()
.withSRV()
.build(device, context);
if (!isOk(positionRes))
{
return error(positionRes);
}
auto depthRes = TextureBuilder()
.withTexture(TextureOptions {
.width = w,
.height = h,
.format = DXGI_FORMAT_R24G8_TYPELESS,
.miscFlags = 0
})
.withSRV({
.format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS
})
.withDSV({
.format = DXGI_FORMAT_D24_UNORM_S8_UINT
})
.build(device, context);