Format troubles Depth stencil view

Started by
3 comments, last by Kurt-olsson 11 years, 6 months ago
Hi!

I am trying to render my scene to a texture and then apply it on a cube at runtime.
I am always getting the backcolor rendered but no primitives from my scene.

however, if i change my Depth_stencil_view_description i get it to work:

DXGI_FORMAT_D24_UNORM_S8_UINT

THIS IS DEFAULT SETTING, DOES NOT WORK, BUT ZBUFFER IS RELEASED OK.
dsvd.Format = DXGI_FORMAT_D32_FLOAT;
dsvd.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMS;


Changing either format to :DXGI_FORMAT_D24_UNORM_S8_UINT
or changing ViewDimension to: D3D11_DSV_DIMENSION_TEXTURE2D makes the cube render my scene with a correct texture as i want it.

However, when using this formats the zbuffer crashed when released and also my meshes in my lever have problems with culling, half of my back-faces are gone.

I have tried most formats but i cant get it to work. I copied this code from a sample, but i think there is some DirectX 10 involved, i only use DX11.

What format is correct for DX11 when rendering your scene to a ShaderResource and then send it to shaders?
Advertisement
Do you have the debug layer enabled (D3D11_CREATE_DEVICE_FLAG)? That should give you more insight into what could possibly be wrong.
D3D11 supports all the texture formats that 10 does.
How do i use the flag?

I have this in my createD3D, but how can i see some debug values?
#if _DEBUG
flags = (D3D11_CREATE_DEVICE_FLAG)(flags | D3D11_CREATE_DEVICE_FLAG::D3D11_CREATE_DEVICE_DEBUG);
#endif
I might be on something...

When i open my frame in PIX and select render, i can not see the texture, but when PIX gives me the dialog "disable multisampling" and i choose "yes". Then the texture is there and correct.

Maybe it is something with Multisampling? Is that a DirectX11 feat that my graphicscard don´t have?
GREAT SUCCESS! (Borat)

I created another depthBuffer and another texture with that Format and now it works.
i thought i could render both with same depthBuffer and textureFormat, but nope.

Now it works, this is really a cool effect that i see i can use in many ways...

like mirrors, changing camera backwards, or a levelmap that displays the level rotating in a big texure... cooooool.

This topic is closed to new replies.

Advertisement