Jump to content

  • Log In with Google      Sign In   
  • Create Account

blackfe2010

Member Since 23 Nov 2011
Offline Last Active Feb 16 2014 06:15 AM

Posts I've Made

In Topic: Debug pixel shader

16 December 2012 - 08:27 AM

	 return float4(1.0f, 1.0f, 1.0f, 1.0f);


I don't see the white object.

And i try to use "D3D11_CULL_NONE", it's still not work.

so I think the problem seem in the render target because I can see the object in Post-Vertex Shader in the PIX,
It can prove the matrix work, isn't it?

Here is the code about the render target:

[source lang="cpp"] hr = m_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&backBufferPtr); CHECK_FAILED(hr) hr = m_device->CreateRenderTargetView(backBufferPtr, NULL, &defaultRenderTargetView); CHECK_FAILED(hr) backBufferPtr->Release(); backBufferPtr = 0; deviceContext->OMSetRenderTargets(1, &defaultRenderTargetView, NULL);[/source]

The code is simple. but I only use OMSetRenderTargets at the beginning of the porgram. Shall I use It pre-frame?

And I still dont know what's wrong in my code.

In Topic: What's wrong about my code?

15 December 2012 - 09:01 PM

you are right. thank you

In Topic: Design a render queue

15 December 2012 - 01:01 AM

This blog explain everything clearly.

http://realtimecolli....net/blog/?p=86


But I haven't support multi-viewport yet. And I think use two render queue at first is suitable for me.

I'm start to do it now!!!

In Topic: How to debug in DirectX11

01 December 2012 - 12:05 AM

Hi, all

I found the problem. Because of i use the ID3D11DepthStencilView.

If I use the code:
[source lang="cpp"]deviceContext->OMSetRenderTargets(1, &defaultRenderTargetView, NULL);[/source]
everything is ok.

What's wrong with ID3D11DepthStencilView in my code?

[source lang="cpp"] // Initialize the description of the depth buffer. ZeroMemory(&depthBufferDesc, sizeof(depthBufferDesc)); // Set up the description of the depth buffer. depthBufferDesc.Width = m_screenWidth; depthBufferDesc.Height = m_screenHeight; depthBufferDesc.MipLevels = 1; depthBufferDesc.ArraySize = 1; depthBufferDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; depthBufferDesc.SampleDesc.Count = 1; depthBufferDesc.SampleDesc.Quality = 0; depthBufferDesc.Usage = D3D11_USAGE_DEFAULT; depthBufferDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; depthBufferDesc.CPUAccessFlags = 0; depthBufferDesc.MiscFlags = 0; // Create the texture for the depth buffer using the filled out description. hr = m_device->CreateTexture2D(&depthBufferDesc, NULL, &defaultDepthStencilBuffer); CHECK_FAILED(hr) // Initialize the description of the stencil state. ZeroMemory(&depthStencilDesc, sizeof(depthStencilDesc)); // Set up the description of the stencil state. depthStencilDesc.DepthEnable = true; depthStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; depthStencilDesc.DepthFunc = D3D11_COMPARISON_LESS; depthStencilDesc.StencilEnable = true; depthStencilDesc.StencilReadMask = 0xFF; depthStencilDesc.StencilWriteMask = 0xFF; // Stencil operations if pixel is front-facing. depthStencilDesc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; depthStencilDesc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_INCR; depthStencilDesc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP; depthStencilDesc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS; // Stencil operations if pixel is back-facing. depthStencilDesc.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; depthStencilDesc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_DECR; depthStencilDesc.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP; depthStencilDesc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS; // Create the depth stencil state. hr = m_device->CreateDepthStencilState(&depthStencilDesc, &defaultDepthStencilState); CHECK_FAILED(hr) deviceContext->OMSetDepthStencilState(defaultDepthStencilState, 1); // Initialize the depth stencil view. ZeroMemory(&depthStencilViewDesc, sizeof(depthStencilViewDesc)); // Set up the depth stencil view description. depthStencilViewDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; depthStencilViewDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; depthStencilViewDesc.Texture2D.MipSlice = 0; // Create the depth stencil view. hr = m_device->CreateDepthStencilView(defaultDepthStencilBuffer, &depthStencilViewDesc, &defaultDepthStencilView); CHECK_FAILED(hr) deviceContext->OMSetRenderTargets(1, &defaultRenderTargetView, defaultDepthStencilView);[/source]

In Topic: How to use boost::unordered_map with for_each?

08 November 2012 - 04:09 AM

I'm find the problem.

I haven't wrt the default constructor...

PARTNERS