Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Fullscreen Shaders And Depth Buffers  (Read 1677 times)
sybixsus
Customers
Community Member
*****
Posts: 1339


WWW
« on: November 29, 2007, 05:15:05 PM »

I've managed to make a number of generic shaders work with TV, but there is one group of shaders I can never get to work, and that is those which use a depth buffer.

In the shader you'll see something like this :

DECLARE_QUAD_TEX(ScnMap,ScnSamp,"X8R8G8B8")
DECLARE_QUAD_DEPTH_BUFFER(DepthBuffer,"D24S8")

That's just pointing to one of Nvidia's macros for declaring rendersurfaces in shaders, but the important thing is the image format. X8R8G8B8 is not a problem, that's a TV compatible surface format. But D24S8 does not appear to be. I've scoured the forums today and on many previous occasions and while I can find vague claims from people about getting shaders which do this working I can never find any proof, let alone code.

I'm guessing that D24S8 is a 24 bit Depth Buffer and an 8 Bit Stencil Buffer format which is attached to a rendersurface somehow. I can't find anything in TVRenderSurface to give me access to it though. Nor can I find any way of creating a surface in that format and subsequently attaching it to a rendersurface so that the depth and stencil buffers are used when you render to it.

So basically, I'd like to know. Is there any way of using these shaders?
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #1 on: November 29, 2007, 05:22:20 PM »

I've never managed to do it either... so looking forward to a discussion about it.
Logged

BlindSide
Customers
Community Member
*****
Posts: 760


« Reply #2 on: November 29, 2007, 06:46:38 PM »

The depth buffer, traditionally, is *not* directly accessable (the depth buffer uses special compression or something to that effect).

Nvidia has a propriatry shadowmapping method which interacts with the depth buffer, but does not actually provide access. Instead, it does a cheap semi-bilinear sample and internal depth comparison for you, and provides the results via shader.

I'm not sure what the specifics are to enabling this - I think there are some discussions on gamedev - but I know it's not exactly trivial. Also, because it's proprietary, the same capability will not be available on ATi cards any time soon (a real shame, because from what I've read hardware shadowmapping gives a decent performance boost, saves instructions and memory, and softens the shadows for you a little).
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks