Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 May 2008
Offline Last Active Jul 24 2016 12:09 AM

Posts I've Made

In Topic: [D3D11]Any explanation for a temporary performance hit on binding a 4k by 4k...

02 July 2016 - 04:56 AM

Are you sure your GPU has enough memory? System will silently transfer data between GRAM and RAM.

Your explanation reminds me of situation I had in a game I played: I had 60 FPS with static scene but whenever I turned camera it dropped to 10 FPS only because PC didn't have enough GRAM to fit all textures at once.


It should have enough, gtx650 has 1gb of dedicated ram and I have very few assets in gpu(~20-30 textures, most of them 256x256). But to confirm, is there a way to find out how much memory is left in GRAM?

In Topic: Assimp loading a skinned model and animation-only fbx file seperately, then m...

15 June 2016 - 10:14 AM

yup. the generated nodes are pivots that are not representable directly in assimp. Thanks for the help, I'm just looking for information on how people usually handle this case. I mean, merging animations and skinned models through assimp shouldn't be that rare a task right?

In Topic: triangle culling in close proximity to other triangles?

29 April 2016 - 10:54 PM

ah ok. fixed the problem. turned out to be a frontface winding issue

In Topic: triangle culling in close proximity to other triangles?

29 April 2016 - 09:33 AM

At first I ruled out Depth Buffer issue, because as Hodge mentioned, Depth testing occurs at a per pixel level, not a per primitive level, so back face culling shouldn't be involved. 

However, in the picture you just posted I do see what seems to be Z Fighting on your last rock.


A few questions,


1. Can we see your depth buffer creation code, preferably all the way up to you bind it to the Output Merger. 


2. Are the Rock Models completely perpendicular to the ground model, or is the camera pitched at a 45d (0.78 in radians), or is the camera looking straight down the Y-Axis?


Marcus Hansen



/************** Setup ************/
// Create depth stencils
  D3D11_TEXTURE2D_DESC descDepth;
  ZeroMemory(&descDepth, sizeof(D3D11_TEXTURE2D_DESC));
  descDepth.Width = texture2ddesc.Width;
  descDepth.Height = texture2ddesc.Height;
  descDepth.MipLevels = 1;
  descDepth.ArraySize = 1;
  descDepth.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; //24 bits for depth, 8 bits for stencil
  descDepth.SampleDesc.Count = 1;
  descDepth.SampleDesc.Quality = 0;
  descDepth.Usage = D3D11_USAGE_DEFAULT;
  descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL;
  descDepth.CPUAccessFlags = 0;
  descDepth.MiscFlags = 0;

  //maincontext->mDepthStencilTexture is of type ID3D11Texture2D*
  hr = GetDevice()->CreateTexture2D(&descDepth, NULL, &maincontext->mDepthStencilTexture);
  if (hr != S_OK)
    ASSERTLOGC(0, "Failed to create DepthStencil for swap chain");
    return false;

  // Create the depth stencil view
  ZeroMemory(&descDSV, sizeof(D3D11_DEPTH_STENCIL_VIEW_DESC));
  descDSV.Format = descDepth.Format;
  descDSV.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
  descDSV.Texture2D.MipSlice = 0;
  //maincontext->mDepthStencilView ID3D11DepthStencilView
  hr = GetDevice()->CreateDepthStencilView(maincontext->mDepthStencilTexture, &descDSV, &maincontext->mDepthStencilView);
  if(hr != S_OK)
    ASSERTLOGC(0, "Failed to create DepthStencilView for swap chain");
    return false;

/************** Binding code ************/
mContext->OMSetRenderTargets(1, &mFrameBufferRT, mDepthStencilView);

2) My camera is not looking straight down, but slight downwards. the rock models are on a flat xz plane.


Also, the rocks flicker a little as I zoom the camera in and out, so it's probably z-fighting like you guys said.

In Topic: triangle culling in close proximity to other triangles?

29 April 2016 - 12:02 AM

the model is meant to a rock. the one in the middle is the rock floating in the air, the rest are touching the ground