Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to transform BoundingShapes to screen space ?


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

#1 BlackBrain   Members   -  Reputation: 239

Like
0Likes
Like

Posted 18 May 2014 - 05:09 AM

Hello .

 

I am trying to implement a tiled deferred shading pipeline . Where I am sticking is to find out what lights affect a given tile ?

I read a paper that said we have to generate AABBs of lights in screen space . So Let's say I have my AABB in World space .

Should I just transform 8 vertices of the box to screen space and recalculate the AABB in screen space ?

 

And another question how is it possible to transform a sphere bounding shape to screen space ?

 

Thanks in advance


Edited by BlackBrain, 18 May 2014 - 05:09 AM.


Sponsor:

#2 BlackBrain   Members   -  Reputation: 239

Like
0Likes
Like

Posted 20 May 2014 - 01:26 AM

Sorry to post again. For my first question only a yes or no is enough . No one can help me ?



#3 Giallanon   Members   -  Reputation: 1060

Like
1Likes
Like

Posted 20 May 2014 - 07:16 AM

1) Yes.

2) For the sphere, you may want to calculate its AABB and then goto 1



#4 Hodgman   Moderators   -  Reputation: 27518

Like
1Likes
Like

Posted 21 May 2014 - 04:00 PM

Yep the typical solution is to project the corners of the original bounding shape, then take their min/max to get a new 2D bounding rectangle.

 

As mentioned by Giallanon, it's common to convert spheres into cubes and then just use this method.

Another option is that you can project a 3D sphere to a 2D ellipse, shown here: http://www.iquilezles.org/www/articles/sphereproj/sphereproj.htm



#5 Dbowler92   Members   -  Reputation: 166

Like
0Likes
Like

Posted 21 May 2014 - 08:02 PM

Hi,

 

Firstly, could I ask the OP what paper he is reading? I didn't actually find anything on the tile based deferred system whilst hunting around the internet about a year back and it's something I wish I knew more about (past the BF3 powerpoint presentation)

 

Secondly, I recently did a "Tile Based Forward Renderer" for my final year project at uni and found the book: GPU Pro 4 to be extreamly handy (2 chapters on the system, one from the guys at AMD). Theres also some very useful source code on the AMD website (they call it Forward+).

 

My system (and the AMD system) did these light (bounding spheres) to tile intersection tests in view space.



#6 BlackBrain   Members   -  Reputation: 239

Like
0Likes
Like

Posted 22 May 2014 - 09:47 AM

Thanks every one .

Dbowler92 , if u have done tiled forward shading so the deferred one would't be a big deal to you.

 

1) Generate G-buffer as usual

2) Split the screen into some tiles (for example 32*32 tiles in pixel)

3) Assig every tile the lights that has an effect on it .

4) either draw a fulscreen quad or in compute shader . Foreach tile iterate through all lights assigned to it and perform the lighting using the G-buffer .

 

You may find this helpful : https://software.intel.com/en-us/articles/deferred-rendering-for-current-and-future-rendering-pipelines



#7 Hodgman   Moderators   -  Reputation: 27518

Like
0Likes
Like

Posted 22 May 2014 - 04:48 PM

This might also be handy:

http://www.humus.name/Articles/PracticalClusteredShading.pdf






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