Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Render To Texture - depthStencilView

4: Adsense

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
4 replies to this topic

#1 gnomgrol   Members   

699
Like
0Likes
Like

Posted 19 February 2013 - 04:03 AM

Hello, 

I recently stumbled over a problem with my render-to-texture mechanism. I was setting

 d3d11DevCon->OMSetRenderTargets(1, &renderTargetView, 0);
, what obviously will let me render to the renderTargetView, but without using a depthStencilView.

Now, when I try to pass my depthStencilView as the last parameter, nothing gets drawn anymore. Is there a specific parameter I have to set in the depthStencilView to allow it to be used when I draw to a texture?

Again, without the depthStencilView it works fine, but of course without depth.

If you need some more code on how I initialise stuff, let me know.

 

Thank you very much!



#2 3D   Members   

554
Like
0Likes
Like

Posted 19 February 2013 - 04:35 AM

This is not my area but shouldn't it just be set to NULL?

http://msdn.microsoft.com/en-us/library/windows/desktop/ff476507%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ff476112%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ff476085%28v=vs.85%29.aspx

#3 Nik02   Members   

4299
Like
0Likes
Like

Posted 19 February 2013 - 05:23 AM

Does the depth stencil view have the same dimensions and sample count as the color target?


Niko Suni


#4 BarrySkellern   Members   

1492
Like
0Likes
Like

Posted 19 February 2013 - 06:18 AM

Could be a few reasons. Check your depth-stencil buffer is cleared correctly unless you're reusing it from a previous pass - depth initially set to 1 typically, so things with less depth pass the depth test. Stencil typically set to 0. And check your depth stencil tests are set as you expect, i.e. you haven't inadvertently left a stencil test set inappropriately from a previous operation, or got the depth test set the wrong way round. You could try temporarily turning both tests off completely to see if anything is drawn then.


Visit http://www.mugsgames.com

Stroids, a retro style mini-game for Windows PC. http://barryskellern.itch.io/stroids

Mugs Games on Twitter: @MugsGames and Facebook: www.facebook.com/mugsgames

Me on Twitter @BarrySkellern

 


#5 gnomgrol   Members   

699
Like
1Likes
Like

Posted 19 February 2013 - 11:28 AM

Found the problem. I forgot to ZeroMemory the descriptionbuffer of the depthstencilview, not sure why this cause such an akward problem though. Well, now it's running fine.






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.