Jump to content

  • Log In with Google      Sign In   
  • Create Account


Format troubles Depth stencil view


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 KurtO   Members   -  Reputation: 210

Like
0Likes
Like

Posted 15 October 2012 - 11:13 AM

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?

Sponsor:

#2 eppo   Crossbones+   -  Reputation: 2342

Like
0Likes
Like

Posted 15 October 2012 - 11:30 AM

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.

#3 KurtO   Members   -  Reputation: 210

Like
0Likes
Like

Posted 15 October 2012 - 11:37 AM

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

#4 KurtO   Members   -  Reputation: 210

Like
0Likes
Like

Posted 15 October 2012 - 12:05 PM

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?

#5 KurtO   Members   -  Reputation: 210

Like
0Likes
Like

Posted 15 October 2012 - 12:21 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS