Jump to content

  • Log In with Google      Sign In   
  • Create Account


Single pass multi-depth buffer generation


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 LancerSolurus   Members   -  Reputation: 483

Like
0Likes
Like

Posted 22 March 2013 - 08:29 PM

I've recently implemented shadowing in my game engine. Currently it only has one shadow map and I want to expand it to at least 3 to 4. I was going to try to attempt doing it using a MRT but ran into the issue of only being able to use 1 depth/stencil buffer which is required to keep the depth pixels in order. So any ideas on how to accomplish this? Using a single texture for all will get around the depth/stencil buffer problem but haven't been able to come up with a way to use the MRT or a single channel to a 1/4 slice of the texture.

 

I am looking to use a cascade shadow mapping technique since I simple calculate a quaternion based position for the shadow map placement directly in front of the player. The reason is I can easily fine-tune the overlap amount.


******************************************************************************************
Youtube Channel


Sponsor:

#2 Yourself   Crossbones+   -  Reputation: 1038

Like
1Likes
Like

Posted 23 March 2013 - 01:39 AM

You can use a single texture but divide it into multiple parts (by adjusting the viewport during rendering and the loopup inside the shaders).

If you have 4 cascades, divide the texture into four parts so that the first quarter (1 in the ascii art) is cascade 0,the second (2 in the ascii art) would be cascade 1.....

----------------------

|            |             |

|    1      |     2      |

|            |             |

----------------------

|            |             |

|    3      |      4     |

 

|            |             |

----------------------


#3 LancerSolurus   Members   -  Reputation: 483

Like
0Likes
Like

Posted 23 March 2013 - 02:37 AM

Well that is along the lines of how I would like to do it but AFAIK there is only one viewport that can be active at one time. Also, I was looking into the possibility of using POSITIONx (x= 0 to 3) to provide the correct coordinates, problem is MS documentation on that command is pretty sparse as to what it's used for beyond POSITION0.


******************************************************************************************
Youtube Channel


#4 Jason Z   Crossbones+   -  Reputation: 4672

Like
1Likes
Like

Posted 23 March 2013 - 07:33 AM

With D3D9 there is indeed only one viewport active at a time.  With D3D11 there is an array of both scissor rects and viewports that are available to use.  Unfortunately, I don't think there is a way to render your geometry into multiple areas with a single pass through the pipeline.

 

You can minimize the cost of multiplying the geometry by using instancing to render multiple copies of your geometry, and then use the instance data to manipulate the geometry into the right portion of the screen.  You would have to profile to get a good idea of how the performance compares to just rendering it four times, but it would be worth a try I suppose.






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