Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Nov 2011
Offline Last Active Jul 26 2016 09:06 AM

#5245946 Texture2DArray and mipmapping

Posted by on 12 August 2015 - 05:39 AM

I fixed it, I just change the MipFilter into D3D11_FILTER_LINEAR when loading image information. But it seems that mipmapping has a problem as bleeding.

#5245455 Backface culling in geometry shader?

Posted by on 10 August 2015 - 07:28 AM

Thanks Kalle_h again, I did it.


@phantom: I need to manipulate vertices in the geometry, therefore I must do backface culling manually :(

#5109362 Is there possible to use dynamic index in shader model 5.0?

Posted by on 14 November 2013 - 10:55 PM

However, a Texture2DArray does not allow multiple textures with different resolutions.

#4936017 How to get an value from Byte Address buffer in DX11, HLSL?

Posted by on 30 April 2012 - 02:48 AM

Thank you so much, Tsus, I have tried the Load function before and I got the same error, but maybe there is something wrong, now it is working.

#4936010 How to get an value from Byte Address buffer in DX11, HLSL?

Posted by on 30 April 2012 - 01:55 AM

I try to modidy the shader code of OIT, http://www.yakiimo3d.com/2010/07/25/dx11-order-independent-transparency-with-msaa/, and the source code can be downloaded from http://yakiimo3d.codeplex.com/releases/view/49570. But in StoreFragments.hlsl, when they render into a linked list, they use a byte address buffer for offset.
void StoreFragmentsPS( SceneVS_Output input )
    uint x = input.pos.x;	    // [0,g_nFrameWidth]
    uint y = input.pos.y;	    // [0,g_nFrameHeight]
    // Create fragment data.
    uint4 nColor = saturate( input.color ) * 255;
    FragmentLink element;
    element.fragmentData.nColor = (nColor.x) | (nColor.y << 8) | (nColor.z << 16) | (nColor.a << 24);
    element.fragmentData.fDepth = input.pos.z;

    // Increment and get current pixel count.
    uint nPixelCount= FLBuffer.IncrementCounter();

    // Read and update Start Offset Buffer.
    uint nIndex = y * g_nFrameWidth + x;
    uint nStartOffsetAddress = 4 * nIndex;
    uint nOldStartOffset;

	    nStartOffsetAddress, nPixelCount, nOldStartOffset );

if ( nOldStartOffset != 0xFFFFFFFF  ) {
  //get an error: array, matrix, vector or indexable object.......
  uint index = StartOffsetBuffer[ idx ];
    // Store fragment link.
    element.nNext = nOldStartOffset;
    FLBuffer[ nPixelCount ] = element;

With the function InterlockedExchange, nPixelCount value will be saved at nStartOffsetAddress position and we can get the old value. Hence, we can use nOldStartOffset value as an index to get the previous/next element, but why did I get that error? and how to solve it?
Anybody help me, please? Thank in advance.