Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Im working with my deferred engine in XNA 4.0 and Im combining it with a forwardpipeline to support semi-transparency and other "forward only" effects.

Let me describe what I do:

  1. Render GBuffer and all deferred geometry based on materials
  2. A final composit where I combine the lightbuffer and the diffusebuffer from the GBuffer. I output color and depth to a rendertarget so I can use forward rendering to draw directly onto that RT.
  3. Render forward geometry
  4. I then take the RT from the forward pipeline and do postprocessing stuff.
  5. Finally I write the RT to the backbuffer

Question:

  • As you can see in the image below there's a problem with the boundingboxes. The are drawn using forward rendering and is drawn using the depthbuffer I descibed in step 2. I have tried to offset the depthbuffer in different directions with a texel or two. But nothing seems to solve the problem. Has anyone experienced this problem before?

EDIT: This post has been cleaned from some statements to avoid confusion.

enter image description here

share|improve this question
    
That's a really strange problem, especially since it only happens at 1920x1080. Can you put a test case online to see if it's just your hardware or an XNA problem? –  Roy T. Dec 22 '12 at 19:41
add comment

1 Answer

up vote 2 down vote accepted

Turns out, I was wrong. The source of the problem was in step 5 where I used a shader to copy the rendertarget to the backbuffer.

I forgot to correct the texture coordinates by negative texel X and Y. Not doing this results in incorrect sampling and color data being lost because the sample was taken at the wrong texel.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.