Deferred rendering issue

Started by
22 comments, last by Noxil 11 years ago

Could you dump the surfaces of the g buffer ? At such a small scale, i doubt there is float issues except if you are doing something really bad.

Dump the surface? I dont understand.

Advertisement

You need to copy the render targets to a lockable surface ( create in the symem pool ) with UpdateTexture/UpdateSurface or GetRenderTargetData. Then call LockRect on it to read the data on CPU to write them in an image file ( TGA or DDS are simple format to create )

Another way to dump the surfaces is to perform a single frame capture in PIX, find the render target you're after, then right click and save it as DDS.

The problem seem to be in the lightshader..

If i only draw the gbuffer surface there is no problem.

But as soon as i apply the light the blackline is there.

Does the black line stay in the same position in the world when you move your camera? Which attributes in the gbuffer are changing at that location? Is there a triangle edge at that location? Are you using MSAA at all?

There's some shader operations that can result in NaN, like x/0, 0^0, x^y where y < 0, etc.
You can add some debug checks before these 'dangerous' operations when testing, e.g.
 ...
    if( position.w == 0 )
        return float4(1,0,0,1);//red for debugging
    position /= position.w;
...

Seem means i am not sure, so you can use a frame debugger ( pix, gpuperfstudio or nsight ) and debug the pixel shader on a black pixel by yourself, or give us more information because without more, it is a bit of a dead end.

The black line is right at the edge of the mesh, where the two meshes would intersect if they where to overlap.
The line flickers and become less and more visible if i move the camera around.

Im not using msaa.

Add random checks to check for non-wanted values and then replace them with something else, so when you find a spot where this fixes the error, you can start moving the check to find out where it happens.

o3o

Thanks for all your tips and feedback.
I think i have narrowed down the problem.

In my screenquad shader, if i only draw the normals from the gbuffer i get the black line.

So somehow when i draw the normals to the gbuffer, something goes wrong on a few pixels.

How do you calculate the normals? In the modeling program, manually or using some d3dx-function?

This topic is closed to new replies.

Advertisement