Jump to content
  • Advertisement
Sign in to follow this  
BlackBrain

How to transform BoundingShapes to screen space ?

This topic is 1490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!