Jump to content

  • Log In with Google      Sign In   
  • Create Account

Annoying issue with MRTs.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 AdeptStrain   Members   -  Reputation: 369

Like
1Likes
Like

Posted 27 August 2012 - 07:33 PM

Sorry for what I'm sure is "yet another post about MRTs" but I've been stuck on this issue for a few days.

Trying my hand at implementing deferred shading but I'm running into an issue where my values are being set properly on the render targets (I can see them in pix), but when I go to render the fullscreen quad - I get nothing. Infact Pix even says the pixel shader is returning the color I expect, but the final frame buffer value is always black.

The high level view of my code goes like this:
  • Create 3 Render Targets(Diffuse, Normal, Depth)
  • Set those 3 Render targets before drawing.
  • Render...
  • Set the Render Target to the original backbuffer and depth buffer (Actually right now I'm using the same depth buffer for the MRTs and the final quad...but Pix isn't saying the pixel is being thrown away due to depth issues, at least that I can tell).
I've disabled Mip Map filtering on the final quad so that shouldn't be the issue (which, again, Pix shows a color being read from the MRTs). Any thoughts on something I might be doing completely wrong here? Should I be using the same depth buffer during the initial render pass as well as during the final composition? Is it correct to set the RT back to the backbuffer before the final write? I'd post my code but everything is abstracted to not sure how readible it would be. However, if you need specific sections I can easily provide those. Pix output below.

Posted Image

EDIT: I just noticed the damn alpha value. I hate Occam, his stupid razor, and I hope he jumped off a cliff (like I will soon be doing).

Edited by AdeptStrain, 27 August 2012 - 07:44 PM.


Sponsor:

#2 Tordin   Members   -  Reputation: 604

Like
0Likes
Like

Posted 28 August 2012 - 01:39 AM

You cant bind and use the same resources.
so you cant use the depth buffer and also bind it while drawing!

Besides that, have you check the dx debug output? it might contain more clues on whats happening.
"There will be major features. none to be thought of yet"

#3 BCullis   Crossbones+   -  Reputation: 1813

Like
0Likes
Like

Posted 28 August 2012 - 07:51 AM

EDIT: I just noticed the damn alpha value. I hate Occam, his stupid razor, and I hope he jumped off a cliff (like I will soon be doing).

Don't sweat it, I finally got my deferred renderer working properly, and the bug I was chasing for a week while I disassembled my framework piece by piece was that I got the arguments to my depthstencilview clear call backwards.

Hoping this means your render is now working properly?
Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#4 AdeptStrain   Members   -  Reputation: 369

Like
0Likes
Like

Posted 28 August 2012 - 08:43 AM


EDIT: I just noticed the damn alpha value. I hate Occam, his stupid razor, and I hope he jumped off a cliff (like I will soon be doing).

Don't sweat it, I finally got my deferred renderer working properly, and the bug I was chasing for a week while I disassembled my framework piece by piece was that I got the arguments to my depthstencilview clear call backwards.

Hoping this means your render is now working properly?


Yea, it's all good now. I was clearing the MRTs with values that had no alpha so, shockingly, everything was transparent. Fixed that and it started working fine. Like you I had started disassembling my framework piece by piece - thank God for Perforce so I can actually revert most my changes I did over the last week to try and fix this simple error.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS