• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By isu diss
      How do I fill the gap between sky and terrain? Scaling the terrain or procedural terrain rendering?

    • By Jiraya
      For a 2D game, does using a float2 for position increases performance in any way?
      I know that in the end the vertex shader will have to return a float4 anyway, but does using a float2 decreases the amount of data that will have to be sent from the CPU to the GPU?
       
    • By ucfchuck
      I am feeding in 16 bit unsigned integer data to process in a compute shader and i need to get a standard deviation.
      So I read in a series of samples and push them into float arrays
      float vals1[9], vals2[9], vals3[9], vals4[9]; int x = 0,y=0; for ( x = 0; x < 3; x++) { for (y = 0; y < 3; y++) { vals1[3 * x + y] = (float) (asuint(Input1[threadID.xy + int2(x - 1, y - 1)].x)); vals2[3 * x + y] = (float) (asuint(Input2[threadID.xy + int2(x - 1, y - 1)].x)); vals3[3 * x + y] = (float) (asuint(Input3[threadID.xy + int2(x - 1, y - 1)].x)); vals4[3 * x + y] = (float) (asuint(Input4[threadID.xy + int2(x - 1, y - 1)].x)); } } I can send these values out directly and the data is as expected

                             
      Output1[threadID.xy] = (uint) (vals1[4] ); Output2[threadID.xy] = (uint) (vals2[4] ); Output3[threadID.xy] = (uint) (vals3[4] ); Output4[threadID.xy] = (uint) (vals4[4] ); however if i do anything to that data it is destroyed.
      If i add a
      vals1[4] = vals1[4]/2; 
      or a
      vals1[4] = vals[1]-vals[4];
      the data is gone and everything comes back 0.
       
       
      How does one go about converting a uint to a float and performing operations on it and then converting back to a rounded uint?
    • By fs1
      I have been trying to see how the ID3DInclude, and how its methods Open and Close work.
      I would like to add a custom path for the D3DCompile function to search for some of my includes.
      I have not found any working example. Could someone point me on how to implement these functions? I would like D3DCompile to look at a custom C:\Folder path for some of the include files.
      Thanks
    • By stale
      I'm continuing to learn more about terrain rendering, and so far I've managed to load in a heightmap and render it as a tessellated wireframe (following Frank Luna's DX11 book). However, I'm getting some really weird behavior where a large section of the wireframe is being rendered with a yellow color, even though my pixel shader is hard coded to output white. 

      The parts of the mesh that are discolored changes as well, as pictured below (mesh is being clipped by far plane).

      Here is my pixel shader. As mentioned, I simply hard code it to output white:
      float PS(DOUT pin) : SV_Target { return float4(1.0f, 1.0f, 1.0f, 1.0f); } I'm completely lost on what could be causing this, so any help in the right direction would be greatly appreciated. If I can help by providing more information please let me know.
  • Advertisement
  • Advertisement
Sign in to follow this  

DX11 Popping SSAO issue DX11

This topic is 990 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've looked at the demo SSAO in Frank Luna's book and I'm having issues where I have to be right in front models to show SSAO. Could it be depth buffer issue?

 

I'm rendering the off screen target as R8G8B8A8_UNORM and depth as DXGI_FORMAT_D24_S8_UINT

 

what could cause this issue when I move the camera right to the target then it shows the SSAO.

Share this post


Link to post
Share on other sites
Advertisement

inside the screen quad code I forgot to store the perspective matrix in a FLOAT4x4.

 

[attachment=28499:ScreenCaptured_nossao06509683.jpg]

 

Now I'm fiddling around with the perspective values. It was ultimately my forgetting issue.

 

looks ten times better and once i blur it then i'll show officially the scene.

Share this post


Link to post
Share on other sites

Upon viewing the hlsl code Frank Luna has the projected point to sample from any occludee from projective coordinates.


		float3 offset = reflect(mOffsets[i].xyz, randVec);
			
		// Flip offset vector if it is behind the plane defined by (p, n).
		float flip = sign( dot(offset, n) );
		
		// Sample a point near p within the occlusion radius.
		float3 q = p + flip * gOcclusionRadius * offset;
		
		
		// Project q and generate projective tex-coords.
		
		float4 projQ = mul( float4(q, 1.0f), gViewToTexSpace);
		projQ /= projQ.w;
	

Inside the screen code as the rendering part:

	static const XMMATRIX T(
		0.5f, 0.0f, 0.0f, 0.0f,
		0.0f, -0.5f, 0.0f, 0.0f,
		0.0f, 0.0f, 1.0f, 0.0f,
		0.5f, 0.5f, 0.0f, 1.0f);
	
	XMMATRIX PT = XMMatrixMultiply(PROJ,T);
	screenCB->gViewToTexSpace = XMMatrixTranspose(PT);

In his code he never transposed the camera's projective to texture matrix.
 As far as the matrix goes and I don't know matrix math what does the T Matrix tell me? I mean inside the hlsl code it's telling me that PT is responsible for projecting the ray point in projective texturing space then sampling around P accumulating occlusion then averaging it out with a sum / samples.

Share this post


Link to post
Share on other sites

whether you people like pretty pictures or not here one is:

 

This is taken from World * View projection from the vertex position.

[attachment=28505:ScreenCaptured_nossao87515385.jpg]

 

this is taken from World * View * Projection of the vertex position.

[attachment=28506:ScreenCaptured_nossao105956665.jpg]

 

I understand SSAO is light independent and doesn't need any lights to set up and is from view matrix. From the world*view matrix it looks not good.

 

So is the world * view a issue or should the depth be from the world * view * proj?

 

What do you people think

Share this post


Link to post
Share on other sites

There's a couple of things I haven't done - when random sampling the randomtexture it suppose to be wrap and when sample the normal/depth texture it's suppose to be clamp.

 

Now I'm messing with the above matrix: Projection and Texture-Space Matrix.

 

Following result I get this but with a nasty hard white cut off.

 

[attachment=28510:ScreenCaptured_nossao39735705.jpg]

 

I have the ability to blur it but for now I need to figure out what is going on with the projective tex-space matrix being sent to the shader.

 

So far I have this inside the screen quad rendering:


	XMMATRIX T = XMMATRIX(
		0.5f, 0.0f, 0.0f, 0.0f,
		0.0f, -0.5f, 0.0f, 0.0f,
		0.0f, 0.0f, 1.0f, 0.0f,
		0.5f, 0.5f, 0.0f, 1.0f);
	T = XMMatrixTranspose(T);
	
	XMMATRIX P = XMMatrixTranspose(PROJ);

	XMMATRIX PT = XMMatrixMultiply(P,T);
	screenCB->gViewToTexSpace = XMMatrixTranspose(PT);
	

Share this post


Link to post
Share on other sites

After going back and returning the projectedQ that is transformed to TextureSpace that's the issue.

 

it takes the NDC and transforms it to TexSpace and that is what's causing the issue. I don't know how to fix it nor what to look at.

 

I changed the camera's FOVY to 0.25 * XM_PI but that gave really bad results.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement