Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


steven166

Member Since 22 Nov 2011
Offline Last Active Apr 20 2015 12:50 AM

Posts I've Made

In Topic: How to use geometry shader instances to divide the output data?

17 March 2015 - 11:44 PM

If I amplify the geometry on the CPU, then it will consume much more memory. I am thinking about using tessellation to amplify the geometry, then in the geometry shader, I just add some attributes. But I do not understand how tessellation works. For instance, I have a prism which is composed of 2 triangle and 3 quads. If I want to tessellate 3 quads into smaller triangles like NNNNN shapes, what about the others two triangles? Will it not be passed to later stages?


In Topic: How to use geometry shader instances to divide the output data?

17 March 2015 - 06:20 AM

Thank Nik02, I have tried to output half of the primitives from one instance, and the other half from another instance, but I still get the same error about the output limitation. It is possible to pack a normalized normal vector into a single float value, the same for a normalized view vector. But I am not sure that the interpolation is correct.


In Topic: Why is a result different with output value in hlsl?

01 December 2014 - 02:34 AM

Thank unbird. You are right. The problem is caused by gamma-correction. The solution is just disable gamma-correction before creating the device (DXUTSetIsInGammaCorrectMode( false )).


In Topic: Cannot save values into fragment using unordered access view buffer

28 March 2014 - 09:49 AM

One more thing that I do not use Compute Shader in this program, is there possible to use UAV without Compute shader?


In Topic: Cannot save values into fragment using unordered access view buffer

28 March 2014 - 06:51 AM

I have already tested with the number of fragments in UAV. I figured out that only a part of UAV is occupied, so that the empty elements have its ID value is 0. However, in the second pass, after saving all fragments into a UAV, I get all fragments belongs to the current pixel as following:

    uint nIndex = (uint)input.pos.y * g_nFrameWidth + (uint)input.pos.x;
    
    uint x = (uint)input.pos.x;
    uint y = (uint)input.pos.y;

    FragmentData aData[ MAX_ELEMENTS ];            
    uint nNumFragment = 0;                         
    uint nNext = StartOffsetSRV.Load(nIndex);

    // early exit if no fragments in the linked list.
    if( nNext == 0xFFFFFFFF )
		return BACKGROUND;

    while( nNext != 0xFFFFFFFF ) 
    {		
        FragmentLink element = FragmentLinkSRV[nNext];		        
        aData[nNumFragment] = element.fragmentData;

	//Test
	int j = nNumFragment;
	while ( (j>0) && (aData[max(j-1, 0)].nDepthAndCoverage > aData[j].nDepthAndCoverage) )
	{
		uint jminusone = max(j-1, 0);
		FragmentData temp = aData[j];
		aData[j] = aData[jminusone];
		aData[jminusone] = temp;
		j--;
	}
	++nNumFragment;

	//check if the next fragment's index is greater than the number of fragments in the UAV
	if (element.nNext >= UAV_Counter)
		return GREEN;

	nNext = element.nNext;
    }

The problem is sometimes the next fragment's index is greater than the number of fragments in the UAV. Is there anybody know the reason? Please, help me. Thanks


PARTNERS