Skip to main content
Game Development

Return to Answer

Minor grammar fixes, markdown formatting
Source Link
liggiorgio
  • 5.5k
  • 6
  • 27
  • 38

I finally found the solution to my problem in this thread: https://computergraphics.stackexchangethis ComputerGraphics.com/questions/10780/objects-in-depth-buffer-are-always-black-0-0SE question. The minDepthminDepth and maxDepthmaxDepth of my viewport waswere wrong. it has, they have to be:

_viewport.MinDepth = 0.0f;
_viewport.MaxDepth = 1.0f;

orOr simply use these default settings:

_viewport = CD3DX12_VIEWPORT{ 0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height) };

Previously, I had this set them to 0.1f0.1f and 1000.0f1000.0f because I followed this tutorialhad been following https://alain.xyz/blog/raw-directx12this tutorial please. Please, be careful!

I finally found the solution to my problem in this thread: https://computergraphics.stackexchange.com/questions/10780/objects-in-depth-buffer-are-always-black-0-0. The minDepth and maxDepth of my viewport was wrong. it has to be:

_viewport.MinDepth = 0.0f;
_viewport.MaxDepth = 1.0f;

or simply use these default settings:

_viewport = CD3DX12_VIEWPORT{ 0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height) };

I had this set to 0.1f and 1000.0f because I followed this tutorial https://alain.xyz/blog/raw-directx12 please be careful!

I finally found the solution to my problem in this ComputerGraphics.SE question. The minDepth and maxDepth of my viewport were wrong, they have to be:

_viewport.MinDepth = 0.0f;
_viewport.MaxDepth = 1.0f;

Or simply use these default settings:

_viewport = CD3DX12_VIEWPORT{ 0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height) };

Previously, I had set them to 0.1f and 1000.0f because I had been following this tutorial . Please, be careful!

added 153 characters in body
Source Link
eli3D
  • 11
  • 3

I finally found the solution to my problem in this thread: https://computergraphics.stackexchange.com/questions/10780/objects-in-depth-buffer-are-always-black-0-0. The minDepth and maxDepth of my viewport was wrong. it has to be:

_viewport.MinDepth = 0.0f;
_viewport.MaxDepth = 1.0f;

or simply use these default settings:

_viewport = CD3DX12_VIEWPORT{ 0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height) };

I had this set to 0.1f and 1000.0f because I followed this tutorial https://alain.xyz/blog/raw-directx12 please be careful!

I finally found the solution to my problem in this thread: https://computergraphics.stackexchange.com/questions/10780/objects-in-depth-buffer-are-always-black-0-0. The minDepth and maxDepth of my viewport was wrong. it has to be:

_viewport.MinDepth = 0.0f;
_viewport.MaxDepth = 1.0f;

I had this set to 0.1f and 1000.0f because I followed this tutorial https://alain.xyz/blog/raw-directx12 please be careful!

I finally found the solution to my problem in this thread: https://computergraphics.stackexchange.com/questions/10780/objects-in-depth-buffer-are-always-black-0-0. The minDepth and maxDepth of my viewport was wrong. it has to be:

_viewport.MinDepth = 0.0f;
_viewport.MaxDepth = 1.0f;

or simply use these default settings:

_viewport = CD3DX12_VIEWPORT{ 0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height) };

I had this set to 0.1f and 1000.0f because I followed this tutorial https://alain.xyz/blog/raw-directx12 please be careful!

Source Link
eli3D
  • 11
  • 3

I finally found the solution to my problem in this thread: https://computergraphics.stackexchange.com/questions/10780/objects-in-depth-buffer-are-always-black-0-0. The minDepth and maxDepth of my viewport was wrong. it has to be:

_viewport.MinDepth = 0.0f;
_viewport.MaxDepth = 1.0f;

I had this set to 0.1f and 1000.0f because I followed this tutorial https://alain.xyz/blog/raw-directx12 please be careful!

default

AltStyle によって変換されたページ (->オリジナル) /